def test_raises_on_non_lexlo_kmer(self): es = EdgeSet(np.zeros(8)) with pytest.raises(AssertionError): es.get_outgoing_kmers('TTT') with pytest.raises(AssertionError): es.get_incoming_kmers('TTT')
def test_outgoing_returns_lexicographically_lowest_kmers(self): es = EdgeSet(np.zeros(8)) es.add_edge('G') assert ['CCG'] == es.get_outgoing_kmers('ACG')
def test_all_incoming_no_outgoing(self): es = EdgeSet(np.concatenate([np.ones(4), np.zeros(4)])) assert es.get_incoming_kmers('AAA') == ['AAA', 'CAA', 'GAA', 'TAA'] assert 0 == len(es.get_outgoing_kmers('AAA'))
def test_no_incoming_all_outgoing(self): es = EdgeSet(np.concatenate([np.zeros(4), np.ones(4)])) assert 0 == len(es.get_incoming_kmers('AAA')) assert {'AAA', 'AAC', 'AAG', 'AAT'} == set(es.get_outgoing_kmers('AAA'))
def test_no_incoming_or_outgoing(self): es = EdgeSet(np.zeros(8)) assert 0 == len(es.get_incoming_kmers('AAA')) assert 0 == len(es.get_outgoing_kmers('AAA'))