Commit f72da30b authored by hmueller's avatar hmueller
Browse files

Make signalp run script accept optional include_mature flag.

parent 5e73cabf
import sys
import json
import argparse
parser = argparse.ArgumentParser(description='Convert signalp results to json documents')
parser.add_argument('--result', '-r', required=True, help='The signalp result file')
parser = argparse.ArgumentParser(description='Convert signalp results to json document')
parser.add_argument('--result', '-r', required=True, help='The signalp result directory')
parser.add_argument('--output', '-o', required=True, help='The converted results json file')
args = parser.parse_args()
filename = args.result
# Check wether args.result + '/mature.fas' exists and if so read into id:seq dict
filename = args.result + '/results.txt'
documents = {}
with open(filename) as f:
tool = None
for line in f:
......@@ -36,5 +40,6 @@ with open(filename) as f:
'mode': split[2]}
output_filename = args.output
with open(output_filename, 'w') as o:
json.dump(documents, o)
#!/usr/bin/env python3
import env
import argparse
from psot import config
from os import system
from os import system,makedirs
signalp_tool = config.load_config()['tools'].get('signalp', 'signalp')
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')
parser.add_argument('--output', required=True, help='The output file')
parser.add_argument('--include_mature', '-m', action='store_true', help='Include mature sequences of proteins with signal peptide')
parser.add_argument('--output', required=True, help='The result directory. Will contain results.txt and optionally mature.fas.')
args = parser.parse_args()
system(signalp_tool + " -t " + args.organism + " " + args.fasta + " > " + args.output)
makedirs(args.output, exist_ok=True)
mature_param = " -m {}/mature.fas ".format(args.output) if args.include_mature else " "
results_file = args.output + '/results.txt'
system(signalp_tool + " -t " + args.organism + mature_param + args.fasta + " > " + results_file)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment