計算核酸序列的GC含量 (GC content)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'shengwei ma'
__author_email__ = '[email protected]'
from Bio import SeqIO
from Bio.SeqUtils import GC
for rec in SeqIO.parse("1.txt", "fasta"): #1.txt爲fasta格式的文件
print ' %s\t%2.2f%%' % (rec.name, GC(rec.seq))