[英]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.