匹配两个RNA序列并打印出匹配碱基对长度的程序

  • 本文关键字:程序 打印 两个 RNA python string list
  • 更新时间 :
  • 英文 :


我在输入两个RNA序列并打印出匹配碱基对长度的程序时遇到了一些麻烦。

这是我到目前为止所拥有的:

def main():
    Sequence1 = ""
    Sequence2 = ""
    print("MatchSequences(Sequence1,Sequence2)")
    MatchSequence = input("Enter the subsequences with each base in single quotes and the subsequences separated a comma")
    input = (x,y)
    x = ([])
    y = ([])
    for i in range(0,len(Sequence1)):
        if x == A
main()

它可以是这样的:

from string import join
def main():
    pairs = {'G':'C', 'C':'G', 'A':'U', 'U':'A'}
    print("MatchSequences(Sequence1, Sequence2)")
    x, y = input("Enter the subsequences with each base in single quotes and the subsequences separated a comma")
    matched = join([a  if pairs[a]==b else '-' for (a, b) in zip(x, y)], sep='')
if __name__=='__main__':
    main()

最新更新