首页 > 其他 > 详细

求DNA序列中各个碱基的含量

时间:2017-01-11 13:59:11      阅读:159      评论:0      收藏:0      [点我收藏+]

方法很简单,用count就可以了,

with open (rD:\Rosalind\rosalind_dna.txt,r) as f:
    for nucleotide in f.readlines():
        num_A = nucleotide.count("A")
        num_G = nucleotide.count("G")
        num_C = nucleotide.count("C")
        num_T = nucleotide.count("T")
        
print ("The numbers of ‘A‘ ====> " + str(num_A))
print ("The numbers of ‘G‘ ====> " + str(num_G))
print ("The numbers of ‘C‘ ====> " + str(num_C))
print ("The numbers of ‘T‘ ====> " + str(num_T))

 

求DNA序列中各个碱基的含量

原文:http://www.cnblogs.com/nklzj/p/6273181.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!