diff flanking_features.xml @ 3:94248d5b9b8b draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/gops/flanking_features commit cae3e05d02e60f595bb8b6d77a84f030e9bd1689
author devteam
date Thu, 22 Jun 2017 18:39:31 -0400
parents e928e029f6eb
children
line wrap: on
line diff
--- a/flanking_features.xml	Fri Dec 18 19:37:56 2015 -0500
+++ b/flanking_features.xml	Thu Jun 22 18:39:31 2017 -0400
@@ -1,86 +1,87 @@
 <tool id="flanking_features_1" name="Fetch closest non-overlapping feature" version="4.0.1">
-  <description>  for every interval</description>
-  <requirements>
-    <requirement type="package" version="0.7.1">bx-python</requirement>
-    <requirement type="package" version="1.0.0">galaxy-ops</requirement>
-  </requirements>
-  <command interpreter="python">
-      flanking_features.py $input1 $input2 $out_file1 $direction
-      
-      #if isinstance( $input1.datatype, $__app__.datatypes_registry.get_datatype_by_extension('gff').__class__):
-          -1 1,4,5,7 --gff1
-      #else:
-          -1 ${input1.metadata.chromCol},${input1.metadata.startCol},${input1.metadata.endCol},${input1.metadata.strandCol}
-      #end if
-          
-      #if isinstance( $input2.datatype, $__app__.datatypes_registry.get_datatype_by_extension('gff').__class__):
-          -2 1,4,5,7 --gff2
-      #else:
-          -2 ${input2.metadata.chromCol},${input2.metadata.startCol},${input2.metadata.endCol},${input2.metadata.strandCol}
-      #end if
-  </command>
-  <inputs>
-    <param format="interval,gff" name="input1" type="data" label="For every interval in"/>
-    <param format="interval,gff" name="input2" type="data" label="Fetch closest feature(s) from"/>
-    <param name="direction" type="select" label="Located">
-      <option value="Either">Either Upstream or Downstream</option>
-      <option value="Both">Both Upstream and Downstream</option>
-      <option value="Upstream">Upstream</option>
-      <option value="Downstream">Downstream</option>
-    </param>
-  </inputs>
-  <outputs>
-    <data format="input" name="out_file1" metadata_source="input1"/>
-  </outputs>
-  <tests>
-    <test>
-      <param name="input1" value="4_windows.bed"/>
-      <param name="input2" value="4_windows_2.bed"/>
-      <param name="direction" value="Either"/>
-      <output name="out_file1" file="closest_features_either.interval"/>
-    </test>
-    <test>
-      <param name="input1" value="4_windows.bed"/>
-      <param name="input2" value="4_windows_2.bed"/>
-      <param name="direction" value="Both"/>
-      <output name="out_file1" file="closest_features.interval"/>
-    </test>
-    <test>
-      <param name="input1" value="4_windows.bed"/>
-      <param name="input2" value="4_windows_2.bed"/>
-      <param name="direction" value="Upstream"/>
-      <output name="out_file1" file="closest_features_up.interval"/>
-    </test>
-    <test>
-      <param name="input1" value="4_windows.bed"/>
-      <param name="input2" value="4_windows_2.bed"/>
-      <param name="direction" value="Downstream"/>
-      <output name="out_file1" file="closest_features_down.interval"/>
-    </test>
-    <test>
-      <param name="input1" value="4_windows.bed"/>
-      <param name="input2" value="4_windows_3.bed"/>
-      <param name="direction" value="Both"/>
-      <output name="out_file1" file="closest_features_both.interval"/>
-    </test>
-    <!-- Tests for GFF functionality. -->
+    <description>for every interval</description>
+    <macros>
+        <import>macros.xml</import>
+    </macros>
+    <expand macro="requirements" />
+    <command><![CDATA[
+python '$__tool_directory__/flanking_features.py'
+'$input1'
+'$input2'
+'$out_file1'
+$direction
+
+#if $input1.is_of_type('gff')
+    -1 1,4,5,7 --gff1
+#else:
+    -1 ${input1.metadata.chromCol},${input1.metadata.startCol},${input1.metadata.endCol},${input1.metadata.strandCol}
+#end if
 
-    <test>
-      <param name="input1" value="4_windows.bed"/>
-      <param name="input2" value="4_windows_2.gff"/>
-      <param name="direction" value="Either"/>
-      <output name="out_file1" file="closest_features_both.gff"/>
-    </test>
-    <test>
-      <param name="input1" value="4_windows.gff"/>
-      <param name="input2" value="4_windows_2.gff"/>
-      <param name="direction" value="Either"/>
-      <output name="out_file1" file="closest_features_both2.gff"/>
-    </test>
-    
-  </tests>
- <help> 
-
+#if $input2.is_of_type('gff')
+    -2 1,4,5,7 --gff2
+#else:
+    -2 ${input2.metadata.chromCol},${input2.metadata.startCol},${input2.metadata.endCol},${input2.metadata.strandCol}
+#end if
+    ]]></command>
+    <inputs>
+        <param name="input1" type="data" format="interval,gff" label="For every interval in"/>
+        <param name="input2" type="data" format="interval,gff" label="Fetch closest feature(s) from"/>
+        <param name="direction" type="select" label="Located">
+            <option value="Either">Either Upstream or Downstream</option>
+            <option value="Both">Both Upstream and Downstream</option>
+            <option value="Upstream">Upstream</option>
+            <option value="Downstream">Downstream</option>
+        </param>
+    </inputs>
+    <outputs>
+        <data name="out_file1" format_source="input1" metadata_source="input1"/>
+    </outputs>
+    <tests>
+        <test>
+            <param name="input1" value="4_windows.bed"/>
+            <param name="input2" value="4_windows_2.bed"/>
+            <param name="direction" value="Either"/>
+            <output name="out_file1" file="closest_features_either.interval"/>
+        </test>
+        <test>
+            <param name="input1" value="4_windows.bed"/>
+            <param name="input2" value="4_windows_2.bed"/>
+            <param name="direction" value="Both"/>
+            <output name="out_file1" file="closest_features.interval"/>
+        </test>
+        <test>
+            <param name="input1" value="4_windows.bed"/>
+            <param name="input2" value="4_windows_2.bed"/>
+            <param name="direction" value="Upstream"/>
+            <output name="out_file1" file="closest_features_up.interval"/>
+        </test>
+        <test>
+            <param name="input1" value="4_windows.bed"/>
+            <param name="input2" value="4_windows_2.bed"/>
+            <param name="direction" value="Downstream"/>
+            <output name="out_file1" file="closest_features_down.interval"/>
+        </test>
+        <test>
+            <param name="input1" value="4_windows.bed"/>
+            <param name="input2" value="4_windows_3.bed"/>
+            <param name="direction" value="Both"/>
+            <output name="out_file1" file="closest_features_both.interval"/>
+        </test>
+        <!-- Tests for GFF functionality. -->
+        <test>
+            <param name="input1" value="4_windows.bed"/>
+            <param name="input2" value="4_windows_2.gff" ftype="gff" />
+            <param name="direction" value="Either"/>
+            <output name="out_file1" file="closest_features_both.gff"/>
+        </test>
+        <test>
+            <param name="input1" value="4_windows.gff" ftype="gff" />
+            <param name="input2" value="4_windows_2.gff" ftype="gff" />
+            <param name="direction" value="Either"/>
+            <output name="out_file1" file="closest_features_both2.gff"/>
+        </test>
+    </tests>
+    <help><![CDATA[
 .. class:: infomark
 
 **What it does**
@@ -91,7 +92,7 @@
 
 .. class:: warningmark
 
-**Note:** 
+**Note:**
 
 Every line should contain at least 3 columns: chromosome number, start and stop coordinates. If any of these columns is missing or if start and stop coordinates are not numerical, the lines will be treated as invalid and skipped. The number of skipped lines is documented in the resulting history item as a "data issue".
 
@@ -124,8 +125,5 @@
    chr1 500  1000 Query1.2 chr1 2000 2204 Query2.4
    chr1 1100 1250 Query1.3 chr1 580  1050 Query2.3
    chr1 1100 1250 Query1.3 chr1 2000 2204 Query2.4
-
-</help>  
-
-
-</tool>
\ No newline at end of file
+    ]]></help>
+</tool>