【问题标题】:input of txt file (codon) to a dict and if there is a similarity print the aminoacid将文本文件(密码子)输入到字典中,如果存在相似性,则打印氨基酸
【发布时间】:2022-01-14 17:12:27
【问题描述】:

Here is my code so far.

我有一个包含两个 txt 文件作为字符串的字典。 现在我想再次导入三元组文件,但使用函数,输出将只返回氨基酸作为字符串。 我怎样才能做到这一点?有任何想法吗? 谢谢

【问题讨论】:

  • 请不要分享您的代码图片,请粘贴到此处。

标签: python file dictionary bioinformatics


【解决方案1】:

你可以使用dict理解:

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

然后,您的字典将不会有不相关的字符作为值。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-08-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多