简体   繁体   中英

input of txt file (codon) to a dict and if there is a similarity print the aminoacid

Here is my code so far.

I have a dict with two txt files as strings. Now I want to import the triplets file again, but with the function, that the output will return only the amino acids as string. How can I do that? Any Ideas? Thank you

You can use dict comprehension:

translation_dict = { t : a for t, a in zip(triplets, aa) if a.isalpha()}

Then, your dictionary won't have irrelevant characters as values.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM