changeset 0:d2738fed5e8b draft

Uploaded
author bgruening
date Tue, 14 Jan 2014 09:26:18 -0500
parents
children 3b804546d28a
files create_html.py exparna.xml test-data/input.fasta tool_dependencies.xml
diffstat 4 files changed, 138 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/create_html.py	Tue Jan 14 09:26:18 2014 -0500
@@ -0,0 +1,26 @@
+#!/usr/bin/env python
+
+import os
+import sys
+import zipfile
+
+
+os.chdir(sys.argv[2])
+o = open( 'results.html', 'w+' )
+
+
+o.write('<html> <body> <h1> ExpaRNA Result </h1>' )
+
+for filename in os.listdir( sys.argv[2] ):
+    if os.path.isfile( os.path.join( sys.argv[2], filename) ) and False ==(filename.endswith('epm') or filename.endswith('fa') or filename.endswith('aln') or filename.endswith('html')):
+        o.write( '<img src="%s" /><br />' % ( filename ))
+
+o.write( '</body></html>' )
+o.close()
+
+# create zip file
+
+zf = zipfile.ZipFile(sys.argv[1], mode='w')
+for files in os.listdir(sys.argv[2]):
+        zf.write(files)
+zf.close()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exparna.xml	Tue Jan 14 09:26:18 2014 -0500
@@ -0,0 +1,75 @@
+<tool id="exparna" name="ExpaRNA" version="0.1.0">
+    <description></description>
+    <requirements>
+        <requirement type="package" version="1.0">exparna</requirement>
+        <requirement type="set_environment">EXPARNA_SCRIPT_PATH</requirement>
+    </requirements>
+    <command>
+ExpaRNA 
+-t$emp_scoring
+#if $check == "no":
+-n$max_used_sub
+#end if
+-s$min_incl_sub
+$locarna_input
+$alignment_to_file
+$list_in_file
+$all_in_file
+$fastafile;
+    mkdir $outfile.files_path;
+    cp ./ExpaRNA-results/* $outfile.files_path;
+    python \$EXPARNA_SCRIPT_PATH/create_html.py $outfile $outfile.files_path;
+#if $locarna_input:
+    cp ./ExpaRNA-results/LCSEPM_LocARNA_* $locarna_inputfile
+#end if
+    </command>
+    <stdio>
+        <exit_code range="1:" level="fatal" description="Error occurred. Please check Tool Standard Error" />
+        <exit_code range=":-1" level="fatal" description="Error occurred. Please check Tool Standard Error" />
+    </stdio>
+    <inputs>
+        <param format="fasta" name="fastafile" type="data" label="Fasta Input File" />
+        <param name="min_incl_sub" label="Minimal size of included substructures" type="integer" value="7" help="-s" />
+        <conditional name="check">
+            <param name="check_all" type="boolean" truevalue="yes" falsevalue="no" label="Use all substructures" help="" checked="true" />
+            <when value="no">
+            <param name="max_used_sub" label="Maximum number of used substructures" type="integer" value="0" help="-n" />
+            </when>
+         </conditional>
+         
+        <param name="emp_scoring" type="select" value="no" label="EPM Scoring" help="-t">
+                        <option value="1" selected="true">Default</option>
+                        <option value="2">Prefer Larger Patterns</option>
+        </param>
+        <!-- output parameter alles booleans
+        /!-->
+        <param name="locarna_input" type="boolean" checked="true" truevalue="-i" falsevalue="" label="Write ExpaRNA result as input for LocARNA with anchor constraints" help="-i" />
+        <param name="alignment_to_file" type="boolean" checked="false" truevalue="-o" falsevalue="" label="Write ExpaRNA result as alignment into text file" help="-o" />
+        <param name="list_in_file" type="boolean" checked="false" truevalue="-e" falsevalue="" label="Write ExpaRNA result as list in file" help="-e" />
+        <param name="all_in_file" type="boolean" checked="false" truevalue="-a" falsevalue="" label="Write all EPMs into file" help="-a" />
+    </inputs>
+    <outputs>
+    <data format="fasta" name="locarna_inputfile" label="Output generated for Locarna">
+          <filter>locarna_input is True</filter>
+        </data>
+        <data name="outfile" format="zip" />
+    </outputs>
+    <tests>
+      <test>
+          <param name="fastafile" value="input.fasta" />
+          <output name="output" file="output.zip" compare="sim_size" />
+          <param name="locarna_input" value=""  />
+          <param name="check_all" value="yes"  />
+      </test>
+
+    </tests>
+    <help>**What it does**
+    http://rna.informatik.uni-freiburg.de/ExpaRNA/Input.jsp
+    
+ExpaRNA is a fast, motif-based comparison and alignment tool for RNA molecules. Instead of computing a full sequence-structure alignment, it computes the best arrangement of sequence-structure motifs common to two RNAs. A motif is a local (or isolated) substructure which is identical to both RNAs. ExpaRNA requires a given nested secondary structure for both RNAs. If no structure is available, RNAfold from Vienna RNA Package is used for a structure prediction. The accuracy of the algorithm is mainly controlled by the minimal size of the included sequence-structure motifs. ExpaRNA is especially useful for comparative structural RNA analysis and to speed-up complex sequence-structure alignment methods. For this purpose, the predicted common substructures by ExpaRNA are used as anchor constraints for a full structural alignment.
+
+**Output**
+    
+You will receive a zip file containing all output files and optionally the outputfile made for postprocessing with locarna.
+    </help>
+</tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/input.fasta	Tue Jan 14 09:26:18 2014 -0500
@@ -0,0 +1,4 @@
+>AF165050.379
+UUGGGGGCGACAUUCCACCAUAGAUAAUUCCCCUGUGAGGAAUUACUGUUUUAACGCAGAAAGCGUUUAGCCAUGGCGUUAGUAUGAGUGUCGUGCAGCUUCCAGGACCCCCCCUCCCGGGAGAGCCAUAGUGGUCUGCGGAACCGGUGAGUACACCGGAAUUGCCAGGAUGACCGGGUCCUUUCUUGGAUCAACCCGCUCAAUGCCUGGAGAUUUGGGCGUGCCCCCGCGAGACUGCUAGCCGAGUAGUGUUGGGUCGCGAAAGGCCUUGUGGUACUGCCUGAUAGGGUGCUUGCGAGUGCCCCGGGAGGUCUCGUAGACCGUGCAUCAUGAGCACAAAUCCUAAACCCCAAAGAAAAACCAAACGUAACACCAACCG
+>D45172.391
+GCCAGCCCCCUGAUGGGGGCGACACUCCACCAUAGAUCACUCCCCUGUGAGGAACUACUGUCUUCACGCAGAAAGCGUCUAGCCAUGGCGUUAGUAUGAGUGUCGUGCAGCCUCCAGGACCCCCCCUCCCGGGAGAGCCAUAGUGGUCUGCGGAACCGGUGAGUACACCGGAAUUGCCAGGACGACCGGGUCCUUUCUUGGAUCAACCCGCUCAAUGCCUGGAGAUUUGGGCGUGCCCCCGCGAGACUGCUAGCCGAGUAGUGUUGGGUCGCGAAAGGCCUUGUGGUACUGCCUGAUAGGGUGCUUGCGAGUGCCCCGGGAGGUCUCGUAGACCGUGCAUCAUGAGCACAAAUCCAAAACCCCAAAGAAAAAUCAAACGUAACACCAACCG
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool_dependencies.xml	Tue Jan 14 09:26:18 2014 -0500
@@ -0,0 +1,33 @@
+<?xml version="1.0"?>
+<tool_dependency>
+    <set_environment version="1.0">
+        <environment_variable action="set_to" name="EXPARNA_SCRIPT_PATH">$REPOSITORY_INSTALL_DIR</environment_variable>
+    </set_environment>
+    <package name="vienna_rna" version="1.8.5">
+        <repository changeset_revision="18c7086dbb43" name="package_vienna_rna_1_8" owner="bgruening" prior_installation_required="True" toolshed="http://testtoolshed.g2.bx.psu.edu" />
+    </package>
+    
+    <package name="exparna" version="1.0">
+        <install version="1.0">
+            <actions>
+                <action type="download_by_url">http://www.bioinf.uni-freiburg.de/Software/expaRNA/exparna-1.0.tar.gz</action>
+                <action type="set_environment_for_install">
+                    <repository changeset_revision="18c7086dbb43" name="package_vienna_rna_1_8" owner="bgruening" toolshed="http://testtoolshed.g2.bx.psu.edu">
+                        <package name="vienna_rna" version="1.8.5" />
+                    </repository>
+                </action>
+                <action type="shell_command">./configure --prefix $INSTALL_DIR --with-RNA=$ROOT_VIENNA_RNA_DIR</action>
+                <action type="make_install" />
+                <action type="move_file">
+                    <source>create_html.py</source>
+                    <destination>$INSTALL_DIR</destination>
+                </action>
+                <action type="set_environment">
+                    <environment_variable action="prepend_to" name="PATH">$INSTALL_DIR/bin</environment_variable>
+                </action>
+                
+            </actions>
+        </install>
+        <readme>Compiling ExpaRNA requires a C compiler (typically gcc)</readme>
+    </package>
+</tool_dependency>