def test_parse_legacy_blasttab(anib_output): """Parses ANIB legacy .blast_tab output.""" fragdata = anib.get_fraglength_dict([anib_output.fragfile]) result = anib.parse_blast_tab(anib_output.legacytabfile, fragdata, mode="ANIblastall") assert ( a == b for a, b in zip(result, [1_966_922, 406_104, 78.578_978_313_253_018]))
def test_parse_blastdir(anib_output_dir): """Parse directory of BLAST+ output.""" orglengths = pyani_files.get_sequence_lengths(anib_output_dir.infiles) fraglengths = anib.get_fraglength_dict(anib_output_dir.fragfiles) result = anib.process_blast(anib_output_dir.blastdir, orglengths, fraglengths, mode="ANIb") assert_frame_equal( result.percentage_identity.sort_index(1).sort_index(), anib_output_dir.blastresult.sort_index(1).sort_index(), )
def test_legacy_blastdir_processing(self): """parse directory of legacy .blast_tab output""" orglengths = pyani_files.get_sequence_lengths(self.infnames) fraglengths = anib.get_fraglength_dict(self.fragfiles) # ANIblastall result = anib.process_blast(self.aniblastalldir, orglengths, fraglengths, mode="ANIblastall") assert_frame_equal( result.percentage_identity.sort_index(1).sort_index(), self.aniblastalltgt.sort_index(1).sort_index(), )
def test_parse_blasttab(self): """parses ANIblastall .blast_tab output.""" fragdata = anib.get_fraglength_dict([self.fragfname]) # ANIb output result = anib.parse_blast_tab(self.fname, fragdata, 0.3, 0.7, mode="ANIb") assert_equal(result, (4016551, 93, 99.997693577050029)) # ANIblastall output result = anib.parse_blast_tab(self.fname_legacy, fragdata, 0.3, 0.7, mode="ANIblastall") assert_equal(result, (1966922, 406104, 78.578978313253018))
def test_parse_blasttab(anib_output): """Parse ANIb BLAST+ .blast_tab output.""" fragdata = anib.get_fraglength_dict([anib_output.fragfile]) result = anib.parse_blast_tab(anib_output.tabfile, fragdata, mode="ANIb") assert (a == b for a, b in zip(result, [4_016_551, 93, 99.997_693_577_050_029]))