Repository 'samtools_rmdup'
hg clone https://toolshed.g2.bx.psu.edu/repos/devteam/samtools_rmdup

Changeset 2:3735f950b2f5 (2015-04-21)
Previous changeset 1:fe83e6f8e65e (2014-03-27) Next changeset 3:bb40e4252392 (2015-12-01)
Commit message:
Uploaded
modified:
samtools_rmdup.xml
tool_dependencies.xml
added:
macros.xml
test-data/samtools-rmdup-input1.bam
test-data/samtools-rmdup-test1.bam
removed:
test-data/1.bam
b
diff -r fe83e6f8e65e -r 3735f950b2f5 macros.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/macros.xml Tue Apr 21 17:21:53 2015 -0400
b
@@ -0,0 +1,70 @@
+<macros>
+    <xml name="requirements">
+        <requirements>
+            <requirement type="package" version="1.2">samtools</requirement>
+            <yield/>
+        </requirements>
+    </xml>
+    <xml name="citations">
+        <citations>
+            <citation type="bibtex">
+                @misc{SAM_def,
+                title={Definition of SAM/BAM format},
+                url = {https://samtools.github.io/hts-specs/SAMv1.pdf},}
+            </citation>
+            <citation type="doi">10.1093/bioinformatics/btp352</citation>
+            <citation type="doi">10.1093/bioinformatics/btr076</citation>
+            <citation type="doi">10.1093/bioinformatics/btr509</citation>
+            <citation type="bibtex">
+                @misc{Danecek_et_al,
+                Author={Danecek, P., Schiffels, S., Durbin, R.},
+                title={Multiallelic calling model in bcftools (-m)},
+                url = {http://samtools.github.io/bcftools/call-m.pdf},}
+            </citation>
+            <citation type="bibtex">
+                @misc{Durbin_VCQC,
+                Author={Durbin, R.},
+                title={Segregation based metric for variant call QC},
+                url = {http://samtools.github.io/bcftools/rd-SegBias.pdf},}
+            </citation>
+            <citation type="bibtex">
+                @misc{Li_SamMath,
+                Author={Li, H.},
+                title={Mathematical Notes on SAMtools Algorithms},
+                url = {http://www.broadinstitute.org/gatk/media/docs/Samtools.pdf},}
+            </citation>
+            <citation type="bibtex">
+                @misc{SamTools_github,
+                title={SAMTools GitHub page},
+                url = {https://github.com/samtools/samtools},}
+            </citation>
+        </citations>
+    </xml>
+    <xml name="version_command">
+        <version_command>samtools --version | head -n 1 | awk '{ print $2 }'</version_command>
+    </xml>
+    <xml name="stdio">
+        <stdio>
+            <exit_code range="1:" level="fatal" description="Error" />
+        </stdio>
+    </xml>
+    <token name="@no-chrom-options@">
+-----
+
+.. class:: warningmark
+
+**No options available? How to re-detect metadata**
+
+If you see a &quot;No options available&quot; within the &quot;**Select references (chromosomes and contigs) you would like to restrict bam to**&quot; drop down, you need to re-detect metadata for the dataset you are trying to process. To do this follow these steps:
+
+1. Click on the **pencil** icon adjacent to the dataset in the history
+2. A new menu will appear in the center pane of the interface
+3. Click **Datatype** tab
+4. Set **New Type** to **BAM**
+5. Click **Save**
+
+The medatada will be re-detected and you will be able to see the list of reference sequences in the &quot;**Select references (chromosomes and contigs) you would like to restrict bam to**&quot; drop-down.
+
+    </token>
+
+</macros>
b
diff -r fe83e6f8e65e -r 3735f950b2f5 samtools_rmdup.xml
--- a/samtools_rmdup.xml Thu Mar 27 15:26:52 2014 -0400
+++ b/samtools_rmdup.xml Tue Apr 21 17:21:53 2015 -0400
b
@@ -1,8 +1,11 @@
-<tool id="samtools_rmdup" name="rmdup" version="1.0.1">
-  <requirements>
-    <requirement type="package" version="0.1.19">samtools</requirement>
-  </requirements>
+<tool id="samtools_rmdup" name="RmDup" version="2.0">
   <description>remove PCR duplicates</description>
+  <macros>
+    <import>macros.xml</import>
+  </macros>
+  <expand macro="requirements"></expand>
+  <expand macro="stdio"></expand>
+  <expand macro="version_command"></expand>
   <command>samtools rmdup 
   #if str( $bam_paired_end_type.bam_paired_end_type_selector ) == "PE"
       ${bam_paired_end_type.force_se}
@@ -10,18 +13,17 @@
       -s
   #end if
   "$input1" "$output1"
-  2&gt;&amp;1 || echo "Error running samtools rmdup." &gt;&amp;2
   </command>
   <inputs>
     <param name="input1" type="data" format="bam" label="BAM File" />
     
     <conditional name="bam_paired_end_type">
-      <param name="bam_paired_end_type_selector" type="select" label="Is data paired-end">
+      <param name="bam_paired_end_type_selector" type="select" label="Is this paired-end or single end data">
         <option value="PE" selected="True">BAM is paired-end</option>
-        <option value="SE">BAM is single-end</option>
+        <option value="SE">BAM is single-end (-s)</option>
       </param>
       <when value="PE">
-        <param name="force_se" type="boolean" label="Treat as single-end" help="(-S)" truevalue="-S" falsevalue="" checked="False"/>
+        <param name="force_se" type="boolean" label="Treat as single-end" help="-S" truevalue="-S" falsevalue="" checked="False"/>
       </when>
       <when value="SE" /> <!-- No extra parameters here -->
     </conditional>
@@ -32,38 +34,21 @@
   </outputs>
   <tests>
     <test>
-      <param name="input1" value="1.bam" ftype="bam" />
-      <param name="bam_paired_end_type_selector" value="SE" />
-      <output name="output1" file="1.bam" ftype="bam" sort="True"/>
-    </test>
-    <test>
-      <param name="input1" value="1.bam" ftype="bam" />
-      <param name="bam_paired_end_type_selector" value="PE" />
-      <param name="force_se" value="True" />
-      <output name="output1" file="1.bam" ftype="bam" sort="True"/>
-    </test>
-    <test>
-      <param name="input1" value="1.bam" ftype="bam" />
+      <param name="input1" value="samtools-rmdup-input1.bam" ftype="bam" />
       <param name="bam_paired_end_type_selector" value="PE" />
       <param name="force_se" />
-      <output name="output1" file="1.bam" ftype="bam" sort="True" />
+      <output name="output1" file="samtools-rmdup-test1.bam" ftype="bam" sort="True" />
     </test>
   </tests>
   <help>
 
 **What it does**
 
-This tool uses the SAMTools_ toolkit to remove potential PCR duplicates: if multiple read pairs have identical external coordinates, only retain the pair with highest mapping quality. In the paired-end mode, this command ONLY works with FR orientation and requires ISIZE is correctly set. It does not work for unpaired reads (e.g. two ends mapped to different chromosomes or orphan reads). 
-
-.. _SAMTools: http://samtools.sourceforge.net/samtools.shtml
-
-------
+Remove potential PCR duplicates: if multiple read pairs have identical external coordinates, only retain the pair with highest mapping quality. In the paired-end mode, this command ONLY works with FR orientation and requires ISIZE is correctly set. It does not work for unpaired reads (e.g. two ends mapped to different chromosomes or orphan reads). This tool has the following parameters::
 
-**Citation**
-
-For the underlying tool, please cite `Li H, Handsaker B, Wysoker A, Fennell T, Ruan J, Homer N, Marth G, Abecasis G, Durbin R; 1000 Genome Project Data Processing Subgroup. The Sequence Alignment/Map format and SAMtools. Bioinformatics. 2009 Aug 15;25(16):2078-9. &lt;http://www.ncbi.nlm.nih.gov/pubmed/19505943&gt;`_
-
-If you use this tool in Galaxy, please cite Blankenberg D, et al. *In preparation.*
+  -s    rmdup for SE reads
+  -S    treat PE reads as SE in rmdup (force -s)
 
   </help>
+    <expand macro="citations"></expand>
 </tool>
b
diff -r fe83e6f8e65e -r 3735f950b2f5 test-data/1.bam
b
Binary file test-data/1.bam has changed
b
diff -r fe83e6f8e65e -r 3735f950b2f5 test-data/samtools-rmdup-input1.bam
b
Binary file test-data/samtools-rmdup-input1.bam has changed
b
diff -r fe83e6f8e65e -r 3735f950b2f5 test-data/samtools-rmdup-test1.bam
b
Binary file test-data/samtools-rmdup-test1.bam has changed
b
diff -r fe83e6f8e65e -r 3735f950b2f5 tool_dependencies.xml
--- a/tool_dependencies.xml Thu Mar 27 15:26:52 2014 -0400
+++ b/tool_dependencies.xml Tue Apr 21 17:21:53 2015 -0400
b
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <tool_dependency>
-    <package name="samtools" version="0.1.19">
-        <repository changeset_revision="1ef76f8d8e52" name="package_samtools_0_1_19" owner="devteam" toolshed="http://toolshed.g2.bx.psu.edu" />
+    <package name="samtools" version="1.2">
+        <repository changeset_revision="6eea04363026" name="package_samtools_1_2" owner="iuc" toolshed="https://toolshed.g2.bx.psu.edu" />
     </package>
 </tool_dependency>