Esempio n. 1
0
 def test_reshape_bins_2(self):
     distogram = Distogram('test')
     distogram.original_file_format = 'pdb'
     distance = Distance(36, 86, (1, ), ((6.589181, 6.589181), ), 0.934108)
     distogram.add(distance)
     with self.assertRaises(ValueError):
         distance.reshape_bins(((0, 1), (1, 10), (10, np.inf)))
Esempio n. 2
0
 def test_reshape_bins_1(self):
     distance = Distance(1, 25, (0.15, 0.45, 0.25, 0.05, 0.1),
                         ((0, 4), (4, 6), (6, 8), (8, 10), (10, np.inf)))
     new_bins = ((0, 2), (2, 8), (8, np.inf))
     distance.reshape_bins(new_bins)
     self.assertEqual(distance.raw_score, 0.85)
     self.assertEqual(round(distance.get_probability_within_distance(8), 2),
                      0.85)
     self.assertTupleEqual(new_bins, distance.distance_bins)
     self.assertTupleEqual((0.075, 0.775, 0.15000000000000002),
                           distance.distance_scores)