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

fh = open('/home/sb/bioinfo/pdbaa')
for rec in SeqIO.parse(fh,'fasta'):
    myprot = ProteinAnalysis(str(rec.seq.tostring))
    print(myprot.count_amino_acids())
    print(myprot.get_amino_acids_percent())
    print(myprot.molecular_weight())
    print(myprot.aromaticity())
    print(myprot.instability_index())
    print(myprot.flexibility())
    print(myprot.isoelectric_point())
    print(myprot.secondary_structure_fraction())
    print(myprot.protein_scale(ProtParamData.kd, 9, .4))
fh.close()

This code is part of the book "Python for Bioinformatics", by Sebastian Bassi (sbassi@genesdigitales.com). Return to home page.