Skip to content
Snippets Groups Projects
Commit a6cb14bf authored by Lukas Jelonek's avatar Lukas Jelonek
Browse files

Added signalp module

parent 7f09a528
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python3
import argparse
from os import system
parser = argparse.ArgumentParser(description='Find signal peptides in amino acid sequences')
parser.add_argument('--fasta', '-f', required=True, help='A fasta file with aminoacid sequences')
parser.add_argument('--organism', '-o', choices=['euk', 'gram+', 'gram-'], default='euk', help='The organism type')
args = parser.parse_args()
system("/vol/biotools/bin/signalp -t " + args.organism + " " + args.fasta)
#!/usr/bin/python3
import sys
import json
filename = sys.argv[1]
documents = {}
with open(filename) as f:
tool = None
for line in f:
if not line.startswith("#"):
split = line.split()
if not split[0] in documents:
documents[split[0]] = {"id": split[0], "computations": [{'tool': tool, 'results':[]}]}
results = documents[split[0]]['computations'][0]["results"]
print(split)
if split[9] == "Y":
results.append({
'signalpeptide': True,
'score': float(split[8]),
'start':1,
'end': int(split[2])-1
})
else:
results.append({'signalpeptide': False})
else:
if line.startswith('# SignalP'):
split = line.split()
tool = {'name': 'SignalP',
'version': split[1].split('-')[1],
'mode': split[2]}
for key in documents:
print(json.dumps(documents[key]))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment