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

Changeset 7:b01db2684fa5 (2020-01-21)
Previous changeset 6:ff313de5f7f4 (2019-10-17) Next changeset 8:bf328cec6a42 (2020-09-02)
Commit message:
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/samtools/samtools_view commit 6692949aa694102abb64c67d46196a822fcb61bf"
modified:
macros.xml
samtools_view.xml
added:
test-data/test.bed
b
diff -r ff313de5f7f4 -r b01db2684fa5 macros.xml
--- a/macros.xml Thu Oct 17 02:25:30 2019 -0400
+++ b/macros.xml Tue Jan 21 07:40:18 2020 -0500
b
@@ -77,18 +77,18 @@
        <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>
-        <option value="4">read is unmapped</option>
-        <option value="8">mate is unmapped</option>
-        <option value="16">read reverse strand</option>
-        <option value="32">mate reverse strand</option>
-        <option value="64">read is the first in a pair</option>
-        <option value="128">read is the second in a pair</option>
-        <option value="256">alignment or read is not primary</option>
-        <option value="512">read fails platform/vendor quality checks</option>
-        <option value="1024">read is a PCR or optical duplicate</option>
-        <option value="2048">supplementary alignment</option>
+        <option value="1">Read is paired</option>
+        <option value="2">Read is mapped in a proper pair</option>
+        <option value="4">Read is unmapped</option>
+        <option value="8">Mate is unmapped</option>
+        <option value="16">Read is mapped to the reverse strand of the reference</option>
+        <option value="32">Mate is mapped to the reverse strand of the reference</option>
+        <option value="64">Read is the first in a pair</option>
+        <option value="128">Read is the second in a pair</option>
+        <option value="256">Alignment of the read is not primary</option>
+        <option value="512">Read fails platform/vendor quality checks</option>
+        <option value="1024">Read is a PCR or optical duplicate</option>
+        <option value="2048">Alignment is supplementary</option>
     </xml>
 
     <!-- region specification macros and tokens for tools that allow the specification 
b
diff -r ff313de5f7f4 -r b01db2684fa5 samtools_view.xml
--- a/samtools_view.xml Thu Oct 17 02:25:30 2019 -0400
+++ b/samtools_view.xml Tue Jan 21 07:40:18 2020 -0500
[
b'@@ -1,7 +1,42 @@\n-<tool id="samtools_view" name="Samtools view" version="@TOOL_VERSION@">\n-    <description>reformat, filter, or subsample</description>\n+<tool id="samtools_view" name="Samtools view" version="@TOOL_VERSION@+galaxy1">\n+    <description>- reformat, filter, or subsample SAM, BAM or CRAM</description>\n     <macros>\n-    <import>macros.xml</import>\n+        <import>macros.xml</import>\n+        <token name="@REF_DATA@">\n+            ## additional reference data\n+            #if $reffa!=None:\n+                -T \'$reffa\'\n+                -t \'$reffai\'\n+            #end if\n+        </token>\n+        <xml name="read_output_formatting">\n+            <yield />\n+            <section name="adv_output" title="Read Reformatting Options" expanded="false">\n+                <repeat name="readtags" title="Strip read tags from output">\n+                    <param name="readtag" type="text" argument="-x" label="Read tag to strip" help="Read tag to exclude from output."/>\n+                </repeat>\n+                <param name="collapsecigar" type="boolean" argument="-B" truevalue="-B" falsevalue="" checked="false" label="Collapse backward CIGAR operation" help="Collapse the backward CIGAR operation." />\n+            </section>\n+        </xml>\n+        <xml name="output_format_selector">\n+            <conditional name="output_format">\n+                <param name="oformat" type="select" label="Output format">\n+                    <option value="sam">SAM</option>\n+                    <option value="bam" selected="True">BAM (-b)</option>\n+                    <option value="cram">CRAM (-C)</option>\n+                </param>\n+                <when value="sam">\n+                    <yield />\n+                    <param name="fmtopt" type="hidden" value="" />\n+                </when>\n+                <when value="bam">\n+                    <param name="fmtopt" type="hidden" value="-b" />\n+                </when>\n+                <when value="cram">\n+                    <param name="fmtopt" type="hidden" value="-C" />\n+                </when>\n+            </conditional>\n+        </xml>\n     </macros>\n     <expand macro="requirements">\n         <requirement type="package">gawk</requirement>\n@@ -13,206 +48,308 @@\n         ## prepare reference data\n         @PREPARE_FASTA_IDX@\n         @PREPARE_IDX@\n-        #if $cond_subsample.select_subsample == \'target\':\n-            ##this must be done before the main command because we don\'t know the total # reads until execution time\n-            #if str($cond_subsample.seed) == \'\':\n-                #set seed_expr="int(rand() * 32768)"\n-            #else\n-                #set seed_expr=$cond_subsample.seed\n-            #end if\n-            #if $input.is_of_type(\'sam\'):\n-                sample_fragment=`samtools view -c infile | awk \'{s=\\$1} END {frac=$cond_subsample.target/s; print(frac < 1 ? "-s "  $seed_expr+frac : "")}\'` &&\n-            #else\n-                sample_fragment=`samtools idxstats infile | awk \'{s+=\\$4+\\$3} END {frac=$cond_subsample.target/s; print(frac < 1 ? "-s " $seed_expr+frac : "")}\'` &&\n-            #end if\n-        #end if\n-        ##call samtools view\n-        samtools view\n-        -@ \\$addthreads\n \n-        #if $outtype == \'count\':\n-            -c\n-        #elif $outtype == \'bam\':\n-            -b\n-        #elif $outtype == \'cram\':\n-            -C\n-        #end if\n-\n-        ## filter options (regions filter is the last parameter)\n-        #if $cond_filter.select_filter == \'yes\':\n-            #if $cond_filter.cond_region.select_region == \'bed\' and str( $cond_filter.cond_region.bedfile ) != \'None\'\n-                -L \'$cond_filter.cond_region.bedfile\'\n-            #end if\n-            #if $cond_filter.cond_rg.select_rg == \'text\':\n-                -r \'$cond_filter.cond_rg.readgr\'\n-            #else if $cond_filter.cond_rg.select_rg == \'file\':\n-                -R \'$cond_filter.cond_rg.rgfile\'\n+        #if str($mode.outtype) == \'header\':\n+            ## call samtools view and be do'..b' reference are stored. As a consequence, the reference that was used during read mapping is needed in order to interpret the alignment records (a checksum stored in the CRAM file is used to verify that only the correct reference sequence can be used). This allows for more space-efficient storage than with BAM format, but such a CRAM file is not usable without its reference.\n+It is also possible, however, to use CRAM without a reference with the disadvantage that the reference sequence gets stored then explicitely (as in SAM and BAM).\n \n The Galaxy tool **currently generates only CRAM without reference sequence**.\n \n@@ -480,8 +775,17 @@\n \n **Filtering alignments**\n \n-samtools view allows to filter alignements based on various criteria, i.e. the output will contain only alignemnts matching all criteria (an additional output containing the remaining alignments can be created additionally, see "Output alignments not passing the filter" in "output options"): e.g. by regions (see below), alignment quality (see below), and tags or flags set in the alignments. \n+If you ask for *A filtered/subsampled selection of reads*, the tool will allow\n+you to specify filter conditions and/or to choose a subsampling strategy, and\n+the output will contain one of the following depending on your choice under\n+*What would you like to have reported?*:\n \n+- All reads retained after filtering and subsampling\n+- Reads dropped during filtering and subsampling\n+\n+If instead you want to *split* the input reads based on your criteria and\n+obtain *two* datasets, one with the retained and one with the dropped reads, check\n+the *Produce extra dataset with dropped/retained reads?* option.\n \n \n **Filtering by regions**\n@@ -490,21 +794,30 @@\n \n Regions can be specified as: RNAME[:STARTPOS[-ENDPOS]] and all position coordinates are 1-based.\n \n-Important note: when multiple regions are given, some alignments may be output multiple times if they overlap more than one of the specified regions.\n+.. class:: Warning mark\n+\n+When multiple regions are given, some alignments may be output multiple times if they overlap more than one of the specified regions.\n \n Examples of region specifications:\n \n-- chr1 Output all alignments mapped to the reference sequence named \'chr1\' (i.e. @SQ SN:chr1).\n-- chr2:1000000 The region on chr2 beginning at base position 1,000,000 and ending at the end of the chromosome.\n-- chr3:1000-2000 The 1001bp region on chr3 beginning at base position 1,000 and ending at base position 2,000 (including both end positions).\n-- \'*\' Output the unmapped reads at the end of the file. (This does not include any unmapped reads placed on a reference sequence alongside their mapped mates.)\n-- . Output all alignments. (Mostly unnecessary as not specifying a region at all has the same effect.)\n+``chr1``\n+   Output all alignments mapped to the reference sequence named \'chr1\' (i.e. @SQ SN:chr1).\n+\n+``chr2:1000000``\n+   The region on chr2 beginning at base position 1,000,000 and ending at the end of the chromosome.\n+\n+``chr3:1000-2000``\n+   The 1001bp region on chr3 beginning at base position 1,000 and ending at base position 2,000 (including both end positions).\n+\n+``*``\n+   Output the unmapped reads at the end of the file. (This does not include any unmapped reads placed on a reference sequence alongside their mapped mates.)\n+\n+``.``\n+   Output all alignments. (Mostly unnecessary as not specifying a region at all has the same effect.)\n \n **Filtering by quality**\n \n-This filters based on the MAPQ column of the SAM format which gives an estimate about the correct placement of the alignemnt. Note that aligners do not follow a consistent definition. \n-\n-The -x, -B, and -s options modify the data which is contained in each alignment.\n+This filters based on the MAPQ column of the SAM format which gives an estimate about the correct placement of the alignment. Note that aligners do not follow a consistent definition. \n     </help>\n     <expand macro="citations"/>\n </tool>\n'
b
diff -r ff313de5f7f4 -r b01db2684fa5 test-data/test.bed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/test.bed Tue Jan 21 07:40:18 2020 -0500
b
@@ -0,0 +1,1 @@
+CHROMOSOME_I 1 120