Сравнение последовательностей ДНК в Python 3

My program so far is:

seq_a = "TGGAGGCAATGGCGGCCAGCA"
seq_b = "GACTCCTCCTCCTCCTGCTCA"    
len_a = len(seq_a)    
len_b = len(seq_b)    
print("Length of Sequence A: " + str(len_a))    
print()    
print("Length of Sequence B: " + str(len_b))
print()

def sequence_compare(seq_a, seq_b):
        len1 = len(seq_a)
        len2 = len(seq_b)
        mismatches = []
        for pos in range (0, min(len1, len2)) :
              if seq_a[pos] != seq_b[pos]:
                  mismatches.append('|')
              else:
                  mismatches.append(' ')
        print (seq_a)
        print (mismatches)
        print (seq_b)
sequence_compare(seq_a,seq_b)

I expect an output along the lines of:

TGGAGGCAATGGCGGCCAGCA
||||||||| |||||||||
GACTCCTCCTCCTCCTGCTCA

But instead the output is:

TGGAGGCAATGGCGGCCAGCA
['|', '|', '|', '|', '|', '|', '|', '|', '|', ' ', '|', '|', '|', '|', '|', '|', '|', '|', '|', ' ', ' ']
GACTCCTCCTCCTCCTGCTCA
7 голосов | спросил user4512750 30 Jpm1000000pmFri, 30 Jan 2015 22:17:52 +030015 2015, 22:17:52

0 ответов


Похожие вопросы

Популярные теги

security × 330linux × 316macos × 2827 × 268performance × 244command-line × 241sql-server × 235joomla-3.x × 222java × 189c++ × 186windows × 180cisco × 168bash × 158c# × 142gmail × 139arduino-uno × 139javascript × 134ssh × 133seo × 132mysql × 132