[英]input of txt file (codon) to a dict and if there is a similarity print the aminoacid
我有一個帶有兩個 txt 文件作為字符串的字典。 現在我想再次導入三元組文件,但是使用 function,output 將只返回氨基酸作為字符串。 我怎樣才能做到這一點? 有任何想法嗎? 謝謝
您可以使用 dict 理解:
translation_dict = { t : a for t, a in zip(triplets, aa) if a.isalpha()}
然后,您的字典不會將不相關的字符作為值。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.