def genome(request, tempdir): """Create a test genome.""" name = "dm3" # Use fake name for blacklist test fafile = "tests/data/small_genome.fa" # Input needs to be bgzipped, depending on param if os.path.exists(fafile + ".gz"): if request.param == "unzipped": check_call(["gunzip", fafile + ".gz"]) elif request.param == "bgzipped": check_call(["bgzip", fafile]) tmpdir = os.path.join(tempdir, request.param, name) os.makedirs(tmpdir) if request.param == "bgzipped": fafile += ".gz" copyfile(fafile, os.path.join(tmpdir, os.path.basename(fafile))) for p in init_plugins(): activate(p) # provide the fixture value yield Genome(name, genome_dir=os.path.join(tempdir, request.param)) if os.path.exists(fafile) and request.param == "unzipped": check_call(["bgzip", fafile])
def test_plugins(): # activate and check all plugins for p in init_plugins(): if p not in ["blacklist", "star"]: assert genomepy.utils.cmd_ok(p) elif p == "star": assert genomepy.utils.cmd_ok(p.upper()) activate(p)
def genome(tempdir): """Create a test genome.""" name = "small_genome" fafile = "tests/data/small_genome.fa" if os.path.exists(fafile + ".gz"): check_call(["gunzip", fafile + ".gz"]) os.mkdir(os.path.join(tempdir, name)) copyfile(fafile, os.path.join(tempdir, name, os.path.basename(fafile))) for p in init_plugins(): activate(p) yield Genome(name, genome_dir=tempdir) # provide the fixture value if os.path.exists(fafile): check_call(["gzip", fafile])