changeset 2:77a6694ebf7a draft

planemo upload commit 33927a87ba2eee9bf0ecdd376a66241b17b3d734
author devteam
date Tue, 13 Oct 2015 12:55:18 -0400
parents 8546afbbd7f1
children b5e69833722f
files macros.xml samtools_reheader.xml test-data/phiX.bam test-data/reheader_input_file.bam test-data/reheader_input_header.bam test-data/reheader_out.bam test-data/samtools_reheader_in1.sam test-data/samtools_reheader_in2.sam test-data/samtools_reheader_out1.bam test-data/samtools_reheader_out2.bam tool_dependencies.xml
diffstat 11 files changed, 89 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/macros.xml	Tue Oct 13 12:55:18 2015 -0400
@@ -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>
--- a/samtools_reheader.xml	Fri Oct 17 14:04:50 2014 -0400
+++ b/samtools_reheader.xml	Tue Oct 13 12:55:18 2015 -0400
@@ -1,35 +1,32 @@
-<tool id="samtools_reheader" name="Replace header" version="1.0.0">
-    <description>on a BAM or SAM file</description>
-    <requirements>
-        <requirement type="package" version="1.1">samtools</requirement>
-    </requirements>
-    <version_command>samtools --version | head -n 1 | awk '{ print $2 }'</version_command>
+<tool id="samtools_reheader" name="Reheader" version="2.0">
+    <description>copy SAM/BAM header between datasets</description>
+    <macros>
+    <import>macros.xml</import>
+  </macros>
+  <expand macro="requirements"></expand>
+  <expand macro="stdio"></expand>
+  <expand macro="version_command"></expand>
     <command><![CDATA[samtools reheader "${input_header}" "${input_file}" > "${output}"]]></command>
-    <stdio>
-        <exit_code range="1:" level="fatal" description="Error" />
-    </stdio>
     <inputs>
-        <param name="input_header" type="data" format="sam" label="SAM file or header" />
-        <param name="input_file" type="data" format="sam,bam" label="File to reheader" />
+        <param name="input_header" type="data" format="sam,bam" label="Select source dataset" help="Header from this dataset will be used to replace header in the target dataset. May be either SAM or BAM dataset."/>
+        <param name="input_file" type="data" format="bam" label="Select target dataset" help="Header from the source dataset will be inserted here. Should be a BAM dataset."/>
     </inputs>
     <outputs>
         <data format="bam" name="output" label="${tool.name} on ${on_string}" />
     </outputs>
     <tests>
+        <test>
+            <param name="input_header" ftype="bam" value="reheader_input_header.bam"/>
+            <param name="input_file" ftype="bam" value="reheader_input_file.bam"/>
+            <output name="output" ftype="bam" file="reheader_out.bam"/>
+        </test>
     </tests>
     <help>
 **What it does**
 
-This tool runs the ``samtools reheader`` command in the SAMtools toolkit.
-
-Replace the header for a SAM or BAM file with a different header.
-
-**Citation**
+Copies header from *source* dataset into *target* dataset using ``samtools reheader`` command.
 
-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.*
     </help>
+    <expand macro="citations"></expand>
 </tool>
 
Binary file test-data/phiX.bam has changed
Binary file test-data/reheader_input_file.bam has changed
Binary file test-data/reheader_input_header.bam has changed
Binary file test-data/reheader_out.bam has changed
--- a/test-data/samtools_reheader_in1.sam	Fri Oct 17 14:04:50 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-@HD	VN:1.0	SO:coordinate
-@SQ	SN:phiX174	LN:5386
-@PG	ID:bowtie2	PN:bowtie2	VN:2.1.0
--- a/test-data/samtools_reheader_in2.sam	Fri Oct 17 14:04:50 2014 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-@HD	VN:1.0	SO:coordinate
-@SQ	SN:phiX174	LN:5386
-@PG	ID:manual	PN:vim	VN:7.4.52
Binary file test-data/samtools_reheader_out1.bam has changed
Binary file test-data/samtools_reheader_out2.bam has changed
--- a/tool_dependencies.xml	Fri Oct 17 14:04:50 2014 -0400
+++ b/tool_dependencies.xml	Tue Oct 13 12:55:18 2015 -0400
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <tool_dependency>
-    <package name="samtools" version="1.1">
-        <repository changeset_revision="c01b111a243b" name="package_samtools_1_1" owner="iuc" toolshed="https://testtoolshed.g2.bx.psu.edu" />
+    <package name="samtools" version="1.2">
+        <repository changeset_revision="192f00129358" name="package_samtools_1_2" owner="iuc" toolshed="https://testtoolshed.g2.bx.psu.edu" />
     </package>
 </tool_dependency>