Example #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
Example #2
0
def main(fname):
    seqs, _ = fasta.read(util.find_file(fname))
    corrections = find_corrections(seqs)
    for c in corrections:
        print c
Example #3
0
def main(fname):
    seqs, _ = fasta.read(util.find_file(fname))
    lcs = find_longest_common_subsequence(seqs[0], seqs[1])
    print lcs
Example #4
0
def main(fname):
    seqs, _ = fasta.read(util.find_file(fname))
    print count_matchings(seqs[0])
Example #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)
Example #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])
Example #7
0
def main(fname):
    seqs, _ = fasta.read(util.find_file(fname))
    pos = find_subseqs(seqs[0], seqs[1])
    print " ".join(map(str, pos))
Example #8
0
def main(fname):
    seq, _ = fasta.read(util.find_file(fname))
    T = build_table(seq[0])
    print " ".join(map(str, T))
Example #9
0
def main(fname):
    seqs, _ = fasta.read(util.find_file(fname))
    print(find_shortest_superstring(seqs))
Example #10
0
def main(fname):
    seqs, _ = fasta.read(util.find_file(fname))
    print calc_matches(seqs[0])
Example #11
0
def main(fname):
    seqs, _ = fasta.read(util.find_file(fname))
    result = count_kmers(seqs[0], 4)
    print " ".join(map(str, result))
Example #12
0
def main(fname):
    seqs, _ = fasta.read(util.find_file(fname))
    ed = find_edit_distance(seqs[0], seqs[1])
    print ed