changeset 0:49e20fa2c66d

Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
author konradpaszkiewicz
date Tue, 07 Jun 2011 17:27:16 -0400
parents
children 3c57a8767bb8
files README_INTERPROSCAN interproscan.py interproscan.xml
diffstat 3 files changed, 174 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/README_INTERPROSCAN	Tue Jun 07 17:27:16 2011 -0400
@@ -0,0 +1,22 @@
+#Created 07/01/2011 - Konrad Paszkiewicz, Exeter Sequencing Service, University of Exeter
+
+The attached is a crude wrapper script for Interproscan. Typically this is useful when one wants to produce an annotation which is not based on sequence 
+similarity. E.g after a denovo transcriptome assembly, each transcript could be translated and run through this tool.
+
+Prerequisites:
+
+1. A working installation of Interproscan on your Galaxy server/cluster.
+
+Limitations:
+
+Currently it is setup to work with PFAM only due to the heavy computational demands Interproscan makes. 
+
+Input formats:
+
+The standard interproscan input is either genomic or protein sequences. In the case of genomic sequences Interproscan will of run an ORF 
+prediction tool. However this tends to lose the ORF information (e.g. start/end co-ordinates) from the header. As such the requirement here is to input ORF 
+sequences (e.g. from EMBOSS getorf) and to then replace any spaces in the FASTA header with underscores. This workaround generally preserves the relevant 
+positional information. 
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/interproscan.py	Tue Jun 07 17:27:16 2011 -0400
@@ -0,0 +1,78 @@
+#!/usr/bin/env python
+
+"""
+Classes encapsulating decypher tool.
+James E Johnson - University of Minnesota
+"""
+import pkg_resources;
+import logging, os, string, sys, tempfile, glob, shutil, types, urllib
+import shlex, subprocess
+from optparse import OptionParser, OptionGroup
+from stat import *
+
+
+log = logging.getLogger( __name__ )
+
+assert sys.version_info[:2] >= ( 2, 4 )
+
+def stop_err( msg ):
+    sys.stderr.write( "%s\n" % msg )
+    sys.exit()
+
+def __main__():
+    #Parse Command Line
+    s = 'interproscan.py:  argv = %s\n' % (sys.argv)
+    # print >> sys.stderr, s # so will appear as blurb for file
+    argcnt = len(sys.argv)
+    working_dir = sys.argv[1]
+    input = sys.argv[2]
+    format = sys.argv[3]
+    output = sys.argv[4]
+    #Convert all spaces in ORF header to underscores
+    cmdline = 'sed  \'s/ /_/\' %s > temp.fa' % (input)
+    #print >> sys.stderr, cmdline
+    try:
+        proc = subprocess.Popen( args=cmdline, shell=True, stderr=subprocess.PIPE )
+        returncode = proc.wait()
+        # get stderr, allowing for case where it's very large
+        stderr = ''
+        buffsize = 1048576
+        try:
+            while True:
+                stderr += proc.stderr.read( buffsize )
+                if not stderr or len( stderr ) % buffsize != 0:
+                    break
+        except OverflowError:
+            pass
+        if returncode != 0:
+            raise Exception, stderr
+    except Exception, e:
+        stop_err( 'Error running sed ' + str( e ) )
+
+    cmdline = 'iprscan -cli -nocrc -i temp.fa -o temp.iprscan -goterms -seqtype p -altjobs -format %s -appl hmmpfam > /dev/null' % (format)
+    #print >> sys.stderr, cmdline # so will appear as blurb for file
+    try:
+        proc = subprocess.Popen( args=cmdline, shell=True, stderr=subprocess.PIPE )
+        returncode = proc.wait()
+        # get stderr, allowing for case where it's very large
+        stderr = ''
+        buffsize = 1048576
+        try:
+            while True:
+                stderr += proc.stderr.read( buffsize )
+                if not stderr or len( stderr ) % buffsize != 0:
+                    break
+        except OverflowError:
+            pass
+        if returncode != 0:
+            raise Exception, stderr
+    except Exception, e:
+        stop_err( 'Error running iprscan ' + str( e ) )
+
+    out = open(output,'w')
+    #outpe_path = os.path.join(working_dir,'')
+    for line in open('temp.iprscan'):
+        out.write( "%s" % (line) )
+    out.close()
+
+if __name__ == "__main__": __main__()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/interproscan.xml	Tue Jun 07 17:27:16 2011 -0400
@@ -0,0 +1,74 @@
+<tool id="interproscan" name="Interproscan functional predictions of ORFs"  version="1.0.0">
+	<description>Interproscan functional predictions of ORFs</description>
+	<command interpreter="python">
+	  interproscan.py 
+           '$__app__.config.new_file_path'
+	   '$input'
+           '$format'
+	   '$output'
+	</command>
+        <inputs>
+            <param name="input" type="data" format="fasta" label="ORFs in protein FASTA format"/>
+           <param name="format" type="boolean" format="gff" label="GFF format?" truevalue="gff" falsevalue="raw"/> 
+        </inputs>
+	<outputs>
+                <data format="tabular" name="output" label="Interproscan output"/>
+		
+	</outputs>
+	<requirements>
+	</requirements>
+	<help>
+**Interproscan **
+
+Interproscan is a batch tool to query the Interpro database. It provides annotations based on multiple searches of profile and other functional databases. These include SCOP, CATH, PFAM and SUPERFAMILY. Currently due to resource limitations, only the PFAM database is searched however.
+
+**Input**
+A FASTA file containing ORF predictions is required. This file must NOT contain any spaces in the FASTA headers - any spaces will be convereted to underscores (_) by this tool before submission to Interproscan.
+
+**Output**
+The output will consist of a file in Interproscan raw format@
+
+This is a basic tab delimited format useful for uploading the data into a relational database or concatenation of different runs. 
+is all on one line. 
+
+Example here (with descriptions): 
+NF00181542      0A5FDCE74AB7C3AD        272     HMMPIR  PIRSF001424     Prephenate dehydratase  1       270     6.5e-141        T       06-Aug-2005\
+        IPR008237       Prephenate dehydratase with ACT region  Molecular Function:prephenate dehydratase activity (GO:0004664), Biological Process\
+        :L-phenylalanine biosynthesis (GO:0009094)
+    
+Key: 
+
+NF00181542 is the id of the input sequence. 
+27A9BBAC0587AB84 is the crc64 (checksum) of the protein sequence (supposed to be unique). 
+272 is the length of the sequence (in AA). 
+HMMPIR is the anaysis method launched. 
+PIRSF001424 is the database members entry for this match. 
+Prephenate dehydratase is the database member description for the entry. 
+1 is the start of the domain match. 
+270 is the end of the domain match. 
+6.5e-141 is the evalue of the match (reported by member database method). 
+T is the status of the match (T: true, ?: unknown). 
+06-Aug-2005 is the date of the run. 
+IPR008237 is the corresponding InterPro entry (if iprlookup requested by the user). 
+Prephenate dehydratase with ACT region is the description of the InterPro entry. 
+Molecular Function:prephenate dehydratase activity (GO:0004664) is the GO (gene ontology) description for the InterPro entry. 
+   
+**Database updates**
+
+Typically these take place 2-3 times a year.
+
+**References** 
+
+Quevillon E., Silventoinen V., Pillai S., Harte N., Mulder N., Apweiler R., Lopez R. 
+InterProScan: protein domains identifier (2005). 
+Nucleic Acids Res. 33 (Web Server issue) :W116-W120 
+
+
+Hunter S, Apweiler R, Attwood TK, Bairoch A, Bateman A, Binns D, Bork P, Das U, Daugherty L, Duquenne L, Finn RD, Gough J, Haft D, Hulo N, Kahn D, Kelly E, Laugraud A, Letunic I, Lonsdale D, Lopez R, Madera M, Maslen J, McAnulla C, McDowall J, Mistry J, Mitchell A, Mulder N, Natale D, Orengo C, Quinn AF, Selengut JD, Sigrist CJ, Thimma M, Thomas PD, Valentin F, Wilson D, Wu CH, Yeats C. 
+InterPro: the integrative protein signature database (2009). 
+Nucleic Acids Res. 37 (Database Issue) :D224-228 
+
+
+
+	</help>
+</tool>