开发者

amino acid composition_CSV_columnwise

Sample file:

Column 10: A|Y|E|A
Column 11: W|I|Q|Q

How do I calculate amino acid composition (percentage) specific to each column? for ex: composition of A in column 10 is 50%, E is 25% and Y is 25%.

Biopython provides modules to calculate amino acid composition of entire file in fasta format

from Bio import SeqIO
from Bio.SeqUtils.ProtParam import ProteinAnalysis

for record in SeqIO.parse('output_translation3.fasta', 'fasta'):
    X = Protei开发者_运维知识库nAnalysis(str(record.seq))
    print('\n Results for record: {}'.format(record.id))
    print(X.count_amino_acids()['G'])
    print(X.count_amino_acids()['A'])
    print(X.count_amino_acids()['L'])
    print(X.count_amino_acids()['M'])
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜