File: test_ProtParam.py

package info (click to toggle)
python-biopython 1.45-3
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 18,192 kB
  • ctags: 12,310
  • sloc: python: 83,505; xml: 13,834; ansic: 7,015; cpp: 1,855; sql: 1,144; makefile: 179
file content (26 lines) | stat: -rw-r--r-- 1,182 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from Bio.SeqUtils import ProtParam, ProtParamData

def PrintDictionary(MyDict):
	for i in MyDict.keys():
		print "%s\t%.2f" %(i, MyDict[i])
	print ""

X = ProtParam.ProteinAnalysis("MAEGEITTFTALTEKFNLPPGNYKKPKLLYCSNGGHFLRILPDGTVDGTRDRSDQHIQLQLSAESVGEVYIKSTETGQYLAMDTSGLLYGSQTPSEECLFLERLEENHYNTYTSKKHAEKNWFVGLKKNGSCKRGPRTHYGQKAILFLPLPV")
print "Amino acid\tCount\n",
PrintDictionary(X.count_amino_acids())
print "Amino acid\tFraction\n",
PrintDictionary(X.get_amino_acids_percent())
print "Molecular weight of test protein:", X.molecular_weight()
print "Aromaticity of test protein: %.2f" % X.aromaticity()
print "Instability index of test protein: %.2f" % X.instability_index()
print "length of flexibility list:", len(X.flexibility())
print "The isoelectric point of the test protein is: %.2f" % X.isoelectric_point()
Helix, Turn, Sheet = X.secondary_structure_fraction()
print "Fraction of amino acids in Helix: %.2f" % Helix
print "Fraction of amino acids in Turn: %.2f" % Turn
print "Fraction of amino acids in Sheet: %.2f" % Sheet
print "\nKyte and Doolittle protein scale:"
for i in X.protein_scale(ProtParamData.kd, 9, 0.4):
	print "%.3f" %i
print "\nGRAVY:"
print X.gravy()