Mercurial > repos > bgruening > protein_properties
comparison 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 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:cd211b8c2e51 |
---|---|
1 #!/usr/bin/env python | |
2 | |
3 import sys | |
4 from Bio import SeqIO | |
5 from Bio.SeqUtils.ProtParam import ProteinAnalysis | |
6 | |
7 sys.stdout.write("ID\tMW\tIP\tgravy\tlength\tinstability\tmonoisotpoic\tSequence\n") | |
8 | |
9 for record in SeqIO.parse(sys.stdin, "fasta"): | |
10 a = ProteinAnalysis(str(record.seq)) | |
11 | |
12 properties = list() | |
13 properties.append(record.id) | |
14 properties.append(a.molecular_weight()) | |
15 properties.append(a.isoelectric_point()) | |
16 properties.append(a.gravy()) | |
17 properties.append(a.length) | |
18 properties.append(a.instability_index()) | |
19 properties.append(a.aromaticity()) | |
20 # always last column to make the output more readable | |
21 properties.append(a.sequence) | |
22 sys.stdout.write( '\t'.join(map(str, properties))+"\n" ) | |
23 |