def test_get_transitions(self): seq = "AUGC" alp = ["A", "U", "G", "C"] out = [ [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0], [0.0, 0.0, 0.0, 0.0] ] self.assertEqual(prob.get_transitions(seq, alp, 1), out)
def __init__(self, seed, **kwargs): self.seed = seed alph = list(set(self.seed.target_seq)) self.__dict__.update({ 'markov_order': 1, 'alphabet': alph, 'transitions': prob.get_transitions(self.seed.target_seq, alph, 1), 'motif_def': None, 'motif_upstream_extension': 0, 'motif_downstream_extension': 0, 'skip_exact': True, }) self.__dict__.update(kwargs) self._routine_done = False
def test_prob_motif(self): seq = "AUGC" alp = ["A", "U", "G", "C"] t = prob.get_transitions(seq, alp, 1) self.assertEqual(prob.prob_motif("AU", alp, 2, t), 1.0)