Example #1
0
 def test_normalize_profiles_neq_len(self):
     '''Normalizing two profiles with many diferent taxa'''
     self.assertEquals(normalize_profiles(self.uneven_profiles),
         [{'taxa1': 0.20, 'taxa2': 0.00, 'taxa3': 0.30, 'taxa4': 0.00, 'taxa5': 0.15, 'taxa6': 0.35, 'taxa7': 0.00, 'not_shared': 0.00},
         {'taxa1': 0.10, 'taxa2': 0.50, 'taxa3': 0.00, 'taxa4': 0.15, 'taxa5': 0.05, 'taxa6': 0.00, 'taxa7': 0.20, 'not_shared': 0.00}])
Example #2
0
 def test_normalize_profiles_eq_len(self):
     '''Normalizing two profiles of equal length'''
     self.assertEquals(normalize_profiles(self.many_profiles),
         [{'taxa1': 0.20, 'taxa2': 0.30, 'taxa3': 0.15, 'taxa4': 0.35, 'not_shared': 0.00},
         {'taxa1': 0.10, 'taxa2': 0.50, 'taxa3': 0.15, 'taxa4': 0.25, 'not_shared': 0.00},
         {'taxa1': 0.15, 'taxa2': 0.22, 'taxa3': 0.15, 'taxa4': 0.48, 'not_shared': 0.00}])