changeset 8:3a3234d7a2e8 draft

planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/picard commit 00a7926c285bc4a339bd7deebf40b28f39c7d947-dirty
author devteam
date Thu, 16 Jul 2015 15:53:10 -0400
parents 379fdf4c41ac
children 5eaa8a968300
files picard_AddCommentsToBam.xml picard_AddOrReplaceReadGroups.xml picard_BedToIntervalList.xml picard_CleanSam.xml picard_CollectAlignmentSummaryMetrics.xml picard_CollectBaseDistributionByCycle.xml picard_CollectGcBiasMetrics.xml picard_CollectInsertSizeMetrics.xml picard_CollectRnaSeqMetrics.xml picard_CollectWgsMetrics.xml picard_DownsampleSam.xml picard_EstimateLibraryComplexity.xml picard_FastqToSam.xml picard_FilterSamReads.xml picard_FixMateInformation.xml picard_MarkDuplicates.xml picard_MarkDuplicatesWithMateCigar.xml picard_MeanQualityByCycle.xml picard_MergeBamAlignment.xml picard_MergeSamFiles.xml picard_NormalizeFasta.xml picard_QualityScoreDistribution.xml picard_ReorderSam.xml picard_ReplaceSamHeader.xml picard_RevertOriginalBaseQualitiesAndAddMateCigar.xml picard_RevertSam.xml picard_SamToFastq.xml picard_SortSam.xml picard_ValidateSamFile.xml picard_macros.xml read_group_macros.xml test-data/picard_ARRG_test1.bam test-data/picard_CollectRnaSeqMetrics.refFlat~ tool_dependencies.xml
diffstat 34 files changed, 410 insertions(+), 247 deletions(-) [+]
line wrap: on
line diff
--- a/picard_AddCommentsToBam.xml	Thu Jan 29 16:11:15 2015 -0500
+++ b/picard_AddCommentsToBam.xml	Thu Jul 16 15:53:10 2015 -0400
@@ -1,11 +1,9 @@
-<tool name="AddCommentsToBam" id="picard_AddCommentsToBam" version="1.126.0">
+<tool name="AddCommentsToBam" id="picard_AddCommentsToBam" version="@TOOL_VERSION@.0">
   <description>add comments to BAM dataset</description>
-  <requirements><requirement type="package" version="1.126.0">picard</requirement></requirements>
-  
   <macros>
     <import>picard_macros.xml</import>
   </macros>
-  
+  <expand macro="requirements" />
   <command>
     @java_options@
     java -jar \$JAVA_JAR_PATH/picard.jar
--- a/picard_AddOrReplaceReadGroups.xml	Thu Jan 29 16:11:15 2015 -0500
+++ b/picard_AddOrReplaceReadGroups.xml	Thu Jul 16 15:53:10 2015 -0400
@@ -1,40 +1,26 @@
-<tool name="AddOrReplaceReadGroups" id="picard_AddOrReplaceReadGroups" version="1.126.0">
+<tool name="AddOrReplaceReadGroups" id="picard_AddOrReplaceReadGroups" version="@TOOL_VERSION@.0">
   <description>add or replaces read group information</description>
-  <requirements>
-    <requirement type="package" version="1.126.0">picard</requirement>
-  </requirements>
-  
   <macros>
     <import>picard_macros.xml</import>
+    <import>read_group_macros.xml</import>
   </macros>
-  
+  <expand macro="requirements" />
   <command>
+    @define_read_group_helpers@
+    #set $rg_auto_name = $read_group_name_default($inputFile)
+    @set_read_group_vars@
     @java_options@
     java -jar \$JAVA_JAR_PATH/picard.jar
       AddOrReplaceReadGroups
       INPUT="${inputFile}"
-      RGLB="${rglb}"
-      RGPL="${rgpl}"
-      RGPU="${rgpu}"
-      RGSM="${rgsm}"
-      RGID="${rgid}"
-      
-      #if str( $rgcn):
-        RGCN="${rgcn}"
-      #end if
-      
-      #if str( $rgds):
-        RGDS="${rgds}"
-      #end if
-      
-      #if str( $rgpi):
-        RGPI="${rgpi}"
-      #end if
-
-      #if str( $rgdt):
-        RGDT="${rgdt}"
-      #end if
-      
+      $format_read_group("RGLB=", $rg_lb, '"')
+      $format_read_group("RGPL=", $rg_pl, '"')
+      $format_read_group("RGPU=", $rg_pu, '"')
+      $format_read_group("RGSM=", $rg_sm, '"')
+      $format_read_group("RGID=", $rg_id, '"')
+      $format_read_group("RGDS=", $rg_ds, '"')
+      $format_read_group("RGPI=", $rg_pi, '"')
+      $format_read_group("RGDT=", $rg_dt, '"')
       VALIDATION_STRINGENCY="${validation_stringency}"
       QUIET=true
       VERBOSITY=ERROR
@@ -44,17 +30,7 @@
   
   <inputs>
     <param format="bam,sam" name="inputFile" type="data" label="Select SAM/BAM dataset or dataset collection" help="If empty, upload or import a SAM/BAM dataset" />
-    <param name="rgid" value="A" type="text" label="Read Group ID" help="RGID; Required" />
-    <param name="rgsm" value="sample-a" type="text" label="Read Group Sample name" help="RGSM; Required" />
-    <param name="rglb" value="tumor-a" type="text" label="Read Group library" help="RGLB; Required" />
-    <param name="rgpl" value="Illumina" type="text" label="Read Group Platform" help="RGPL; Required; e.g., Illumina, 454, IonTorrent, etc" />
-    <param name="rgpu" value="run-1" type="text" label="Read Group Platform Unit" help="RGPU; Required; e.g., run, barcode, etc" />
-    <!-- optional params -->
-    <param name="rgcn" value="" optional="True" type="text" label="Read Group sequencing center name" help="RGCN; Optional" />
-    <param name="rgds" value="" optional="True" type="text" label="Read Group description" help="RGDS; Optional" />
-    <param name="rgpi" value="" optional="True" type="integer" label="Read Group predicted insert size" help="RGPI; Optional" />
-    <param name="rgdt" value="" optional="True" type="text" label="Read Group run date" help="RGDT; Optional; Format=YYYY-MM-DD (eg 1997-07-16)"/>
-    
+    <expand macro="read_group_inputs_picard" />
     <expand macro="VS" />
     
   </inputs>
@@ -70,11 +46,11 @@
   <tests>
     <test>
       <param name="inputFile" value="picard_ARRG.bam" />
-      <param name="rglb" value="tumor-a" />
-      <param name="rgpl" value="Illumina" />
-      <param name="rgpu" value="run-1" />
-      <param name="rgsm" value="sample-a" />
-      <param name="rgid" value="id-1" />
+      <param name="LB" value="tumor-a" />
+      <param name="PL" value="ILLUMINA" />
+      <param name="PU" value="run-1" />
+      <param name="SM" value="sample-a" />
+      <param name="ID" value="id-1" />
       <output name="outFile" file="picard_ARRG_test1.bam" ftype="bam" />
     </test>
   </tests>
@@ -146,3 +122,4 @@
 
 
 
+
--- a/picard_BedToIntervalList.xml	Thu Jan 29 16:11:15 2015 -0500
+++ b/picard_BedToIntervalList.xml	Thu Jul 16 15:53:10 2015 -0400
@@ -1,11 +1,9 @@
-<tool name="BedToIntervalList" id="picard_BedToIntervalList" version="1.126.0">
+<tool name="BedToIntervalList" id="picard_BedToIntervalList" version="@TOOL_VERSION@.0">
   <description>convert coordinate data into picard interval list format</description>
-  <requirements><requirement type="package" version="1.126.0">picard</requirement></requirements>
-  
   <macros>
     <import>picard_macros.xml</import>
   </macros>
-  
+  <expand macro="requirements" />
   <command>
     @java_options@
     
--- a/picard_CleanSam.xml	Thu Jan 29 16:11:15 2015 -0500
+++ b/picard_CleanSam.xml	Thu Jul 16 15:53:10 2015 -0400
@@ -1,15 +1,9 @@
-<tool id="picard_CleanSam" name="CleanSam" version="1.126.0">
-    
+<tool id="picard_CleanSam" name="CleanSam" version="@TOOL_VERSION@.0">
   <description>perform SAM/BAM grooming</description>
-  
-  <requirements>
-    <requirement type="package" version="1.126.0">picard</requirement>
-  </requirements>
-  
   <macros>
     <import>picard_macros.xml</import>
   </macros>
-  
+  <expand macro="requirements" />
   <command>
     @java_options@
     java -jar \$JAVA_JAR_PATH/picard.jar
@@ -60,4 +54,4 @@
 @more_info@
 
   </help>
-</tool>
\ No newline at end of file
+</tool>
--- a/picard_CollectAlignmentSummaryMetrics.xml	Thu Jan 29 16:11:15 2015 -0500
+++ b/picard_CollectAlignmentSummaryMetrics.xml	Thu Jul 16 15:53:10 2015 -0400
@@ -1,13 +1,9 @@
-<tool name="Collect Alignment Summary Metrics" id="picard_CASM" version="1.126.0">
+<tool name="Collect Alignment Summary Metrics" id="picard_CASM" version="@TOOL_VERSION@.0">
   <description>writes a file containing summary alignment metrics</description>
-  <requirements>
-    <requirement type="package" version="1.126.0">picard</requirement>
-  </requirements>
-  
   <macros>
     <import>picard_macros.xml</import>
   </macros>
-  
+  <expand macro="requirements" />
   <command>
     @java_options@
     ##set up input files
@@ -55,7 +51,7 @@
         </param>
       </when>
       <when value="history">
-        <param name="ref_file" type="data" format="fasta" label="Use the folloing dataset as the reference sequence" help="REFERENCE_SEQUENCE; You can upload a FASTA sequence to the history and use it as reference" />
+        <param name="ref_file" type="data" format="fasta" label="Use the following dataset as the reference sequence" help="REFERENCE_SEQUENCE; You can upload a FASTA sequence to the history and use it as reference" />
       </when>
     </conditional>
     <param name="metric_accumulation_level" type="select" label="The level(s) at which to accumulate metrics" multiple="true" help="METRIC_ACCUMULATION_LEVEL">
--- a/picard_CollectBaseDistributionByCycle.xml	Thu Jan 29 16:11:15 2015 -0500
+++ b/picard_CollectBaseDistributionByCycle.xml	Thu Jul 16 15:53:10 2015 -0400
@@ -1,13 +1,11 @@
-<tool name="CollectBaseDistributionByCycle" id="picard_CollectBaseDistributionByCycle" version="1.126.0">
+<tool name="CollectBaseDistributionByCycle" id="picard_CollectBaseDistributionByCycle" version="@TOOL_VERSION@.0">
   <description>charts the nucleotide distribution per cycle in a SAM or BAM dataset</description>
-  <requirements>
-    <requirement type="package" version="1.126.0">picard</requirement>
-  </requirements>
-  
   <macros>
     <import>picard_macros.xml</import>
   </macros>
-  
+  <expand macro="requirements">
+    <requirement type="package" version="3.1.2">R</requirement>
+  </expand>
   <command>
     @java_options@
     ##set up input files
--- a/picard_CollectGcBiasMetrics.xml	Thu Jan 29 16:11:15 2015 -0500
+++ b/picard_CollectGcBiasMetrics.xml	Thu Jul 16 15:53:10 2015 -0400
@@ -1,13 +1,11 @@
-<tool name="CollectGcBiasMetrics" id="picard_CollectGcBiasMetrics" version="1.126.0">
+<tool name="CollectGcBiasMetrics" id="picard_CollectGcBiasMetrics" version="@TOOL_VERSION@.0">
   <description>charts the GC bias metrics</description>
-  <requirements>
-    <requirement type="package" version="1.126.0">picard</requirement>
-  </requirements>
-  
   <macros>
     <import>picard_macros.xml</import>
   </macros>
-  
+  <expand macro="requirements">
+    <requirement type="package" version="3.1.2">R</requirement>
+  </expand>
   <command>
     @java_options@
     ##set up input files
--- a/picard_CollectInsertSizeMetrics.xml	Thu Jan 29 16:11:15 2015 -0500
+++ b/picard_CollectInsertSizeMetrics.xml	Thu Jul 16 15:53:10 2015 -0400
@@ -1,13 +1,11 @@
-<tool name="CollectInsertSizeMetrics" id="picard_CollectInsertSizeMetrics" version="1.126.0">
+<tool name="CollectInsertSizeMetrics" id="picard_CollectInsertSizeMetrics" version="@TOOL_VERSION@.0">
   <description>plots distribution of insert sizes</description>
-  <requirements>
-    <requirement type="package" version="1.126.0">picard</requirement>
-  </requirements>
-  
   <macros>
     <import>picard_macros.xml</import>
   </macros>
-  
+  <expand macro="requirements">
+    <requirement type="package" version="3.1.2">R</requirement>
+  </expand>
   <command>
     @java_options@
     ##set up input files
--- a/picard_CollectRnaSeqMetrics.xml	Thu Jan 29 16:11:15 2015 -0500
+++ b/picard_CollectRnaSeqMetrics.xml	Thu Jul 16 15:53:10 2015 -0400
@@ -1,16 +1,13 @@
-<tool name="CollectRnaSeqMetrics" id="picard_CollectRnaSeqMetrics" version="1.126.0">
-<description> collect metrics about the alignment of RNA to various functional classes of loci in the genome</description>
-<requirements>
-   <requirement type="package" version="1.126.0">picard</requirement>
-</requirements>
+<tool name="CollectRnaSeqMetrics" id="picard_CollectRnaSeqMetrics" version="@TOOL_VERSION@.0">
+    <description> collect metrics about the alignment of RNA to various functional classes of loci in the genome</description>
+    <macros>
+        <import>picard_macros.xml</import>
+    </macros>
+    <expand macro="requirements">
+        <requirement type="package" version="3.1.2">R</requirement>
+    </expand>
+    <command>
 
-<macros>
-    <import>picard_macros.xml</import>
-</macros>
-  
-
-   <command>
-      
       ## Set up input files
       
       ## Reference sequences
--- a/picard_CollectWgsMetrics.xml	Thu Jan 29 16:11:15 2015 -0500
+++ b/picard_CollectWgsMetrics.xml	Thu Jul 16 15:53:10 2015 -0400
@@ -1,13 +1,9 @@
-<tool name="CollectWgsMetrics" id="picard_CollectWgsMetrics" version="1.126.0">
+<tool name="CollectWgsMetrics" id="picard_CollectWgsMetrics" version="@TOOL_VERSION@.0">
   <description>compute metrics for evaluating of whole genome sequencing experiments</description>
-  <requirements>
-    <requirement type="package" version="1.126.0">picard</requirement>
-  </requirements>
-  
   <macros>
     <import>picard_macros.xml</import>
   </macros>
-  
+  <expand macro="requirements" />
   <command>
     @java_options@
     ##set up input files
--- a/picard_DownsampleSam.xml	Thu Jan 29 16:11:15 2015 -0500
+++ b/picard_DownsampleSam.xml	Thu Jul 16 15:53:10 2015 -0400
@@ -1,13 +1,9 @@
-<tool name="Downsample SAM/BAM" id="picard_DownsampleSam" version="1.126.0">
+<tool name="Downsample SAM/BAM" id="picard_DownsampleSam" version="@TOOL_VERSION@.0">
   <description>Downsample a file to retain a subset of the reads</description>
-  <requirements>
-    <requirement type="package" version="1.126.0">picard</requirement>
-  </requirements>
-   
   <macros>
     <import>picard_macros.xml</import>
   </macros>
-   
+  <expand macro="requirements" />
   <command>
     @java_options@
     java -jar
--- a/picard_EstimateLibraryComplexity.xml	Thu Jan 29 16:11:15 2015 -0500
+++ b/picard_EstimateLibraryComplexity.xml	Thu Jul 16 15:53:10 2015 -0400
@@ -1,13 +1,9 @@
-<tool name="EstimateLibraryComplexity" id="picard_EstimateLibraryComplexity" version="1.126.0">
+<tool name="EstimateLibraryComplexity" id="picard_EstimateLibraryComplexity" version="@TOOL_VERSION@.0">
   <description>assess sequence library complexity from read sequences</description>
-  <requirements>
-    <requirement type="package" version="1.126.0">picard</requirement>
-  </requirements>
-  
   <macros>
     <import>picard_macros.xml</import>
   </macros>
-  
+  <expand macro="requirements" />
   <command>
     @java_options@
     
--- a/picard_FastqToSam.xml	Thu Jan 29 16:11:15 2015 -0500
+++ b/picard_FastqToSam.xml	Thu Jul 16 15:53:10 2015 -0400
@@ -1,13 +1,9 @@
-<tool name="FastqToSam" id="picard_FastqToSam" version="1.126.0">
+<tool name="FastqToSam" id="picard_FastqToSam" version="@TOOL_VERSION@.0">
   <description>convert Fastq data into unaligned BAM</description>
-  <requirements>
-    <requirement type="package" version="1.126.0">picard</requirement>
-  </requirements>
-  
   <macros>
     <import>picard_macros.xml</import>
   </macros>
-  
+  <expand macro="requirements" />
   <command>
     @java_options@
     
--- a/picard_FilterSamReads.xml	Thu Jan 29 16:11:15 2015 -0500
+++ b/picard_FilterSamReads.xml	Thu Jul 16 15:53:10 2015 -0400
@@ -1,13 +1,9 @@
-<tool name="FilterSamReads" id="picard_FilterSamReads" version="1.126.0">
+<tool name="FilterSamReads" id="picard_FilterSamReads" version="@TOOL_VERSION@.0">
   <description>include or exclude aligned and unaligned reads and read lists</description>
-  <requirements>
-    <requirement type="package" version="1.126.0">picard</requirement>
-  </requirements>
-  
   <macros>
     <import>picard_macros.xml</import>
   </macros>
-  
+  <expand macro="requirements" />
   <command>
     @java_options@
     
@@ -41,7 +37,7 @@
   
   </command>
   <inputs>
-    <param name="inputFile" multiple="True" type="data" format="sam,bam" label="Select SAM/BAM dataset or dataset collection" help="If empty, upload or import a SAM/BAM dataset"/>
+    <param name="inputFile" type="data" format="sam,bam" label="Select SAM/BAM dataset or dataset collection" help="If empty, upload or import a SAM/BAM dataset"/>
     <conditional name="filter_type">
       <param name="filter" type="select" label="Select filtering type" help="FILTER; see Help for deatiled info">
         <option value="includeAligned">Include aligned</option>
--- a/picard_FixMateInformation.xml	Thu Jan 29 16:11:15 2015 -0500
+++ b/picard_FixMateInformation.xml	Thu Jul 16 15:53:10 2015 -0400
@@ -1,13 +1,9 @@
-<tool name="FixMateInformation" id="picard_FixMateInformation" version="1.126.0">
+<tool name="FixMateInformation" id="picard_FixMateInformation" version="@TOOL_VERSION@.0">
   <description>ensure that all mate-pair information is in sync between each read and it's mate pair</description>
-  <requirements>
-    <requirement type="package" version="1.126.0">picard</requirement>
-  </requirements>
-  
   <macros>
     <import>picard_macros.xml</import>
   </macros>
-  
+  <expand macro="requirements" />
   <command>
     @java_options@
     
--- a/picard_MarkDuplicates.xml	Thu Jan 29 16:11:15 2015 -0500
+++ b/picard_MarkDuplicates.xml	Thu Jul 16 15:53:10 2015 -0400
@@ -1,13 +1,9 @@
-<tool name="MarkDuplicates" id="picard_MarkDuplicates" version="1.126.0">
+<tool name="MarkDuplicates" id="picard_MarkDuplicates" version="@TOOL_VERSION@.0">
   <description>examine aligned records in BAM datasets to locate duplicate molecules</description>
-  <requirements>
-    <requirement type="package" version="1.126.0">picard</requirement>
-  </requirements>
-  
   <macros>
     <import>picard_macros.xml</import>
   </macros>
-  
+  <expand macro="requirements" />
   <command>
     @java_options@
     
--- a/picard_MarkDuplicatesWithMateCigar.xml	Thu Jan 29 16:11:15 2015 -0500
+++ b/picard_MarkDuplicatesWithMateCigar.xml	Thu Jul 16 15:53:10 2015 -0400
@@ -1,13 +1,9 @@
-<tool name="MarkDuplicatesWithMateCigar" id="picard_MarkDuplicatesWithMateCigar" version="1.126.0">
+<tool name="MarkDuplicatesWithMateCigar" id="picard_MarkDuplicatesWithMateCigar" version="@TOOL_VERSION@.0">
   <description>examine aligned records in BAM datasets to locate duplicate molecules</description>
-  <requirements>
-    <requirement type="package" version="1.126.0">picard</requirement>
-  </requirements>
-  
   <macros>
     <import>picard_macros.xml</import>
   </macros>
-  
+  <expand macro="requirements" />
   <command>
     @java_options@
     
@@ -18,10 +14,8 @@
     OUTPUT="${outFile}"
     
     METRICS_FILE="${metrics_file}"
-    #for $element in $comments:
-      COMMENT="${element.comment}"
-    #end for
-    
+    COMMENT="${comment}"
+
     MINIMUM_DISTANCE="${minimum_distance}"
     SKIP_PAIRS_WITH_NO_MATE_CIGAR="${skip_pairs_with_no_mate_cigar}"
     
--- a/picard_MeanQualityByCycle.xml	Thu Jan 29 16:11:15 2015 -0500
+++ b/picard_MeanQualityByCycle.xml	Thu Jul 16 15:53:10 2015 -0400
@@ -1,13 +1,11 @@
-<tool name="MeanQualityByCycle" id="picard_MeanQualityByCycle" version="1.126.0">
+<tool name="MeanQualityByCycle" id="picard_MeanQualityByCycle" version="@TOOL_VERSION@.0">
   <description>chart distribution of base qualities</description>
-  <requirements>
-    <requirement type="package" version="1.126.0">picard</requirement>
-  </requirements>
-  
   <macros>
     <import>picard_macros.xml</import>
   </macros>
-  
+  <expand macro="requirements">
+    <requirement type="package" version="3.1.2">R</requirement>
+  </expand>
   <command>
     @java_options@
     ##set up input files
--- a/picard_MergeBamAlignment.xml	Thu Jan 29 16:11:15 2015 -0500
+++ b/picard_MergeBamAlignment.xml	Thu Jul 16 15:53:10 2015 -0400
@@ -1,11 +1,9 @@
-<tool name="MergeBamAlignment" id="picard_MergeBamAlignment" version="1.126.0">
+<tool name="MergeBamAlignment" id="picard_MergeBamAlignment" version="@TOOL_VERSION@.0">
   <description>merge alignment data with additional info stored in an unmapped BAM dataset</description>
-  <requirements><requirement type="package" version="1.126.0">picard</requirement></requirements>
-  
   <macros>
     <import>picard_macros.xml</import>
   </macros>
-  
+  <expand macro="requirements" />
   <command>
     @java_options@
     #set $picard_dict = "localref.dict"
@@ -42,7 +40,7 @@
           READ1_ALIGNED_BAM="${dataset.read1_aligned_bam}"
         #end for
         #for $dataset in $aligned_or_read1_and_read2.read2_aligned_bams:
-          READ2_ALIGNED_BAM="${dataset.read1_aligned_bam}"
+          READ2_ALIGNED_BAM="${dataset.read2_aligned_bam}"
         #end for
       #else
         #for $dataset in $aligned_or_read1_and_read2.read1_aligned_bams:
--- a/picard_MergeSamFiles.xml	Thu Jan 29 16:11:15 2015 -0500
+++ b/picard_MergeSamFiles.xml	Thu Jul 16 15:53:10 2015 -0400
@@ -1,13 +1,9 @@
-<tool name="MergeSamFiles" id="picard_MergeSamFiles" version="1.126.0">
+<tool name="MergeSamFiles" id="picard_MergeSamFiles" version="@TOOL_VERSION@.0">
   <description>merges multiple SAM/BAM datasets into one</description>
-  <requirements>
-    <requirement type="package" version="1.126.0">picard</requirement>
-  </requirements>
-  
   <macros>
     <import>picard_macros.xml</import>
   </macros>
-  
+  <expand macro="requirements" />
   <command>
     @java_options@
     
--- a/picard_NormalizeFasta.xml	Thu Jan 29 16:11:15 2015 -0500
+++ b/picard_NormalizeFasta.xml	Thu Jul 16 15:53:10 2015 -0400
@@ -1,13 +1,9 @@
-<tool name="NormalizeFasta" id="picard_NormalizeFasta" version="1.126.0">
+<tool name="NormalizeFasta" id="picard_NormalizeFasta" version="@TOOL_VERSION@.0">
   <description>normalize fasta datasets</description>
-  <requirements>
-    <requirement type="package" version="1.126.0">picard</requirement>
-  </requirements>
-  
   <macros>
     <import>picard_macros.xml</import>
   </macros>
-  
+  <expand macro="requirements" />
   <command>
     @java_options@
     
--- a/picard_QualityScoreDistribution.xml	Thu Jan 29 16:11:15 2015 -0500
+++ b/picard_QualityScoreDistribution.xml	Thu Jul 16 15:53:10 2015 -0400
@@ -1,13 +1,11 @@
-<tool name="QualityScoreDistribution" id="picard_QualityScoreDistribution" version="1.126.0">
+<tool name="QualityScoreDistribution" id="picard_QualityScoreDistribution" version="@TOOL_VERSION@.0">
   <description>chart quality score distribution</description>
-  <requirements>
-    <requirement type="package" version="1.126.0">picard</requirement>
-  </requirements>
-  
   <macros>
     <import>picard_macros.xml</import>
   </macros>
-  
+  <expand macro="requirements">
+    <requirement type="package" version="3.1.2">R</requirement>
+  </expand>
   <command>
     @java_options@
     ##set up input files
--- a/picard_ReorderSam.xml	Thu Jan 29 16:11:15 2015 -0500
+++ b/picard_ReorderSam.xml	Thu Jul 16 15:53:10 2015 -0400
@@ -1,11 +1,9 @@
-<tool name="ReorderSam" id="picard_ReorderSam" version="1.126.0">
+<tool name="ReorderSam" id="picard_ReorderSam" version="@TOOL_VERSION@.0">
   <description>reorder reads to match ordering in reference sequences</description>
-  <requirements><requirement type="package" version="1.126.0">picard</requirement></requirements>
-  
   <macros>
     <import>picard_macros.xml</import>
   </macros>
-  
+  <expand macro="requirements" />
   <command>
     @java_options@
     #set $picard_dict = "localref.dict"
--- a/picard_ReplaceSamHeader.xml	Thu Jan 29 16:11:15 2015 -0500
+++ b/picard_ReplaceSamHeader.xml	Thu Jul 16 15:53:10 2015 -0400
@@ -1,13 +1,9 @@
-<tool name="ReplaceSamHeader" id="picard_ReplaceSamHeader" version="1.126.0">
+<tool name="ReplaceSamHeader" id="picard_ReplaceSamHeader" version="@TOOL_VERSION@.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>
-  
+  <expand macro="requirements" />
   <command>
     @java_options@
     
--- a/picard_RevertOriginalBaseQualitiesAndAddMateCigar.xml	Thu Jan 29 16:11:15 2015 -0500
+++ b/picard_RevertOriginalBaseQualitiesAndAddMateCigar.xml	Thu Jul 16 15:53:10 2015 -0400
@@ -1,13 +1,9 @@
-<tool name="RevertOriginalBaseQualitiesAndAddMateCigar" id="picard_RevertOriginalBaseQualitiesAndAddMateCigar" version="1.126.0">
+<tool name="RevertOriginalBaseQualitiesAndAddMateCigar" id="picard_RevertOriginalBaseQualitiesAndAddMateCigar" version="@TOOL_VERSION@.0">
   <description>revert the original base qualities and add the mate cigar tag</description>
-  <requirements>
-    <requirement type="package" version="1.126.0">picard</requirement>
-  </requirements>
-  
   <macros>
     <import>picard_macros.xml</import>
   </macros>
-  
+  <expand macro="requirements" />
   <command>
     @java_options@
     
--- a/picard_RevertSam.xml	Thu Jan 29 16:11:15 2015 -0500
+++ b/picard_RevertSam.xml	Thu Jul 16 15:53:10 2015 -0400
@@ -1,13 +1,9 @@
-<tool name="RevertSam" id="picard_RevertSam" version="1.126.0">
+<tool name="RevertSam" id="picard_RevertSam" version="@TOOL_VERSION@.0">
   <description>revert SAM/BAM datasets to a previous state</description>
-  <requirements>
-    <requirement type="package" version="1.126.0">picard</requirement>
-  </requirements>
-  
   <macros>
     <import>picard_macros.xml</import>
   </macros>
-  
+  <expand macro="requirements" />
   <command>
     @java_options@
     
--- a/picard_SamToFastq.xml	Thu Jan 29 16:11:15 2015 -0500
+++ b/picard_SamToFastq.xml	Thu Jul 16 15:53:10 2015 -0400
@@ -1,13 +1,9 @@
-<tool name="SamToFastq" id="picard_SamToFastq" version="1.126.0">
+<tool name="SamToFastq" id="picard_SamToFastq" version="@TOOL_VERSION@.0">
   <description>extract reads and qualities from SAM/BAM dataset and convert to fastq</description>
-  <requirements>
-    <requirement type="package" version="1.126.0">picard</requirement>
-  </requirements>
-  
   <macros>
     <import>picard_macros.xml</import>
   </macros>
-  
+  <expand macro="requirements" />
   <command>
      
     echo "BAM" > $report &amp;&amp;    ## This is necessary for output dataset detection (see output tags below)
--- a/picard_SortSam.xml	Thu Jan 29 16:11:15 2015 -0500
+++ b/picard_SortSam.xml	Thu Jul 16 15:53:10 2015 -0400
@@ -1,15 +1,9 @@
-<tool id="picard_SortSam" name="SortSam" version="1.126.0">
-    
+<tool id="picard_SortSam" name="SortSam" version="@TOOL_VERSION@.0">
   <description>sort SAM/BAM dataset</description>
-  
-  <requirements>
-    <requirement type="package" version="1.126.0">picard</requirement>
-  </requirements>
-  
   <macros>
     <import>picard_macros.xml</import>
   </macros>
-  
+  <expand macro="requirements" />
   <command>
     @java_options@
     java -jar \$JAVA_JAR_PATH/picard.jar
@@ -67,4 +61,4 @@
  @more_info@
 
   </help>
-</tool>
\ No newline at end of file
+</tool>
--- a/picard_ValidateSamFile.xml	Thu Jan 29 16:11:15 2015 -0500
+++ b/picard_ValidateSamFile.xml	Thu Jul 16 15:53:10 2015 -0400
@@ -1,13 +1,9 @@
-<tool name="ValidateSamFile" id="picard_ValidateSamFile" version="1.126.0">
+<tool name="ValidateSamFile" id="picard_ValidateSamFile" version="@TOOL_VERSION@.0">
   <description>assess validity of SAM/BAM dataset</description>
-  <requirements>
-    <requirement type="package" version="1.126.0">picard</requirement>
-  </requirements>
-  
   <macros>
     <import>picard_macros.xml</import>
   </macros>
-  
+  <expand macro="requirements" />
   <command>
     
     ##set the maximum number of open file to hard maximum or 4096 if on a mac (mac gives 'unlimited' as output of `ulimit -Hn` command
--- a/picard_macros.xml	Thu Jan 29 16:11:15 2015 -0500
+++ b/picard_macros.xml	Thu Jul 16 15:53:10 2015 -0400
@@ -6,7 +6,16 @@
           <option value="STRICT">Strict</option>
         </param>
     </xml>
-    
+
+    <token name="@TOOL_VERSION@">1.136</token>
+
+    <xml name="requirements">
+        <requirements>
+            <requirement type="package" version="1.136">picard</requirement>
+            <yield/>
+        </requirements>
+    </xml>
+
     <token name="@java_options@">
     _JAVA_OPTIONS=\${_JAVA_OPTIONS:-'-Xmx2048m -Xms256m'} &amp;&amp;
     export _JAVA_OPTIONS &amp;&amp;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/read_group_macros.xml	Thu Jul 16 15:53:10 2015 -0400
@@ -0,0 +1,294 @@
+<macros>
+    <!-- Import this at the top of your command block and then
+         define rg_auto_name. -->
+    <token name="@define_read_group_helpers@">
+#def identifier_or_name($input1)
+    #if hasattr($input1, 'element_identifier')
+        #return $input1.element_identifier
+    #else
+        #return $input1.name.rstrip('.gz').rstrip('.fastq').rstrip('.fq')
+    #end if
+#end def
+
+#def clean(name)
+    #import re
+    #set $name_clean = re.sub('[^\w\-_\.]', '_', $name)
+    #return $name_clean
+#end def
+
+#def read_group_name_default($input1, $input2=None)
+    #if $input2 is None
+        #return $clean($identifier_or_name($input1))
+    #else
+        #import itertools
+        #set $input_name1 = $clean($identifier_or_name($input1))
+        #set $input_name2 = $clean($identifier_or_name($input2))
+        #set $common_prefix = ''.join([c[0] for c in itertools.takewhile(lambda x: all(x[0] == y for y in x), itertools.izip(*[$input_name1, $input_name2]))])
+        #if len($common_prefix) > 3
+            #return $common_prefix
+        #else
+            #return $input_name1
+        #end if
+    #end if
+#end def
+
+#def format_read_group(prefix, value, quote='', arg='')
+    #if $value
+        #return $arg + $quote + $prefix + $value + $quote
+    #else
+        #return ''
+    #end if
+#end def
+
+#def rg_param(name)
+    #if $varExists("rg")
+        #return $rg.get($name, None)
+    #else
+        #return $getVar($name, None)
+    #end if
+#end def
+
+#set $use_rg = True
+    </token>
+    <!-- preconditions use_rg and rg_auto_name have been
+         defined.
+    -->
+    <token name="@set_read_group_vars@">
+#if $use_rg
+    #if $rg_param('read_group_id_conditional') is None
+        #set $rg_id = $rg_auto_name
+    #elif $rg_param('read_group_id_conditional').do_auto_name
+        #set $rg_id = $rg_auto_name
+    #else
+        #set $rg_id = str($rg_param('read_group_id_conditional').ID)
+    #end if
+
+    #if $rg_param('read_group_sm_conditional') is None
+        #set $rg_sm = ''
+    #elif $rg_param('read_group_sm_conditional').do_auto_name
+        #set $rg_sm = $rg_auto_name
+    #else
+        #set $rg_sm = str($rg_param('read_group_sm_conditional').SM)
+    #end if
+
+    #if $rg_param('PL')
+        #set $rg_pl = str($rg_param('PL'))
+    #else
+        #set $rg_pl = ''
+    #end if
+
+    #if $rg_param('read_group_lb_conditional') is None
+        #set $rg_lb = ''
+    #elif $rg_param('read_group_lb_conditional').do_auto_name
+        #set $rg_lb = $rg_auto_name
+    #else
+        #set $rg_lb = str($rg_param('read_group_lb_conditional').LB)
+    #end if
+
+    #if $rg_param('CN')
+        #set $rg_cn = str($rg_param('CN'))
+    #else
+        #set $rg_cn = ''
+    #end if
+
+    #if $rg_param("DS")
+        #set $rg_ds = str($rg_param("DS"))
+    #else
+        #set $rg_ds = ''
+    #end if
+
+    #if $rg_param("DT")
+        #set $rg_dt = str($rg_param("DT"))
+    #else
+        #set $rg_dt = ''
+    #end if
+
+    #if $rg_param("FO")
+        #set $rg_fo = str($rg_param("FO"))
+    #else
+        #set $rg_fo = ''
+    #end if
+
+    #if $rg_param("KS")
+        #set $rg_ks = str($rg_param("KS"))
+    #else
+        #set $rg_ks = ''
+    #end if
+
+    #if $rg_param("PG")
+        #set $rg_pg = str($rg_param("PG"))
+    #else
+        #set $rg_pg = ''
+    #end if
+
+    #if str($rg_param("PI"))
+        #set $rg_pi = str($rg_param("PI"))
+    #else
+        #set $rg_pi = ''
+    #end if
+
+    #if $rg_param("PU")
+        #set $rg_pu = str($rg_param("PU"))
+    #else
+        #set $rg_pu = ''
+    #end if
+#end if
+    </token>
+    <token name="@set_use_rg_var@">
+#set $use_rg = str($rg.rg_selector) != "do_not_set"
+    </token>
+    <xml name="read_group_auto_name_conditional">
+        <param name="do_auto_name" type="boolean" label="Auto-assign" help="Use dataset name or collection information to automatically assign this value" checked="no" />
+        <when value="true">
+        </when>
+        <when value="false">
+            <yield />
+        </when>
+    </xml>
+    <xml name="read_group_id_param">
+        <param name="ID" type="text" value="" size="20" label="Read group identifier (ID)" help="This value must be unique among multiple samples in your experiment" optional="false">
+            <validator type="empty_field" />
+        </param>
+    </xml>
+    <xml name="read_group_id_conditional">
+        <conditional name="read_group_id_conditional">
+            <expand macro="read_group_auto_name_conditional">
+                <expand macro="read_group_id_param" />
+            </expand>
+        </conditional>
+    </xml>
+    <xml name="read_group_sm_param">
+        <param name="SM" type="text" value="" size="20" label="Read group sample name (SM)" help="This value should be descriptive. Use pool name where a pool is being sequenced" />
+    </xml>
+    <xml name="read_group_sm_conditional">
+        <conditional name="read_group_sm_conditional">
+            <expand macro="read_group_auto_name_conditional">
+                <expand macro="read_group_sm_param" />
+            </expand>
+        </conditional>
+    </xml>
+    <!-- Above SM param is optional (for SAM/BAM spec, this is required
+         as per Picard.
+    -->
+    <xml name="read_group_sm_param_required">
+        <param name="SM" type="text" value="" size="20" label="Read group sample name (SM)" optional="false" help="This value should be descriptive. Use pool name where a pool is being sequenced">
+            <validator type="empty_field" />
+        </param>
+    </xml>
+    <xml name="read_group_sm_required_conditional">
+        <conditional name="read_group_sm_conditional">
+            <expand macro="read_group_auto_name_conditional">
+                <expand macro="read_group_sm_param" />
+            </expand>
+        </conditional>
+    </xml>
+    <xml name="read_group_pl_param">
+        <param name="PL" type="select" label="Platform/technology used to produce the reads (PL)">
+            <option value="CAPILLARY">CAPILLARY</option>
+            <option value="LS454">LS454</option>
+            <option selected="True" value="ILLUMINA">ILLUMINA</option>
+            <option value="SOLID">SOLID</option>
+            <option value="HELICOS">HELICOS</option>
+            <option value="IONTORRENT">IONTORRENT</option>
+            <option value="PACBIO">PACBIO</option>
+        </param>
+    </xml>
+    <xml name="read_group_lb_param">
+        <param name="LB" type="text" size="25" label="Library name (LB)" optional="true" />
+    </xml>
+    <xml name="read_group_lb_conditional">
+        <conditional name="read_group_lb_conditional">
+            <expand macro="read_group_auto_name_conditional">
+                <expand macro="read_group_lb_param" />
+            </expand>
+        </conditional>
+    </xml>
+    <xml name="read_group_lb_required_param">
+        <param name="LB" type="text" size="25" label="Library name (LB)" optional="false">
+            <validator type="empty_field" />
+        </param>
+    </xml>
+    <xml name="read_group_lb_required_conditional">
+        <conditional name="read_group_lb_conditional">
+            <expand macro="read_group_auto_name_conditional">
+                <expand macro="read_group_lb_required_param" />
+            </expand>
+        </conditional>
+    </xml>
+    <xml name="read_group_cn_param">
+        <param name="CN" type="text" size="25" label="Sequencing center that produced the read (CN)" />
+    </xml>
+    <xml name="read_group_ds_param">
+        <param name="DS" type="text" size="25" label="Description (DS)" />
+    </xml>
+    <xml name="read_group_dt_param">
+        <param name="DT" type="text" size="25" label="Date that run was produced (DT)" help="ISO8601 format date or date/time, like YYYY-MM-DD" />
+    </xml>
+    <xml name="read_group_fo_param">
+        <param name="FO" type="text" size="25" optional="true" label="Flow order (FO)" help="The array of nucleotide bases that correspond to the nucleotides used for each flow of each read. Multi-base flows are encoded in IUPAC format, and non-nucleotide flows by various other characters. Format: /\*|[ACMGRSVTWYHKDBN]+/">
+          <validator type="regex" message="Invalid flow order">\*|[ACMGRSVTWYHKDBN]+$</validator>
+        </param>
+    </xml>
+    <xml name="read_group_ks_param">
+        <param name="KS" type="text" size="25" label="The array of nucleotide bases that correspond to the key sequence of each read (KS)" />
+    </xml>
+    <xml name="read_group_pg_param">
+        <param name="PG" type="text" size="25" label="Programs used for processing the read group (PG)" />
+    </xml>
+    <xml name="read_group_pi_param">
+        <param name="PI" type="integer" optional="true" label="Predicted median insert size (PI)" />
+    </xml>
+    <xml name="read_group_pu_param">
+        <param name="PU" type="text" size="25" label="Platform unit (PU)" help="Unique identifier (e.g. flowcell-barcode.lane for Illumina or slide for SOLiD)" optional="True" />
+    </xml>
+    <xml name="read_group_pu_required_param">
+        <param name="PU" type="text" size="25" label="Platform unit (PU)" help="Unique identifier (e.g. flowcell-barcode.lane for Illumina or slide for SOLiD)" optional="False" />
+    </xml>
+    <!-- Only ID is required - all groups available -->
+    <xml name="read_group_inputs_spec">
+        <expand macro="read_group_id_conditional" />
+        <expand macro="read_group_sm_conditional" />
+        <expand macro="read_group_pl_param" />
+        <expand macro="read_group_lb_conditional" />
+        <expand macro="read_group_cn_param" />
+        <expand macro="read_group_ds_param" />
+        <expand macro="read_group_dt_param" />
+        <expand macro="read_group_fo_param" />
+        <expand macro="read_group_ks_param" />
+        <expand macro="read_group_pg_param" />
+        <expand macro="read_group_pi_param" />
+        <expand macro="read_group_pu_param" />
+    </xml>
+    <!-- ID, SM, LB, PU, PL all required - not ks, pg, or fo params. -->
+    <xml name="read_group_inputs_picard">
+        <expand macro="read_group_id_conditional" />
+        <expand macro="read_group_sm_required_conditional" />
+        <expand macro="read_group_lb_required_conditional" />
+        <expand macro="read_group_pl_param" />
+        <expand macro="read_group_pu_required_param" />
+        <expand macro="read_group_cn_param" />
+        <expand macro="read_group_ds_param" />
+        <expand macro="read_group_pi_param" />
+        <expand macro="read_group_dt_param" />
+    </xml>
+    <xml name="read_group_conditional">
+        <conditional name="rg">
+            <param name="rg_selector" type="select" label="Set read groups information?" help="Specifying read group information can greatly simplify your downstream analyses by allowing combining multiple datasets.">
+                <option value="set">Set read groups (SAM/BAM specification)</option>
+                <option value="set_picard">Set read groups (Picard style)</option>
+                <option value="set_id_auto">Automatically assign ID</option>
+                <option value="do_not_set" selected="True">Do not set</option>
+            </param>
+            <when value="set_picard">
+                <expand macro="read_group_inputs_picard" />
+            </when>
+            <when value="set">
+                <expand macro="read_group_inputs_spec" />
+            </when>
+            <when value="set_id_auto">
+            </when>
+            <when value="do_not_set">
+            </when>
+        </conditional>
+    </xml>
+</macros>
Binary file test-data/picard_ARRG_test1.bam has changed
--- a/test-data/picard_CollectRnaSeqMetrics.refFlat~	Thu Jan 29 16:11:15 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-hg19.kgXref.kgID	#hg19.knownGene.name	hg19.knownGene.chrom	hg19.knownGene.strand	hg19.knownGene.txStart	hg19.knownGene.txEnd	hg19.knownGene.cdsStart	hg19.knownGene.cdsEnd	hg19.knownGene.exonCount	hg19.knownGene.exonStarts	hg19.knownGene.exonEnds
-uc004coq.4	uc004coq.4	chrM	-	235	368	235	235	1	235,	368,
-uc022bqo.2	uc022bqo.2	chrM	+	650	674	650	650	1	650,	674,
-uc004cor.1	uc004cor.1	chrM	+	1603	1634	1603	1603	1	1603,	1634,
-uc004cos.5	uc004cos.5	chrM	+	1843	4264	1843	1843	1	1843,	4264,
-uc022bqp.1	uc022bqp.1	chrM	-	5543	5566	5543	5543	1	5543,	5566,
-uc022bqq.1	uc022bqq.1	chrM	-	5585	5606	5585	5585	1	5585,	5606,
-uc022bqr.1	uc022bqr.1	chrM	-	5690	5714	5690	5690	1	5690,	5714,
-uc031tga.1	uc031tga.1	chrM	+	5904	7439	5904	5904	1	5904,	7439,
-uc022bqs.1	uc022bqs.1	chrM	-	7586	15888	7586	7586	2	7586,15503,	7982,15888,
-uc011mfi.2	uc011mfi.2	chrM	+	7586	9208	7586	7586	1	7586,	9208,
-uc022bqt.1	uc022bqt.1	chrM	-	8366	14149	8366	8366	2	8366,13449,	8472,14149,
-uc022bqu.2	uc022bqu.2	chrM	+	10059	10404	10059	10059	1	10059,	10404,
-uc004cov.5	uc004cov.5	chrM	+	10470	12138	10470	10470	1	10470,	12138,
-uc031tgb.1	uc031tgb.1	chrM	-	10760	14149	10760	10760	2	10760,13978,	11231,14149,
-uc004cow.2	uc004cow.2	chrM	+	12207	12264	12207	12207	1	12207,	12264,
-uc004cox.4	uc004cox.4	chrM	+	12907	14149	12907	12907	1	12907,	14149,
-uc022bqv.1	uc022bqv.1	chrM	-	14674	14698	14674	14674	1	14674,	14698,
-uc022bqw.1	uc022bqw.1	chrM	+	14856	15888	14856	14856	1	14856,	15888,
-uc022bqx.1	uc022bqx.1	chrM	-	15959	16024	15959	15959	1	15959,	16024,
-uc004coz.1	uc004coz.1	chrM	+	15998	16571	15998	15998	1	15998,	16571,
--- a/tool_dependencies.xml	Thu Jan 29 16:11:15 2015 -0500
+++ b/tool_dependencies.xml	Thu Jul 16 15:53:10 2015 -0400
@@ -1,6 +1,9 @@
 <?xml version="1.0"?>
 <tool_dependency>
-    <package name="picard" version="1.126.0">
-        <repository changeset_revision="b455d70e90b8" name="package_picard_1_126_0" owner="devteam" toolshed="https://toolshed.g2.bx.psu.edu" />
+    <package name="picard" version="1.136">
+        <repository changeset_revision="3e9c24e5325b" name="package_picard_1_136" owner="devteam" toolshed="https://toolshed.g2.bx.psu.edu" />
+    </package>
+    <package name="R" version="3.1.2">
+        <repository changeset_revision="6e0eee4ea4e1" name="package_r_3_1_2" owner="iuc" toolshed="https://toolshed.g2.bx.psu.edu" />
     </package>
 </tool_dependency>