annotate protein_properties.py @ 0:cd211b8c2e51 draft default tip

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/protein_properties commit 6767a5ffb02052c844e9d862c79912f998f39d8e
author bgruening
date Mon, 20 Nov 2017 05:09:21 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
cd211b8c2e51 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/protein_properties commit 6767a5ffb02052c844e9d862c79912f998f39d8e
bgruening
parents:
diff changeset
1 #!/usr/bin/env python
cd211b8c2e51 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/protein_properties commit 6767a5ffb02052c844e9d862c79912f998f39d8e
bgruening
parents:
diff changeset
2
cd211b8c2e51 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/protein_properties commit 6767a5ffb02052c844e9d862c79912f998f39d8e
bgruening
parents:
diff changeset
3 import sys
cd211b8c2e51 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/protein_properties commit 6767a5ffb02052c844e9d862c79912f998f39d8e
bgruening
parents:
diff changeset
4 from Bio import SeqIO
cd211b8c2e51 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/protein_properties commit 6767a5ffb02052c844e9d862c79912f998f39d8e
bgruening
parents:
diff changeset
5 from Bio.SeqUtils.ProtParam import ProteinAnalysis
cd211b8c2e51 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/protein_properties commit 6767a5ffb02052c844e9d862c79912f998f39d8e
bgruening
parents:
diff changeset
6
cd211b8c2e51 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/protein_properties commit 6767a5ffb02052c844e9d862c79912f998f39d8e
bgruening
parents:
diff changeset
7 sys.stdout.write("ID\tMW\tIP\tgravy\tlength\tinstability\tmonoisotpoic\tSequence\n")
cd211b8c2e51 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/protein_properties commit 6767a5ffb02052c844e9d862c79912f998f39d8e
bgruening
parents:
diff changeset
8
cd211b8c2e51 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/protein_properties commit 6767a5ffb02052c844e9d862c79912f998f39d8e
bgruening
parents:
diff changeset
9 for record in SeqIO.parse(sys.stdin, "fasta"):
cd211b8c2e51 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/protein_properties commit 6767a5ffb02052c844e9d862c79912f998f39d8e
bgruening
parents:
diff changeset
10 a = ProteinAnalysis(str(record.seq))
cd211b8c2e51 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/protein_properties commit 6767a5ffb02052c844e9d862c79912f998f39d8e
bgruening
parents:
diff changeset
11
cd211b8c2e51 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/protein_properties commit 6767a5ffb02052c844e9d862c79912f998f39d8e
bgruening
parents:
diff changeset
12 properties = list()
cd211b8c2e51 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/protein_properties commit 6767a5ffb02052c844e9d862c79912f998f39d8e
bgruening
parents:
diff changeset
13 properties.append(record.id)
cd211b8c2e51 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/protein_properties commit 6767a5ffb02052c844e9d862c79912f998f39d8e
bgruening
parents:
diff changeset
14 properties.append(a.molecular_weight())
cd211b8c2e51 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/protein_properties commit 6767a5ffb02052c844e9d862c79912f998f39d8e
bgruening
parents:
diff changeset
15 properties.append(a.isoelectric_point())
cd211b8c2e51 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/protein_properties commit 6767a5ffb02052c844e9d862c79912f998f39d8e
bgruening
parents:
diff changeset
16 properties.append(a.gravy())
cd211b8c2e51 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/protein_properties commit 6767a5ffb02052c844e9d862c79912f998f39d8e
bgruening
parents:
diff changeset
17 properties.append(a.length)
cd211b8c2e51 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/protein_properties commit 6767a5ffb02052c844e9d862c79912f998f39d8e
bgruening
parents:
diff changeset
18 properties.append(a.instability_index())
cd211b8c2e51 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/protein_properties commit 6767a5ffb02052c844e9d862c79912f998f39d8e
bgruening
parents:
diff changeset
19 properties.append(a.aromaticity())
cd211b8c2e51 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/protein_properties commit 6767a5ffb02052c844e9d862c79912f998f39d8e
bgruening
parents:
diff changeset
20 # always last column to make the output more readable
cd211b8c2e51 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/protein_properties commit 6767a5ffb02052c844e9d862c79912f998f39d8e
bgruening
parents:
diff changeset
21 properties.append(a.sequence)
cd211b8c2e51 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/protein_properties commit 6767a5ffb02052c844e9d862c79912f998f39d8e
bgruening
parents:
diff changeset
22 sys.stdout.write( '\t'.join(map(str, properties))+"\n" )
cd211b8c2e51 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/protein_properties commit 6767a5ffb02052c844e9d862c79912f998f39d8e
bgruening
parents:
diff changeset
23