def setUp(self):
        TestCaseWithTmp.setUp(self)
        self.tempDir = tempfile.mkdtemp()
        commonInputDir = util.file.get_test_input_path()
        ref_fasta = os.path.join(commonInputDir, '5kb_human_from_chr6.fasta')
        self.database_prefix_path = os.path.join(self.tempDir, "5kb_human_from_chr6")

        # create blast db
        self.blastdb_path = tools.blast.MakeblastdbTool().build_database(ref_fasta, self.database_prefix_path)

        # create multiple dbs
        self.blastdbs_multi = []
        for db in ['humanChr1Subset.fa', 'humanChr9Subset.fa']:
            dbPath = tools.blast.MakeblastdbTool().build_database(
                os.path.join(util.file.get_test_input_path(self), db),
                os.path.join(self.tempDir, db[:-3]))
            self.blastdbs_multi.append(dbPath)

        # tar one db, but not the other
        tar_db_tgz = util.file.mkstempfname('-humanChr9Subset.blastn.db.tar.gz')
        cmd = ['tar', '-C', self.tempDir, '-cvzf', tar_db_tgz]
        for ext in ('nhr', 'nin', 'nsq'):
            cmd.append('humanChr9Subset.'+ext)
        subprocess.check_call(cmd)
        self.blastdbs_multi[1] = tar_db_tgz
        for ext in ('nhr', 'nin', 'nsq'):
            os.unlink(os.path.join(self.tempDir, 'humanChr9Subset.'+ext))
示例#2
0
    def setUp(self):
        TestCaseWithTmp.setUp(self)
        self.tempDir = tempfile.mkdtemp()
        commonInputDir = util.file.get_test_input_path()
        ref_fasta = os.path.join(commonInputDir, '5kb_human_from_chr6.fasta')
        self.database_prefix_path = os.path.join(self.tempDir,
                                                 "5kb_human_from_chr6")

        # create blast db
        self.blastdb_path = tools.blast.MakeblastdbTool().build_database(
            ref_fasta, self.database_prefix_path)

        # create multiple dbs
        self.blastdbs_multi = []
        for db in ['humanChr1Subset.fa', 'humanChr9Subset.fa']:
            dbPath = tools.blast.MakeblastdbTool().build_database(
                os.path.join(util.file.get_test_input_path(self), db),
                os.path.join(self.tempDir, db[:-3]))
            self.blastdbs_multi.append(dbPath)

        # tar one db, but not the other
        tar_db_tgz = util.file.mkstempfname(
            '-humanChr9Subset.blastn.db.tar.gz')
        cmd = ['tar', '-C', self.tempDir, '-cvzf', tar_db_tgz]
        for ext in ('nhr', 'nin', 'nsq'):
            cmd.append('humanChr9Subset.' + ext)
        subprocess.check_call(cmd)
        self.blastdbs_multi[1] = tar_db_tgz
        for ext in ('nhr', 'nin', 'nsq'):
            os.unlink(os.path.join(self.tempDir, 'humanChr9Subset.' + ext))
示例#3
0
    def setUp(self):
        TestCaseWithTmp.setUp(self)
        self.tempDir = tempfile.mkdtemp()
        myInputDir = util.file.get_test_input_path(self)
        ref_fasta = os.path.join(myInputDir, '5kb_human_from_chr6.fasta')
        self.database_prefix_path = os.path.join(self.tempDir,
                                                 "5kb_human_from_chr6")
        polio_fasta = os.path.join(util.file.get_test_input_path(),
                                   'TestMetagenomicsViralMix', 'db', 'library',
                                   'Viruses', 'Poliovirus_uid15288',
                                   'NC_002058.ffn')

        # create blast db
        self.blastdb_path = tools.blast.MakeblastdbTool().build_database(
            ref_fasta, self.database_prefix_path)

        # create bmtagger db
        self.bmtooldb_path = tools.bmtagger.BmtoolTool().build_database(
            ref_fasta, self.database_prefix_path + ".bitmask")
        self.srprismdb_path = tools.bmtagger.SrprismTool().build_database(
            ref_fasta, self.database_prefix_path + ".srprism")

        # create last db
        self.lastdb_path = tools.last.Lastdb().build_database(
            polio_fasta, os.path.join(self.tempDir, 'polio'))
 def setUp(self):
     TestCaseWithTmp.setUp(self)
     self.tempDir = tempfile.mkdtemp()
     self.ebolaRef = util.file.mkstempfname('.fasta', directory=self.tempDir)
     shutil.copyfile(os.path.join(util.file.get_test_input_path(), 'G5012.3.fasta'), self.ebolaRef)
     self.bwa = tools.bwa.Bwa()
     self.samtools = tools.samtools.SamtoolsTool()
     self.bwa.index(self.ebolaRef)
示例#5
0
 def setUp(self):
     TestCaseWithTmp.setUp(self)
     self.tempDir = tempfile.mkdtemp()
     self.ebolaRef = util.file.mkstempfname('.fasta', directory=self.tempDir)
     shutil.copyfile(os.path.join(util.file.get_test_input_path(), 'G5012.3.fasta'), self.ebolaRef)
     self.bwa = tools.bwa.Bwa()
     self.samtools = tools.samtools.SamtoolsTool()
     self.bwa.index(self.ebolaRef)
 def setUp(self):
     TestCaseWithTmp.setUp(self)
     self.polio_fasta = os.path.join(
         util.file.get_test_input_path(),
         'TestMetagenomicsViralMix', 'db', 'library', 'Viruses', 'Enterovirus_C', 'GCF_000861165.1_ViralProj15288_genomic.fna'
     )
     dbDir = tempfile.mkdtemp()
     self.lastdb_path = tools.last.Lastdb().build_database(self.polio_fasta, os.path.join(dbDir, 'NC_002058'))
示例#7
0
 def setUp(self):
     TestCaseWithTmp.setUp(self)
     polio_fasta = os.path.join(util.file.get_test_input_path(),
                                'TestMetagenomicsViralMix', 'db', 'library',
                                'Viruses', 'Poliovirus_uid15288',
                                'NC_002058.ffn')
     dbDir = tempfile.mkdtemp()
     self.lastdb_path = tools.last.Lastdb().build_database(
         polio_fasta, os.path.join(dbDir, 'NC_002058'))
示例#8
0
 def setUp(self):
     TestCaseWithTmp.setUp(self)
     self.polio_fasta = os.path.join(
         util.file.get_test_input_path(), 'TestMetagenomicsViralMix', 'db',
         'library', 'Viruses', 'Enterovirus_C',
         'GCF_000861165.1_ViralProj15288_genomic.fna')
     dbDir = tempfile.mkdtemp()
     self.lastdb_path = tools.last.Lastdb().build_database(
         self.polio_fasta, os.path.join(dbDir, 'NC_002058'))
示例#9
0
 def setUp(self):
     TestCaseWithTmp.setUp(self)
     self.tempDir = tempfile.mkdtemp()
     ref_fasta = os.path.join(util.file.get_test_input_path(),
                              '5kb_human_from_chr6.fasta')
     self.database_prefix_path = os.path.join(self.tempDir,
                                              "5kb_human_from_chr6")
     taxon_filter.bmtagger_build_db(ref_fasta,
                                    self.tempDir,
                                    "5kb_human_from_chr6",
                                    word_size=8)
示例#10
0
    def setUp(self):
        TestCaseWithTmp.setUp(self)
        self.tempDir = tempfile.mkdtemp()
        commonInputDir = util.file.get_test_input_path()
        ref_fasta = os.path.join(commonInputDir, 'TestDepleteHuman',
                                 '5kb_human_from_chr6.fasta')
        self.database_prefix_path = os.path.join(self.tempDir,
                                                 "5kb_human_from_chr6")

        # create blast db
        self.blastdb_path = tools.blast.MakeblastdbTool().build_database(
            ref_fasta, self.database_prefix_path)
示例#11
0
 def setUp(self):
     TestCaseWithTmp.setUp(self)
     self.tempDir = tempfile.mkdtemp()
     myInputDir = os.path.join(util.file.get_test_input_path(),
                               'TestDepleteHuman')
     ref_fasta = os.path.join(myInputDir, '5kb_human_from_chr6.fasta')
     self.database_prefix_path = os.path.join(self.tempDir,
                                              "5kb_human_from_chr6")
     self.bmtooldb_path = tools.bmtagger.BmtoolTool().build_database(
         ref_fasta, self.database_prefix_path + ".bitmask")
     self.srprismdb_path = tools.bmtagger.SrprismTool().build_database(
         ref_fasta, self.database_prefix_path + ".srprism")
示例#12
0
    def setUp(self):
        TestCaseWithTmp.setUp(self)
        self.tempDir = tempfile.mkdtemp()
        myInputDir = util.file.get_test_input_path(self)

        for db in ['humanChr1Subset', 'humanChr9Subset']:
            # .map file is > 100M, so recreate instead of copying
            dbfa = os.path.join(myInputDir, db + '.fa')
            dbsrprism = os.path.join(self.tempDir, db + '.srprism')
            srprismdb_path = tools.bmtagger.SrprismTool().build_database(dbfa, dbsrprism)
            # .bitmask and .srprism.* files must be in same dir, so copy
            shutil.copy(os.path.join(myInputDir, db + '.bitmask'), self.tempDir)
    def setUp(self):
        TestCaseWithTmp.setUp(self)
        self.tempDir = tempfile.mkdtemp()
        myInputDir = util.file.get_test_input_path()
        ref_fasta = os.path.join(myInputDir, '5kb_human_from_chr6.fasta')
        self.database_prefix_path = os.path.join(self.tempDir, "5kb_human_from_chr6")

        # create blast db
        self.blastdb_path = classify.blast.MakeblastdbTool().build_database(ref_fasta, self.database_prefix_path)

        # create bmtagger db
        taxon_filter.bmtagger_build_db(ref_fasta, self.tempDir, "5kb_human_from_chr6", word_size=8)
 def setUp(self) :
     TestCaseWithTmp.setUp(self)
     self.tempDir = tempfile.mkdtemp()
     myInputDir = util.file.get_test_input_path(self)
     srprismPath = tools.bmtagger.SrprismTool().install_and_get_path()
     for db in ['humanChr1Subset', 'humanChr9Subset'] :
         # .map file is > 100M, so recreate instead of copying
         dbfa = os.path.join(myInputDir, db + '.fa')
         dbsrprism = os.path.join(self.tempDir, db + '.srprism')
         subprocess.check_call([srprismPath, 'mkindex', '-i', dbfa, '-o', dbsrprism])
         # .bitmask and .srprism.* files must be in same dir, so copy
         shutil.copy(os.path.join(myInputDir, db + '.bitmask'), self.tempDir)
    def setUp(self):
        TestCaseWithTmp.setUp(self)
        self.tempDir = tempfile.mkdtemp()
        myInputDir = util.file.get_test_input_path()
        ref_fasta = os.path.join(myInputDir, '5kb_human_from_chr6.fasta')
        self.database_prefix_path = os.path.join(self.tempDir, "5kb_human_from_chr6")

        # create blast db
        self.blastdb_path = tools.blast.MakeblastdbTool().build_database(ref_fasta, self.database_prefix_path)

        # create bmtagger db
        taxon_filter.bmtagger_build_db(ref_fasta, self.tempDir, "5kb_human_from_chr6", word_size=8)
示例#16
0
 def setUp(self):
     TestCaseWithTmp.setUp(self)
     self.tempDir = tempfile.mkdtemp()
     myInputDir = util.file.get_test_input_path(self)
     srprismPath = tools.bmtagger.SrprismTool().install_and_get_path()
     for db in ['humanChr1Subset', 'humanChr9Subset']:
         # .map file is > 100M, so recreate instead of copying
         dbfa = os.path.join(myInputDir, db + '.fa')
         dbsrprism = os.path.join(self.tempDir, db + '.srprism')
         subprocess.check_call([srprismPath, 'mkindex', '-i', dbfa, '-o', dbsrprism])
         # .bitmask and .srprism.* files must be in same dir, so copy
         shutil.copy(os.path.join(myInputDir, db + '.bitmask'), self.tempDir)
示例#17
0
 def setUp(self) :
     TestCaseWithTmp.setUp(self)
     self.tempDir = tempfile.mkdtemp()
     myInputDir = util.file.get_test_input_path(self)
     srprismPath = tools.bmtagger.SrprismTool().install_and_get_path()
     for db in ['humanChr1Subset', 'humanChr9Subset'] :
         # .map file is > 100M, so recreate instead of copying
         dbfa = os.path.join(myInputDir, db + '.fa')
         dbsrprism = os.path.join(self.tempDir, db + '.srprism')
         assert not os.system(
             '{srprismPath} mkindex -i {dbfa} -o {dbsrprism}'.format(
                 **locals()))
         # .bitmask and .srprism.* files must be in same dir, so copy
         shutil.copy(os.path.join(myInputDir, db + '.bitmask'), self.tempDir)
示例#18
0
    def setUp(self):
        TestCaseWithTmp.setUp(self)
        self.tempDir = tempfile.mkdtemp()
        myInputDir = util.file.get_test_input_path(self)

        for db in ['humanChr1Subset', 'humanChr9Subset']:
            # .map file is > 100M, so recreate instead of copying
            dbfa = os.path.join(myInputDir, db + '.fa')
            dbsrprism = os.path.join(self.tempDir, db + '.srprism')
            srprismdb_path = tools.bmtagger.SrprismTool().build_database(
                dbfa, dbsrprism)
            # .bitmask and .srprism.* files must be in same dir, so copy
            shutil.copy(os.path.join(myInputDir, db + '.bitmask'),
                        self.tempDir)
示例#19
0
    def setUp(self):
        TestCaseWithTmp.setUp(self)
        os.environ.pop('TMPDIR', None)
        util.file.set_tmp_dir(None)
        self.tempDir = tempfile.mkdtemp()
        myInputDir = util.file.get_test_input_path(self)
        ref_fasta = os.path.join(myInputDir, '5kb_human_from_chr6.fasta')
        self.database_prefix_path = os.path.join(self.tempDir,
                                                 "5kb_human_from_chr6")

        # create blast db
        self.blastdb_path = tools.blast.MakeblastdbTool().build_database(
            ref_fasta, self.database_prefix_path)

        # create bmtagger db
        self.bmtooldb_path = tools.bmtagger.BmtoolTool().build_database(
            ref_fasta, self.database_prefix_path + ".bitmask")
        self.srprismdb_path = tools.bmtagger.SrprismTool().build_database(
            ref_fasta, self.database_prefix_path + ".srprism")
示例#20
0
    def setUp(self):
        TestCaseWithTmp.setUp(self)
        self.tempDir = tempfile.mkdtemp()
        myInputDir = util.file.get_test_input_path(self)
        ref_fasta = os.path.join(myInputDir, '5kb_human_from_chr6.fasta')
        self.database_prefix_path = os.path.join(self.tempDir, "5kb_human_from_chr6")
        polio_fasta = os.path.join(
            util.file.get_test_input_path(),
            'TestMetagenomicsViralMix', 'db', 'library', 'Viruses', 'Poliovirus_uid15288', 'NC_002058.ffn'
        )

        # create blast db
        self.blastdb_path = tools.blast.MakeblastdbTool().build_database(ref_fasta, self.database_prefix_path)

        # create bmtagger db
        self.bmtooldb_path = tools.bmtagger.BmtoolTool().build_database(ref_fasta, self.database_prefix_path + ".bitmask")
        self.srprismdb_path = tools.bmtagger.SrprismTool().build_database(ref_fasta, self.database_prefix_path + ".srprism")

        # create last db
        self.lastdb_path = tools.last.Lastdb().build_database(polio_fasta, self.database_prefix_path)
示例#21
0
    def setUp(self):
        TestCaseWithTmp.setUp(self)
        self.tempDir = tempfile.mkdtemp()
        commonInputDir = util.file.get_test_input_path()
        ref_fasta = os.path.join(commonInputDir, 'TestDepleteHuman',
                                 '5kb_human_from_chr6.fasta')
        self.database_prefix_path = os.path.join(self.tempDir,
                                                 "5kb_human_from_chr6")

        # create blast db
        self.blastdb_path = tools.blast.MakeblastdbTool().build_database(
            ref_fasta, self.database_prefix_path)

        # create multiple dbs
        self.blastdbs_multi = []
        for db in ['humanChr1Subset.fa', 'humanChr9Subset.fa']:
            dbPath = tools.blast.MakeblastdbTool().build_database(
                os.path.join(util.file.get_test_input_path(self), db),
                os.path.join(self.tempDir, db[:-3]))
            self.blastdbs_multi.append(dbPath)
 def setUp(self):
     TestCaseWithTmp.setUp(self)
     self.tempDir = tempfile.mkdtemp()
     ref_fasta = os.path.join(util.file.get_test_input_path(), '5kb_human_from_chr6.fasta')
     self.database_prefix_path = os.path.join(self.tempDir, "5kb_human_from_chr6")
     taxon_filter.bmtagger_build_db(ref_fasta, self.tempDir, "5kb_human_from_chr6", word_size=8)
示例#23
0
 def setUp(self):
     TestCaseWithTmp.setUp(self)
     self.input_dir = util.file.get_test_input_path(self)