Exemplo n.º 1
0
 def setUp(self):
     THIS_DIR = os.path.dirname(os.path.abspath(__file__))
     table = Table({}, [], [])
     self.emptyfeatures = table
     table = Table({}, ['a', 'b', 'c'], [])
     self.wrongtips = table
     self.goodtable = os.path.join(THIS_DIR, 'data/features_formated.biom')
     self.goodcsi = os.path.join(THIS_DIR, 'data/goodcsi')
     self.goodthresh = 0.5
     tablefp = collate_fingerprint(self.goodcsi)
     treeout = make_hierarchy(tablefp, prob_threshold=self.goodthresh)
     self.goodtree = treeout
Exemplo n.º 2
0
 def test_thresholdError(self):
     with self.assertRaises(ValueError):
         make_hierarchy(self.goodin, prob_threshold=self.bigthresh)
     with self.assertRaises(ValueError):
         make_hierarchy(self.goodin, prob_threshold=self.smallthresh)
Exemplo n.º 3
0
 def test_tipMatch(self):
     treeout = make_hierarchy(self.goodin, prob_threshold=self.goodthresh)
     tip_names = {node.name for node in treeout.tips()}
     self.assertEqual(tip_names, set(self.goodin._observation_ids))
Exemplo n.º 4
0
 def test_emptyFingerprint(self):
     with self.assertRaises(ValueError):
         make_hierarchy(self.emptyin, prob_threshold=self.goodthresh)