1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| indel=[]
heteroplasmies={}
test=[2,'C','T'],[4,'A','T'],[5,'C','G'],[8,'T','GGG'],[15,'T','GCC'],[18,'T','ACCCC']
for x in test:
if len(x[2]) > 1 :
tmp=x[0],x[2]
indel.append(tmp)
else:
heteroplasmies[x[0]-1]='_'.join(x[1:3])
seq=['A','C','C','A','C','G','G','T','G','T','G','T','G','A','G','T','G','T']
new_seq = []
for i,x in enumerate(seq):
new_char = x
for c,v in heteroplasmies.items():
if i == c :
if x == 'C' and v == 'C_G':
new_char='W'
elif x == 'C' and v == 'C_T':
new_char='Z'
elif x == 'A' and v == 'A_T':
new_char='Y'
new_seq.append(new_char)
seq_wait=['A','Z','C','Y','W','G','G','T','G','T','G','T','G','A','G','T','G','T']
for x,y in zip(new_seq, seq_wait):
print("%s (waited %s)"%(x,y)) |