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.