示例#1
0
def test_run():
    try:
        remfile = os.path.join(
                tmpdir, "ref_prok_rep_genomes.05.tar.gz.md5")
        create_mock_archives()
        cmd = [
                "getblastdb.py", "--database", "ref_prok_rep_genomes",
                "--dbpath", "/blastdb/tmp", "--test", "--delete"]
        os.chdir(tmpdir)
        os.remove(remfile)

        for files in os.listdir(tmpdir):
            if (
                files.startswith("ref_prok_rep_genomes.05")
                and not files.endswith(".md5")
            ):
                os.remove(files)

        G.run_subprocess(cmd)

        file1 = os.path.join(
                tmpdir, "md5_files", "ref_prok_rep_genomes.00.tar.gz.md5")
        file2 = os.path.join(
                tmpdir, "md5_files", "ref_prok_rep_genomes.05.tar.gz.md5")
        assert os.path.isfile(file1) is True
        assert os.path.isfile(file2) is True
        check_all_files()
    finally:
        os.chdir("..")
        if os.path.isdir(tmpdir):
            shutil.rmtree(tmpdir)
示例#2
0
 def create_customblastdb(config, infile):
     cmd = [
         "makeblastdb", "-in", infile, "-parse_seqids", "-title",
         "mockconservedDB", "-dbtype", "nucl", "-out", config.customdb
     ]
     G.run_subprocess(cmd, printcmd=False, logcmd=False, printoption=False)
示例#3
0
 def create_customblastdb():
     cmd = [
         "makeblastdb", "-in", dbpath, "-parse_seqids", "-title",
         "mockconservedDB", "-dbtype", "nucl", "-out", dbpath
     ]
     G.run_subprocess(cmd, printcmd=False, logcmd=False, printoption=False)