Ejemplo n.º 1
0
def main(fname):
    seqs, _ = fasta.read(util.find_file(fname))
    print "s:", seqs[0]
    print "t:", seqs[1]
    align, os, ot = edit_distance_alignment(seqs[0], seqs[1])
    print align
    print os
    print ot
Ejemplo n.º 2
0
def main(fname):
    seqs, _ = fasta.read(util.find_file(fname))
    corrections = find_corrections(seqs)
    for c in corrections:
        print c
Ejemplo n.º 3
0
def main(fname):
    seqs, _ = fasta.read(util.find_file(fname))
    lcs = find_longest_common_subsequence(seqs[0], seqs[1])
    print lcs
Ejemplo n.º 4
0
def main(fname):
    seqs, _ = fasta.read(util.find_file(fname))
    print count_matchings(seqs[0])
Ejemplo n.º 5
0
    def run_test(self, sample_name, expected_name):
        seqs, _ = fasta.read(util.find_file(sample_name, __file__))
        expected = seqio.read_list(util.find_file(expected_name, __file__))
        actual = main.find_corrections(seqs)

        self.assertItemsEqual(actual, expected)
Ejemplo n.º 6
0
def main(fname):
    seqs, _ = fasta.read(util.find_file(fname))
    if len(seqs[0]) != len(seqs[1]):
        print "Sequences have different lengths!"
        sys.exit(1)
    print compute_ratio(seqs[0], seqs[1])
Ejemplo n.º 7
0
def main(fname):
    seqs, _ = fasta.read(util.find_file(fname))
    pos = find_subseqs(seqs[0], seqs[1])
    print " ".join(map(str, pos))
Ejemplo n.º 8
0
def main(fname):
    seq, _ = fasta.read(util.find_file(fname))
    T = build_table(seq[0])
    print " ".join(map(str, T))
Ejemplo n.º 9
0
def main(fname):
    seqs, _ = fasta.read(util.find_file(fname))
    print(find_shortest_superstring(seqs))
Ejemplo n.º 10
0
def main(fname):
    seqs, _ = fasta.read(util.find_file(fname))
    print calc_matches(seqs[0])
Ejemplo n.º 11
0
def main(fname):
    seqs, _ = fasta.read(util.find_file(fname))
    result = count_kmers(seqs[0], 4)
    print " ".join(map(str, result))
Ejemplo n.º 12
0
def main(fname):
    seqs, _ = fasta.read(util.find_file(fname))
    ed = find_edit_distance(seqs[0], seqs[1])
    print ed