Repository 'samtools_coverage'
hg clone https://toolshed.g2.bx.psu.edu/repos/iuc/samtools_coverage

Changeset 3:c4ff13d2aab3 (2023-06-29)
Previous changeset 2:8a477224dfee (2023-05-31)
Commit message:
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/samtools/sam_to_bam commit 69ce9eb437322f15750e532c6e9586e4e17fe424
modified:
samtools_coverage.xml
added:
test-data/results_4.tabular
test-data/results_5.tabular
b
diff -r 8a477224dfee -r c4ff13d2aab3 samtools_coverage.xml
--- a/samtools_coverage.xml Wed May 31 17:15:17 2023 +0000
+++ b/samtools_coverage.xml Thu Jun 29 10:40:07 2023 +0000
[
@@ -1,4 +1,4 @@
-<tool id="samtools_coverage" name="Samtools coverage" version="@TOOL_VERSION@+galaxy1" profile="@PROFILE@">
+<tool id="samtools_coverage" name="Samtools coverage" version="@TOOL_VERSION@+galaxy2" profile="@PROFILE@">
     <description>computes the depth at each position or region</description>
     <macros>
         <import>macros.xml</import>
@@ -8,16 +8,18 @@
     <expand macro="version_command"/>
     <command><![CDATA[
         #if $condition_input.input_pooling == "No":
+            #set $input = $condition_input.input
             @PREPARE_IDX@
         #else:
+            #set $input_bams = $condition_input.input_bams
             @PREPARE_IDX_MULTIPLE@
         #end if
         samtools coverage
 
             #if $condition_input.input_pooling == "Yes":
-                ${ ' '.join( [ "'%s'" %  $x for $x in $condition_input.input_bams] ) }
+                ${ ' '.join( [ "'%s'" %  $i for $i, $x in enumerate($condition_input.input_bams)]) }
             #else
-                '$condition_input.input'
+                infile
             #end if
 
             -l $additional_options.min_read_length
@@ -32,12 +34,13 @@
             @FLAGS@
             --ff $flags
 
+            #if $additional_options.region != "":
+                -r '$additional_options.region'
+            #end if
+
             #if $condition_histogram.histogram_select == "yes"
                 -m
                 -w $condition_histogram.n_bins
-                #if $condition_histogram.region != "":
-                    -r '$condition_histogram.region'
-                #end if
             #end if
 
             -o '$output'
@@ -68,6 +71,15 @@
             <param name="skipped_flags" argument="--ff" type="select" multiple="True" label="Exclude reads with any of the following flags set">
                 <expand macro="flag_options" s4="true" s256="true" s512="true" s1024="true"/>
             </param>
+            <param name="region" argument="-r" type="text" value="" label="Show specified region" help="Show specified region. Format: chr:start-end." >
+                <sanitizer invalid_char="">
+                    <valid initial="string.ascii_letters,string.digits">
+                        <add value=":" />
+                        <add value="-" />
+                        <add value="_" />
+                    </valid>
+                </sanitizer>
+            </param>
         </section>
 
         <conditional name="condition_histogram">
@@ -77,7 +89,6 @@
             </param>
             <when value="yes">
                 <param name="n_bins" argument="-w" type="integer" min="1" value="100" label="Number of bins in histogram" help="Number of bins in histogram" />
-                <param name="region" argument="-r" type="text" value="" label="Show specified region" help="Show specified region. Format: chr:start-end." />
             </when>
             <when value="no" />
         </conditional>
@@ -105,6 +116,17 @@
             <param name="n_bins" value="100" />
             <output name="output" file="results_3.txt" ftype="tabular" />
         </test>
+        <test><!-- test with a region (requires index) -->
+            <param name="input" value="test_1.bam" ftype="bam" />
+            <param name="region" value="ref1" />
+            <output name="output" file="results_4.tabular" ftype="tabular" />
+        </test>
+        <test><!-- test with pooled BAMs and a region -->
+            <param name="input_pooling" value="Yes" />
+            <param name="input_bams" value="test_1.bam,test_2.bam" ftype="bam" />
+            <param name="region" value="ref2" />
+            <output name="output" file="results_5.tabular" ftype="tabular" />
+        </test>
     </tests>
     <help><![CDATA[
 **What it does**
b
diff -r 8a477224dfee -r c4ff13d2aab3 test-data/results_4.tabular
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/results_4.tabular Thu Jun 29 10:40:07 2023 +0000
b
@@ -0,0 +1,2 @@
+#rname startpos endpos numreads covbases coverage meandepth meanbaseq meanmapq
+ref1 1 45 6 31 68.8889 1.24444 255 30
b
diff -r 8a477224dfee -r c4ff13d2aab3 test-data/results_5.tabular
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/results_5.tabular Thu Jun 29 10:40:07 2023 +0000
b
@@ -0,0 +1,2 @@
+#rname startpos endpos numreads covbases coverage meandepth meanbaseq meanmapq
+ref2 1 40 12 36 90 6.75 63.3 30