Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SOaAS
psot.repository
Commits
f72da30b
Commit
f72da30b
authored
Dec 13, 2017
by
hmueller
Browse files
Make signalp run script accept optional include_mature flag.
parent
5e73cabf
Changes
2
Hide whitespace changes
Inline
Side-by-side
scripts/convert_signalp.py
View file @
f72da30b
#!/usr/bin/python3
import
sys
import
json
import
argparse
parser
=
argparse
.
ArgumentParser
(
description
=
'Convert signalp results to json document
s
'
)
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
)
scripts/run_signalp.py
View file @
f72da30b
#!/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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment