Translation DNA to Protein

前端 未结 2 1606
无人及你
无人及你 2021-02-10 05:57

I am a biology graduate student and I taught myself a very limited amount of python in the past few months to deal with some data I have. I am not asking for homework help, this

2条回答
  •  被撕碎了的回忆
    2021-02-10 06:41

    Your problem stems from the line

    if cds[n:n+3] in codontable == True
    

    This always evaluates to False, and thus you never append to proteinsequence. Just remove the == True portion like so

    if cds[n:n+3] in codontable
    

    and you will get the protein sequence. Also, make sure to return proteinsequence in translate_dna().

提交回复
热议问题