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
4f316a5c
Commit
4f316a5c
authored
Feb 07, 2018
by
Lukas Jelonek
Browse files
Fix bug: adapt ghostx runner to new helpers path
parent
fce52ed3
Changes
2
Hide whitespace changes
Inline
Side-by-side
psot/scripts/convert_ghostx.py
View file @
4f316a5c
#!/usr/bin/python3
#!/usr/bin/
env
python3
import
sys
import
json
import
argparse
from
os
import
path
from
psot
import
config
import
subprocess
parser
=
argparse
.
ArgumentParser
(
description
=
'Convert ghostx results to json documents'
)
...
...
@@ -60,5 +61,5 @@ with open(output_filename, 'w') as o:
json
.
dump
(
documents
,
o
)
# Replace sequences' enumerated ids with their original ids
restore_seq_ids_tool
=
path
.
dirname
(
__file__
)
+
'/restore_seq_id_from_enumeration.py'
restore_seq_ids_tool
=
config
.
load_config
()[
'helpers_path'
]
+
'/restore_seq_id_from_enumeration.py'
subprocess
.
run
([
restore_seq_ids_tool
,
'-j'
,
output_filename
,
'-e'
,
args
.
result
+
'/enum_headers.tsv'
])
psot/scripts/run_ghostx.py
View file @
4f316a5c
...
...
@@ -7,7 +7,8 @@ from psot import config
import
subprocess
import
json
ghostx_tool
=
config
.
load_config
()[
'tools'
].
get
(
'ghostx'
,
'ghostx'
)
cfg
=
config
.
load_config
()
ghostx_tool
=
cfg
[
'tools'
].
get
(
'ghostx'
,
'ghostx'
)
parser
=
argparse
.
ArgumentParser
(
description
=
'Identify homologues in the swissprot database'
)
parser
.
add_argument
(
'--fasta'
,
'-f'
,
required
=
True
,
help
=
'A fasta file with aminoacid sequences'
)
...
...
@@ -18,7 +19,7 @@ args = parser.parse_args()
makedirs
(
args
.
output
,
exist_ok
=
True
)
# Swap fasta headers for unique numbers to save ghostx from dealing with complex headers
reduce_headers_tool
=
path
.
dirname
(
__file__
)
+
'/reduce_fasta_headers_to_enumeration.py'
reduce_headers_tool
=
cfg
[
'helpers_path'
]
+
'/reduce_fasta_headers_to_enumeration.py'
subprocess
.
run
([
reduce_headers_tool
,
"-f"
,
args
.
fasta
,
"-e"
,
args
.
output
+
'/enum_headers.tsv'
])
# Aproach:
...
...
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