def test_tool(tool_name): """Test motif prediction tools.""" params = {"background": bg_fa, "organism": "hg38", "width": 7} print(__tools__) if tool_name in [ "yamda", # not installable vio bioconda "rpmcmc", # not installable via bioconda "gadem", # sometimes crashes on invalid pointer "jaspar", "xxmotif", # takes too long "trawler", # unpredictable, sometimes doesn't find the motif "weeder", # doesn't work at the moment "posmo", # motif doesn't predictably look like AP1 "dreme", # current dreme in bioconda is broken ]: return if platform.system() == "Darwin": # No support for osx if tool_name in ["amd", "hms", "improbizer", "motifsampler", "dinamo"]: return t = get_tool(tool_name) print("Testing {}...".format(t)) (motifs, stderr, stdout) = t.run(fa, params) print(motifs) print(stderr) print(stdout) assert ap1_included(motifs)
def test_tools(self): """Test motif prediction tools.""" params = { "background": self.bg_fa, "organism": "hg38", "width": 7, } for tool_name in sorted(__tools__): if tool_name in [ "gadem", # sometimes crashes on invalid pointer "jaspar", "xxmotif", # takes too long "trawler", # unpredictable, sometimes doesn't find the motif ]: continue if platform.system() == "Darwin": # No support for osx if tool_name in [ "amd", "hms", "improbizer", "motifsampler", "posmo", "meme", # until the bioconda package is fixed "memew", # until the bioconda package is fixed ]: continue t = get_tool(tool_name) print("Testing {}...".format(t)) (motifs, stderr, stdout) = t.run(self.fa, params) self.assertTrue(self.ap1_included(motifs))
def prediction(args): tool = args.tool infile = args.infile outfile = args.outfile paramfile = args.paramfile t = get_tool(tool) params = {} if paramfile: params = load(open(paramfile)) (motifs, stdout, stderr) = t.run(infile, params) sys.stderr.write(stderr) sys.stdout.write(stdout) f = open(outfile, "w") for m in motifs: f.write("{0}\n".format(m.to_pfm())) f.close()
def test_tools(self): """Test motif prediction tools.""" params = { "background": self.bg_fa, "organism": "hg38", "width": 7, } for tool_name in sorted(__tools__): if tool_name in [ "gadem", # sometimes crashes on invalid pointer "jaspar", "xxmotif", # takes too long "trawler", # unpredictable, sometimes doesn't find the motif "weeder", # doesn't work at the moment "posmo", # motif doesn't predictably look like AP1 ]: continue if platform.system() == "Darwin": # No support for osx if tool_name in [ "amd", "hms", "improbizer", "motifsampler", ]: continue t = get_tool(tool_name) print("Testing {}...".format(t)) (motifs, stderr, stdout) = t.run(self.fa, params) print(motifs) print(stderr) print(stdout) self.assertTrue(self.ap1_included(motifs))