Skip to content

Commit

Permalink
[FIX] broken unittests
Browse files Browse the repository at this point in the history
  • Loading branch information
alpae committed Sep 12, 2024
1 parent 58c987d commit 75e73b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 2 additions & 5 deletions tests/test_fasttree_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,16 @@
import pathlib
this_dir = pathlib.Path(__file__).parent

# todo needs update


class FastTreeTester(unittest.TestCase):
def test_failing_tree_building_reports_error_from_fasttree(self):
msa = AlignIO.read(this_dir / "data" / "failing-msa.fa", "fasta")
with self.assertLogs("FastOMA", level="ERROR") as cm:
with self.assertRaises(WrapperError):
infer_gene_tree(msa, "/tmp")
infer_gene_tree(msa)
self.assertIn("Non-unique name", "\n".join(cm.output))

def test_treebuilding_with_correct_msa(self):
msa = AlignIO.read(this_dir / "data" / "correct-msa.fa", "fasta")
gene_rooting_method= ""
tree = infer_gene_tree(msa, "/tmp", gene_rooting_method)
tree = infer_gene_tree(msa)
self.assertIn("HUMAN01350", tree)
3 changes: 2 additions & 1 deletion tests/test_infer_subhog.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ def setUp(self):
'(((((G00100_SE001||SE001:153.567,G00100_SE008||SE008:153.567)1:39.499[&&NHX:evoltype=S],(G00100_SE006||SE006:173.507,G00100_SE007||SE007:173.507)1:19.5597[&&NHX:evoltype=S])1:14.0196[&&NHX:evoltype=S],(G00100_SE003||SE003:198.481,((((G00100_SE011||SE011:136.533,G00100_SE012||SE012:136.533)1:7.60673[&&NHX:evoltype=S],(G00100_SE010||SE010:36.1782,G00342_SE010||SE010:36.1782)1:107.961[&&NHX:evoltype=D])1:8.49419[&&NHX:evoltype=S],G00100_SE009||SE009:152.634)1:13.723[&&NHX:evoltype=S],(((G00186_SE004||SE004:143.819,(G00186_SE011||SE011:136.533,(G00186_SE012||SE012:116.411,G00242_SE012||SE012:116.411)1:20.1214[&&NHX:evoltype=D])1:7.28662[&&NHX:evoltype=S])1:0.32011[&&NHX:evoltype=S],(G00186_SE010||SE010:31.4887,G00350_SE010||SE010:31.4887)1:112.651[&&NHX:evoltype=D])1:8.49419[&&NHX:evoltype=S],G00186_SE009||SE009:152.634)1:13.723[&&NHX:evoltype=S])1:32.1245[&&NHX:evoltype=D])1:8.60492[&&NHX:evoltype=S])1:36.2336[&&NHX:evoltype=S],(((G00110_SE001||SE001:153.567,G00110_SE008||SE008:153.567)1:39.499[&&NHX:evoltype=S],(G00110_SE006||SE006:173.507,G00110_SE007||SE007:173.507)1:19.5597[&&NHX:evoltype=S])1:14.0196[&&NHX:evoltype=S],(G00110_SE003||SE003:198.481,(((G00110_SE004||SE004:143.819,(G00110_SE011||SE011:136.533,G00110_SE012||SE012:136.533)1:7.28662[&&NHX:evoltype=S])1:0.32011[&&NHX:evoltype=S],G00110_SE010||SE010:144.139)1:8.49419[&&NHX:evoltype=S],G00110_SE009||SE009:152.634)1:45.8474[&&NHX:evoltype=S])1:8.60492[&&NHX:evoltype=S])1:36.2336[&&NHX:evoltype=S])1:6.68041[&&NHX:evoltype=D],(G00100_SE002||SE002:119.545,(G00100_SE013||SE013:97.4899,(G00100_SE014||SE014:87.2367,G00100_SE015||SE015:87.2367)1:10.2532[&&NHX:evoltype=S])1:22.055[&&NHX:evoltype=S])1:130.455[&&NHX:evoltype=S]);')
sptree = Tree("dummy;")
hogs = [HOG(SeqRecord(Seq("AAAAAA"), id=n.name), sptree, "test1") for n in genetree.iter_leaves()]
conf = Namespace(msa_write=False, gene_tree_write=False, number_of_samples_per_hog=5)
conf = Namespace(msa_write=False, gene_trees_write=False, number_of_samples_per_hog=5, msa_filter_method="col-row-threshold",
gap_ratio_row=0.3, gap_ratio_col=0.5, min_col_trim=400)
self.genetree = genetree
self.lp = LevelHOGProcessor(sptree, hogs, "test1", conf)

Expand Down

0 comments on commit 75e73b0

Please sign in to comment.