changeset 3:e613c1ad4c4c draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/samtools/samtools_sort commit 64305ae905dc79e44b478203000add73598bcca1
author iuc
date Sat, 06 Apr 2019 06:37:47 -0400
parents f56bdb93ae58
children 6c2c1836728b
files macros.xml samtools_sort.xml
diffstat 2 files changed, 43 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/macros.xml	Wed Sep 19 09:53:49 2018 -0400
+++ b/macros.xml	Sat Apr 06 06:37:47 2019 -0400
@@ -53,11 +53,11 @@
         #if $addref_cond.addref_select == "history":
             ln -s '${addref_cond.ref}' reference.fa &&
             samtools faidx reference.fa &&
-            #set reffa=str($addref_cond.ref)
+            #set reffa="reference.fa"
             #set reffai="reference.fa.fai"
         #elif $addref_cond.addref_select == "cached":
             #set reffa=str($addref_cond.ref.fields.path)
-            #set reffai=str($addref_cond.ref.fields.path)
+            #set reffai=str($addref_cond.ref.fields.path)+".fai"
         #else
             #set reffa=None
             #set reffai=None
@@ -67,13 +67,15 @@
         ##compute the number of ADDITIONAL threads to be used by samtools (-@)
         addthreads=\${GALAXY_SLOTS:-1} && (( addthreads-- )) &&
     ]]></token>
-
     <token name="@ADDMEMORY@"><![CDATA[
         ##compute the number of memory available to samtools sort (-m)
         ##use only 75% of available: https://github.com/samtools/samtools/issues/831
         addmemory=\${GALAXY_MEMORY_MB_PER_SLOT:-768} && 
         ((addmemory=addmemory*75/100)) &&
     ]]></token>
+    <xml name="seed_input">
+       <param name="seed" type="integer" optional="True" label="Seed for random number generator" help="If empty a random seed is used." /> 
+    </xml>
     <xml name="flag_options">
         <option value="1">read is paired</option>
         <option value="2">read is mapped in a proper pair</option>
@@ -88,6 +90,42 @@
         <option value="1024">read is a PCR or optical duplicate</option>
         <option value="2048">supplementary alignment</option>
     </xml>
+
+    <!-- region specification macros and tokens for tools that allow the specification 
+         of region by bed file / space separated list of regions -->
+    <token name="@REGIONS_FILE@"><![CDATA[
+        #if $cond_region.select_region == 'tab':
+            -t '$cond_region.targetregions'
+        #end if
+    ]]></token>
+    <token name="@REGIONS_MANUAL@"><![CDATA[
+        #if $cond_region.select_region == 'text':
+            #for $i, $x in enumerate($cond_region.regions_repeat):
+               '${x.region}'
+            #end for
+        #end if
+    ]]></token>
+    <xml name="regions_macro">
+        <conditional name="cond_region">
+            <param name="select_region" type="select" label="Filter by regions" help="restricts output to only those alignments which overlap the specified region(s)">
+                <option value="no" selected="True">No</option>
+                <option value="text">Manualy specify regions</option>
+                <option value="tab">Regions from tabular file</option>
+            </param>
+            <when value="no"/>
+            <when value="text">
+                <repeat name="regions_repeat" min="1" default="1" title="Regions">
+                    <param name="region" type="text" label="region" help="format chr:from-to">
+                        <validator type="regex" message="Required format: CHR[:FROM[-TO]]; where CHR: string containing any character except quotes, whitespace and colon; FROM and TO: any integer">^[^\s'\":]+(:\d+(-\d+){0,1}){0,1}$</validator>
+                    </param>
+                </repeat>
+            </when>
+            <when value="tab">
+                <param name="targetregions" argument="-t/--target-regions" type="data" format="tabular" label="Target regions file" help="Do stats in these regions only. Tab-delimited file chr,from,to (1-based, inclusive)" />
+            </when>
+        </conditional>
+    </xml>
+
     <xml name="citations">
         <citations>
             <citation type="bibtex">
--- a/samtools_sort.xml	Wed Sep 19 09:53:49 2018 -0400
+++ b/samtools_sort.xml	Sat Apr 06 06:37:47 2019 -0400
@@ -1,4 +1,4 @@
-<tool id="samtools_sort" name="Samtools sort" version="2.0.2">
+<tool id="samtools_sort" name="Samtools sort" profile="18.01" version="2.0.3">
     <description>order of storing aligned sequences</description>
     <macros>
         <import>macros.xml</import>
@@ -26,7 +26,7 @@
              > '${output1}'
     ]]></command>
     <inputs>
-        <param name="input1" type="data" format="sam,bam,cram" label="BAM File" />
+        <param name="input1" type="data" format="sam,unsorted.bam,cram" label="BAM File" />
         <conditional name="prim_key_cond">
             <param name="prim_key_select" type="select" label="Primary sort key">
                 <option value="">coordinate</option>