changeset 2:720217c23995 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/samtools/samtools_fastx commit 0f75269223c0821c6c82acf98fde947d0f816f2b"
author iuc
date Tue, 28 Sep 2021 16:13:01 +0000
parents a8d69aee190e
children b3d99709fe1a
files macros.xml samtools_fastx.xml test-data/11.1.fq.expected test-data/11.2.fq.expected test-data/11.s.fq.expected test-data/7.1.fq.expected test-data/7.2.fq.expected test-data/7.s.fq.expected test-data/8.1.fq.expected test-data/8.2.fq.expected test-data/8.i.fq.expected test-data/8.s.fq.expected test-data/bc.fq.expected test-data/bc10.fq.expected
diffstat 14 files changed, 324 insertions(+), 131 deletions(-) [+]
line wrap: on
line diff
--- a/macros.xml	Fri Sep 28 04:39:19 2018 -0400
+++ b/macros.xml	Tue Sep 28 16:13:01 2021 +0000
@@ -5,10 +5,16 @@
             <yield/>
         </requirements>
     </xml>
-    <token name="@TOOL_VERSION@">1.9</token>
-    <token name="@FLAGS@">#set $flags = sum(map(int, str($filter).split(',')))</token>
+    <token name="@TOOL_VERSION@">1.13</token>
+    <token name="@PROFILE@">20.05</token>
+    <token name="@FLAGS@"><![CDATA[
+        #set $flags = 0
+        #if $filter
+            #set $flags = sum(map(int, str($filter).split(',')))
+        #end if
+    ]]></token>
     <token name="@PREPARE_IDX@"><![CDATA[
-        ##prepare input and indices 
+        ##prepare input and indices
         ln -s '$input' infile &&
         #if $input.is_of_type('bam'):
             #if str( $input.metadata.bam_index ) != "None":
@@ -25,7 +31,7 @@
         #end if
     ]]></token>
     <token name="@PREPARE_IDX_MULTIPLE@"><![CDATA[
-        ##prepare input and indices 
+        ##prepare input and indices
         #for $i, $bam in enumerate( $input_bams ):
             ln -s '$bam' '${i}' &&
             #if $bam.is_of_type('bam'):
@@ -63,6 +69,51 @@
             #set reffai=None
         #end if
     ]]></token>
+
+    <xml name="optional_reference">
+        <conditional name="addref_cond">
+            <param name="addref_select" type="select" label="Use a reference sequence">
+                <help>@HELP@</help>
+                <option value="no">No</option>
+                <option value="history">Use a genome/index from the history</option>
+                <option value="cached">Use a built-in genome</option>
+            </param>
+            <when value="no"/>
+            <when value="history">
+                <param name="ref" argument="@ARGUMENT@" type="data" format="fasta,fasta.gz" label="Reference"/>
+            </when>
+            <when value="cached">
+                <param name="ref" argument="@ARGUMENT@" type="select" label="Reference">
+                    <options from_data_table="fasta_indexes">
+                        <filter type="data_meta" ref="input" key="dbkey" column="dbkey"/>
+                    </options>
+                    <validator  type="no_options" message="No reference genome is available for the build associated with the selected input dataset"/>
+                </param>
+            </when>
+        </conditional>
+    </xml>
+    <xml name="mandatory_reference" token_help="" token_argument="">
+        <conditional name="addref_cond">
+            <param name="addref_select" type="select" label="Use a reference sequence">
+                <help>@HELP@</help>
+                <option value="history">Use a genome/index from the history</option>
+                <option value="cached">Use a built-in genome</option>
+            </param>
+            <when value="history">
+                <param name="ref" argument="@ARGUMENT@" type="data" format="fasta,fasta.gz" label="Reference"/>
+            </when>
+            <when value="cached">
+                <param name="ref" argument="@ARGUMENT@" type="select" label="Reference">
+                    <options from_data_table="fasta_indexes">
+                        <filter type="data_meta" ref="input" key="dbkey" column="dbkey"/>
+                        <validator message="No reference genome is available for the build associated with the selected input dataset" type="no_options" />
+                    </options>
+                </param>
+            </when>
+        </conditional>
+    </xml>
+
+
     <token name="@ADDTHREADS@"><![CDATA[
         ##compute the number of ADDITIONAL threads to be used by samtools (-@)
         addthreads=\${GALAXY_SLOTS:-1} && (( addthreads-- )) &&
@@ -70,28 +121,28 @@
     <token name="@ADDMEMORY@"><![CDATA[
         ##compute the number of memory available to samtools sort (-m)
         ##use only 75% of available: https://github.com/samtools/samtools/issues/831
-        addmemory=\${GALAXY_MEMORY_MB_PER_SLOT:-768} && 
+        addmemory=\${GALAXY_MEMORY_MB_PER_SLOT:-768} &&
         ((addmemory=addmemory*75/100)) &&
     ]]></token>
     <xml name="seed_input">
-       <param name="seed" type="integer" optional="True" label="Seed for random number generator" help="If empty a random seed is used." /> 
+       <param name="seed" type="integer" optional="True" label="Seed for random number generator" help="If empty a random seed is used." />
     </xml>
-    <xml name="flag_options">
-        <option value="1">read is paired</option>
-        <option value="2">read is mapped in a proper pair</option>
-        <option value="4">read is unmapped</option>
-        <option value="8">mate is unmapped</option>
-        <option value="16">read reverse strand</option>
-        <option value="32">mate reverse strand</option>
-        <option value="64">read is the first in a pair</option>
-        <option value="128">read is the second in a pair</option>
-        <option value="256">alignment or read is not primary</option>
-        <option value="512">read fails platform/vendor quality checks</option>
-        <option value="1024">read is a PCR or optical duplicate</option>
-        <option value="2048">supplementary alignment</option>
+    <xml name="flag_options" token_s1="false" token_s2="false" token_s4="false" token_s8="false" token_s16="false" token_s32="false" token_s64="false" token_s128="false" token_s256="false" token_s512="false" token_s1024="false" token_s2048="false">
+        <option value="1" selected="@S1@">Read is paired</option>
+        <option value="2" selected="@S2@">Read is mapped in a proper pair</option>
+        <option value="4" selected="@S4@">Read is unmapped</option>
+        <option value="8" selected="@S8@">Mate is unmapped</option>
+        <option value="16" selected="@S16@">Read is mapped to the reverse strand of the reference</option>
+        <option value="32" selected="@S32@">Mate is mapped to the reverse strand of the reference</option>
+        <option value="64" selected="@S64@">Read is the first in a pair</option>
+        <option value="128" selected="@S128@">Read is the second in a pair</option>
+        <option value="256" selected="@S256@">Alignment of the read is not primary</option>
+        <option value="512" selected="@S512@">Read fails platform/vendor quality checks</option>
+        <option value="1024" selected="@S1024@">Read is a PCR or optical duplicate</option>
+        <option value="2048" selected="@S2048@">Alignment is supplementary</option>
     </xml>
 
-    <!-- region specification macros and tokens for tools that allow the specification 
+    <!-- region specification macros and tokens for tools that allow the specification
          of region by bed file / space separated list of regions -->
     <token name="@REGIONS_FILE@"><![CDATA[
         #if $cond_region.select_region == 'tab':
--- a/samtools_fastx.xml	Fri Sep 28 04:39:19 2018 -0400
+++ b/samtools_fastx.xml	Tue Sep 28 16:13:01 2021 +0000
@@ -1,4 +1,4 @@
-<tool id="samtools_fastx" name="Samtools fastx" version="@TOOL_VERSION@+galaxy1">
+<tool id="samtools_fastx" name="Samtools fastx" version="@TOOL_VERSION@" profile="@PROFILE@">
     <description>extract FASTA or FASTQ from alignment files</description>
     <macros>
         <import>macros.xml</import>
@@ -7,10 +7,10 @@
     <expand macro="stdio"/>
     <expand macro="version_command" />
     <command><![CDATA[
-@ADDTHREADS@ 
+@ADDTHREADS@
 ## name sort input file if neccessary
 #if not $input.is_of_type('qname_sorted.bam', 'qname_input_sorted.bam'):
-    samtools sort -@ \$addthreads -n '$input' > input &&
+    samtools sort -@ \$addthreads -n '$input' -T "\${TMPDIR:-.}" > input &&
 #else:
     ln -s '$input' input &&
 #end if
@@ -39,21 +39,15 @@
 #if 'r2' in str($outputs):
     -2 reverse.$output_fmt_cond.output_fmt_select
 #end if
-#if str($inclusive_filter) != 'None':
-    #set $filter = $inclusive_filter
-    @FLAGS@
-    -f $flags
-#end if
-#if str($exclusive_filter) != 'None':
-    #set $filter = $exclusive_filter
-    @FLAGS@
-    -F $flags
-#end if
-#if str($exclusive_filter) != 'None':
-    #set $filter = $exclusive_filter_all
-    @FLAGS@
-    -G $flags
-#end if
+#set $filter = $inclusive_filter
+@FLAGS@
+-f $flags
+#set $filter = $exclusive_filter
+@FLAGS@
+-F $flags
+#set $filter = $exclusive_filter_all
+@FLAGS@
+-G $flags
 #if 's' in str($outputs):
     -s singletons.$output_fmt_cond.output_fmt_select
 #end if
@@ -75,12 +69,12 @@
     #end if
 #end if
 
-input 
+input
 
 #if str($outputs)=='None' or 'other' in str($outputs):
     ## since currently stdout in not zipped (samtools doesn't know about the extension)
     #if str($output_fmt_cond.output_fmt_select).endswith('.gz'):
-        | gzip - 
+        | gzip -
     #end if
     > output.$output_fmt_cond.output_fmt_select
     && ln -s output.$output_fmt_cond.output_fmt_select output
@@ -148,10 +142,10 @@
             <option value="-N">always append /1 and /2 to read name</option>
         </param>
         <param name="inclusive_filter" argument="-f" type="select" multiple="True" label="Require that these flags are set">
-            <expand macro="flag_options" />
+            <expand macro="flag_options"/>
         </param>
         <param name="exclusive_filter" argument="-F" type="select" multiple="True" label="Exclude reads with any of the following flags set">
-            <expand macro="flag_options" />
+            <expand macro="flag_options" s256="true" s2048="true"/>
         </param>
         <param name="exclusive_filter_all" argument="-G" type="select" multiple="True" label="Exclude reads with all of the following flags set">
             <expand macro="flag_options" />
@@ -270,8 +264,8 @@
             <output name="forward" file="samtools_fastx-out3-2.fasta" ftype="fasta" />
             <output name="reverse" file="samtools_fastx-out3-3.fasta" ftype="fasta" />
         </test>
-        <!-- tests from original Galaxy tool with gz output. for some reason gzip (which is used 
-             for compressing stdout does not give exactly the same file contents .. the other 
+        <!-- tests from original Galaxy tool with gz output. for some reason gzip (which is used
+             for compressing stdout does not give exactly the same file contents .. the other
              compressed files seem to)-->
         <test>
             <param name="input" value="samtools_fastx-in1.bam" ftype="bam" />
@@ -279,7 +273,7 @@
                 <param name="output_fmt_select" value="fasta.gz" />
             </conditional>
             <param name="outputs" value="other" />
-            <output name="output" file="samtools_fastx-out1.fasta.gz" ftype="fasta.gz"  compare="sim_size" />
+            <output name="output" file="samtools_fastx-out1.fasta.gz" ftype="fasta.gz" decompress="true"/>
         </test>
         <test>
             <param name="input" value="samtools_fastx-in2.bam" ftype="bam" />
@@ -287,9 +281,9 @@
                 <param name="output_fmt_select" value="fastqsanger.gz" />
             </conditional>
             <param name="outputs" value="r0,r1,r2" />
-            <output name="nonspecific" file="samtools_fastx-out2-1.fastq.gz" ftype="fastqsanger.gz" />
-            <output name="forward" file="samtools_fastx-out2-2.fastq.gz" ftype="fastqsanger.gz" />
-            <output name="reverse" file="samtools_fastx-out2-3.fastq.gz" ftype="fastqsanger.gz" />
+            <output name="nonspecific" file="samtools_fastx-out2-1.fastq.gz" ftype="fastqsanger.gz" decompress="true" />
+            <output name="forward" file="samtools_fastx-out2-2.fastq.gz" ftype="fastqsanger.gz" decompress="true" />
+            <output name="reverse" file="samtools_fastx-out2-3.fastq.gz" ftype="fastqsanger.gz" decompress="true" />
         </test>
         <test>
             <param name="input" value="samtools_fastx-in3.sam" ftype="sam" />
@@ -297,9 +291,9 @@
                 <param name="output_fmt_select" value="fasta.gz" />
             </conditional>
             <param name="outputs" value="r0,r1,r2" />
-            <output name="nonspecific" file="samtools_fastx-out3-1.fasta.gz" ftype="fasta.gz" />
-            <output name="forward" file="samtools_fastx-out3-2.fasta.gz" ftype="fasta.gz" />
-            <output name="reverse" file="samtools_fastx-out3-3.fasta.gz" ftype="fasta.gz" />
+            <output name="nonspecific" file="samtools_fastx-out3-1.fasta.gz" ftype="fasta.gz" decompress="true" />
+            <output name="forward" file="samtools_fastx-out3-2.fasta.gz" ftype="fasta.gz" decompress="true" />
+            <output name="reverse" file="samtools_fastx-out3-3.fasta.gz" ftype="fasta.gz" decompress="true" />
         </test>
         <!-- tests from: https://github.com/samtools/samtools/blob/6d79411685d8f0fbb34e123f52d72b63271f4dcb/test/test.pl#L2313-->
         <!--# basic 2 output test without singleton tracking-->
@@ -476,12 +470,16 @@
                 <param name="ilumina_casava" value="-i" />
             </conditional>
             <param name="outputs" value="r1,r2,s,other" />
+            <conditional name="idxout_cond">
+                <param name="idxout_select" value="yes"/>
+                <param name="index_format" value="n2i2"/>
+            </conditional>
             <param name="copy_tags" value="-t" />
             <param name="copy_arb_tags" value="MD,ia" />
             <param name="read_numbering" value="-N"/>
-            <output name="forward" file="7.1.fq.expected" ftype="fastqsanger" />
-            <output name="reverse" file="7.2.fq.expected" ftype="fastqsanger" />
-            <output name="singletons" file="7.s.fq.expected" ftype="fastqsanger" />
+            <output name="forward" file="11.1.fq.expected" ftype="fastqsanger" />
+            <output name="reverse" file="11.2.fq.expected" ftype="fastqsanger" />
+            <output name="singletons" file="11.s.fq.expected" ftype="fastqsanger" />
             <output name="output"  file="2.stdout.expected" ftype="fastqsanger" />
         </test>
         <!--# -i flag with index-->
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/11.1.fq.expected	Tue Sep 28 16:13:01 2021 +0000
@@ -0,0 +1,68 @@
+@ref1_grp1_p001/1 1:N:0:AC+GT	MD:Z:10	RG:Z:grp1	BC:Z:AC-GT
+CGAGCTCGGT
++
+!!!!!!!!!!
+@ref1_grp1_p002/1 1:N:0:AATT+CCGG	MD:Z:10	RG:Z:grp1	BC:Z:AATT+CCGG
+CTCGGTACCC
++
+##########
+@ref1_grp1_p003/1 1:N:0:0	MD:Z:10	RG:Z:grp1
+GTACCCGGGG
++
+%%%%%%%%%%
+@ref1_grp1_p004/1 1:N:0:0	MD:Z:10	RG:Z:grp1
+CCGGGGATCC
++
+''''''''''
+@ref1_grp1_p005/1 1:N:0:0	MD:Z:10	RG:Z:grp1	ia:i:40000
+GGATCCTCTA
++
+))))))))))
+@ref1_grp1_p006/1 1:N:0:0	MD:Z:10	RG:Z:grp1	ia:i:255
+CCTCTAGAGT
++
+++++++++++
+@ref1_grp2_p001/1 1:N:0:TG+CA	MD:Z:8	RG:Z:grp2	BC:Z:TG+CA	QT:Z:ab+cd
+AGCTCGGTAC
++
+""""""""""
+@ref1_grp2_p002/1 1:N:0:0	MD:Z:10	RG:Z:grp2
+CGGTACCCGG
++
+$$$$$$$$$$
+@ref1_grp2_p003/1 1:N:0:0	MD:Z:10	RG:Z:grp2	ia:i:4294967295
+ACCCGGGGAT
++
+&&&&&&&&&&
+@ref1_grp2_p004/1 1:N:0:0	MD:Z:10	RG:Z:grp2	ia:i:-2147483648
+GGGGATCCTC
++
+((((((((((
+@ref1_grp2_p005/1 1:N:0:0	MD:Z:10	RG:Z:grp2	ia:i:-1000
+ATCCTCTAGA
++
+**********
+@ref1_grp2_p006/1 1:N:0:0	MD:Z:10	RG:Z:grp2	ia:i:-1
+TCTAGAGTCG
++
+,,,,,,,,,,
+@ref2_grp3_p001/1 1:N:0:0	MD:Z:15	RG:Z:grp3
+GTGACACTATAGAAT
++
+~~~~~~~~~~~~~~~
+@ref2_grp3_p002/1 1:N:0:0	MD:Z:15	RG:Z:grp3
+CTGTTTCCTGTGTGA
++
+{{{{{{{{{{{{{{{
+@ref2_grp3_p003/1 1:N:0:0	MD:Z:1T0T0C0T0A0T0A0G0T0G0T0C0A0C0	RG:Z:grp3
+ACGTMRWSYKVHDBN
++
+0123456789abcd!
+@ref12_grp1_p001/1 1:N:0:0	MD:Z:10	RG:Z:grp1
+TGCAGGCATG
++
+AAAAAAAAAA
+@ref12_grp2_p001/1 1:N:0:0	MD:Z:10	RG:Z:grp2
+CAAGCTTGAG
++
+AAAAAAAAAA
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/11.2.fq.expected	Tue Sep 28 16:13:01 2021 +0000
@@ -0,0 +1,68 @@
+@ref1_grp1_p001/2 2:N:0:AC+GT	MD:Z:10	RG:Z:grp1	BC:Z:AC-GT
+GTCGACTCTA
++
+----------
+@ref1_grp1_p002/2 2:N:0:AATT+CCGG	MD:Z:10	RG:Z:grp1	BC:Z:AATT+CCGG
+GCAGGTCGAC
++
+//////////
+@ref1_grp1_p003/2 2:N:0:0	MD:Z:10	RG:Z:grp1
+GCCTGCAGGT
++
+1111111111
+@ref1_grp1_p004/2 2:N:0:0	MD:Z:10	RG:Z:grp1
+GCATGCCTGC
++
+3333333333
+@ref1_grp1_p005/2 2:N:0:0	MD:Z:10	RG:Z:grp1
+GCTTGCATGC
++
+5555555555
+@ref1_grp1_p006/2 2:N:0:0	MD:Z:10	RG:Z:grp1
+TCAAGCTTGC
++
+7777777777
+@ref1_grp2_p001/2 2:N:0:TG+CA	MD:Z:10	RG:Z:grp2	BC:Z:TG+CA	QT:Z:ab+cd
+AGGTCGACTC
++
+..........
+@ref1_grp2_p002/2 2:N:0:0	MD:Z:10	RG:Z:grp2
+CTGCAGGTCG
++
+0000000000
+@ref1_grp2_p003/2 2:N:0:0	MD:Z:10	RG:Z:grp2
+ATGCCTGCAG
++
+2222222222
+@ref1_grp2_p004/2 2:N:0:0	MD:Z:10	RG:Z:grp2
+TTGCATGCCT
++
+4444444444
+@ref1_grp2_p005/2 2:N:0:0	MD:Z:10	RG:Z:grp2
+AAGCTTGCAT
++
+6666666666
+@ref1_grp2_p006/2 2:N:0:0	MD:Z:10	RG:Z:grp2
+ACTCAAGCTT
++
+8888888888
+@ref2_grp3_p001/2 2:N:0:0	MD:Z:0T0A0A1C0A0T0G0G0T0C0A1A0G0	RG:Z:grp3
+CTGTTTCCTGTGTGA
++
+|||||||||||||||
+@ref2_grp3_p002/2 2:N:0:0	MD:Z:15	RG:Z:grp3
+CGCCAAGCTATTTAG
++
+}}}}}}}}}}}}}}}
+@ref2_grp3_p003/2 2:N:0:0	MD:Z:0A0T0T0C0T0A0T0A0G0T0G0T1A0C0	RG:Z:grp3
+ACGTMRWSYKVHDBN
++
+0123456789abcd!
+@ref12_grp1_p001/2 2:N:0:0	MD:Z:10	RG:Z:grp1
+CACTATAGAA
++
+BBBBBBBBBB
+@ref12_grp2_p001/2 2:N:0:0	MD:Z:10	RG:Z:grp2
+ATTTAGGTGA
++
+BBBBBBBBBB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/11.s.fq.expected	Tue Sep 28 16:13:01 2021 +0000
@@ -0,0 +1,8 @@
+@ref1_grp2_p002a/1 1:N:0:0	MD:Z:10	RG:Z:grp2
+CGGTACCCGG
++
+$$$$$$$$$$
+@unaligned_grp3_p001/1 1:N:0:0	RG:Z:grp3
+CACTCGTTCATGACG
++
+0123456789abcde
--- a/test-data/7.1.fq.expected	Fri Sep 28 04:39:19 2018 -0400
+++ b/test-data/7.1.fq.expected	Tue Sep 28 16:13:01 2021 +0000
@@ -1,68 +1,68 @@
-@ref1_grp1_p001/1	RG:Z:grp1	BC:Z:AC-GT	MD:Z:10
+@ref1_grp1_p001/1	MD:Z:10	RG:Z:grp1	BC:Z:AC-GT
 CGAGCTCGGT
 +
 !!!!!!!!!!
-@ref1_grp1_p002/1	RG:Z:grp1	BC:Z:AATT+CCGG	MD:Z:10
+@ref1_grp1_p002/1	MD:Z:10	RG:Z:grp1	BC:Z:AATT+CCGG
 CTCGGTACCC
 +
 ##########
-@ref1_grp1_p003/1	RG:Z:grp1	MD:Z:10
+@ref1_grp1_p003/1	MD:Z:10	RG:Z:grp1
 GTACCCGGGG
 +
 %%%%%%%%%%
-@ref1_grp1_p004/1	RG:Z:grp1	MD:Z:10
+@ref1_grp1_p004/1	MD:Z:10	RG:Z:grp1
 CCGGGGATCC
 +
 ''''''''''
-@ref1_grp1_p005/1	RG:Z:grp1	MD:Z:10	ia:i:40000
+@ref1_grp1_p005/1	MD:Z:10	RG:Z:grp1	ia:i:40000
 GGATCCTCTA
 +
 ))))))))))
-@ref1_grp1_p006/1	RG:Z:grp1	MD:Z:10	ia:i:255
+@ref1_grp1_p006/1	MD:Z:10	RG:Z:grp1	ia:i:255
 CCTCTAGAGT
 +
 ++++++++++
-@ref1_grp2_p001/1	RG:Z:grp2	BC:Z:TG+CA	QT:Z:ab+cd	MD:Z:8
+@ref1_grp2_p001/1	MD:Z:8	RG:Z:grp2	BC:Z:TG+CA	QT:Z:ab+cd
 AGCTCGGTAC
 +
 """"""""""
-@ref1_grp2_p002/1	RG:Z:grp2	MD:Z:10
+@ref1_grp2_p002/1	MD:Z:10	RG:Z:grp2
 CGGTACCCGG
 +
 $$$$$$$$$$
-@ref1_grp2_p003/1	RG:Z:grp2	MD:Z:10	ia:i:4294967295
+@ref1_grp2_p003/1	MD:Z:10	RG:Z:grp2	ia:i:4294967295
 ACCCGGGGAT
 +
 &&&&&&&&&&
-@ref1_grp2_p004/1	RG:Z:grp2	MD:Z:10	ia:i:-2147483648
+@ref1_grp2_p004/1	MD:Z:10	RG:Z:grp2	ia:i:-2147483648
 GGGGATCCTC
 +
 ((((((((((
-@ref1_grp2_p005/1	RG:Z:grp2	MD:Z:10	ia:i:-1000
+@ref1_grp2_p005/1	MD:Z:10	RG:Z:grp2	ia:i:-1000
 ATCCTCTAGA
 +
 **********
-@ref1_grp2_p006/1	RG:Z:grp2	MD:Z:10	ia:i:-1
+@ref1_grp2_p006/1	MD:Z:10	RG:Z:grp2	ia:i:-1
 TCTAGAGTCG
 +
 ,,,,,,,,,,
-@ref2_grp3_p001/1	RG:Z:grp3	MD:Z:15
+@ref2_grp3_p001/1	MD:Z:15	RG:Z:grp3
 GTGACACTATAGAAT
 +
 ~~~~~~~~~~~~~~~
-@ref2_grp3_p002/1	RG:Z:grp3	MD:Z:15
+@ref2_grp3_p002/1	MD:Z:15	RG:Z:grp3
 CTGTTTCCTGTGTGA
 +
 {{{{{{{{{{{{{{{
-@ref2_grp3_p003/1	RG:Z:grp3	MD:Z:1T0T0C0T0A0T0A0G0T0G0T0C0A0C0
+@ref2_grp3_p003/1	MD:Z:1T0T0C0T0A0T0A0G0T0G0T0C0A0C0	RG:Z:grp3
 ACGTMRWSYKVHDBN
 +
 0123456789abcd!
-@ref12_grp1_p001/1	RG:Z:grp1	MD:Z:10
+@ref12_grp1_p001/1	MD:Z:10	RG:Z:grp1
 TGCAGGCATG
 +
 AAAAAAAAAA
-@ref12_grp2_p001/1	RG:Z:grp2	MD:Z:10
+@ref12_grp2_p001/1	MD:Z:10	RG:Z:grp2
 CAAGCTTGAG
 +
 AAAAAAAAAA
--- a/test-data/7.2.fq.expected	Fri Sep 28 04:39:19 2018 -0400
+++ b/test-data/7.2.fq.expected	Tue Sep 28 16:13:01 2021 +0000
@@ -1,68 +1,68 @@
-@ref1_grp1_p001/2	RG:Z:grp1	MD:Z:10
+@ref1_grp1_p001/2	MD:Z:10	RG:Z:grp1
 GTCGACTCTA
 +
 ----------
-@ref1_grp1_p002/2	RG:Z:grp1	MD:Z:10
+@ref1_grp1_p002/2	MD:Z:10	RG:Z:grp1
 GCAGGTCGAC
 +
 //////////
-@ref1_grp1_p003/2	RG:Z:grp1	MD:Z:10
+@ref1_grp1_p003/2	MD:Z:10	RG:Z:grp1
 GCCTGCAGGT
 +
 1111111111
-@ref1_grp1_p004/2	RG:Z:grp1	MD:Z:10
+@ref1_grp1_p004/2	MD:Z:10	RG:Z:grp1
 GCATGCCTGC
 +
 3333333333
-@ref1_grp1_p005/2	RG:Z:grp1	MD:Z:10
+@ref1_grp1_p005/2	MD:Z:10	RG:Z:grp1
 GCTTGCATGC
 +
 5555555555
-@ref1_grp1_p006/2	RG:Z:grp1	MD:Z:10
+@ref1_grp1_p006/2	MD:Z:10	RG:Z:grp1
 TCAAGCTTGC
 +
 7777777777
-@ref1_grp2_p001/2	RG:Z:grp2	MD:Z:10
+@ref1_grp2_p001/2	MD:Z:10	RG:Z:grp2
 AGGTCGACTC
 +
 ..........
-@ref1_grp2_p002/2	RG:Z:grp2	MD:Z:10
+@ref1_grp2_p002/2	MD:Z:10	RG:Z:grp2
 CTGCAGGTCG
 +
 0000000000
-@ref1_grp2_p003/2	RG:Z:grp2	MD:Z:10
+@ref1_grp2_p003/2	MD:Z:10	RG:Z:grp2
 ATGCCTGCAG
 +
 2222222222
-@ref1_grp2_p004/2	RG:Z:grp2	MD:Z:10
+@ref1_grp2_p004/2	MD:Z:10	RG:Z:grp2
 TTGCATGCCT
 +
 4444444444
-@ref1_grp2_p005/2	RG:Z:grp2	MD:Z:10
+@ref1_grp2_p005/2	MD:Z:10	RG:Z:grp2
 AAGCTTGCAT
 +
 6666666666
-@ref1_grp2_p006/2	RG:Z:grp2	MD:Z:10
+@ref1_grp2_p006/2	MD:Z:10	RG:Z:grp2
 ACTCAAGCTT
 +
 8888888888
-@ref2_grp3_p001/2	RG:Z:grp3	MD:Z:0T0A0A1C0A0T0G0G0T0C0A1A0G0
+@ref2_grp3_p001/2	MD:Z:0T0A0A1C0A0T0G0G0T0C0A1A0G0	RG:Z:grp3
 CTGTTTCCTGTGTGA
 +
 |||||||||||||||
-@ref2_grp3_p002/2	RG:Z:grp3	MD:Z:15
+@ref2_grp3_p002/2	MD:Z:15	RG:Z:grp3
 CGCCAAGCTATTTAG
 +
 }}}}}}}}}}}}}}}
-@ref2_grp3_p003/2	RG:Z:grp3	MD:Z:0A0T0T0C0T0A0T0A0G0T0G0T1A0C0
+@ref2_grp3_p003/2	MD:Z:0A0T0T0C0T0A0T0A0G0T0G0T1A0C0	RG:Z:grp3
 ACGTMRWSYKVHDBN
 +
 0123456789abcd!
-@ref12_grp1_p001/2	RG:Z:grp1	MD:Z:10
+@ref12_grp1_p001/2	MD:Z:10	RG:Z:grp1
 CACTATAGAA
 +
 BBBBBBBBBB
-@ref12_grp2_p001/2	RG:Z:grp2	MD:Z:10
+@ref12_grp2_p001/2	MD:Z:10	RG:Z:grp2
 ATTTAGGTGA
 +
 BBBBBBBBBB
--- a/test-data/7.s.fq.expected	Fri Sep 28 04:39:19 2018 -0400
+++ b/test-data/7.s.fq.expected	Tue Sep 28 16:13:01 2021 +0000
@@ -1,4 +1,4 @@
-@ref1_grp2_p002a/1	RG:Z:grp2	MD:Z:10
+@ref1_grp2_p002a/1	MD:Z:10	RG:Z:grp2
 CGGTACCCGG
 +
 $$$$$$$$$$
--- a/test-data/8.1.fq.expected	Fri Sep 28 04:39:19 2018 -0400
+++ b/test-data/8.1.fq.expected	Tue Sep 28 16:13:01 2021 +0000
@@ -1,68 +1,68 @@
-@ref1_grp1_p001 1:N:0:GT
+@ref1_grp1_p001 1:N:0:ACGT
 CGAGCTCGGT
 +
 !!!!!!!!!!
-@ref1_grp1_p002 1:N:0:TT
+@ref1_grp1_p002 1:N:0:AATTCCGG
 CTCGGTACCC
 +
 ##########
-@ref1_grp1_p003
+@ref1_grp1_p003 1:N:0:0
 GTACCCGGGG
 +
 %%%%%%%%%%
-@ref1_grp1_p004
+@ref1_grp1_p004 1:N:0:0
 CCGGGGATCC
 +
 ''''''''''
-@ref1_grp1_p005
+@ref1_grp1_p005 1:N:0:0
 GGATCCTCTA
 +
 ))))))))))
-@ref1_grp1_p006
+@ref1_grp1_p006 1:N:0:0
 CCTCTAGAGT
 +
 ++++++++++
-@ref1_grp2_p001 1:N:0:CA
+@ref1_grp2_p001 1:N:0:TGCA
 AGCTCGGTAC
 +
 """"""""""
-@ref1_grp2_p002
+@ref1_grp2_p002 1:N:0:0
 CGGTACCCGG
 +
 $$$$$$$$$$
-@ref1_grp2_p003
+@ref1_grp2_p003 1:N:0:0
 ACCCGGGGAT
 +
 &&&&&&&&&&
-@ref1_grp2_p004
+@ref1_grp2_p004 1:N:0:0
 GGGGATCCTC
 +
 ((((((((((
-@ref1_grp2_p005
+@ref1_grp2_p005 1:N:0:0
 ATCCTCTAGA
 +
 **********
-@ref1_grp2_p006
+@ref1_grp2_p006 1:N:0:0
 TCTAGAGTCG
 +
 ,,,,,,,,,,
-@ref2_grp3_p001
+@ref2_grp3_p001 1:N:0:0
 GTGACACTATAGAAT
 +
 ~~~~~~~~~~~~~~~
-@ref2_grp3_p002
+@ref2_grp3_p002 1:N:0:0
 CTGTTTCCTGTGTGA
 +
 {{{{{{{{{{{{{{{
-@ref2_grp3_p003
+@ref2_grp3_p003 1:N:0:0
 ACGTMRWSYKVHDBN
 +
 0123456789abcd!
-@ref12_grp1_p001
+@ref12_grp1_p001 1:N:0:0
 TGCAGGCATG
 +
 AAAAAAAAAA
-@ref12_grp2_p001
+@ref12_grp2_p001 1:N:0:0
 CAAGCTTGAG
 +
 AAAAAAAAAA
--- a/test-data/8.2.fq.expected	Fri Sep 28 04:39:19 2018 -0400
+++ b/test-data/8.2.fq.expected	Tue Sep 28 16:13:01 2021 +0000
@@ -1,68 +1,68 @@
-@ref1_grp1_p001 1:N:0:GT
+@ref1_grp1_p001 2:N:0:ACGT
 GTCGACTCTA
 +
 ----------
-@ref1_grp1_p002 1:N:0:TT
+@ref1_grp1_p002 2:N:0:AATTCCGG
 GCAGGTCGAC
 +
 //////////
-@ref1_grp1_p003
+@ref1_grp1_p003 2:N:0:0
 GCCTGCAGGT
 +
 1111111111
-@ref1_grp1_p004
+@ref1_grp1_p004 2:N:0:0
 GCATGCCTGC
 +
 3333333333
-@ref1_grp1_p005
+@ref1_grp1_p005 2:N:0:0
 GCTTGCATGC
 +
 5555555555
-@ref1_grp1_p006
+@ref1_grp1_p006 2:N:0:0
 TCAAGCTTGC
 +
 7777777777
-@ref1_grp2_p001 1:N:0:CA
+@ref1_grp2_p001 2:N:0:TGCA
 AGGTCGACTC
 +
 ..........
-@ref1_grp2_p002
+@ref1_grp2_p002 2:N:0:0
 CTGCAGGTCG
 +
 0000000000
-@ref1_grp2_p003
+@ref1_grp2_p003 2:N:0:0
 ATGCCTGCAG
 +
 2222222222
-@ref1_grp2_p004
+@ref1_grp2_p004 2:N:0:0
 TTGCATGCCT
 +
 4444444444
-@ref1_grp2_p005
+@ref1_grp2_p005 2:N:0:0
 AAGCTTGCAT
 +
 6666666666
-@ref1_grp2_p006
+@ref1_grp2_p006 2:N:0:0
 ACTCAAGCTT
 +
 8888888888
-@ref2_grp3_p001
+@ref2_grp3_p001 2:N:0:0
 CTGTTTCCTGTGTGA
 +
 |||||||||||||||
-@ref2_grp3_p002
+@ref2_grp3_p002 2:N:0:0
 CGCCAAGCTATTTAG
 +
 }}}}}}}}}}}}}}}
-@ref2_grp3_p003
+@ref2_grp3_p003 2:N:0:0
 ACGTMRWSYKVHDBN
 +
 0123456789abcd!
-@ref12_grp1_p001
+@ref12_grp1_p001 2:N:0:0
 CACTATAGAA
 +
 BBBBBBBBBB
-@ref12_grp2_p001
+@ref12_grp2_p001 2:N:0:0
 ATTTAGGTGA
 +
 BBBBBBBBBB
--- a/test-data/8.i.fq.expected	Fri Sep 28 04:39:19 2018 -0400
+++ b/test-data/8.i.fq.expected	Tue Sep 28 16:13:01 2021 +0000
@@ -1,12 +1,12 @@
-@ref1_grp1_p001 1:N:0:GT
+@ref1_grp1_p001 1:N:0:ACGT
 GT
 +
 ""
-@ref1_grp1_p002 1:N:0:TT
+@ref1_grp1_p002 1:N:0:AATTCCGG
 TT
 +
 ""
-@ref1_grp2_p001 1:N:0:CA
+@ref1_grp2_p001 1:N:0:TGCA
 CA
 +
-cd
+""
--- a/test-data/8.s.fq.expected	Fri Sep 28 04:39:19 2018 -0400
+++ b/test-data/8.s.fq.expected	Tue Sep 28 16:13:01 2021 +0000
@@ -1,8 +1,8 @@
-@ref1_grp2_p002a
+@ref1_grp2_p002a 1:N:0:0
 CGGTACCCGG
 +
 $$$$$$$$$$
-@unaligned_grp3_p001
+@unaligned_grp3_p001 1:N:0:0
 CACTCGTTCATGACG
 +
 0123456789abcde
--- a/test-data/bc.fq.expected	Fri Sep 28 04:39:19 2018 -0400
+++ b/test-data/bc.fq.expected	Tue Sep 28 16:13:01 2021 +0000
@@ -9,4 +9,4 @@
 @ref1_grp2_p001
 CA
 +
-cd
+""
--- a/test-data/bc10.fq.expected	Fri Sep 28 04:39:19 2018 -0400
+++ b/test-data/bc10.fq.expected	Tue Sep 28 16:13:01 2021 +0000
@@ -9,4 +9,4 @@
 @ref1_grp2_p001
 CA
 +
-cd
+""