Commit 4f7f7870 authored by Lukas Jelonek's avatar Lukas Jelonek
Browse files

Fix missing dependendies in run scripts

parent 7ef0be7b
......@@ -2,6 +2,7 @@
import argparse
from psot import config
from subprocess import call
import sys
blastp_tool = config.load_config()['tools'].get('blastp', 'blastp')
......
......@@ -7,6 +7,7 @@ from psot import config
import subprocess
from subprocess import call
import json
import sys
cfg = config.load_config()
ghostx_tool = cfg['tools'].get('ghostx', 'ghostx')
......@@ -33,8 +34,8 @@ toolconfig = {
'database': args.database
}
# find version
output = subprocess.run([ghostx_tool], stderr=subprocess.PIPE)
text = output.stderr.decode('ascii')
output = subprocess.run([ghostx_tool], stderr=subprocess.STDOUT, stdout=subprocess.PIPE)
text = output.stdout.decode('ascii')
result = re.search('version (.*)', text)
toolconfig['version'] = result.group(1)
......
......@@ -4,6 +4,7 @@ import json
from psot import config
from subprocess import call
from os import makedirs
import sys
hmmscan_tool = config.load_config()['tools'].get('hmmscan', 'hmmscan')
......@@ -16,13 +17,25 @@ args = parser.parse_args()
makedirs(args.output, exist_ok=True)
command = hmmscan_tool +
# Provide a list of all query sequence names for conversion process
queries = []
with open(args.fasta) as f:
for line in f:
if line.startswith('>'):
queries.append(line.split()[0].strip().lstrip('>'))
query_file = args.output + '/queries.json'
with open(query_file, 'w') as o:
json.dump(queries, o)
command = (hmmscan_tool +
" -E " + args.evalue +
" -o " + args.output + "/hmmscan.out " +
" --tblout " + args.output + "/tblout.tsv " +
" --domtblout " + args.output + "/domtblout.tsv " +
" --pfamtblout " + args.output + "/pfamtblout.tsv " +
args.database + " " + args.fasta
args.database + " " + args.fasta)
try:
retcode = call(command, shell=True)
......@@ -31,14 +44,3 @@ except OSError as e:
print("Execution failed:", e, file=sys.stderr)
exit(1)
# Provide a list of all query sequence names for conversion process
queries = []
with open(args.fasta) as f:
for line in f:
if line.startswith('>'):
queries.append(line.split()[0].strip().lstrip('>'))
query_file = args.output + '/queries.json'
with open(query_file, 'w') as o:
json.dump(queries, o)
......@@ -4,6 +4,7 @@ import argparse
from psot import config
from os import system,makedirs
from subprocess import call
import sys
signalp_tool = config.load_config()['tools'].get('signalp', 'signalp')
......
......@@ -5,6 +5,7 @@ from psot import config
from os import system,makedirs,path
import subprocess
from subprocess import call
import sys
cfg = config.load_config()
......
......@@ -4,6 +4,7 @@ from psot import config
from os import system
import subprocess
from subprocess import call
import sys
tmhmm_tool = config.load_config()['tools'].get('tmhmm', 'tmhmm')
......
Markdown is supported
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