changeset 14:526b91fbde60 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/hisat2 commit 5d57e4f6fdaed9e042c334fbe76f3f41ceb4fbc2
author iuc
date Wed, 19 Jul 2017 04:57:27 -0400
parents f4fa77189eb0
children d5fe9aead222
files hisat2.xml hisat2_macros.xml
diffstat 2 files changed, 192 insertions(+), 179 deletions(-) [+]
line wrap: on
line diff
--- a/hisat2.xml	Tue Jul 18 14:25:13 2017 -0400
+++ b/hisat2.xml	Wed Jul 19 04:57:27 2017 -0400
@@ -5,13 +5,12 @@
         <import>hisat2_macros.xml</import>
     </macros>
     <requirements>
-        <!-- Conda dependency -->
         <requirement type="package" version="2.0.5">hisat2</requirement>
         <requirement type="package" version="1.4">samtools</requirement>
     </requirements>
     <stdio>
-        <regex match="hisat2-align exited with value 1" source="both" level="fatal"/>
-        <regex match="hisat2: not found" source="both" level="fatal"/>
+        <regex level="fatal" match="hisat2-align exited with value 1" source="both" />
+        <regex level="fatal" match="hisat2: not found" source="both" />
         <exit_code range="1:" />
     </stdio>
     <version_command>hisat2 --version</version_command>
@@ -31,27 +30,27 @@
             #set index_path = $reference_genome.index.fields.path
         #end if
         hisat2 -p \${GALAXY_SLOTS:-1} -x '${index_path}'
-        #if str($input_format.paired.paired_selector) != 'single':
+        #if str($input_format.paired.paired_selector) == 'paired':
             -1 '${read1}' -2 '${read2}'
             @paired_end_options@
         #else:
             -U '${read1}'
             #if str( $input_format.paired.unaligned_file ) == "true":
                 #if $compressed == "GZ":
-                    --un-gz '$output_unaligned_reads_l'
+                    --un-gz '$output_unaligned_reads'
                 #else if $compressed == "BZ2":
-                    --un-bz2 '$output_unaligned_reads_l'
+                    --un-bz2 '$output_unaligned_reads'
                 #else:
-                    --un '$output_unaligned_reads_l'
+                    --un '$output_unaligned_reads'
                 #end if
             #end if
             #if str( $input_format.paired.aligned_file ) == "true":
                 #if $compressed == "GZ":
-                    --al-gz '$output_aligned_reads_l'
+                    --al-gz '$output_aligned_reads'
                 #else if $compressed == "BZ2":
-                    --al-bz2 '$output_aligned_reads_l'
+                    --al-bz2 '$output_aligned_reads'
                 #else:
-                    --al '$output_aligned_reads_l'
+                    --al '$output_aligned_reads'
                 #end if
             #end if
         #end if
@@ -113,21 +112,18 @@
             ${paired_options.dovetail} ${paired_options.contain} ${paired_options.overlap}
         #end if
         | samtools sort - -@ \${GALAXY_SLOTS:-1} -l 6 -o '${output_alignments}'
-
         ## Rename any output fastq files
-        #if str($input_format.paired.paired_selector) == 'paired' or str($input_format.paired.paired_selector) == 'paired_collection':
-            #if $output_unaligned_reads_l and $output_unaligned_reads_r:
-                #set left = str($output_unaligned_reads_l).replace(".dat", ".1.dat")
-                #set right = str($output_unaligned_reads_l).replace(".dat", ".2.dat")
-                && mv '${left}' '${output_unaligned_reads_l}'
-                && mv '${right}' '${output_unaligned_reads_r}'
-            #end if
-            #if $output_aligned_reads_l and $output_aligned_reads_r:
-                #set left = str($output_aligned_reads_l).replace(".dat", ".1.dat")
-                #set right = str($output_aligned_reads_l).replace(".dat", ".2.dat")
-                && mv '${left}' '${output_aligned_reads_l}'
-                && mv '${right}' '${output_aligned_reads_r}'
-            #end if
+        #if $output_unaligned_reads_l and $output_unaligned_reads_r:
+            #set left = str($output_unaligned_reads_l).replace(".dat", ".1.dat")
+            #set right = str($output_unaligned_reads_l).replace(".dat", ".2.dat")
+            && mv '${left}' '${output_unaligned_reads_l}'
+            && mv '${right}' '${output_unaligned_reads_r}'
+        #end if
+        #if $output_aligned_reads_l and $output_aligned_reads_r:
+            #set left = str($output_aligned_reads_l).replace(".dat", ".1.dat")
+            #set right = str($output_aligned_reads_l).replace(".dat", ".2.dat")
+            && mv '${left}' '${output_aligned_reads_l}'
+            && mv '${right}' '${output_aligned_reads_r}'
         #end if
     ]]></command>
     <inputs>
@@ -145,7 +141,7 @@
         </conditional>
         <conditional name="reference_genome">
             <param name="reference_genome_source" type="select" label="Source for the reference genome to align against" help="Built-in references were created using default options">
-                <option value="indexed" selected="True">Use a built-in genome</option>
+                <option value="indexed" selected="true">Use a built-in genome</option>
                 <option value="history">Use a genome from history</option>
             </param>
             <when value="indexed">
@@ -160,11 +156,11 @@
                 <param name="history_item" type="data" format="fasta" label="Select the reference genome" />
             </when>
         </conditional>
-        <param argument="-k" name="max_primary" type="integer" value="" optional="true" label="Primary alignments" help="Search for at most K distinct, primary alignments for each read. Primary alignments mean alignments whose alignment score is equal or higher than any other alignments. The search terminates when it can't find more distinct valid alignments, or when it finds K, whichever happens first. The alignment score for a paired-end alignment equals the sum of the alignment scores of the individual mates. Each reported read or pair alignment beyond the first has the SAM 'secondary' bit (which equals 256) set in its FLAGS field. For reads that have more than K distinct, valid alignments, hisat2 does not guarantee that the K alignments reported are the best possible in terms of alignment score. HISAT2 is not designed with large values for -k in mind, so when aligning reads to long repetitive genomes, a large K can be very, very slow. Default: 5 (HFM) or 10 (HGFM)" />
-        <param argument="--max-seeds" name="max_seeds" type="integer" value="" optional="true" label="Maximum number of seeds that will be extended" help="HISAT2, like other aligners, uses seed-and-extend approaches. HISAT2 tries to extend seeds to full-length alignments. HISAT2 extends up to these many seeds and skips the rest of the seeds. Large values for --max-seeds may improve alignment sensitivity, but HISAT2 is not designed with large values for --max-seeds in mind, and when aligning reads to long repetitive genomes, a large --max-seeds can be very, very slow. Default: 5 (HFM) or 10 (HGFM)" />
+        <param name="max_primary" argument="-k" type="integer" optional="true" label="Primary alignments" help="Search for at most K distinct, primary alignments for each read. Primary alignments mean alignments whose alignment score is equal or higher than any other alignments. The search terminates when it can't find more distinct valid alignments, or when it finds K, whichever happens first. The alignment score for a paired-end alignment equals the sum of the alignment scores of the individual mates. Each reported read or pair alignment beyond the first has the SAM 'secondary' bit (which equals 256) set in its FLAGS field. For reads that have more than K distinct, valid alignments, hisat2 does not guarantee that the K alignments reported are the best possible in terms of alignment score. HISAT2 is not designed with large values for -k in mind, so when aligning reads to long repetitive genomes, a large K can be very, very slow. Default: 5 (HFM) or 10 (HGFM)" />
+        <param name="max_seeds" argument="--max-seeds" type="integer" optional="true" label="Maximum number of seeds that will be extended" help="HISAT2, like other aligners, uses seed-and-extend approaches. HISAT2 tries to extend seeds to full-length alignments. HISAT2 extends up to these many seeds and skips the rest of the seeds. Large values for --max-seeds may improve alignment sensitivity, but HISAT2 is not designed with large values for --max-seeds in mind, and when aligning reads to long repetitive genomes, a large --max-seeds can be very, very slow. Default: 5 (HFM) or 10 (HGFM)" />
         <param argument="--secondary" type="boolean" truevalue="--secondary" falsevalue="" label="Report secondary alignments" />
         <conditional name="alignment_options">
-            <param label="Alignment options" name="alignment_options_selector" type="select">
+            <param name="alignment_options_selector" type="select" label="Alignment options">
                 <option value="defaults">Use default values</option>
                 <option value="advanced">Specify alignment parameters</option>
             </param>
@@ -190,10 +186,10 @@
             </param>
             <when value="defaults" />
             <when value="advanced">
-                <param argument="-s" name="skip" type="integer" min="0" value="0" label="Skip the first N reads or pairs in the input" />
-                <param argument="-u" name="stop_after" type="integer" min="0" value="0" label="Stop after aligning N reads" help="Align the first N reads or read pairs from the input (after the first N reads or pairs have been skipped), then stop" />
-                <param argument="-5" name="trim_five" type="integer" min="0" value="0" label="Trim 5' end" help="Trim N bases from 5' (left) end of each read before alignment" />
-                <param argument="-3" name="trim_three" type="integer" min="0" value="0" label="Trim 3' end" help="Trim N bases from 3' (right) end of each read before alignment" />
+                <param name="skip" argument="-s" type="integer" min="0" value="0" label="Skip the first N reads or pairs in the input" />
+                <param name="stop_after" argument="-u" type="integer" min="0" value="0" label="Stop after aligning N reads" help="Align the first N reads or read pairs from the input (after the first N reads or pairs have been skipped), then stop" />
+                <param name="trim_five" argument="-5" type="integer" min="0" value="0" label="Trim 5' end" help="Trim N bases from 5' (left) end of each read before alignment" />
+                <param name="trim_three" argument="-3" type="integer" min="0" value="0" label="Trim 3' end" help="Trim N bases from 3' (right) end of each read before alignment" />
             </when>
         </conditional>
         <conditional name="scoring_options">
@@ -251,20 +247,20 @@
                 <param name="nc_coefficient" type="float" value="1" label="Coefficient (A)" help="Coefficient for the above function" />
                 <param name="min_intron" type="integer" value="20" label="Minimum intron length" />
                 <param name="max_intron" type="integer" value="500000" label="Maximum intron length" />
-                <param argument="--rna-strandness" name="rna_strandness" type="select" label="Specify strand-specific information"
+                <param name="rna_strandness" argument="--rna-strandness" type="select" label="Specify strand-specific information"
                     help="'F' means a read corresponds to a transcript. 'R' means a read corresponds to the reverse complemented counterpart of a transcript">
                     <option value="">FR Unstranded</option>
                     <option value="R">First Strand (R/RF)</option>
                     <option value="F">Second Strand (F/FR)</option>
                 </param>
                 <conditional name="no_spliced_alignment_options">
-                    <param argument="--no-spliced-alignment" name="no_spliced_alignment" type="select" label="Disable spliced alignment">
+                    <param name="no_spliced_alignment" argument="--no-spliced-alignment" type="select" label="Disable spliced alignment">
                         <option value="--no-spliced-alignment">True</option>
                         <option value="">False</option>
                     </param>
                     <when value="--no-spliced-alignment">
-                        <param argument="-I" name="minins" type="integer" value="0" label="Minimum fragment length for valid paired-end alignments" help="E.g. if -I 60 is specified and a paired-end alignment consists of two 20-bp alignments in the appropriate orientation with a 20-bp gap between them, that alignment is considered valid (as long as -X is also satisfied). A 19-bp gap would not be valid in that case. If trimming options -3 or -5 are also used, the -I constraint is applied with respect to the untrimmed mates. The larger the difference between -I and -X, the slower HISAT2 will run. This is because larger differences between -I and -X require that HISAT2 scan a larger window to determine if a concordant alignment exists. For typical fragment length ranges (200 to 400 nucleotides), HISAT2 is very efficient" />
-                        <param argument="-X" name="maxins" type="integer" value="500" label="Maximum fragment length for valid paired-end alignments" help="E.g. if -X 100 is specified and a paired-end alignment consists of two 20-bp alignments in the proper orientation with a 60-bp gap between them, that alignment is considered valid (as long as -I is also satisfied). A 61-bp gap would not be valid in that case. If trimming options -3 or -5 are also used, the -X constraint is applied with respect to the untrimmed mates, not the trimmed mates. The larger the difference between -I and -X, the slower HISAT2 will run. This is because larger differences between -I and -X require that HISAT2 scan a larger window to determine if a concordant alignment exists. For typical fragment length ranges (200 to 400 nucleotides), HISAT2 is very efficient" />
+                        <param name="minins" argument="-I" type="integer" value="0" label="Minimum fragment length for valid paired-end alignments" help="E.g. if -I 60 is specified and a paired-end alignment consists of two 20-bp alignments in the appropriate orientation with a 20-bp gap between them, that alignment is considered valid (as long as -X is also satisfied). A 19-bp gap would not be valid in that case. If trimming options -3 or -5 are also used, the -I constraint is applied with respect to the untrimmed mates. The larger the difference between -I and -X, the slower HISAT2 will run. This is because larger differences between -I and -X require that HISAT2 scan a larger window to determine if a concordant alignment exists. For typical fragment length ranges (200 to 400 nucleotides), HISAT2 is very efficient" />
+                        <param name="maxins" argument="-X" type="integer" value="500" label="Maximum fragment length for valid paired-end alignments" help="E.g. if -X 100 is specified and a paired-end alignment consists of two 20-bp alignments in the proper orientation with a 60-bp gap between them, that alignment is considered valid (as long as -I is also satisfied). A 61-bp gap would not be valid in that case. If trimming options -3 or -5 are also used, the -X constraint is applied with respect to the untrimmed mates, not the trimmed mates. The larger the difference between -I and -X, the slower HISAT2 will run. This is because larger differences between -I and -X require that HISAT2 scan a larger window to determine if a concordant alignment exists. For typical fragment length ranges (200 to 400 nucleotides), HISAT2 is very efficient" />
                     </when>
                     <when value="" />
                 </conditional>
@@ -284,13 +280,15 @@
             </param>
             <when value="defaults" />
             <when value="advanced">
-                <param argument="--minins" name="minins" type="integer" value="0" label="Minimum fragment length" help="The minimum fragment length for valid paired-end alignments. 0 sets no minimum" />
-                <param argument="--maxins" name="maxins" type="integer" value="500" label="Maximum fragment length" help="The maximum fragment length for valid paired-end alignments" />
-                <param argument="--no-mixed" name="no_mixed" type="boolean" truevalue="--no-mixed" falsevalue="" label="Disable finding alignments for individual mates" help="By default, when hisat2 cannot find a concordant or discordant alignment for a pair, it then tries to find alignments for the individual mates" />
-                <param argument="--no-discordant" name="no_discordant" type="boolean" truevalue="--no-discordant" falsevalue="" label="Disable looking for discordant alignments" help="By default, hisat2 looks for discordant alignments if it cannot find any concordant alignments. A discordant alignment is an alignment where both mates align uniquely, but that does not satisfy the paired-end constraints" />
-                <param argument="--dovetail" name="dovetail" type="boolean" truevalue="--dovetail" falsevalue="" label="Mates not dovetail" help="If the mates &quot;dovetail&quot;, that is if one mate alignment extends past the beginning of the other such that the wrong mate begins upstream, consider that to be concordant" />
-                <param argument="--no-contain" name="contain" type="boolean" truevalue="--no-contain" falsevalue="" label="Mates cannot contain others" help="If one mate alignment contains the other, consider that to be non-concordant" />
-                <param argument="--no-overlap" name="overlap" type="boolean" truevalue="--no-overlap" falsevalue="" label="Mates cannot overlap" help="If one mate alignment overlaps the other at all, consider that to be non-concordant" />
+                <param argument="--minins" type="integer" value="0" label="Minimum fragment length" help="The minimum fragment length for valid paired-end alignments. 0 sets no minimum" />
+                <param argument="--maxins" type="integer" value="500" label="Maximum fragment length" help="The maximum fragment length for valid paired-end alignments" />
+                <param name="no_mixed" argument="--no-mixed" type="boolean" truevalue="--no-mixed" falsevalue="" label="Disable finding alignments for individual mates"
+                    help="By default, when hisat2 cannot find a concordant or discordant alignment for a pair, it then tries to find alignments for the individual mates" />
+                <param name="no_discordant" argument="--no-discordant" type="boolean" truevalue="--no-discordant" falsevalue="" label="Disable looking for discordant alignments"
+                    help="By default, hisat2 looks for discordant alignments if it cannot find any concordant alignments. A discordant alignment is an alignment where both mates align uniquely, but that does not satisfy the paired-end constraints" />
+                <param argument="--dovetail" type="boolean" truevalue="--dovetail" falsevalue="" label="Mates not dovetail" help="If the mates &quot;dovetail&quot;, that is if one mate alignment extends past the beginning of the other such that the wrong mate begins upstream, consider that to be concordant" />
+                <param name="contain" argument="--no-contain" type="boolean" truevalue="--no-contain" falsevalue="" label="Mates cannot contain others" help="If one mate alignment contains the other, consider that to be non-concordant" />
+                <param name="overlap" argument="--no-overlap" type="boolean" truevalue="--no-overlap" falsevalue="" label="Mates cannot overlap" help="If one mate alignment overlaps the other at all, consider that to be non-concordant" />
             </when>
         </conditional>
     </inputs>
@@ -301,8 +299,8 @@
                     <when value="indexed">
                         <action type="metadata" name="dbkey">
                             <option type="from_data_table" name="hisat2_indexes" column="1" offset="0">
-                                <filter type="param_value" column="0" value="#" compare="startswith" keep="False"/>
-                                <filter type="param_value" ref="reference_genome.index" column="0"/>
+                                <filter type="param_value" column="0" compare="startswith" value="#" keep="false" />
+                                <filter type="param_value" ref="reference_genome.index" column="0" />
                             </option>
                         </action>
                     </when>
@@ -314,79 +312,85 @@
                 </conditional>
             </actions>
         </data>
-        <data name="output_unaligned_reads_l" format="fastqsanger" label="${tool.name} on ${on_string}: unaligned reads (L)" >
-            <filter>input_format['paired']['unaligned_file'] is True</filter>
+        <data name="output_unaligned_reads" format="fastqsanger" label="${tool.name} on ${on_string}: unaligned reads">
+            <filter>input_format['paired']['unaligned_file'] is True and input_format['paired']['paired_selector'] == 'single'</filter>
+            <actions>
+                <action type="format">
+                    <option type="from_param" name="input_format.paired.reads" param_attribute="ext" />
+                </action>
+            </actions>
+        </data>
+        <data name="output_aligned_reads" format="fastqsanger" label="${tool.name} on ${on_string}: aligned reads">
+            <filter>input_format['paired']['aligned_file'] is True and input_format['paired']['paired_selector'] == 'single'</filter>
             <actions>
-                <conditional name="input_format.paired.paired_selector">
-                    <when value="single">
+                <action type="format">
+                    <option type="from_param" name="input_format.paired.reads" param_attribute="ext" />
+                </action>
+            </actions>
+        </data>
+        <data name="output_unaligned_reads_l" format="fastqsanger" label="${tool.name} on ${on_string}: unaligned reads (L)">
+            <filter>input_format['paired']['unaligned_file'] is True and input_format['paired']['paired_selector'] == 'paired'</filter>
+            <actions>
+                <conditional name="input_format.paired.collection.collection_selector">
+                    <when value="collection">
                         <action type="format">
-                            <option type="from_param" name="input_format.paired.reads" param_attribute="ext" />
+                            <option type="from_param" name="input_format.paired.collection.reads.forward" param_attribute="ext" />
                         </action>
                     </when>
-                    <when value="paired">
+                    <when value="files">
                         <action type="format">
-                            <option type="from_param" name="input_format.paired.reads_f" param_attribute="ext" />
-                        </action>
-                    </when>
-                    <when value="paired_collection">
-                        <action type="format">
-                            <option type="from_param" name="input_format.paired.reads" param_attribute="forward.ext" />
+                            <option type="from_param" name="input_format.paired.collection.forward" param_attribute="ext" />
                         </action>
                     </when>
                 </conditional>
             </actions>
         </data>
-        <data name="output_unaligned_reads_r" format="fastqsanger" label="${tool.name} on ${on_string}: unaligned reads (R)" >
-            <filter>input_format['paired']['unaligned_file'] is True and input_format['paired']['paired_selector'] != 'single'</filter>
+        <data name="output_unaligned_reads_r" format="fastqsanger" label="${tool.name} on ${on_string}: unaligned reads (R)">
+            <filter>input_format['paired']['unaligned_file'] is True and input_format['paired']['paired_selector'] == 'paired'</filter>
             <actions>
-                <conditional name="input_format.paired.paired_selector">
-                    <when value="paired">
+                <conditional name="input_format.paired.collection.collection_selector">
+                    <when value="collection">
                         <action type="format">
-                            <option type="from_param" name="input_format.paired.reads_r" param_attribute="ext" />
+                            <option type="from_param" name="input_format.paired.collection.reads.reverse" param_attribute="ext" />
                         </action>
                     </when>
-                    <when value="paired_collection">
+                    <when value="files">
                         <action type="format">
-                            <option type="from_param" name="input_format.paired.reads" param_attribute="forward.ext" />
+                            <option type="from_param" name="input_format.paired.collection.reverse" param_attribute="ext" />
                         </action>
                     </when>
                 </conditional>
             </actions>
         </data>
-        <data name="output_aligned_reads_l" format="fastqsanger" label="${tool.name} on ${on_string}: aligned reads${' (L)' if str($input_format.paired.paired_selector) != 'single' else ''}" >
-            <filter>input_format['paired']['aligned_file'] is True</filter>
+        <data name="output_aligned_reads_l" format="fastqsanger" label="${tool.name} on ${on_string}: aligned reads (L)">
+            <filter>input_format['paired']['aligned_file'] is True and input_format['paired']['paired_selector'] == 'paired'</filter>
             <actions>
-                <conditional name="input_format.paired.paired_selector">
-                    <when value="single">
+                <conditional name="input_format.paired.collection.collection_selector">
+                    <when value="collection">
                         <action type="format">
-                            <option type="from_param" name="input_format.paired.reads" param_attribute="ext" />
+                            <option type="from_param" name="input_format.paired.collection.reads.forward" param_attribute="ext" />
                         </action>
                     </when>
-                    <when value="paired">
+                    <when value="files">
                         <action type="format">
-                            <option type="from_param" name="input_format.paired.reads_f" param_attribute="ext" />
-                        </action>
-                    </when>
-                    <when value="paired_collection">
-                        <action type="format">
-                            <option type="from_param" name="input_format.paired.reads" param_attribute="forward.ext" />
+                            <option type="from_param" name="input_format.paired.collection.forward" param_attribute="ext" />
                         </action>
                     </when>
                 </conditional>
             </actions>
         </data>
-        <data name="output_aligned_reads_r" format="fastqsanger" label="${tool.name} on ${on_string}: aligned reads (R)" >
-            <filter>input_format['paired']['aligned_file'] is True and input_format['paired']['paired_selector'] != 'single'</filter>
+        <data name="output_aligned_reads_r" format="fastqsanger" label="${tool.name} on ${on_string}: aligned reads (R)">
+            <filter>input_format['paired']['aligned_file'] is True and input_format['paired']['paired_selector'] == 'paired'</filter>
             <actions>
-                <conditional name="input_format.paired.paired_selector">
-                    <when value="paired">
+                <conditional name="input_format.paired.collection.collection_selector">
+                    <when value="collection">
                         <action type="format">
-                            <option type="from_param" name="input_format.paired.reads_r" param_attribute="ext" />
+                            <option type="from_param" name="input_format.paired.collection.reads.reverse" param_attribute="ext" />
                         </action>
                     </when>
-                    <when value="paired_collection">
+                    <when value="files">
                         <action type="format">
-                            <option type="from_param" name="input_format.paired.reads" param_attribute="forward.ext" />
+                            <option type="from_param" name="input_format.paired.collection.reverse" param_attribute="ext" />
                         </action>
                     </when>
                 </conditional>
@@ -397,98 +401,103 @@
         <test>
             <param name="input_format_selector" value="fastq" />
             <param name="paired_selector" value="paired" />
+            <param name="collection_selector" value="files" />
             <param name="reference_genome_source" value="history" />
-            <param ftype="fasta" name="history_item" value="phiX.fa" />
-            <param ftype="fastqsanger" name="reads_f" value="hisat_input_1_forward.fastq" />
-            <param ftype="fastqsanger" name="reads_r" value="hisat_input_1_reverse.fastq" />
-            <output file="hisat_output_1.bam" ftype="bam" name="output_alignments" lines_diff="2" />
+            <param name="history_item" ftype="fasta" value="phiX.fa" />
+            <param name="forward" ftype="fastqsanger" value="hisat_input_1_forward.fastq" />
+            <param name="reverse" ftype="fastqsanger" value="hisat_input_1_reverse.fastq" />
+            <output name="output_alignments" file="hisat_output_1.bam" ftype="bam" lines_diff="2" />
         </test>
         <test>
             <param name="input_format_selector" value="fastq" />
             <param name="paired_selector" value="paired" />
+            <param name="collection_selector" value="files" />
             <param name="reference_genome_source" value="history" />
-            <param ftype="fasta" name="history_item" value="phiX.fa" />
+            <param name="history_item" ftype="fasta" value="phiX.fa" />
             <param name="input_options_selector" value="advanced" />
             <param name="trim_three" value="15" />
             <param name="trim_five" value="15" />
-            <param ftype="fastqsanger" name="reads_f" value="hisat_input_2_forward.fastq" />
-            <param ftype="fastqsanger" name="reads_r" value="hisat_input_2_reverse.fastq" />
-            <output file="hisat_output_2.bam" ftype="bam" name="output_alignments" lines_diff="2" />
+            <param name="forward" ftype="fastqsanger" value="hisat_input_2_forward.fastq" />
+            <param name="reverse" ftype="fastqsanger" value="hisat_input_2_reverse.fastq" />
+            <output name="output_alignments" file="hisat_output_2.bam" ftype="bam" lines_diff="2" />
         </test>
         <test>
             <param name="input_format_selector" value="fastq" />
             <param name="paired_selector" value="paired" />
+            <param name="collection_selector" value="files" />
             <param name="reference_genome_source" value="history" />
-            <param name="history_item" value="phiX.fa" ftype="fasta" />
+            <param name="history_item" ftype="fasta" value="phiX.fa" />
             <param name="input_options_selector" value="advanced" />
             <param name="trim_three" value="15" />
             <param name="trim_five" value="15" />
-            <param name="reads_f" ftype="fastqsanger" value="hisat_input_2_forward.fastq" />
-            <param name="reads_r" ftype="fastqsanger" value="hisat_input_2_reverse.fastq" />
+            <param name="forward" ftype="fastqsanger" value="hisat_input_2_forward.fastq" />
+            <param name="reverse" ftype="fastqsanger" value="hisat_input_2_reverse.fastq" />
             <param name="paired_end_options_selector" value="advanced" />
             <param name="no_mixed" value="True" />
             <param name="no_discordant" value="True" />
-            <output name="output_alignments" ftype="bam" file="hisat_output_3.bam" lines_diff="2" />
+            <output name="output_alignments" file="hisat_output_3.bam" ftype="bam" lines_diff="2" />
         </test>
-        <test><!-- testing unaligned output (single dataset) -->
+        <test>
             <param name="input_format_selector" value="fasta" />
             <param name="paired_selector" value="single" />
             <param name="reference_genome_source" value="history" />
-            <param name="history_item" value="phiX.fa" ftype="fasta" />
+            <param name="history_item" ftype="fasta" value="phiX.fa" />
             <param name="unaligned_file" value="true" />
             <param name="aligned_file" value="true" />
             <param name="reference_genome_source" value="history" />
-            <param name="history_item" value="phiX.fa" ftype="fasta" />
-            <param name="reads" value="test_unaligned_reads.fasta" ftype="fasta" />
-            <output name="output_unaligned_reads_l" file="test_unaligned_reads.fasta" />
+            <param name="history_item" ftype="fasta" value="phiX.fa" />
+            <param name="reads" ftype="fasta" value="test_unaligned_reads.fasta" />
+            <output name="output_unaligned_reads" file="test_unaligned_reads.fasta" />
         </test>
         <test>
             <param name="input_format_selector" value="fasta" />
             <param name="paired_selector" value="paired" />
+            <param name="collection_selector" value="files" />
             <param name="reference_genome_source" value="history" />
-            <param name="history_item" value="phiX.fa" ftype="fasta" />
+            <param name="history_item" ftype="fasta" value="phiX.fa" />
             <param name="unaligned_file" value="true" />
             <param name="aligned_file" value="true" />
             <param name="reference_genome_source" value="history" />
-            <param name="history_item" value="phiX.fa" ftype="fasta" />
-            <param name="reads_f" value="test_unaligned_reads.fasta" ftype="fasta" />
-            <param name="reads_r" value="test_unaligned_reads.fasta" ftype="fasta" />
+            <param name="history_item" ftype="fasta" value="phiX.fa" />
+            <param name="forward" ftype="fasta" value="test_unaligned_reads.fasta" />
+            <param name="reverse" ftype="fasta" value="test_unaligned_reads.fasta" />
             <output name="output_unaligned_reads_l" file="test_unaligned_reads.fasta" />
             <output name="output_unaligned_reads_r" file="test_unaligned_reads.fasta" />
         </test>
         <test><!-- Ensure fastqsanger.gz works -->
             <param name="input_format_selector" value="fastq" />
             <param name="paired_selector" value="paired" />
+            <param name="collection_selector" value="files" />
             <param name="reference_genome_source" value="history" />
-            <param name="history_item" value="phiX.fa" ftype="fasta" />
+            <param name="history_item" ftype="fasta" value="phiX.fa" />
             <param name="input_options_selector" value="advanced" />
             <param name="trim_three" value="15" />
             <param name="trim_five" value="15" />
-            <param name="reads_f" ftype="fastqsanger.gz" value="hisat_input_2_forward.fastq.gz" />
-            <param name="reads_r" ftype="fastqsanger.gz" value="hisat_input_2_reverse.fastq.gz" />
+            <param name="forward" ftype="fastqsanger.gz" value="hisat_input_2_forward.fastq.gz" />
+            <param name="reverse" ftype="fastqsanger.gz" value="hisat_input_2_reverse.fastq.gz" />
             <param name="paired_end_options_selector" value="advanced" />
             <param name="no_mixed" value="True" />
             <param name="no_discordant" value="True" />
-            <output name="output_alignments" ftype="bam" file="hisat_output_3.bam" lines_diff="2" />
+            <output name="output_alignments" file="hisat_output_3.bam" ftype="bam" lines_diff="2" />
         </test>
         <test><!-- Ensure fastqsanger.bz2 works -->
             <param name="input_format_selector" value="fastq" />
             <param name="paired_selector" value="paired" />
+            <param name="collection_selector" value="files" />
             <param name="reference_genome_source" value="history" />
-            <param name="history_item" value="phiX.fa" ftype="fasta" />
+            <param name="history_item" ftype="fasta" value="phiX.fa" />
             <param name="input_options_selector" value="advanced" />
             <param name="trim_three" value="15" />
             <param name="trim_five" value="15" />
-            <param name="reads_f" ftype="fastqsanger.bz2" value="hisat_input_2_forward.fastq.bz2" />
-            <param name="reads_r" ftype="fastqsanger.bz2" value="hisat_input_2_reverse.fastq.bz2" />
+            <param name="forward" ftype="fastqsanger.bz2" value="hisat_input_2_forward.fastq.bz2" />
+            <param name="reverse" ftype="fastqsanger.bz2" value="hisat_input_2_reverse.fastq.bz2" />
             <param name="paired_end_options_selector" value="advanced" />
             <param name="no_mixed" value="True" />
             <param name="no_discordant" value="True" />
-            <output name="output_alignments" ftype="bam" file="hisat_output_3.bam" lines_diff="2" />
+            <output name="output_alignments" file="hisat_output_3.bam" ftype="bam" lines_diff="2" />
         </test>
     </tests>
-    <help>
-        <![CDATA[
+    <help><![CDATA[
 Introduction
 ============
 
@@ -622,8 +631,7 @@
     96.70% overall alignment rate
 
 The indentation indicates how subtotals relate to totals.
-        ]]>
-    </help>
+    ]]></help>
     <citations>
         <citation type="doi">10.1038/nmeth.3317</citation>
     </citations>
--- a/hisat2_macros.xml	Tue Jul 18 14:25:13 2017 -0400
+++ b/hisat2_macros.xml	Wed Jul 19 04:57:27 2017 -0400
@@ -1,52 +1,55 @@
 <?xml version="1.0"?>
 <macros>
     <xml name="single_paired_selector">
-        <param label="Single end or paired reads?" name="paired_selector" type="select">
-            <option value="paired_collection">Collection of paired reads</option>
-            <option value="paired">Individual paired reads</option>
-            <option value="single">Individual unpaired reads</option>
+        <param name="paired_selector" type="select" label="Single end or paired reads?">
+            <option value="paired">Paired reads</option>
+            <option value="single">Unpaired reads</option>
         </param>
     </xml>
     <xml name="paired_input_conditional" tokens="ftype">
         <conditional name="paired">
             <expand macro="single_paired_selector" />
-            <when value="paired_collection">
-                <param collection_type="paired" format="@FTYPE@" label="Paired reads" name="reads" type="data_collection" />
-                <expand macro="paired_end_conditional" />
-                <expand macro="paired_end_output" />
-            </when>
             <when value="paired">
-                <param format="@FTYPE@" label="Forward reads" name="reads_f" type="data" />
-                <param format="@FTYPE@" label="Reverse reads" name="reads_r" type="data" />
+                <conditional name="collection" label="Data structure">
+                    <param name="collection_selector" type="select" label="Input is structured as" help="If a list of pairs is selected, HISAT2 will run in batch mode over each pair in the list, producing a list of output bam files">
+                        <option value="files">Individual files</option>
+                        <option value="collection">Pair collection or list of pairs</option>
+                    </param>
+                    <when value="collection">
+                        <param name="reads" type="data_collection" collection_type="paired" format="@FTYPE@" label="Paired reads" />
+                    </when>
+                    <when value="files">
+                        <param name="forward" type="data" format="@FTYPE@" label="Forward reads" />
+                        <param name="reverse" type="data" format="@FTYPE@" label="Reverse reads" />
+                    </when>
+                </conditional>
                 <expand macro="paired_end_conditional" />
                 <expand macro="paired_end_output" />
             </when>
             <when value="single">
-                <param format="@FTYPE@" label="Reads" name="reads" type="data" />
-                <param name="unaligned_file" type="boolean" truevalue="true" falsevalue="false" checked="False" label="Write unaligned reads (in fastq format) to separate file(s)" argument="--un / --un-gz" />
-                <param name="aligned_file" type="boolean" truevalue="true" falsevalue="false" checked="False" label="Write aligned reads (in fastq format) to separate file(s)" argument="--al / --al-gz" />
+                <param name="reads" type="data" format="@FTYPE@" label="Reads" />
+                <param name="unaligned_file" argument="--un-gz" type="boolean" truevalue="true" falsevalue="false" checked="False" label="Write unaligned reads (in fastq format) to separate file(s)" />
+                <param name="aligned_file" argument="--al-gz" type="boolean" truevalue="true" falsevalue="false" checked="False" label="Write aligned reads (in fastq format) to separate file(s)" />
             </when>
         </conditional>
     </xml>
     <xml name="paired_end_conditional">
         <conditional name="paired_end_options">
-            <param label="Paired-end options" name="paired_end_options_selector" type="select">
+            <param name="paired_end_options_selector" type="select" label="Paired-end options">
                 <option value="defaults">Use default values</option>
                 <option value="advanced">Specify paired-end parameters</option>
             </param>
             <when value="defaults" />
             <when value="advanced">
-                <param name="no_mixed" label="Disable alignments of individual mates" type="boolean" truevalue="--no-mixed" falsevalue=""
-                    help="By default, when hisat cannot find a concordant or discordant alignment for a pair, it then tries to find alignments for the individual mates. This option disables that behavior. (--no-mixed)" />
-                <param name="no_discordant" label="Disable discordant alignments" type="boolean" truevalue="--no-discordant" falsevalue=""
-                    help="By default, hisat looks for discordant alignments if it cannot find any concordant alignments. A discordant alignment is an alignment where both mates align uniquely, but that does not satisfy the paired-end constraints (--fr/--rf/--ff, -I, -X). This option disables that behavior. (--no-discordant)" />
-                <param name="skip_reverse" label="Skip reference strand of reference" type="boolean" truevalue="--norc" falsevalue="" help="(--norc) If --norc is specified, hisat will not attempt to align unpaired reads against the reverse-complement (Crick) reference strand. In paired-end mode, --nofw and --norc pertain to the fragments; i.e. specifying --nofw causes hisat to explore only those paired-end configurations corresponding to fragments from the reverse-complement (Crick) strand." />
+                <param name="no_mixed" type="boolean" truevalue="--no-mixed" falsevalue="" label="Disable alignments of individual mates" help="By default, when hisat cannot find a concordant or discordant alignment for a pair, it then tries to find alignments for the individual mates. This option disables that behavior" />
+                <param name="no_discordant" type="boolean" truevalue="--no-discordant" falsevalue="" label="Disable alignments of individual mates" help="By default, hisat looks for discordant alignments if it cannot find any concordant alignments. A discordant alignment is an alignment where both mates align uniquely, but that does not satisfy the paired-end constraints (--fr/--rf/--ff, -I, -X). This option disables that behavior" />
+                <param name="skip_reverse" type="boolean" truevalue="--norc" falsevalue="" label="Skip reference strand of reference" help="If --norc is specified, hisat will not attempt to align unpaired reads against the reverse-complement (Crick) reference strand. In paired-end mode, --nofw and --norc pertain to the fragments; i.e. specifying --nofw causes hisat to explore only those paired-end configurations corresponding to fragments from the reverse-complement (Crick) strand" />
             </when>
         </conditional>
     </xml>
     <xml name="paired_end_output">
-        <param name="unaligned_file" type="boolean" truevalue="true" falsevalue="false" checked="False" label="Write unaligned reads (in fastq format) to separate file(s)" argument="--un-conc / --un-conc-gz" />
-        <param name="aligned_file" type="boolean" truevalue="true" falsevalue="false" checked="False" label="Write aligned reads (in fastq format) to separate file(s)" argument="--al-conc / --al-conc-gz" />
+        <param name="unaligned_file" argument="--un-conc-gz" type="boolean" truevalue="true" falsevalue="false" checked="False" label="Write unaligned reads (in fastq format) to separate file(s)" />
+        <param name="aligned_file" argument="--al-conc-gz" type="boolean" truevalue="true" falsevalue="false" checked="False" label="Write aligned reads (in fastq format) to separate file(s)" />
     </xml>
     <token name="@paired_end_options@">
         #if str( $input_format.paired.unaligned_file ) == "true":
@@ -66,7 +69,7 @@
             #else:
                 --al-conc '${output_aligned_reads_l}'
             #end if
-        #end if  
+        #end if
         #if str($input_format.paired.paired_end_options.paired_end_options_selector) == 'advanced':
             ${input_format.paired.paired_end_options.no_mixed}
             ${input_format.paired.paired_end_options.no_discordant}
@@ -83,49 +86,51 @@
 <![CDATA[
         #set compressed="False"
         #if str($input_format.paired.paired_selector) == 'paired':
-            #if $input_format.paired.reads_f.is_of_type("fastq.gz", "fastqsanger.gz"):
-                #set read1 = "input_f.fastq.gz"
-                #set compressed = "GZ"
-            #else if $input_format.paired.reads_f.is_of_type("fastq.bz2", "fastqsanger.bz2"):
-                #set read1 = "input_f.fastq.bz2"
-                #set compressed = "BZ2"
+            #if str($input_format.paired.collection.collection_selector) == 'collection':
+                #if $input_format.paired.collection.reads.forward.is_of_type("fastq.gz", "fastqsanger.gz"):
+                    #set read1 = "input_f.fastq.gz"
+                    #set compressed = "GZ"
+                #else if $input_format.paired.collection.reads.forward.is_of_type("fastq.bz2", "fastqsanger.bz2"):
+                    #set read1 = "input_f.fastq.bz2"
+                    #set compressed = "BZ2"
+                #else:
+                    #set read1 = "input_f.fastq"
+                #end if
+                ln -f -s '${input_format.paired.collection.reads.forward}' ${read1} &&
+
+                #if $input_format.paired.collection.reads.reverse.is_of_type("fastq.gz", "fastqsanger.gz"):
+                    #set read2 = "input_r.fastq.gz"
+                    #set compressed = "GZ"
+                #else if $input_format.paired.collection.reads.reverse.is_of_type("fastq.bz2", "fastqsanger.bz2"):
+                    #set read2 = "input_r.fastq.bz2"
+                    #set compressed = "BZ2"
+                #else:
+                    #set read2 = "input_r.fastq"
+                #end if
+                ln -f -s '${input_format.paired.collection.reads.reverse}' ${read2} &&
             #else:
-                #set read1 = "input_f.fastq"
-            #end if
-            ln -f -s '${input_format.paired.reads_f}' ${read1} &&
+                #if $input_format.paired.collection.forward.is_of_type("fastq.gz", "fastqsanger.gz"):
+                    #set read1 = "input_f.fastq.gz"
+                    #set compressed = "GZ"
+                #else if $input_format.paired.collection.forward.is_of_type("fastq.bz2", "fastqsanger.bz2"):
+                    #set read1 = "input_f.fastq.bz2"
+                    #set compressed = "BZ2"
+                #else:
+                    #set read1 = "input_f.fastq"
+                #end if
+                ln -f -s '${input_format.paired.collection.forward}' ${read1} &&
 
-            #if $input_format.paired.reads_r.is_of_type("fastq.gz", "fastqsanger.gz"):
-                #set read2 = "input_r.fastq.gz"
-                #set compressed = "GZ"
-            #else if $input_format.paired.reads_r.is_of_type("fastq.bz2", "fastqsanger.bz2"):
-                #set read2 = "input_r.fastq.bz2"
-                #set compressed = "BZ2"
-            #else:
-                #set read2 = "input_r.fastq"
+                #if $input_format.paired.collection.reverse.is_of_type("fastq.gz", "fastqsanger.gz"):
+                    #set read2 = "input_r.fastq.gz"
+                    #set compressed = "GZ"
+                #else if $input_format.paired.collection.reverse.is_of_type("fastq.bz2", "fastqsanger.bz2"):
+                    #set read2 = "input_r.fastq.bz2"
+                    #set compressed = "BZ2"
+                #else:
+                    #set read2 = "input_r.fastq"
+                #end if
+                ln -f -s '${input_format.paired.collection.reverse}' ${read2} &&
             #end if
-            ln -f -s '${input_format.paired.reads_r}' ${read2} &&
-        #else if str($input_format.paired.paired_selector) == 'paired_collection':
-            #if $input_format.paired.reads.forward.is_of_type("fastq.gz", "fastqsanger.gz"):
-                #set read1 = "input_f.fastq.gz"
-                #set compressed = "GZ"
-            #else if $input_format.paired.reads.forward.is_of_type("fastq.bz2", "fastqsanger.bz2"):
-                #set read1 = "input_f.fastq.bz2"
-                #set compressed = "BZ2"
-            #else:
-                #set read1 = "input_f.fastq"
-            #end if
-            ln -s '${input_format.paired.reads.forward}' ${read1} &&
-
-            #if $input_format.paired.reads.reverse.is_of_type("fastq.gz", "fastqsanger.gz"):
-                #set read2 = "input_r.fastq.gz"
-                #set compressed = "GZ"
-            #else if $input_format.paired.reads.reverse.is_of_type("fastq.bz2", "fastqsanger.bz2"):
-                #set read2 = "input_r.fastq.bz2"
-                #set compressed = "BZ2"
-            #else:
-                #set read2 = "input_r.fastq"
-            #end if
-            ln -s '${input_format.paired.reads.reverse}' ${read2} &&
         #else:
             #if $input_format.paired.reads.is_of_type("fastq.gz", "fastqsanger.gz"):
                 #set read1 = "input_f.fastq.gz"