diff picard_ReplaceSamHeader.xml @ 5:3d4f1fa26f0e draft

Uploaded
author devteam
date Tue, 16 Dec 2014 19:03:21 -0500
parents 9227b8c3093b
children 3a3234d7a2e8
line wrap: on
line diff
--- a/picard_ReplaceSamHeader.xml	Fri Feb 21 12:07:49 2014 -0500
+++ b/picard_ReplaceSamHeader.xml	Tue Dec 16 19:03:21 2014 -0500
@@ -1,115 +1,67 @@
-<tool name="Replace SAM/BAM Header" id="picard_ReplaceSamHeader" version="1.56.0">
-  <requirements><requirement type="package" version="1.56.0">picard</requirement></requirements>
-  <command interpreter="python">
-    picard_wrapper.py
-      --input "${inputFile}"
-      -o "${outFile}"
-      --header-file "${headerFile}"
-      --output-format "${outputFormat}"
-      -j "\$JAVA_JAR_PATH/ReplaceSamHeader.jar"
-      --tmpdir "${__new_file_path__}" 
+<tool name="ReplaceSamHeader" id="picard_ReplaceSamHeader" version="1.126.0">
+  <description>replace header in a SAM/BAM dataset</description>
+  <requirements>
+    <requirement type="package" version="1.126.0">picard</requirement>
+  </requirements>
+  
+  <macros>
+    <import>picard_macros.xml</import>
+  </macros>
+  
+  <command>
+    @java_options@
+    
+  
+    ## Two lines below are due to the fact that picard likes fasta files to have extension .fa  
+    #set $fasta_file="local_fasta.fa"
+    ln -s "${inputFile}" "${fasta_file}" &amp;&amp;    
+    
+    java -jar \$JAVA_JAR_PATH/picard.jar
+    ReplaceSamHeader
+    
+    INPUT="${inputFile}"
+    HEADER="${header}"
+    OUTPUT="${outFile}"
+    
+    QUIET=true
+    VERBOSITY=ERROR
+  
   </command>
   <inputs>
-    <param format="bam,sam" name="inputFile" type="data" label="SAM/BAM dataset to replace header in (TARGET)"
-      help="If empty, upload or import a SAM/BAM dataset." />
-    <param format="bam,sam" name="headerFile" type="data" label="SAM/BAM to reader header from (SOURCE)"
-      help="If empty, upload or import a SAM/BAM dataset." />
-    <param name="outputFormat" type="boolean" checked="True" truevalue="bam" falsevalue="sam" label="Output BAM instead of SAM" help="Uncheck for SAM output" />
-  </inputs>
+    <param format="sam,bam" name="inputFile" type="data" label="Select SAM/BAM dataset or dataset collection (header recepient dataset)" help="If empty, upload or import a SAM/BAM dataset"/>
+    <param name="header" type="data" format="sam,bam" label="SAM/BAM dataset from which Header will be read (header source dataset)" help="HEADER; If empty, upload or import a SAM/BAM dataset"/>
+  </inputs> 
+  
   <outputs>
-    <data name="outFile" format="bam" label="${tool.name} on ${on_string}: ${outputFormat} with replaced header">
-      <change_format>
-        <when input="outputFormat" value="sam" format="sam" />
-      </change_format>
-    </data>
+    <data format="bam" name="outFile" label="${tool.name} on ${on_string}: BAM file with replaced header"/>
   </outputs>
+  
   <tests>
     <test>
-      <!-- Command:
-      java -jar ReplaceSamHeader.jar VALIDATION_STRINGENCY=LENIENT I=test-data/picard_input_tiny_coord.bam HEADER=test-data/picard_RSH_input1.bam O=picard_RSH_output1.sam
-      picard_RSH_input1.bam can be made from picard_RSH_input1.sam
-      -->
-      <param name="inputFile" value="picard_input_tiny_coord.bam" ftype="bam" />
-      <param name="headerFile" value="picard_RSH_input1.bam" ftype="bam" />
-      <param name="outputFormat" value="False" />
-      <output name="outFile" file="picard_RSH_output1.sam" ftype="sam" />
-    </test>
-    <test>
-      <!-- Command:
-      java -jar ReplaceSamHeader.jar VALIDATION_STRINGENCY=LENIENT I=test-data/picard_input_tiny_coord.sam HEADER=test-data/picard_RSH_input1.bam O=picard_RSH_output2.sam
-      picard_RSH_input1.bam can be made from picard_RSH_input1.sam
-      -->
-      <param name="inputFile" value="picard_input_tiny_coord.sam" ftype="sam" />
-      <param name="headerFile" value="picard_RSH_input1.bam" ftype="bam" />
-      <param name="outputFormat" value="False" />
-      <output name="outFile" file="picard_RSH_output2.sam" ftype="sam" />
-    </test>
-    <test>
-      <!-- Command:
-      java -jar ReplaceSamHeader.jar VALIDATION_STRINGENCY=LENIENT I=test-data/picard_input_tiny_coord.sam HEADER=test-data/picard_RSH_input1.sam O=picard_RSH_output2.bam
-      -->
-      <param name="inputFile" value="picard_input_tiny_coord.sam" ftype="sam" />
-      <param name="headerFile" value="picard_RSH_input1.sam" ftype="sam" />
-      <param name="outputFormat" value="True" />
-      <output name="outFile" file="picard_RSH_output2.bam" ftype="bam" />
+      <param name="inputFile" value="picard_ReplaceSamHeader.bam" ftype="bam"/>
+      <param name="header" value="picard_ReplaceSamHeader_header.bam" ftype="bam"/>
+      <output name="outFile" file="picard_ReplaceSamHeader_test1.bam" ftype="bam"/>
     </test>
   </tests>
+  
+  <stdio>
+    <exit_code range="1:"  level="fatal"/>
+  </stdio>
+  
   <help>
 
-
-.. class:: infomark
-
 **Purpose**
 
-Replace Sam Header with the header from another sam file. The tool does not do any
-significant validation, so it's up to the user to make sure that the elements in
-the header are relevant and that the new header has all the required things.
-
-Replace the SAMFileHeader in a SAM file with the given header. Validation is
-minimal. It is up to the user to ensure that all the elements referred to in the
-SAMRecords are present in the new header. Sort order of the two input files must
-be the same.
-
-**Picard documentation**
-
-This is a Galaxy wrapper for ReplaceSamHeader, a part of the external package Picard-tools_.
-
- .. _Picard-tools: http://www.google.com/search?q=picard+samtools
-
-------
-
-.. class:: infomark
+Replace the SAMFileHeader in a SAM/BAM dataset with the given header. Validation is minimal. It is up to the user to ensure that all the elements referred to in the SAMRecords are present in the new header. Sort order of the two input datasets must be the same.
+@dataset_collections@
 
-**Inputs and outputs**
-
-Either a sam file or a bam file is required as the file whose header will be replaced.
-The header file is also required and can also be either sam or bam (it does not have
-to be the same type as the other file). In both cases, if a bam file is used, it must
-be coordinate-sorted. Galaxy currently coordinate-sorts all bam files.
-
-The tool will output either bam (the default) or sam. Bam is recommended since it is smaller.
+@description@
 
-.. class:: warningmark
-
-**Warning on SAM/BAM quality**
+  HEADER=File                   SAM file from which SAMFileHeader will be read.  Required. 
 
-Many SAM/BAM files produced externally and uploaded to Galaxy do not fully conform to SAM/BAM specifications. Galaxy deals with this by using the **LENIENT**
-flag when it runs Picard, which allows reads to be discarded if they're empty or don't map. This appears
-to be the only way to deal with SAM/BAM that cannot be parsed.
-
-
+@more_info@
 
   </help>
 </tool>
 
 
-
-
-
-
-
-
-
-
-
-