changeset 3:e5a471c4630e draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_snpeff commit de422632b9310905f8e9d44faee9ff768752968f
author iuc
date Mon, 31 Oct 2016 08:13:11 -0400
parents 984733fcab49
children 847b0f43c0e5
files data_manager/data_manager_snpEff_databases.xml data_manager/data_manager_snpEff_download.xml data_manager/snpEff_macros.xml
diffstat 3 files changed, 63 insertions(+), 35 deletions(-) [+]
line wrap: on
line diff
--- a/data_manager/data_manager_snpEff_databases.xml	Tue Jun 07 15:44:15 2016 -0400
+++ b/data_manager/data_manager_snpEff_databases.xml	Mon Oct 31 08:13:11 2016 -0400
@@ -1,20 +1,23 @@
-<tool id="data_manager_snpeff_databases" name="SnpEff Databases" version="4.1.0" tool_type="manage_data">
-	<description>Read the list of available snpEff databases</description>
-	<requirements>
-		<requirement type="package" version="4.1">snpEff</requirement>
-	</requirements>
-        <stdio>
-          <exit_code range=":-1"  level="fatal"   description="Error: Cannot open file" />
-          <exit_code range="1:"  level="fatal"   description="Error" />
-        </stdio>
-	<command interpreter="python">
-        data_manager_snpEff_databases.py --jar_path "\$SNPEFF_JAR_PATH/snpEff.jar" "$out_file"
-        </command>
-	<inputs>
-	</inputs>
-	<outputs>
+<tool id="data_manager_snpeff_databases" name="SnpEff Databases" version="@WRAPPER_VERSION@.0" tool_type="manage_data">
+    <description>Read the list of available snpEff databases</description>
+    <macros>
+        <import>snpEff_macros.xml</import>
+    </macros>
+    <expand macro="requirements" />
+    <expand macro="stdio" />
+    <expand macro="version_command" />
+    <command><![CDATA[
+        @CONDA_SNPEFF_JAR_PATH@ &&
+        python '$__tool_directory__/data_manager_snpEff_databases.py' 
+            --jar_path '\$SNPEFF_JAR_PATH/snpEff.jar'
+            '$out_file'
+        ]]>
+    </command>
+    <inputs>
+    </inputs>
+    <outputs>
            <data name="out_file" format="data_manager_json"/>
-	</outputs>
+    </outputs>
         <tests>
             <test>
                 <output name="out_file">
@@ -25,7 +28,7 @@
                 </output>
             </test>
         </tests>
-	<help>
+    <help>
 
 This tool updatess the list of SnpEff databases for the SnpEff Download data manager.
 It should only need to be run once for a snpEff version, 
@@ -36,9 +39,7 @@
 Please cite:
 "A program for annotating and predicting the effects of single nucleotide polymorphisms, SnpEff: SNPs in the genome of Drosophila melanogaster strain w1118; iso-2; iso-3.", Cingolani P, Platts A, Wang le L, Coon M, Nguyen T, Wang L, Land SJ, Lu X, Ruden DM. Fly (Austin). 2012 Apr-Jun;6(2):80-92. PMID: 22728672 [PubMed - in process]
 
-	</help>
-      <citations>
-        <citation type="doi">10.4161/fly.19695</citation>
-      </citations>
+    </help>
+    <expand macro="citations" />
 </tool>
 
--- a/data_manager/data_manager_snpEff_download.xml	Tue Jun 07 15:44:15 2016 -0400
+++ b/data_manager/data_manager_snpEff_download.xml	Mon Oct 31 08:13:11 2016 -0400
@@ -1,16 +1,17 @@
-<tool id="data_manager_snpeff_download" name="SnpEff Download" version="4.1.0" tool_type="manage_data">
+<tool id="data_manager_snpeff_download" name="SnpEff Download" version="@WRAPPER_VERSION@.0" tool_type="manage_data">
     <description>Download a new database</description>
-    <requirements>
-        <requirement type="package" version="4.1">snpEff</requirement>
-    </requirements>
-    <stdio>
-        <exit_code range=":-1" level="fatal" description="Error: Cannot open file" />
-        <exit_code range="1:" level="fatal" description="Error" />
-    </stdio>
-    <command interpreter="python">
-        data_manager_snpEff_download.py --jar_path "\$SNPEFF_JAR_PATH/snpEff.jar" --config "\$SNPEFF_JAR_PATH/snpEff.config"
+    <macros>
+        <import>snpEff_macros.xml</import>
+    </macros>
+    <expand macro="requirements" />
+    <expand macro="stdio" />
+    <expand macro="version_command" />
+    <command><![CDATA[
+        @CONDA_SNPEFF_JAR_PATH@ &&
+        python $__tool_directory__/data_manager_snpEff_download.py --jar_path "\$SNPEFF_JAR_PATH/snpEff.jar" --config "\$SNPEFF_JAR_PATH/snpEff.config"
           --genome_version "$genome_version" "$out_file"
-        </command>
+        ]]>
+    </command>
     <inputs>
         <param name="genome_version" type="text" value="" label="Snpff Genome Version Name (e.g. GRCh38.76)">
             <help>https://snpeff-data.galaxyproject.org/databases/</help>
@@ -49,8 +50,6 @@
 "A program for annotating and predicting the effects of single nucleotide polymorphisms, SnpEff: SNPs in the genome of Drosophila melanogaster strain w1118; iso-2; iso-3.", Cingolani P, Platts A, Wang le L, Coon M, Nguyen T, Wang L, Land SJ, Lu X, Ruden DM. Fly (Austin). 2012 Apr-Jun;6(2):80-92. PMID: 22728672 [PubMed - in process]
 
     </help>
-      <citations>
-        <citation type="doi">10.4161/fly.19695</citation>
-      </citations>
+    <expand macro="citations" />
 </tool>
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/data_manager/snpEff_macros.xml	Mon Oct 31 08:13:11 2016 -0400
@@ -0,0 +1,28 @@
+<macros>
+    <xml name="requirements">
+        <requirements>
+            <requirement type="package" version="4.1">snpEff</requirement>
+        </requirements>
+    </xml>
+  <xml name="stdio">
+    <stdio>
+        <exit_code range=":-1"  level="fatal" description="Error: Cannot open file" />
+        <exit_code range="1:"  level="fatal" description="Error" />
+    </stdio>
+  </xml>
+  <token name="@CONDA_SNPEFF_JAR_PATH@">if [ -z "\$SNPEFF_JAR_PATH" ]; then export SNPEFF_JAR_PATH=\$(dirname \$(readlink -e \$(which snpEff))); fi</token>
+  <xml name="version_command">
+    <version_command><![CDATA[
+    if [ -z "$SNPEFF_JAR_PATH" ]; then
+        export SNPEFF_JAR_PATH=$(dirname $(readlink -e $(which snpEff)));
+    fi && java -jar "$SNPEFF_JAR_PATH/snpEff.jar" -version
+    ]]></version_command>
+  </xml>
+  <token name="@WRAPPER_VERSION@">4.1</token>
+  <xml name="citations">
+      <citations>
+        <citation type="doi">10.4161/fly.19695</citation>
+        <yield />
+      </citations>
+  </xml>
+</macros>