當前位置:成語大全網 - 新華字典 - python分析FASTA中CG,AT的含量。

python分析FASTA中CG,AT的含量。

#!/usr/bin/python3

#-*-?coding:utf-8?-*-

"計算fatsa文件中的不同類型的堿基含量"

f=open('./test.txt','r')

line=f.read()

dict={}?#創建壹個空字典

for?i?in?['A',?'T',?'G',?'C']:

dict[i]=line.count(i)?#字典賦值

print(dict)

f.close()