Dear all,
I am having a problem with a code I wrote. I made a dictionary in python. This dictionary contains the keys which are amino acids (single letters code) and then I added values which give how many times this code is present. As a final step, I read a fasta file and make a code that should be able to give the values for the equivalent seq present in the file. However, as an answer, I just get only the last sequence with values and nothing for the other 4 sequences (They are 5 in total).
aa_code = {
'A': 4, 'C': 2, 'D': 2, 'E': 2, 'F': 2,
'G': 4, 'H': 2, 'I': 3, 'K': 2, 'L': 6,
'M': 1, 'N': 2, 'P': 4, 'Q': 2, 'R': 6,
'S': 6, 'T': 4, 'V': 4, 'W': 1, 'Y': 2,
}
This is the right answer!!
[4, 2, 2, 6]
[2, 2, 2, 4, 4]
[6, 4, 2, 4]
[6, 1, 6, 1, 3, 2, 2, 4, 2, 2, 2]
[2, 2, 4, 4, 4, 1, 4, 2, 2, 4, 2]