Commit c040c5fd authored by Lukas Jelonek's avatar Lukas Jelonek
Browse files

Merge commit '9db2c064' into develop

parents 535a948c 9db2c064
signalp: '/vol/biotools/bin/signalp'
ghostx: '/vol/biotools/bin/ghostx'
tmhmm: '/vol/biotools/bin/tmhmm'
......@@ -15,6 +15,7 @@ In order to run PSOT on your machine you need:
* hmmscan
* signalp
* ghostx
* tmhmm
* the bioinformatic databases you want to use
# Module manifest for the tmhmm analysis
# The name of the module. Is needed for the list-analyses option, for custom
# configurations and custom profiles.
name: 'tmhmm'
# Short description of the analysis.
info: 'predict transmembrane helices in proteins'
# The configuration of the script for the analysis step.
# script must take a --fasta parameter
script: ''
# specify additional default configuration here
# The configuration of the script for the json conversion step.
# script must take a --result parameter, which is the result from the analysis step
script: ''
# specify additional default configuration here
......@@ -4,3 +4,4 @@ modules:
organism: 'euk'
import sys
import json
import argparse
parser = argparse.ArgumentParser(description='Convert tmhmm results to json documents')
parser.add_argument('--result', '-r', required=True, help='The tmhmm result file')
parser.add_argument('--output', '-o', required=True, help='The converted results json file')
args = parser.parse_args()
def parse_topology(s, l):
elements = []
result = []
flag = False
num = ""
for c in s:
if c == 'i' or c == 'o' or c == '-':
if num != "":
num = ""
if c != '-':
num += c
if num != "":
for i in range(len(elements)):
if flag:
flag = False
if elements[i] == 'i' or elements[i] == 'o':
location = ""
if elements[i] == 'i':
location = "inside"
location = "outside"
if i == 0:
if len(elements) == 1:
result.append({'start': 1, 'end': l , 'location': location})
result.append({'start': 1, 'end': elements[i+1]-1 , 'location': location})
elif i+1 == len(elements):
result.append({'start': elements[i-1]+1, 'end':l , 'location': location})
result.append({'start': elements[i-1]+1, 'end': elements[i+1]-1 , 'location': location})
result.append({'start': elements[i], 'end': elements[i+1] , 'location': 'membrane'})
flag = True
return (result)
filename = args.result
documents = {}
with open(filename) as f:
for line in f:
line_dic = {}
elements = line.rstrip().split("\t")
for i in range(1, len(elements)):
key = elements[i][:elements[i].rfind('=')]
value = elements[i][elements[i].rfind('=')+1:]
if key == 'Topology':
line_dic[key] = parse_topology(value, elements[i-4][elements[i-4].rfind('=')+1:])
line_dic[key] = value
documents[elements[0]] = line_dic
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
import subprocess
tmhmm_tool = config.load_config()['tools'].get('tmhmm', 'tmhmm')
parser = argparse.ArgumentParser(description='Find transmembrane helices in amino acid sequences')
parser.add_argument('--fasta', '-f', required=True, help='A fasta file with aminoacid sequences')
#parser.add_argument('--workdir', '-workdir', help='Working directory')
#parser.add_argument('--wwwdir', '-wwwdir', help='The place where the www server looks for files')
#parser.add_argument('--serverhome', '-serverhome', help='') #
#parser.add_argument('--basedir', '-basedir', help='basis directory for TMHMM package')
#parser.add_argument('--bindir', '-bindir', help='Bin directory (defaults basedir/bin)')
#parser.add_argument('--scrdir', '-scrdir', help='Script directory (defaults basedir/bin)')
#parser.add_argument('--libdir', '-libdir', help='Library directory (defaults basedir/lib)')
#parser.add_argument('--html', '-html', help='Produce HTML output')
#parser.add_argument('--short', '-s', help='Short output format')
#parser.add_argument('--plot', '-p', help='Produce graphics')
#parser.add_argument('--version1', '-v1', help='Use old model (version 1)')
#parser.add_argument('--debugging', '-d', help='') #
parser.add_argument('--output', required=True, help='The output file')
args = parser.parse_args()
system("cat " + args.fasta + " | " + tmhmm_tool + " -short > " + args.output) #
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