comapring 2 sequences of DNA ouput the silent and non mutations
Maxime S
maxischmeii at gmail.com
Sun Oct 30 05:01:30 EDT 2016
More information about the Python-list mailing list
Sun Oct 30 05:01:30 EDT 2016
- Previous message (by thread): comapring 2 sequences of DNA ouput the silent and non mutations
- Next message (by thread): pip3 : command not found
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
2016-10-29 21:38 GMT+02:00 <dishaacharya96 at gmail.com>: > > Code: > > [...] > > for i in range (len(protein) & len(seq1)) : > > if protein[i] != mutantPRO[i] : > print (protein[i] + str(i) + mutantPRO[i]) > A+= 1 > else: > if seq1[i:i+3] != mutant[i:i+3]: > print(protein[i] + str(i) + mutantPRO[i] +' Silent mutation ') > print(seq1[i:i+3] + mutant[i:i+3]) > B+= 1 Hi, The problem here is that you try to mix two different index in one variable. Instead, you need to do something like this: #i index protein #j index DNA for i in range (len(protein)) : j = i*3 if protein[i] != mutantPRO[i] : print (protein[i] + str(i) + mutantPRO[i]) A+= 1 else: if seq1[j:j+3] != mutant[j:j+3]: print(protein[i] + str(i) + mutantPRO[i] +' Silent mutation ') print(seq1[j:j+3] + mutant[j:j+3]) B+=1
- Previous message (by thread): comapring 2 sequences of DNA ouput the silent and non mutations
- Next message (by thread): pip3 : command not found
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list