def test_columnProbs(self): """Alignment.columnProbs should find Pr(symbol) in each column""" #make an alignment with 4 rows (easy to calculate probabilities) align = Alignment(["AAA", "ACA", "GGG", "GUC"]) cp = align.columnProbs() #check that the column probs match the counts we expect self.assertEqual(cp, map(Freqs, [ {'A':0.5, 'G':0.5}, {'A':0.25, 'C':0.25, 'G':0.25, 'U':0.25}, {'A':0.5, 'G':0.25, 'C':0.25}, ]))