利用python计算fasta文件中ATGC的含量

 1 #!/usr/bin/python3
 2 #-*- coding:utf-8 -*-
 3 "计算fatsa文件中的不同类型的碱基含量"
 4 f=open('./test.txt','r')
 5 line=f.read()
 6 dict={}  #创建一个空字典
 7 for i in ['A', 'T', 'G', 'C']:
 8     dict[i]=line.count(i)      #字典赋值
 9 print(dict)
10 f.close()
11