def test_overlap_create():
    kmers = ['ATGCG', 'GCATG', 'CATGC', 'AGGCA', 'GGCAT']
    expected = [('GCATG', 'CATGC'), ('CATGC', 'ATGCG'), ('AGGCA', 'GGCAT'), ('GGCAT', 'GCATG')]

    actual = overlapgraph.create(kmers)

    expected.sort()
    actual.sort()

    assert (expected == actual)
Example #2
0
import overlapgraph, sys

filename = sys.argv[1]

with open(filename, 'r') as f:
    kmers = [line.strip() for line in f.readlines() if line.strip() != '']
    graph = overlapgraph.create(kmers)
    print(overlapgraph.graph_to_string(graph))