Ejemplo n.º 1
0
 def test_information(self):
     """calculates entropies correctly"""
     data = [[0.25, 0.25, 0.25, 0.25], [0.5, 0.5, 0, 0]]
     got = MotifFreqsArray(array(data), "ABCD")
     entropy = got.information()
     assert_allclose(entropy, [0, 1])
Ejemplo n.º 2
0
 def test_construct_succeeds(self):
     """construct from float array or list"""
     data = [[2 / 6, 4 / 6], [3 / 8, 5 / 8], [4 / 12, 8 / 12]]
     got = MotifFreqsArray(array(data), "AB")
     data = [[2 / 6, 4 / 6], [3 / 8, 5 / 8], [4 / 12, 8 / 12]]
     got = MotifFreqsArray(data, "AB")