changeset 10:350bbc5c2ffd draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/samtools/samtools_view commit 0f75269223c0821c6c82acf98fde947d0f816f2b"
author iuc
date Tue, 28 Sep 2021 16:18:32 +0000
parents b72793637686
children df20f1fd453f
files macros.xml samtools_view.xml test-data/1.bam test-data/1_sort.bam test-data/1_sort_read_names.bam test-data/bam_to_sam_in1.bam test-data/bam_to_sam_in1.sam test-data/bam_to_sam_in2.bam test-data/bam_to_sam_in2.sam test-data/bam_to_sam_out1.sam test-data/bam_to_sam_out2.sam test-data/bam_to_sam_out3.sam test-data/in_test_1.sam test-data/in_test_11.bam test-data/in_test_14.bam test-data/in_test_15.sam test-data/in_test_17.cram test-data/in_test_23.sam test-data/in_test_24.bam test-data/in_test_3.sam test-data/in_test_30.bam test-data/in_test_4.cram test-data/in_test_5.bam test-data/in_test_7.bam test-data/input/1.bam test-data/input/1_sort.bam test-data/input/1_sort_read_names.bam test-data/input/bam_to_sam_in1.bam test-data/input/bam_to_sam_in1.sam test-data/input/bam_to_sam_in2.bam test-data/input/bam_to_sam_in2.sam test-data/input/bam_to_sam_out1.sam test-data/input/bam_to_sam_out2.sam test-data/input/bam_to_sam_out3.sam test-data/input/chr_m.fasta test-data/input/cram_to_bam_out.bam test-data/input/no_reads.bam test-data/input/no_reads.sam test-data/input/sam_to_bam_noheader_in2.sam test-data/input/sam_to_bam_out1.bam test-data/input/sam_to_bam_out2.bam test-data/input/sam_to_bam_out3.bam test-data/input/tag.as.sort.expected.sam test-data/input/tag.fi.sort.expected.sam test-data/input/tag.rg.n.sort.expected.sam test-data/input/tag.rg.sort.expected.sam test-data/input/test.bam test-data/input/test.bed test-data/input/test.cram test-data/input/test.fa test-data/input/test.fa.fai test-data/input/test.sam test-data/input/test.txt test-data/input/test2.cram test-data/input/test_counts.tab test-data/input/test_ds.bam test-data/input/test_ds.cram test-data/input/test_ds.sam test-data/input/test_input_1_a.bam test-data/no_reads.bam test-data/no_reads.sam test-data/readnames.txt test-data/sam_to_bam_in1.sam test-data/sam_to_bam_noheader_in2.sam test-data/sam_to_bam_out1.bam test-data/sam_to_bam_out2.bam test-data/sam_to_bam_out3.bam test-data/tag.as.sort.expected.sam test-data/tag.fi.sort.expected.sam test-data/tag.rg.n.sort.expected.sam test-data/tag.rg.sort.expected.sam test-data/test.bam test-data/test.cram test-data/test.sam test-data/test2.cram test-data/test_1.bam test-data/test_11.sam test-data/test_12.sam test-data/test_13.sam test-data/test_14.tab test-data/test_15.cram test-data/test_17.bam test-data/test_19.bam test-data/test_2.bam test-data/test_20.bam test-data/test_21.sam test-data/test_22.sam test-data/test_23.sam test-data/test_24.bam test-data/test_25.sam test-data/test_26.bam test-data/test_27.bam test-data/test_28.bam test-data/test_29.bam test-data/test_3.bam test-data/test_30.bam test-data/test_31.bam test-data/test_4.bam test-data/test_5.bam test-data/test_7.bam test-data/test_8.bam test-data/test_counts.tab test-data/test_ds.bam test-data/test_ds.cram test-data/test_ds.sam test-data/test_input_1_a.bam
diffstat 106 files changed, 1093 insertions(+), 356 deletions(-) [+]
line wrap: on
line diff
--- a/macros.xml	Mon Jan 04 10:43:33 2021 +0000
+++ b/macros.xml	Tue Sep 28 16:18:32 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 is mapped to the reverse strand of the reference</option>
-        <option value="32">Mate is mapped to the reverse strand of the reference</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 of the 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">Alignment is supplementary</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_view.xml	Mon Jan 04 10:43:33 2021 +0000
+++ b/samtools_view.xml	Tue Sep 28 16:18:32 2021 +0000
@@ -1,4 +1,4 @@
-<tool id="samtools_view" name="Samtools view" version="@TOOL_VERSION@+galaxy3">
+<tool id="samtools_view" name="Samtools view" version="@TOOL_VERSION@" profile="@PROFILE@">
     <description>- reformat, filter, or subsample SAM, BAM or CRAM</description>
     <macros>
         <import>macros.xml</import>
@@ -121,20 +121,20 @@
                 #if str($mode.filter_config.cigarcons):
                     #set $std_filters = $std_filters + " -m %s" % str($mode.filter_config.cigarcons)
                 #end if
-                #if str($mode.filter_config.inclusive_filter) != 'None':
-                    #set $filter = str($mode.filter_config.inclusive_filter)
-                    @FLAGS@
-                    #set $std_filters = $std_filters + " -f %s" % str($flags)
+                #set $filter = $mode.filter_config.inclusive_filter
+                @FLAGS@
+                #set $std_filters = $std_filters + " -f %s" % str($flags)
+                #set $filter = $mode.filter_config.exclusive_filter
+                @FLAGS@
+                #set $std_filters = $std_filters + " -F %s" % str($flags)
+                #set $filter = $mode.filter_config.exclusive_filter_all
+                @FLAGS@
+                #set $std_filters = $std_filters + " -G %s" % str($flags)
+                #if $mode.filter_config.tag:
+                    #set $std_filters = $std_filters + " --tag '%s'" % $mode.filter_config.tag
                 #end if
-                #if str($mode.filter_config.exclusive_filter) != 'None':
-                    #set $filter = str($mode.filter_config.exclusive_filter)
-                    @FLAGS@
-                    #set $std_filters = $std_filters + " -F %s" % str($flags)
-                #end if
-                #if str($mode.filter_config.exclusive_filter_all) != 'None':
-                    #set $filter = str($mode.filter_config.exclusive_filter_all)
-                    @FLAGS@
-                    #set $std_filters = $std_filters + " -G %s" % str($flags)
+                #if $mode.filter_config.qname_file:
+                    #set std_filters = $std_filters + " --qname-file '%s'" % $mode.filter_config.qname_file
                 #end if
             #end if
 
@@ -311,6 +311,9 @@
                     <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" />
                     </param>
+                    <param  argument="--tag" type="text" optional="true" label="Filter by tag" help="Only include reads with tag STR1 and associated value STR2. Write in the format STR1:STR2 (see help for more details)." />
+                    <!-- TODO implement -D -->
+                    <param argument="--qname-file" format="text" optional="true" type="data" label="Filter by readnames" help="Only output alignments with readnames that are listed in this file." />
                 </section>
                 <section name="subsample_config" title="Configure subsampling" expanded="false">
                     <conditional name="subsampling_mode">
@@ -370,26 +373,7 @@
                 </conditional>
             </when>
         </conditional>
-        <conditional name="addref_cond">
-            <param name="addref_select" type="select" label="Reference data">
-                <help>Reference data as fasta(.gz). Required for SAM input without @SQ headers and useful/required for writing CRAM output (see help).</help>
-                <option value="no" selected="True">No, see help (-output-fmt-option no_ref)</option>
-                <option value="history">Use a genome/index from the history (-t/-T)</option>
-                <option value="cached">Use a built-in genome (-t/-T)</option>
-            </param>
-            <when value="no"/>
-            <when value="history">
-                <param name="ref" format="fasta,fasta.gz" optional="true" type="data" label="Reference file"/>
-            </when>
-            <when value="cached">
-                <param name="ref" type="select" label="Using reference genome">
-                    <options from_data_table="fasta_indexes">
-                        <filter column="dbkey" key="dbkey" ref="input" type="data_meta" />
-                        <validator message="No reference genome is available for the build associated with the selected input dataset" type="no_options" />
-                    </options>
-                </param>
-            </when>
-        </conditional>
+        <expand macro="optional_reference" argument="-t" help="Reference data as fasta(.gz). Required for SAM input without @SQ headers and useful/required for writing CRAM output (see help)."/>
     </inputs>
     <outputs>
         <!-- TODO do I need an action for dbkey? -->
@@ -414,50 +398,51 @@
         </data>
     </outputs>
     <tests>
-        <!-- sam to bam (copied from the sam_to_bam tool) -->
+<!-- 1) sam to bam (copied from the sam_to_bam tool) -->
         <test>
-            <param name="input" ftype="sam" value="sam_to_bam_in1.sam" />
-            <output name="outputsam" ftype="bam" file="sam_to_bam_out1.bam" />
+            <param name="input" ftype="sam" value="in_test_1.sam" />
+            <output name="outputsam" ftype="bam" file="test_1.bam" lines_diff="4" />
         </test>
+        <!-- 2) -->
         <test>
-            <param name="input" ftype="sam" dbkey="equCab2" value="sam_to_bam_in1.sam" />
+            <param name="input" ftype="sam" dbkey="equCab2" value="in_test_1.sam" />
             <conditional name="addref_cond">
                 <param name="addref_select" value="cached" />
                 <param name="ref" value="equCab2chrM" />
             </conditional>
-            <output name="outputsam" ftype="bam" file="sam_to_bam_out2.bam" />
+            <output name="outputsam" ftype="bam" file="test_2.bam" lines_diff="4" />
         </test>
+        <!-- 3) -->
         <test>
-            <param name="input" ftype="sam" value="sam_to_bam_noheader_in2.sam" />
+            <param name="input" ftype="sam" value="in_test_3.sam" />
             <conditional name="addref_cond">
                 <param name="addref_select" value="history" />
                 <param name="ref" ftype="fasta" dbkey="equCab2" value="chr_m.fasta" />
             </conditional>
-            <output name="outputsam" ftype="bam" file="sam_to_bam_out3.bam" />
+            <output name="outputsam" ftype="bam" file="test_3.bam" lines_diff="4" />
         </test>
-
-        <!-- bam to cram -->
+        <!-- 4) cram to bam -->
         <test>
-            <param name="input" value="test.cram" ftype="cram" />
+            <param name="input" value="in_test_4.cram" ftype="cram" />
             <conditional name="addref_cond">
                 <param name="addref_select" value="history" />
                 <param name="ref" value="test.fa" />
             </conditional>
-            <output name="outputsam" file="test.bam" ftype="bam" />
+            <output name="outputsam" file="test_4.bam" ftype="bam" lines_diff="4" />
         </test>
-
-        <!-- within bam operations expected to result in sorting or not -->
-        <test>
+        <!-- 5) within bam operations expected to result in sorting or not -->
+        <test >
             <!-- sorted bam should always result in unmodifed output -->
-            <param name="input" ftype="bam" value="1_sort.bam" />
+            <param name="input" ftype="bam" value="in_test_5.bam" />
             <assert_command>
                 <not_has_text text="samtools sort" />
             </assert_command>
-            <output name="outputsam" ftype="bam" file="1_sort.bam" />
+            <output name="outputsam" ftype="bam" file="test_5.bam" lines_diff="2"/>
         </test>
+        <!-- 6) -->
         <test>
             <!-- sorted bam should always result in unmodifed output -->
-            <param name="input" ftype="bam" value="1_sort.bam" />
+            <param name="input" ftype="bam" value="in_test_5.bam" />
             <conditional name="mode">
                 <conditional name="output_options">
                     <conditional name="output_format">
@@ -468,19 +453,21 @@
             <assert_command>
                 <not_has_text text="samtools sort" />
             </assert_command>
-            <output name="outputsam" ftype="bam" file="1_sort.bam" />
+            <output name="outputsam" ftype="bam" file="test_5.bam" lines_diff="2"/>
         </test>
+        <!-- 7) -->
         <test>
             <!-- qname_sorted.bam should get sorted during "conversion" to bam ... -->
-            <param name="input" ftype="qname_sorted.bam" value="1_sort_read_names.bam" />
+            <param name="input" ftype="qname_sorted.bam" value="in_test_7.bam" />
             <assert_command>
                 <has_text text="samtools sort" />
             </assert_command>
-            <output name="outputsam" ftype="bam" file="1_sort.bam" />
+            <output name="outputsam" ftype="bam" file="test_7.bam" lines_diff="4" />
         </test>
+        <!-- 8) -->
         <test>
             <!-- ... but should be emitted unmodifed when using input format -->
-            <param name="input" ftype="qname_sorted.bam" value="1_sort_read_names.bam" />
+            <param name="input" ftype="qname_sorted.bam" value="in_test_7.bam" />
             <conditional name="mode">
                 <conditional name="output_options">
                     <conditional name="output_format">
@@ -491,19 +478,21 @@
             <assert_command>
                 <not_has_text text="samtools sort" />
             </assert_command>
-            <output name="outputsam" ftype="qname_sorted.bam" file="1_sort_read_names.bam" />
+            <output name="outputsam" ftype="qname_sorted.bam" file="test_8.bam" lines_diff="2"/>
         </test>
+        <!-- 9) -->
         <test>
             <!-- unsorted.bam should get sorted during "conversion" to bam ... -->
-            <param name="input" ftype="unsorted.bam" value="1_sort_read_names.bam" />
+            <param name="input" ftype="unsorted.bam" value="in_test_7.bam" />
             <assert_command>
                 <has_text text="samtools sort" />
             </assert_command>
-            <output name="outputsam" ftype="bam" file="1_sort.bam" />
+            <output name="outputsam" ftype="bam" file="test_7.bam" lines_diff="4" />
         </test>
+        <!-- 10) -->
         <test>
             <!-- ... ... but should be emitted unmodifed when using input format -->
-            <param name="input" ftype="unsorted.bam" value="1_sort_read_names.bam" />
+            <param name="input" ftype="unsorted.bam" value="in_test_7.bam" />
             <conditional name="mode">
                 <conditional name="output_options">
                     <conditional name="output_format">
@@ -514,12 +503,11 @@
             <assert_command>
                 <not_has_text text="samtools sort" />
             </assert_command>
-            <output name="outputsam" ftype="unsorted.bam" file="1_sort_read_names.bam" />
+            <output name="outputsam" ftype="unsorted.bam" file="test_8.bam" lines_diff="2" />
         </test>
-
-        <!-- bam to sam + header options (adapted from bam_to_sam tool)-->
+        <!-- 11) bam to sam + header options (adapted from bam_to_sam tool)-->
         <test>
-            <param ftype="bam" name="input" value="bam_to_sam_in1.bam" />
+            <param ftype="bam" name="input" value="in_test_11.bam" />
             <conditional name="mode">
                 <conditional name="output_options">
                     <conditional name="output_format">
@@ -528,10 +516,11 @@
                     </conditional>
                 </conditional>
             </conditional>
-            <output file="bam_to_sam_out1.sam" ftype="sam" name="outputsam" />
+            <output file="test_11.sam" ftype="sam" name="outputsam" lines_diff="2" />
         </test>
+        <!-- 12) -->
         <test>
-            <param ftype="bam" name="input" value="bam_to_sam_in1.bam" />
+            <param ftype="bam" name="input" value="in_test_11.bam" />
             <conditional name="mode">
                 <param name="outtype" value="header" />
                 <conditional name="output_options">
@@ -540,10 +529,11 @@
                     </conditional>
                 </conditional>
             </conditional>
-            <output file="bam_to_sam_out2.sam" ftype="sam" name="outputsam" />
+            <output file="test_12.sam" ftype="sam" name="outputsam" lines_diff="2" />
         </test>
+        <!-- 13) -->
         <test>
-            <param ftype="bam" name="input" value="bam_to_sam_in1.bam" />
+            <param ftype="bam" name="input" value="in_test_11.bam" />
             <conditional name="mode">
                 <conditional name="output_options">
                     <conditional name="output_format">
@@ -552,24 +542,22 @@
                     </conditional>
                 </conditional>
             </conditional>
-            <output file="bam_to_sam_out3.sam" ftype="sam" name="outputsam" />
+            <output file="test_13.sam" ftype="sam" name="outputsam" lines_diff="2" />
         </test>
-
-        <!-- count alignments -->
+        <!-- 14) count alignments -->
         <test>
-            <param name="input" value="test.bam" ftype="bam" />
+            <param name="input" value="in_test_14.bam" ftype="bam" />
             <conditional name="mode">
                 <param name="outtype" value="all_reads" />
                 <conditional name="output_options">
                     <param name="reads_report_type" value="count" />
                 </conditional>
             </conditional>
-            <output name="outputcnt" file="test_counts.tab" ftype="tabular" />
+            <output name="outputcnt" file="test_14.tab" ftype="tabular" lines_diff="2" />
         </test>
-
-        <!-- region filters -->
+        <!-- 15) region filters -->
         <test>
-            <param name="input" value="test.sam" ftype="sam" />
+            <param name="input" value="in_test_15.sam" ftype="sam" />
             <conditional name="mode">
                 <param name="outtype" value="selected_reads" />
                 <section name="filter_config">
@@ -587,10 +575,11 @@
                 <param name="addref_select" value="history" />
                 <param name="ref" value="test.fa" />
             </conditional>
-            <output name="outputsam" file="test.cram" ftype="cram" compare="sim_size" delta="250" />
+            <output name="outputsam" file="test_15.cram" ftype="cram" compare="sim_size" delta="250" />
         </test>
+        <!-- 16) -->
         <test>
-            <param name="input" value="test.bam" ftype="bam" />
+            <param name="input" value="in_test_14.bam" ftype="bam" />
             <conditional name="mode">
                 <param name="outtype" value="selected_reads" />
                 <section name="filter_config">
@@ -608,10 +597,11 @@
                 <param name="addref_select" value="history" />
                 <param name="ref" value="test.fa" />
             </conditional>
-            <output name="outputsam" file="test.cram" ftype="cram" compare="sim_size" delta="250" />
+            <output name="outputsam" file="test_15.cram" ftype="cram" compare="sim_size" delta="250" />
         </test>
+        <!-- 17) -->
         <test>
-            <param name="input" value="test2.cram" dbkey="equCab2" ftype="cram" />
+            <param name="input" value="in_test_17.cram" dbkey="equCab2" ftype="cram" />
             <conditional name="mode">
                 <param name="outtype" value="selected_reads" />
                 <section name="filter_config">
@@ -629,10 +619,11 @@
                 <param name="addref_select" value="cached" />
                 <param name="ref" value="equCab2chrM" />
             </conditional>
-            <output name="outputsam" file="sam_to_bam_out2.bam" ftype="bam" />
+            <output name="outputsam" file="test_17.bam" ftype="bam" lines_diff="4" />
         </test>
+        <!-- 18) -->
         <test>
-            <param name="input" value="test.bam" ftype="bam" />
+            <param name="input" value="in_test_14.bam" ftype="bam" />
             <conditional name="mode">
                 <param name="outtype" value="selected_reads" />
                 <section name="filter_config">
@@ -651,10 +642,11 @@
                 <param name="addref_select" value="history" />
                 <param name="ref" value="test.fa" />
             </conditional>
-            <output name="outputsam" file="test.cram" ftype="cram" compare="sim_size" delta="250" />
+            <output name="outputsam" file="test_15.cram" ftype="cram" compare="sim_size" delta="250" />
         </test>
+        <!-- 19) -->
         <test>
-            <param name="input" value="test.cram" ftype="cram" />
+            <param name="input" value="test_15.cram" ftype="cram" />
             <conditional name="mode">
                 <param name="outtype" value="selected_reads" />
                 <section name="filter_config">
@@ -673,10 +665,11 @@
                 <param name="addref_select" value="history" />
                 <param name="ref" value="test.fa" />
             </conditional>
-            <output name="outputsam" file="test.bam" ftype="bam" />
+            <output name="outputsam" file="test_19.bam" ftype="bam" lines_diff="4"/>
         </test>
+        <!-- 20) -->
         <test>
-            <param name="input" value="test.cram" ftype="cram" />
+            <param name="input" value="test_15.cram" ftype="cram" />
             <conditional name="mode">
                 <param name="outtype" value="selected_reads" />
                 <section name="filter_config">
@@ -695,12 +688,11 @@
                 <param name="addref_select" value="history" />
                 <param name="ref" value="test.fa" />
             </conditional>
-            <output name="outputsam" file="test.bam" ftype="bam" />
+            <output name="outputsam" file="test_20.bam" ftype="bam" lines_diff="4" />
         </test>
-
-        <!-- sampling options-->
+        <!-- 21) sampling options-->
         <test>
-            <param name="input" value="test.sam" ftype="sam" />
+            <param name="input" value="in_test_15.sam" ftype="sam" />
             <conditional name="mode">
                 <param name="outtype" value="selected_reads" />
                 <section name="subsample_config">
@@ -715,10 +707,11 @@
                     </conditional>
                 </conditional>
             </conditional>
-            <output name="outputsam" file="test_ds.sam" ftype="sam" compare="diff" lines_diff="6" />
+            <output name="outputsam" file="test_21.sam" ftype="sam" compare="diff" lines_diff="6" />
         </test>
+        <!-- 22) -->
         <test>
-            <param name="input" value="test.sam" ftype="sam" />
+            <param name="input" value="in_test_15.sam" ftype="sam" />
             <conditional name="mode">
                 <param name="outtype" value="selected_reads" />
                 <section name="subsample_config">
@@ -733,11 +726,12 @@
                     </conditional>
                 </conditional>
             </conditional>
-            <output name="outputsam" file="test.sam" ftype="sam" />
+            <output name="outputsam" file="test_22.sam" ftype="sam" lines_diff="2"/>
         </test>
+        <!-- 23) -->
         <test>
             <!-- subsampling SAM input without reads -->
-            <param name="input" value="no_reads.sam" ftype="sam" />
+            <param name="input" value="in_test_23.sam" ftype="sam" />
             <conditional name="mode">
                 <param name="outtype" value="selected_reads" />
                 <section name="subsample_config">
@@ -752,11 +746,12 @@
                     </conditional>
                 </conditional>
             </conditional>
-            <output name="outputsam" file="no_reads.sam" ftype="sam" />
+            <output name="outputsam" file="test_23.sam" ftype="sam" lines_diff="2"/>
         </test>
+        <!-- 24) -->
         <test>
             <!-- subsampling BAM input without reads -->
-            <param name="input" value="no_reads.bam" ftype="bam" />
+            <param name="input" value="in_test_24.bam" ftype="bam" />
             <conditional name="mode">
                 <param name="outtype" value="selected_reads" />
                 <section name="subsample_config">
@@ -771,10 +766,11 @@
                     </conditional>
                 </conditional>
             </conditional>
-            <output name="outputsam" file="no_reads.bam" ftype="bam" />
+            <output name="outputsam" file="test_24.bam" ftype="bam" lines_diff="2" />
         </test>
+        <!-- 25) -->
         <test>
-            <param name="input" value="test.sam" ftype="sam" />
+            <param name="input" value="in_test_15.sam" ftype="sam" />
             <conditional name="mode">
                 <param name="outtype" value="selected_reads" />
                 <section name="subsample_config">
@@ -790,10 +786,11 @@
                     </conditional>
                 </conditional>
             </conditional>
-            <output name="outputsam" file="test_ds.sam" ftype="sam" compare="diff" lines_diff="6" />
+            <output name="outputsam" file="test_25.sam" ftype="sam" compare="diff" lines_diff="6" />
         </test>
+        <!-- 26) -->
         <test>
-            <param name="input" value="test.bam" ftype="bam" />
+            <param name="input" value="in_test_14.bam" ftype="bam" />
             <conditional name="mode">
                 <param name="outtype" value="selected_reads" />
                 <section name="subsample_config">
@@ -809,10 +806,11 @@
                     </conditional>
                 </conditional>
             </conditional>
-            <output name="outputsam" file="test_ds.bam" ftype="bam" />
+            <output name="outputsam" file="test_26.bam" ftype="bam" lines_diff="2" />
         </test>
+        <!-- 27) -->
         <test>
-            <param name="input" value="test.bam" ftype="bam" />
+            <param name="input" value="in_test_14.bam" ftype="bam" />
             <conditional name="mode">
                 <param name="outtype" value="selected_reads" />
                 <section name="subsample_config">
@@ -828,10 +826,11 @@
                     </conditional>
                 </conditional>
             </conditional>
-            <output name="outputsam" file="test.bam" ftype="bam" />
+            <output name="outputsam" file="test_27.bam" ftype="bam" lines_diff="2"/>
         </test>
+        <!-- 28) -->
         <test>
-            <param name="input" value="test.bam" ftype="bam" />
+            <param name="input" value="in_test_14.bam" ftype="bam" />
             <conditional name="mode">
                 <param name="outtype" value="selected_reads" />
                 <section name="subsample_config">
@@ -847,10 +846,11 @@
                     </conditional>
                 </conditional>
             </conditional>
-            <output name="outputsam" file="test_ds.bam" ftype="bam" />
-        </test>        
+            <output name="outputsam" file="test_28.bam" ftype="bam" lines_diff="2" />
+        </test>
+        <!-- 29) -->
         <test>
-            <param name="input" value="test.bam" ftype="bam" />
+            <param name="input" value="in_test_14.bam" ftype="bam" />
             <conditional name="mode">
                 <param name="outtype" value="selected_reads" />
                 <section name="subsample_config">
@@ -867,20 +867,58 @@
                     </conditional>
                 </conditional>
             </conditional>
-            <output name="outputsam" file="test_ds.bam" ftype="bam" />
-        </test>        
+            <output name="outputsam" file="test_29.bam" ftype="bam" lines_diff="2"/>
+        </test>
+        <!-- 30) testing tag filtering -->
+        <test>
+            <param name="input" value="in_test_30.bam" ftype="bam" />
+            <conditional name="mode">
+                <param name="outtype" value="selected_reads" />
+                <section name="filter_config">
+                    <param name="tag" value="XS:-18" />
+                </section>
+                <conditional name="output_options">
+                    <conditional name="output_format">
+                        <param name="oformat" value="bam" />
+                    </conditional>
+                </conditional>
+            </conditional>
+            <assert_command>
+                <has_text text="--tag 'XS:-18'"/>
+            </assert_command>
+            <output name="outputsam" file="test_30.bam" ftype="bam" lines_diff="2" />
+        </test>
+        <!-- 31) testing readname filtering -->
+        <test>
+            <param name="input" value="in_test_30.bam" ftype="bam" />
+            <conditional name="mode">
+                <param name="outtype" value="selected_reads" />
+                <section name="filter_config">
+                    <param name="qname_file" value="readnames.txt" />
+                </section>
+                <conditional name="output_options">
+                    <conditional name="output_format">
+                        <param name="oformat" value="bam" />
+                    </conditional>
+                </conditional>
+            </conditional>
+            <assert_command>
+                <has_text text="--qname-file"/>
+            </assert_command>
+            <output name="outputsam" file="test_31.bam" ftype="bam" lines_diff="2" />
+        </test>
     </tests>
     <help>
 **What it does**
 
-Samtools view can: 
+Samtools view can:
 
 1. convert between alignment formats (SAM, BAM, CRAM)
 2. filter and subsample alignments according to user-specified criteria
 3. count the reads in the input dataset or those retained after filtering
    and subsampling
 4. obtain just the header of the input in any supported format
-  
+
 In addition, the tool has (limited) options to modify read records during conversion and/or filtering by:
 
 - stripping them of user-specified tags
@@ -894,9 +932,9 @@
 
 By changing the *Output format* it is possible to convert an input dataset to
 another format.
-Inputs of type SAM, BAM, and CRAM are accepted and can be converted to each of these formats (alternatively alignment counts can be computed) by selecting the appropriate "Output type". 
+Inputs of type SAM, BAM, and CRAM are accepted and can be converted to each of these formats (alternatively alignment counts can be computed) by selecting the appropriate "Output type".
 
-.. class:: infomark 
+.. class:: infomark
 
 The tool allows you to specify a reference sequence. This is required for SAM input with missing @SQ headers (which include sequence names, length, md5, etc) and useful (and sometimes necessary) for CRAM input and output. In the following the use of the reference sequence in the CRAM format is detailed.
 CRAM is (primarily) a reference-based compressed format, i.e. only sequence differences between aligned reads and the reference are stored. As a consequence, the reference that was used during read mapping is needed in order to interpret the alignment records (a checksum stored in the CRAM file is used to verify that only the correct reference sequence can be used). This allows for more space-efficient storage than with BAM format, but such a CRAM file is not usable without its reference.
@@ -950,7 +988,14 @@
 
 **Filtering by quality**
 
-This filters based on the MAPQ column of the SAM format which gives an estimate about the correct placement of the alignment. Note that aligners do not follow a consistent definition. 
+This filters based on the MAPQ column of the SAM format which gives an estimate about the correct placement of the alignment. Note that aligners do not follow a consistent definition.
+
+## Filtering by Tag **
+
+This filter allows to select reads based on tool or user specific tags, e.g., XS:i:-18 the alignment score tag of bowtie.
+Thus to filter for a specific value of the tag you need the format STR1:STR2, e.g., XS:-18 to filter reads with an aligment score of -18.
+You can also just write STR1 without the value STR2 hence the filter selects all reads with the tag STR1, e.g., XS.
+
     </help>
     <expand macro="citations"/>
 </tool>
Binary file test-data/1.bam has changed
Binary file test-data/1_sort.bam has changed
Binary file test-data/1_sort_read_names.bam has changed
Binary file test-data/bam_to_sam_in1.bam has changed
--- a/test-data/bam_to_sam_in1.sam	Mon Jan 04 10:43:33 2021 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-@HD	VN:1.0	SO:coordinate
-@SQ	SN:chr1	LN:101
-@SQ	SN:chr7	LN:404
-@SQ	SN:chr8	LN:202
-@RG	ID:0	SM:Hi,Mom!
-@PG	ID:1	PN:Hey!	VN:2.0
-both_reads_align_clip_marked	83	chr7	1	255	101M	=	302	201	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
-both_reads_present_only_first_aligns	89	chr7	1	255	101M	*	0	0	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
-read_2_too_many_gaps	83	chr7	1	255	101M	=	302	201	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
-both_reads_align_clip_adapter	147	chr7	16	255	101M	=	21	-96	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
-both_reads_align_clip_adapter	99	chr7	21	255	101M	=	16	96	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
-both_reads_align_clip_marked	163	chr7	302	255	101M	=	1	-201	NCGCGGCATCNCGATTTCTTTCCGCAGCTAACCTCCCGACAGATCGGCAGCGCGTCGTGTAGGTTATTATGGTACATCTTGTCGTGCGGCNAGAGCATACA	&/15445666651/566666553+2/14/&/555512+3/)-'/-&-'*+))*''13+3)'//++''/'))/3+&*5++)&'2+&+/*&-&&*)&-./1'1	RG:Z:0
-read_2_too_many_gaps	163	chr7	302	255	10M1D10M5I76M	=	1	-201	NCGCGGCATCNCGATTTCTTTCCGCAGCTAACCTCCCGACAGATCGGCAGCGCGTCGTGTAGGTTATTATGGTACATCTTGTCGTGCGGCNAGAGCATACA	&/15445666651/566666553+2/14/&/555512+3/)-'/-&-'*+))*''13+3)'//++''/'))/3+&*5++)&'2+&+/*&-&&*)&-./1'1	RG:Z:0
-both_reads_present_only_first_aligns	165	*	0	0	*	chr7	1	0	NCGCGGCATCNCGATTTCTTTCCGCAGCTAACCTCCCGACAGATCGGCAGCGCGTCGTGTAGGTTATTATGGTACATCTTGTCGTGCGGCNAGAGCATACA	&/15445666651/566666553+2/14/&/555512+3/)-'/-&-'*+))*''13+3)'//++''/'))/3+&*5++)&'2+&+/*&-&&*)&-./1'1	RG:Z:0
Binary file test-data/bam_to_sam_in2.bam has changed
--- a/test-data/bam_to_sam_in2.sam	Mon Jan 04 10:43:33 2021 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-@HD	VN:1.0	SO:coordinate
-@SQ	SN:chr1	LN:10001
-@SQ	SN:chr2	LN:100001
-@SQ	SN:chr3	LN:10001
-@SQ	SN:chr4	LN:1001
-@RG	ID:rg1	SM:s1
-@RG	ID:rg2	SM:s3
-bar:record:4	77	chr1	1	0	*	*	0	0	AAAAAAAAAAAAA	1111111111111	RG:Z:rg1
-bar:record:6	77	chr1	1	0	*	*	0	0	AAAAAAAAAAAAA	1111111111111	RG:Z:rg2
-bar:record:1	77	chr1	10	0	*	*	0	0	AAAAAAAAAAAAA	1111111111111	RG:Z:rg1
-bar:record:3	77	chr1	10	0	*	*	0	0	AAAAAAAAAAAAA	1111111111111	RG:Z:rg2
-bar:record:1	141	chr1	20	0	*	*	0	0	CCCCCCCCCCCCC	2222222222222	RG:Z:rg1
-bar:record:7	77	chr1	20	0	*	*	0	0	AAAAAAAAAAAAA	1111111111111	RG:Z:rg2
-bar:record:8	77	chr1	30	0	*	*	0	0	AAAAAAAAAAAAA	1111111111111	RG:Z:rg2
-bar:record:4	141	chr1	40	0	*	*	0	0	CCCCCCCCCCCCC	2222222222222	RG:Z:rg1
-bar:record:5	77	chr1	40	0	*	*	0	0	AAAAAAAAAAAAA	1111111111111	RG:Z:rg2
-bar:record:6	141	chr1	50	0	*	*	0	0	CCCCCCCCCCCCC	2222222222222	RG:Z:rg2
-bar:record:2	77	chr2	10	0	*	*	0	0	AAAAAAAAAAAAA	1111111111111	RG:Z:rg1
-bar:record:2	141	chr2	30	0	*	*	0	0	CCCCCCCCCCCCC	2222222222222	RG:Z:rg2
-bar:record:3	141	chr3	20	0	*	*	0	0	CCCCCCCCCCCCC	2222222222222	RG:Z:rg1
-bar:record:8	141	chr3	20	0	*	*	0	0	CCCCCCCCCCCCC	2222222222222	RG:Z:rg1
-bar:record:5	141	chr3	40	0	*	*	0	0	CCCCCCCCCCCCC	2222222222222	RG:Z:rg1
-bar:record:9	77	chr4	10	0	*	*	0	0	AAAAAAAAAAAAA	1111111111111	RG:Z:rg1
-bar:record:7	141	chr4	20	0	*	*	0	0	CCCCCCCCCCCCC	2222222222222	RG:Z:rg1
-bar:record:9	141	chr4	60	0	*	*	0	0	CCCCCCCCCCCCC	2222222222222	RG:Z:rg1
--- a/test-data/bam_to_sam_out1.sam	Mon Jan 04 10:43:33 2021 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-@HD	VN:1.0	SO:coordinate
-@SQ	SN:chr1	LN:101
-@SQ	SN:chr7	LN:404
-@SQ	SN:chr8	LN:202
-@RG	ID:0	SM:Hi,Mom!
-@PG	ID:1	PN:Hey!	VN:2.0
-both_reads_align_clip_marked	83	chr7	1	255	101M	=	302	201	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
-both_reads_present_only_first_aligns	89	chr7	1	255	101M	*	0	0	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
-read_2_too_many_gaps	83	chr7	1	255	101M	=	302	201	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
-both_reads_align_clip_adapter	147	chr7	16	255	101M	=	21	-96	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
-both_reads_align_clip_adapter	99	chr7	21	255	101M	=	16	96	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
-both_reads_align_clip_marked	163	chr7	302	255	101M	=	1	-201	NCGCGGCATCNCGATTTCTTTCCGCAGCTAACCTCCCGACAGATCGGCAGCGCGTCGTGTAGGTTATTATGGTACATCTTGTCGTGCGGCNAGAGCATACA	&/15445666651/566666553+2/14/&/555512+3/)-'/-&-'*+))*''13+3)'//++''/'))/3+&*5++)&'2+&+/*&-&&*)&-./1'1	RG:Z:0
-read_2_too_many_gaps	163	chr7	302	255	10M1D10M5I76M	=	1	-201	NCGCGGCATCNCGATTTCTTTCCGCAGCTAACCTCCCGACAGATCGGCAGCGCGTCGTGTAGGTTATTATGGTACATCTTGTCGTGCGGCNAGAGCATACA	&/15445666651/566666553+2/14/&/555512+3/)-'/-&-'*+))*''13+3)'//++''/'))/3+&*5++)&'2+&+/*&-&&*)&-./1'1	RG:Z:0
-both_reads_present_only_first_aligns	165	*	0	0	*	chr7	1	0	NCGCGGCATCNCGATTTCTTTCCGCAGCTAACCTCCCGACAGATCGGCAGCGCGTCGTGTAGGTTATTATGGTACATCTTGTCGTGCGGCNAGAGCATACA	&/15445666651/566666553+2/14/&/555512+3/)-'/-&-'*+))*''13+3)'//++''/'))/3+&*5++)&'2+&+/*&-&&*)&-./1'1	RG:Z:0
--- a/test-data/bam_to_sam_out2.sam	Mon Jan 04 10:43:33 2021 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-@HD	VN:1.0	SO:coordinate
-@SQ	SN:chr1	LN:101
-@SQ	SN:chr7	LN:404
-@SQ	SN:chr8	LN:202
-@RG	ID:0	SM:Hi,Mom!
-@PG	ID:1	PN:Hey!	VN:2.0
--- a/test-data/bam_to_sam_out3.sam	Mon Jan 04 10:43:33 2021 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-both_reads_align_clip_marked	83	chr7	1	255	101M	=	302	201	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
-both_reads_present_only_first_aligns	89	chr7	1	255	101M	*	0	0	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
-read_2_too_many_gaps	83	chr7	1	255	101M	=	302	201	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
-both_reads_align_clip_adapter	147	chr7	16	255	101M	=	21	-96	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
-both_reads_align_clip_adapter	99	chr7	21	255	101M	=	16	96	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
-both_reads_align_clip_marked	163	chr7	302	255	101M	=	1	-201	NCGCGGCATCNCGATTTCTTTCCGCAGCTAACCTCCCGACAGATCGGCAGCGCGTCGTGTAGGTTATTATGGTACATCTTGTCGTGCGGCNAGAGCATACA	&/15445666651/566666553+2/14/&/555512+3/)-'/-&-'*+))*''13+3)'//++''/'))/3+&*5++)&'2+&+/*&-&&*)&-./1'1	RG:Z:0
-read_2_too_many_gaps	163	chr7	302	255	10M1D10M5I76M	=	1	-201	NCGCGGCATCNCGATTTCTTTCCGCAGCTAACCTCCCGACAGATCGGCAGCGCGTCGTGTAGGTTATTATGGTACATCTTGTCGTGCGGCNAGAGCATACA	&/15445666651/566666553+2/14/&/555512+3/)-'/-&-'*+))*''13+3)'//++''/'))/3+&*5++)&'2+&+/*&-&&*)&-./1'1	RG:Z:0
-both_reads_present_only_first_aligns	165	*	0	0	*	chr7	1	0	NCGCGGCATCNCGATTTCTTTCCGCAGCTAACCTCCCGACAGATCGGCAGCGCGTCGTGTAGGTTATTATGGTACATCTTGTCGTGCGGCNAGAGCATACA	&/15445666651/566666553+2/14/&/555512+3/)-'/-&-'*+))*''13+3)'//++''/'))/3+&*5++)&'2+&+/*&-&&*)&-./1'1	RG:Z:0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/in_test_1.sam	Tue Sep 28 16:18:32 2021 +0000
@@ -0,0 +1,13 @@
+@HD	VN:1.0	SO:coordinate
+@SQ	SN:chrM	LN:100001
+@RG	ID:rg1	SM:s1
+HWI-EAS91_1_30788AAXX:1:1:1513:715	16	chrM	9563	25	36M	*	0	0	CTGACTACCACAACTAAACATCTATGCNNAAAAAAC	I+-II?IDIIIIIIIIIIIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
+HWI-EAS91_1_30788AAXX:1:1:1698:516	16	chrM	2735	25	36M	*	0	0	TTTACACTCAGAGGTTCAACTCCTCTCNNTAACAAC	I9IIIII5IIIIIIIIIIIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
+HWI-EAS91_1_30788AAXX:1:1:1491:637	16	chrM	10864	25	36M	*	0	0	TGTAGAAGCCCCAATTGCCGGATCCATNNTGCTAGC	DBAIIIIIIIIIIIFIIIIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
+HWI-EAS91_1_30788AAXX:1:1:1711:249	16	chrM	10617	25	36M	*	0	0	ACCAAACAGAACGCCTGAACGCAGGCCNNTACTTCC	IIIIIIIIIIIIIIIIIIIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
+HWI-EAS91_1_30788AAXX:1:1:1634:211	0	chrM	9350	25	36M	*	0	0	GAAGCAGNNGCTTGATACTGACACTTCGTCGACGTA	IIIIIII""IIIIIIIIIIIIIIIIIIIIII9IIDF	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
+HWI-EAS91_1_30788AAXX:1:1:1218:141	16	chrM	14062	25	36M	*	0	0	ACAAAACTAACAACAAAAATAACACTCNNAATAAAC	I+IIII1IIIIIIIIIIIIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
+HWI-EAS91_1_30788AAXX:1:1:1398:854	16	chrM	3921	25	36M	*	0	0	CACCCTTCCCGTACTAATAAATCCCCTNNTCTTCAC	IIIII=AIIIIIIIIIIIIIIBIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
+HWI-EAS91_1_30788AAXX:1:1:1310:991	16	chrM	10002	25	36M	*	0	0	CTCCTATGCCTAGAAGGAATAATACTANNACTATTC	I:2IEI:IIDIIIIII4IIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
+HWI-EAS91_1_30788AAXX:1:1:1716:413	0	chrM	6040	25	36M	*	0	0	GATCCAANNCTTTATCAACACCTATTCTGATTCTTC	IIIIIII""IIIIIIIIIIIIIIIIIIIIIIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
+HWI-EAS91_1_30788AAXX:1:1:1630:59	16	chrM	12387	25	36M	*	0	0	TCATACTCGACCCCAACCTTACCAACCNNCCGCTCC	FIIHII;IIIIIIIIIIIIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
Binary file test-data/in_test_11.bam has changed
Binary file test-data/in_test_14.bam has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/in_test_15.sam	Tue Sep 28 16:18:32 2021 +0000
@@ -0,0 +1,15 @@
+@HD	VN:1.4	SO:unsorted
+@SQ	SN:CHROMOSOME_I	LN:100
+@RG	ID:UNKNOWN	SM:UNKNOWN
+@PG	ID:bowtie2	PN:bowtie2	VN:2.0.0-beta5
+@PG	ID:0	CL:aaaaa/aaa/aaaaa/aaaaaa/aaaaaaaaa/aaa/iuc/package_aaaaaaaaa_x_y/aaaaaaaaaaaa/bin/aaaaaaaaaaaaaaaaa aaaaaaaaaa /aaaa/aaaaa/aaa/aaaaaaaaaaaaaaaaaaa/tools/aaaaaaaaa/test-data/test.cram aa /aaaa/aaaaa/aaa/aaaaaaaaaaaaaaaaaaa/tools/aaaaaaaaa/test-data/test.fa -O test	PN:samtools	VN:1.2
+SRR065390.14978392	16	CHROMOSOME_I	2	1	27M1D73M	*	0	0	CCTAGCCCTAACCCTAACCCTAACCCTAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	#############################@B?8B?BA@@DDBCDDCBC@CDCDCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC	RG:Z:UNKNOWN	XG:i:1	XM:i:5	XN:i:0	XO:i:1	AS:i:-18	XS:i:-18	YT:Z:UU
+SRR065390.921023	16	CHROMOSOME_I	3	12	100M	*	0	0	CTAAGCCTAAATCTAAGCCTAACCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	###############################################???88:;98768700000<>:BBA?BBAB?BBBBBBBB>B>BB::;?:00000	RG:Z:UNKNOWN	XG:i:0	XM:i:3	XN:i:0	XO:i:0	AS:i:-6	XS:i:-13	YT:Z:UU
+SRR065390.1871511	16	CHROMOSOME_I	3	1	100M	*	0	0	CTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	<?@<@A8>0:BB@>B<=B@???@=8@B>BB@CA@DACDCBBCCCA@CCCCACCBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC	RG:Z:UNKNOWN	XG:i:0	XM:i:0	XN:i:0	XO:i:0	AS:i:0	XS:i:0	YT:Z:UU
+SRR065390.3743423	16	CHROMOSOME_I	3	1	100M	*	0	0	CTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	##################?6@:7<=@3=@ABAAB>BDBBABADABDDDBDDBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC	RG:Z:UNKNOWN	XG:i:0	XM:i:0	XN:i:0	XO:i:0	AS:i:0	XS:i:0	YT:Z:UU
+SRR065390.4251890	16	CHROMOSOME_I	3	1	100M	*	0	0	CTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	###########@BB=BCBBC?B>B;>B@@ADBBB@DBBBBDCCBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC	RG:Z:UNKNOWN	XG:i:0	XM:i:0	XN:i:0	XO:i:0	AS:i:0	XS:i:0	YT:Z:UU
+SRR065390.5238868	16	CHROMOSOME_I	3	1	100M	*	0	0	CTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	@,=@@D8D;?BBB>;?BBB==BB@D;>D>BBB>BBDDB<DABADCACDCCBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC	RG:Z:UNKNOWN	XG:i:0	XM:i:0	XN:i:0	XO:i:0	AS:i:0	XS:i:0	YT:Z:UU
+SRR065390.6023338	0	CHROMOSOME_I	3	1	100M	*	0	0	CTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAAGCTAC	CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC@CCDDDBCCABB=DABBA?################	RG:Z:UNKNOWN	XG:i:0	XM:i:3	XN:i:0	XO:i:0	AS:i:-6	XS:i:-6	YT:Z:UU
+SRR065390.6815812	16	CHROMOSOME_I	3	1	100M	*	0	0	CTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	###############?@.@?B;B0B=;<DADB@@BDDBBDDBCBCBD@CCDCCCCCCCDCCCCCCCCACCCCCCCCCCBCCCCCCDCCCCCCCCCCCBCC	RG:Z:UNKNOWN	XG:i:0	XM:i:0	XN:i:0	XO:i:0	AS:i:0	XS:i:0	YT:Z:UU
+SRR065390.6905811	16	CHROMOSOME_I	3	1	100M	*	0	0	CTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	#######################BB@>A<BC>@@BCCB@=BACBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC	RG:Z:UNKNOWN	XG:i:0	XM:i:0	XN:i:0	XO:i:0	AS:i:0	XS:i:0	YT:Z:UU
+SRR065390.8289592	16	CHROMOSOME_I	3	1	100M	*	0	0	CTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	###############################A?@C9@@BC=AABDD@A@DC@CB=@BA?6@CCAAC@+CCCCCCCCCCCCCCC@CCCCCCCCCCCCCCCC	RG:Z:UNKNOWN	XG:i:0	XM:i:0	XN:i:0	XO:i:0	AS:i:0	XS:i:0	YT:Z:UU
Binary file test-data/in_test_17.cram has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/in_test_23.sam	Tue Sep 28 16:18:32 2021 +0000
@@ -0,0 +1,6 @@
+@HD	VN:1.4	SO:unsorted
+@SQ	SN:CHROMOSOME_I	LN:100
+@RG	ID:UNKNOWN	SM:UNKNOWN
+@PG	ID:bowtie2	PN:bowtie2	VN:2.0.0-beta5
+@PG	ID:0	CL:aaaaa/aaa/aaaaa/aaaaaa/aaaaaaaaa/aaa/iuc/package_aaaaaaaaa_x_y/aaaaaaaaaaaa/bin/aaaaaaaaaaaaaaaaa aaaaaaaaaa /aaaa/aaaaa/aaa/aaaaaaaaaaaaaaaaaaa/tools/aaaaaaaaa/test-data/test.cram aa /aaaa/aaaaa/aaa/aaaaaaaaaaaaaaaaaaa/tools/aaaaaaaaa/test-data/test.fa -O test	PN:samtools	VN:1.2
+@PG	ID:samtools	PN:samtools	PP:0	VN:1.12	CL:samtools view -@ 0 -h -s .0 -o outfile infile
Binary file test-data/in_test_24.bam has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/in_test_3.sam	Tue Sep 28 16:18:32 2021 +0000
@@ -0,0 +1,10 @@
+HWI-EAS91_1_30788AAXX:1:1:1513:715	16	chrM	9563	25	36M	*	0	0	CTGACTACCACAACTAAACATCTATGCNNAAAAAAC	I+-II?IDIIIIIIIIIIIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
+HWI-EAS91_1_30788AAXX:1:1:1698:516	16	chrM	2735	25	36M	*	0	0	TTTACACTCAGAGGTTCAACTCCTCTCNNTAACAAC	I9IIIII5IIIIIIIIIIIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
+HWI-EAS91_1_30788AAXX:1:1:1491:637	16	chrM	10864	25	36M	*	0	0	TGTAGAAGCCCCAATTGCCGGATCCATNNTGCTAGC	DBAIIIIIIIIIIIFIIIIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
+HWI-EAS91_1_30788AAXX:1:1:1711:249	16	chrM	10617	25	36M	*	0	0	ACCAAACAGAACGCCTGAACGCAGGCCNNTACTTCC	IIIIIIIIIIIIIIIIIIIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
+HWI-EAS91_1_30788AAXX:1:1:1634:211	0	chrM	9350	25	36M	*	0	0	GAAGCAGNNGCTTGATACTGACACTTCGTCGACGTA	IIIIIII""IIIIIIIIIIIIIIIIIIIIII9IIDF	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
+HWI-EAS91_1_30788AAXX:1:1:1218:141	16	chrM	14062	25	36M	*	0	0	ACAAAACTAACAACAAAAATAACACTCNNAATAAAC	I+IIII1IIIIIIIIIIIIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
+HWI-EAS91_1_30788AAXX:1:1:1398:854	16	chrM	3921	25	36M	*	0	0	CACCCTTCCCGTACTAATAAATCCCCTNNTCTTCAC	IIIII=AIIIIIIIIIIIIIIBIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
+HWI-EAS91_1_30788AAXX:1:1:1310:991	16	chrM	10002	25	36M	*	0	0	CTCCTATGCCTAGAAGGAATAATACTANNACTATTC	I:2IEI:IIDIIIIII4IIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
+HWI-EAS91_1_30788AAXX:1:1:1716:413	0	chrM	6040	25	36M	*	0	0	GATCCAANNCTTTATCAACACCTATTCTGATTCTTC	IIIIIII""IIIIIIIIIIIIIIIIIIIIIIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
+HWI-EAS91_1_30788AAXX:1:1:1630:59	16	chrM	12387	25	36M	*	0	0	TCATACTCGACCCCAACCTTACCAACCNNCCGCTCC	FIIHII;IIIIIIIIIIIIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
Binary file test-data/in_test_30.bam has changed
Binary file test-data/in_test_4.cram has changed
Binary file test-data/in_test_5.bam has changed
Binary file test-data/in_test_7.bam has changed
Binary file test-data/input/1.bam has changed
Binary file test-data/input/1_sort.bam has changed
Binary file test-data/input/1_sort_read_names.bam has changed
Binary file test-data/input/bam_to_sam_in1.bam has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/input/bam_to_sam_in1.sam	Tue Sep 28 16:18:32 2021 +0000
@@ -0,0 +1,14 @@
+@HD	VN:1.0	SO:coordinate
+@SQ	SN:chr1	LN:101
+@SQ	SN:chr7	LN:404
+@SQ	SN:chr8	LN:202
+@RG	ID:0	SM:Hi,Mom!
+@PG	ID:1	PN:Hey!	VN:2.0
+both_reads_align_clip_marked	83	chr7	1	255	101M	=	302	201	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
+both_reads_present_only_first_aligns	89	chr7	1	255	101M	*	0	0	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
+read_2_too_many_gaps	83	chr7	1	255	101M	=	302	201	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
+both_reads_align_clip_adapter	147	chr7	16	255	101M	=	21	-96	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
+both_reads_align_clip_adapter	99	chr7	21	255	101M	=	16	96	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
+both_reads_align_clip_marked	163	chr7	302	255	101M	=	1	-201	NCGCGGCATCNCGATTTCTTTCCGCAGCTAACCTCCCGACAGATCGGCAGCGCGTCGTGTAGGTTATTATGGTACATCTTGTCGTGCGGCNAGAGCATACA	&/15445666651/566666553+2/14/&/555512+3/)-'/-&-'*+))*''13+3)'//++''/'))/3+&*5++)&'2+&+/*&-&&*)&-./1'1	RG:Z:0
+read_2_too_many_gaps	163	chr7	302	255	10M1D10M5I76M	=	1	-201	NCGCGGCATCNCGATTTCTTTCCGCAGCTAACCTCCCGACAGATCGGCAGCGCGTCGTGTAGGTTATTATGGTACATCTTGTCGTGCGGCNAGAGCATACA	&/15445666651/566666553+2/14/&/555512+3/)-'/-&-'*+))*''13+3)'//++''/'))/3+&*5++)&'2+&+/*&-&&*)&-./1'1	RG:Z:0
+both_reads_present_only_first_aligns	165	*	0	0	*	chr7	1	0	NCGCGGCATCNCGATTTCTTTCCGCAGCTAACCTCCCGACAGATCGGCAGCGCGTCGTGTAGGTTATTATGGTACATCTTGTCGTGCGGCNAGAGCATACA	&/15445666651/566666553+2/14/&/555512+3/)-'/-&-'*+))*''13+3)'//++''/'))/3+&*5++)&'2+&+/*&-&&*)&-./1'1	RG:Z:0
Binary file test-data/input/bam_to_sam_in2.bam has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/input/bam_to_sam_in2.sam	Tue Sep 28 16:18:32 2021 +0000
@@ -0,0 +1,25 @@
+@HD	VN:1.0	SO:coordinate
+@SQ	SN:chr1	LN:10001
+@SQ	SN:chr2	LN:100001
+@SQ	SN:chr3	LN:10001
+@SQ	SN:chr4	LN:1001
+@RG	ID:rg1	SM:s1
+@RG	ID:rg2	SM:s3
+bar:record:4	77	chr1	1	0	*	*	0	0	AAAAAAAAAAAAA	1111111111111	RG:Z:rg1
+bar:record:6	77	chr1	1	0	*	*	0	0	AAAAAAAAAAAAA	1111111111111	RG:Z:rg2
+bar:record:1	77	chr1	10	0	*	*	0	0	AAAAAAAAAAAAA	1111111111111	RG:Z:rg1
+bar:record:3	77	chr1	10	0	*	*	0	0	AAAAAAAAAAAAA	1111111111111	RG:Z:rg2
+bar:record:1	141	chr1	20	0	*	*	0	0	CCCCCCCCCCCCC	2222222222222	RG:Z:rg1
+bar:record:7	77	chr1	20	0	*	*	0	0	AAAAAAAAAAAAA	1111111111111	RG:Z:rg2
+bar:record:8	77	chr1	30	0	*	*	0	0	AAAAAAAAAAAAA	1111111111111	RG:Z:rg2
+bar:record:4	141	chr1	40	0	*	*	0	0	CCCCCCCCCCCCC	2222222222222	RG:Z:rg1
+bar:record:5	77	chr1	40	0	*	*	0	0	AAAAAAAAAAAAA	1111111111111	RG:Z:rg2
+bar:record:6	141	chr1	50	0	*	*	0	0	CCCCCCCCCCCCC	2222222222222	RG:Z:rg2
+bar:record:2	77	chr2	10	0	*	*	0	0	AAAAAAAAAAAAA	1111111111111	RG:Z:rg1
+bar:record:2	141	chr2	30	0	*	*	0	0	CCCCCCCCCCCCC	2222222222222	RG:Z:rg2
+bar:record:3	141	chr3	20	0	*	*	0	0	CCCCCCCCCCCCC	2222222222222	RG:Z:rg1
+bar:record:8	141	chr3	20	0	*	*	0	0	CCCCCCCCCCCCC	2222222222222	RG:Z:rg1
+bar:record:5	141	chr3	40	0	*	*	0	0	CCCCCCCCCCCCC	2222222222222	RG:Z:rg1
+bar:record:9	77	chr4	10	0	*	*	0	0	AAAAAAAAAAAAA	1111111111111	RG:Z:rg1
+bar:record:7	141	chr4	20	0	*	*	0	0	CCCCCCCCCCCCC	2222222222222	RG:Z:rg1
+bar:record:9	141	chr4	60	0	*	*	0	0	CCCCCCCCCCCCC	2222222222222	RG:Z:rg1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/input/bam_to_sam_out1.sam	Tue Sep 28 16:18:32 2021 +0000
@@ -0,0 +1,14 @@
+@HD	VN:1.0	SO:coordinate
+@SQ	SN:chr1	LN:101
+@SQ	SN:chr7	LN:404
+@SQ	SN:chr8	LN:202
+@RG	ID:0	SM:Hi,Mom!
+@PG	ID:1	PN:Hey!	VN:2.0
+both_reads_align_clip_marked	83	chr7	1	255	101M	=	302	201	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
+both_reads_present_only_first_aligns	89	chr7	1	255	101M	*	0	0	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
+read_2_too_many_gaps	83	chr7	1	255	101M	=	302	201	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
+both_reads_align_clip_adapter	147	chr7	16	255	101M	=	21	-96	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
+both_reads_align_clip_adapter	99	chr7	21	255	101M	=	16	96	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
+both_reads_align_clip_marked	163	chr7	302	255	101M	=	1	-201	NCGCGGCATCNCGATTTCTTTCCGCAGCTAACCTCCCGACAGATCGGCAGCGCGTCGTGTAGGTTATTATGGTACATCTTGTCGTGCGGCNAGAGCATACA	&/15445666651/566666553+2/14/&/555512+3/)-'/-&-'*+))*''13+3)'//++''/'))/3+&*5++)&'2+&+/*&-&&*)&-./1'1	RG:Z:0
+read_2_too_many_gaps	163	chr7	302	255	10M1D10M5I76M	=	1	-201	NCGCGGCATCNCGATTTCTTTCCGCAGCTAACCTCCCGACAGATCGGCAGCGCGTCGTGTAGGTTATTATGGTACATCTTGTCGTGCGGCNAGAGCATACA	&/15445666651/566666553+2/14/&/555512+3/)-'/-&-'*+))*''13+3)'//++''/'))/3+&*5++)&'2+&+/*&-&&*)&-./1'1	RG:Z:0
+both_reads_present_only_first_aligns	165	*	0	0	*	chr7	1	0	NCGCGGCATCNCGATTTCTTTCCGCAGCTAACCTCCCGACAGATCGGCAGCGCGTCGTGTAGGTTATTATGGTACATCTTGTCGTGCGGCNAGAGCATACA	&/15445666651/566666553+2/14/&/555512+3/)-'/-&-'*+))*''13+3)'//++''/'))/3+&*5++)&'2+&+/*&-&&*)&-./1'1	RG:Z:0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/input/bam_to_sam_out2.sam	Tue Sep 28 16:18:32 2021 +0000
@@ -0,0 +1,6 @@
+@HD	VN:1.0	SO:coordinate
+@SQ	SN:chr1	LN:101
+@SQ	SN:chr7	LN:404
+@SQ	SN:chr8	LN:202
+@RG	ID:0	SM:Hi,Mom!
+@PG	ID:1	PN:Hey!	VN:2.0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/input/bam_to_sam_out3.sam	Tue Sep 28 16:18:32 2021 +0000
@@ -0,0 +1,8 @@
+both_reads_align_clip_marked	83	chr7	1	255	101M	=	302	201	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
+both_reads_present_only_first_aligns	89	chr7	1	255	101M	*	0	0	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
+read_2_too_many_gaps	83	chr7	1	255	101M	=	302	201	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
+both_reads_align_clip_adapter	147	chr7	16	255	101M	=	21	-96	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
+both_reads_align_clip_adapter	99	chr7	21	255	101M	=	16	96	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
+both_reads_align_clip_marked	163	chr7	302	255	101M	=	1	-201	NCGCGGCATCNCGATTTCTTTCCGCAGCTAACCTCCCGACAGATCGGCAGCGCGTCGTGTAGGTTATTATGGTACATCTTGTCGTGCGGCNAGAGCATACA	&/15445666651/566666553+2/14/&/555512+3/)-'/-&-'*+))*''13+3)'//++''/'))/3+&*5++)&'2+&+/*&-&&*)&-./1'1	RG:Z:0
+read_2_too_many_gaps	163	chr7	302	255	10M1D10M5I76M	=	1	-201	NCGCGGCATCNCGATTTCTTTCCGCAGCTAACCTCCCGACAGATCGGCAGCGCGTCGTGTAGGTTATTATGGTACATCTTGTCGTGCGGCNAGAGCATACA	&/15445666651/566666553+2/14/&/555512+3/)-'/-&-'*+))*''13+3)'//++''/'))/3+&*5++)&'2+&+/*&-&&*)&-./1'1	RG:Z:0
+both_reads_present_only_first_aligns	165	*	0	0	*	chr7	1	0	NCGCGGCATCNCGATTTCTTTCCGCAGCTAACCTCCCGACAGATCGGCAGCGCGTCGTGTAGGTTATTATGGTACATCTTGTCGTGCGGCNAGAGCATACA	&/15445666651/566666553+2/14/&/555512+3/)-'/-&-'*+))*''13+3)'//++''/'))/3+&*5++)&'2+&+/*&-&&*)&-./1'1	RG:Z:0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/input/chr_m.fasta	Tue Sep 28 16:18:32 2021 +0000
@@ -0,0 +1,335 @@
+>chrM
+GTTAATGTAGCTTAATAATATAAAGCAAGGCACTGAAAATGCCTAGATGA
+GTATTCTTACTCCATAAACACATAGGCTTGGTCCTAGCCTTTTTATTAGT
+TATTAATAGAATTACACATGCAAGTATCCGCACCCCAGTGAGAATGCCCT
+CTAAATCACGTCTCTACGATTAAAAGGAGCAGGTATCAAGCACACTAGAA
+AGTAGCTCATAACACCTTGCTCAGCCACACCCCCACGGGACACAGCAGTG
+ATAAAAATTAAGCTATGAACGAAAGTTCGACTAAGTCATATTAAATAAGG
+GTTGGTAAATTTCGTGCCAGCCACCGCGGTCATACGATTAACCCAAATTA
+ATAAATCTCCGGCGTAAAGCGTGTCAAAGACTAATACCAAAATAAAGTTA
+AAACCCAGTTAAGCCGTAAAAAGCTACAACCAAAGTAAAATAGACTACGA
+AAGTGACTTTAATACCTCTGACTACACGATAGCTAAGACCCAAACTGGGA
+TTAGATACCCCACTATGCTTAGCCCTAAACTAAAATAGCTTACCACAACA
+AAGCTATTCGCCAGAGTACTACTAGCAACAGCCTAAAACTCAAAGGACTT
+GGCGGTGCTTTACATCCCTCTAGAGGAGCCTGTTCCATAATCGATAAACC
+CCGATAAACCCCACCATCCCTTGCTAATTCAGCCTATATACCGCCATCTT
+CAGCAAACCCTAAACAAGGTACCGAAGTAAGCACAAATATCCAACATAAA
+AACGTTAGGTCAAGGTGTAGCCCATGGGATGGAGAGAAATGGGCTACATT
+TTCTACCCTAAGAACAAGAACTTTAACCCGGACGAAAGTCTCCATGAAAC
+TGGAGACTAAAGGAGGATTTAGCAGTAAATTAAGAATAGAGAGCTTAATT
+GAATCAGGCCATGAAGCGCGCACACACCGCCCGTCACCCTCCTTAAATAT
+CACAAATCATAACATAACATAAAACCGTGACCCAAACATATGAAAGGAGA
+CAAGTCGTAACAAGGTAAGTATACCGGAAGGTGTACTTGGATAACCAAAG
+TGTAGCTTAAACAAAGCATCCAGCTTACACCTAGAAGATTTCACTCAAAA
+TGAACACTTTGAACTAAAGCTAGCCCAAACAATACCTAATTCAATTACCC
+TTAGTCACTTAACTAAAACATTCACCAAACCATTAAAGTATAGGAGATAG
+AAATTTTAACTTGGCGCTATAGAGAAAGTACCGTAAGGGAACGATGAAAG
+ATGCATTAAAAGTACTAAACAGCAAAGCTTACCCCTTTTACCTTTTGCAT
+AATGATTTAACTAGAATAAACTTAGCAAAGAGAACTTAAGCTAAGCACCC
+CGAAACCAGACGAGCTACCTATGAACAGTTACAAATGAACCAACTCATCT
+ATGTCGCAAAATAGTGAGAAGATTCGTAGGTAGAGGTGAAAAGCCCAACG
+AGCCTGGTGATAGCTGGTTGTCCAGAAACAGAATTTCAGTTCAAATTTAA
+ATTTACCTAAAAACTACTCAATTCTAATGTAAATTTAAATTATAGTCTAA
+AAAGGTACAGCTTTTTAGATACAGGTTACAACCTTCATTAGAGAGTAAGA
+ACAAGATAAACCCATAGTTGGCTTAAAAGCAGCCATCAATTAAGAAAGCG
+TTCAAGCTCAACGACACATCTATCTTAATCCCAACAATCAACCCAAACTA
+ACTCCTAATCTCATACTGGACTATTCTATCAACACATAGAAGCAATAATG
+TTAATATGAGTAACAAGAATTATTTCTCCTTGCATAAGCTTATATCAGAA
+CGAATACTCACTGATAGTTAACAACAAGATAGGGATAATCCAAAAACTAA
+TCATCTATTTAAACCATTGTTAACCCAACACAGGCATGCATCTATAAGGA
+AAGATTAAAAGAAGTAAAAGGAACTCGGCAAACACAAACCCCGCCTGTTT
+ACCAAAAACATCACCTCTAGCATTTCCAGTATTAGAGGCACTGCCTGCCC
+AGTGACATCTGTTtaaacggccgcggtatcctaaccgtgcaaaggtagca
+taatcacttgttccctaaatagggacttgtatgaatggccacacgagggt
+tttactgtctcttacttccaatcagtgaaattgaccttcccgtgaagagg
+cgggaatgactaaataagacgagaagaccctatggagcttTAATTAACTG
+ATTCACAAAAAACAACACACAAACCTTAACCTTCAGGGACAACAAAACTT
+TTGATTGAATCAGCAATTTCGGTTGGGGTGACCTCGGAGAACAAAACAAC
+CTCCGAGTGATTTAAATCCAGACTAACCAGTCAAAATATATAATCACTTA
+TTGATCCAAACCATTGATCAACGGAACAAGTTACCCTAGGGATAACAGCG
+CAATCCTATTCCAGAGTCCATATCGACAATTAGGGTTTACGACCTCGATG
+TTGGATCAAGACATCCTAATGGTGCAACCGCTATTAAGGGTTCGTTTGTT
+CAACGATTAAAGTCTTACGTGATCTGAGTTCAGACCGGAGTAATCCAGGT
+CGGTTTCTATCTATTCTATACTTTTCCCAGTACGAAAGGACAAGAAAAGT
+AGGGCCCACTTTACAAGAAGCGCCCTCAAACTAATAGATGACATAATCTA
+AATCTAACTAATTTATAACTTCTACCGCCCTAGAACAGGGCTCgttaggg
+tggcagagcccggaaattgcataaaacttaaacctttacactcagaggtt
+caactcctctccctaacaacaTGTTCATAATTAACGTCCTCCTCCTAATT
+GTCCCAATCTTGCTCGCCGTAGCATTCCTCACACTAGTTGAACGAAAAGT
+CTTAGGCTATATGCAACTTCGCAAAGGACCCAACATCGTAGGCCCCTATG
+GCCTACTACAACCTATTGCCGATGCCCTCAAACTATTTATCAAAGAGCCA
+CTACAACCACTAACATCATCGACATCCATATTCATCATCGCACCAATCCT
+AGCCCTAACCCTGGCCTTAACCATATGAATCCCTCTGCCCATACCATACC
+CACTAATCAACATAAACCTAGGAATTCTATTCATACTAGCCATGTCCAGC
+CTAGCTGTCTACTCAATCCTTTGATCAGGATGGGCCTCAAACTCAAAATA
+CGCCCTAATTGGAGCTCTACGAGCAGTAGCACAAACCATCTCATACGAAG
+TAACTCTAGCAATCATCCTACTCTCAGTCCTCCTAATAAGCGGATCATTC
+ACATTATCAACACTTATTATTACCCAAGAATACCTCTGATTAATCTTCCC
+ATCATGACCCTTAGCCATAATGTGATTCATCTCAACATTAGCCGAAACCA
+ACCGAGCTCCATTTGACCTAACAGAAGGAGAATCAGAACTCGTCTCTGGA
+TTCAACGTTGAATACGCAGCCGGCCCATTTGCTCTATTCTTCCTAGCAGA
+ATACGCAAACATCATCATGATAAACATCTTCACAACAACCCTATTTCTAG
+GAGCATTTCACAACCCCTACCTGCCAGAACTCTACTCAATTAATTTCACC
+ATTAAAGCTCTCCTTCTAACATGTTCCTTCCTATGAATCCGAGCATCCTA
+CCCACGATTCCGATATGACCAACTTATACACCTCCTATGAAAGAACTTCC
+TACCACTCACACTAGCCCTCTGCATATGACACGTCTCACTTCCAATCATA
+CTATCCAGCATCCCACCACAAACATAGGAAATATGTCTGACAAAAGAGTT
+ACTTTGATAGAGTAAAACATAGAGGCTCAAACCCTCTTATTTctagaact
+acaggaattgaacctgctcctgagaattcaaaatcctccgtgctaccgaa
+ttacaccatgtcctaCAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCAT
+ACCCCGAAAATGTTGGATTACACCCTTCCCGTACTAATAAATCCCCTTAT
+CTTCACAACTATTCTAATAACAGTTCTTCTAGGAACTATAATCGTTATAA
+TAAGCTCACACTGACTAATAATCTGAATCGGATTTGAAATAAATCTACTA
+GCCATTATCCCTATCCTAATAAAAAAGTACAATCCCCGAACCATAGAAGC
+CTCCACCAAATATTTTCTAACCCAAGCCACCGCATCAATACTCCTCATAA
+TAGCGATCATCATTAACCTCATACACTCAGGCCAATGAACAATCACAAAA
+GTCTTCAACCCCACAGCGTCCATCATTATAACTTCAGCTCTCGCCATAAA
+ACTTGGACTCACACCATTCCACTTCTGAGTACCCGAAGTCACACAGGGCA
+TCTCATTAACATCAGGTCTCATCCTACTTACATGACAAAAACTAGCCCCA
+ATATCAATCCTATATCAAATCTCACCCTCAATTAACCTAAATATCTTATT
+AACTATAGCCGTACTGTCAATCCTAGTAGGAGGCTGAGGCGGTCTCAACC
+AAACCCAACTACGAAAAATCATAGCATACTCGTCAATCGCGCATATAGGA
+TGAATAACAGCTGTCCTAGTATATAACCCAACACTAACAATACTAAACAT
+ATTAATTTACATTATAATAACACTCACAATATTCATACTATTTATCCACA
+GCTCCTCTACTACAACACTATCACTCTCCCACACATGAAACAAAATACCT
+CTAACCACTACACTAATCTTAATTACCTTACTATCCATAGGAGGCCTCCC
+CCCACTATCAGGATTCATACCCAAATGAATAATCATTCAAGAGCTCACCA
+AAAATAGCAGCATCATCCTCCCCACACTAATAGCCATTATAGCACTACTC
+AACCTCTACTTCTACATACGACTAACCTATTCCACCTCACTGACCATATT
+CCCATCCACAAACAACATAAAAATAAAATGACAATTCGAAACCAAACGAA
+TTACTCTCTTACCCCCGTTAATTGTTATATCCTCCCTACTCCTCCCCCTA
+ACCCCCATACTATCAATTTTGGACTAGGAATTTAGGTTAACATCCCAGAC
+CAAGAGCCTTCAAAGCTCTAAGCAAGTGAATCCACTTAATTCCTGCATAC
+TAAGGACTGCGAGACTCTATCTCACATCAATTGAACGCAAATCAAACTCT
+TTTATTAAGCTAAGCCCTTACTAGATTGGTGGGCTACCATCCCACGAAAT
+TTTAGTTAACAGCTAAATACCCTAATCAACTGGCTTCAATCTACTTCTCC
+CGCCGCCTAGAAAAAAAGGCGGGAGAAGCCCCGGCAGAAATTGAAGCTGC
+TCCTTTGAATTTGCAATTCAATGTGAAAATTCACCACGGGACTTGATAAG
+AAGAGGATTCCAACCCCTGTCTTTAGATTTACAGTCTAATGCTTACTCAG
+CCATCTTACCTATGTTCATCAACCGCTGACTATTTTCAACTAACCACAAA
+GACATCGGCACTCTGTACCTCCTATTCGGCGCTTGAGCTGGAATAGTAGG
+AACTGCCCTAAGCCTCCTAATCCGTGCTGAATTAGGCCAACCTGGGACCC
+TACTAGGAGATGATCAGATCTACAATGTCATTGTAACCGCCCATGCATTC
+GTAATAATTTTCTTTATGGTCATACCCATTATAATCGGAGGATTCGGAAA
+CTGATTAGTCCCCCTGATAATTGGAGCACCTGATATAGCTTTCCCCCGAA
+TAAACAACATAAGCTTCTGATTACTTCCCCCATCATTCCTACTTCTTCTC
+GCTTCCTCAATAATTGAAGCAGGTGCCGGAACAGGCTGAACCGTATATCC
+TCCTCTAGCTGGAAATCTGGCGCATGCAGGAGCCTCTGTTGACTTAACCA
+TTTTCTCTCTCCACCTAGCTGGGGTGTCCTCGATTTTAGGTGCCATCAAC
+TTTATTACCACAATCATTAACATAAAACCACCAGCCCTATCCCAATATCA
+AACCCCCCTATTCGTTTGATCTGTCCTTATTACGGCAGTACTCCTTCTCC
+TAGCCCTCCCGGTCCTAGCAGCAGGCATTACCATGCTTCTCACAGACCGT
+AACCTGAACACTACTTTCTTCGACCCCGCAGGAGGAGGGGATCCAATCCT
+TTATCAACACCTATTCTGATTCTTCGGACACCCCGAAGTCTATATTCTTA
+TCCTACCAGGCTTCGGTATAATCTCACACATCGTCACATACTACTCAGGT
+AAAAAGGAACCTTTTGGCTACATGGGTATAGTGTGAGCTATAATATCCAT
+TGGCTTTCTAGGCTTCATCGTATGGGCTCACCACATGTTTACAGTAGGGA
+TAGACGTTGACACACGAGCATACTTCACATCAGCTACCATAATCATCGCT
+ATCCCTACTGGTGTAAAAGTATTCAGCTGACTAGCCACCCTGCACGGAGG
+AAATATCAAATGATCTCCAGCTATACTCTGAGCTCTAGGCTTCATCTTCT
+TATTCACAGTAGGAGGTCTAACAGGAATCGTCCTAGCTAACTCATCCCTA
+GATATTGTTCTCCACGATACTTATTATGTAGTAGCACATTTCCATTATGT
+CCTGTCTATAGGAGCAGTCTTCGCCATTATGGGGGGATTTGTACACTGAT
+TCCCTCTATTCTCAGGATACACACTCAACCAAACCTGAGCAAAAATCCAC
+TTTACAATTATATTCGTAGGGGTAAATATAACCTTCTTCCCACAACATTT
+CCTTGGCCTCTCAGGAATGCCACGACGCTATTCTGATTATCCAGACGCAT
+ATACAACATGAAATACCATCTCATCCATAGGATCTTTTATCTCACTTACA
+GCAGTGATACTAATAATTTTCATAATTTGAGAAGCGTTCGCATCCAAACG
+AGAAGTGTCTACAGTAGAATTAACCTCAACTAATCTGGAATGACTACACG
+GATGCCCCCCACCATACCACACATTTGAAGAACCCACCTACGTAAACCTA
+AAAtaagaaaggaaggaatcgaaccccctctaactggtttcaagccaata
+tcataaccactatgtctttctcCATCAATTGAGGTATTAGTAAAAATTAC
+ATGACTTTGTCAAAGTTAAATTATAGGTTAAACCCCTATATACCTCTATG
+GCCTACCCCTTCCAACTAGGATTCCAAGACGCAACATCCCCTATTATAGA
+AGAACTCCTACACTTCCACGACCACACACTAATAATCGTATTCCTAATTA
+GCTCTCTAGTATTATATATTATCTCATCAATACTAACAACTAAATTAACC
+CATACCAGCACCATAGATGCTCAAGAAGTAGAGACAATTTGAACGATTTT
+ACCAGCCATCATCCTTATTCTAATCGCCCTCCCATCCCTACGAATTCTAT
+ATATAATAGATGAAATCAATAATCCGTCCCTCACAGTCAAAACAATAGGC
+CACCAATGATACTGAAGCTACGAGTATACCGATTACGAAGACTTGACCTT
+TGACTCCTACATGATCCCCACATCAGACCTAAAACCAGGAGAATTACGTC
+TTCTAGAAGTCGACAATCGAGTGGTTCTCCCCATAGAAATAACCATCCGA
+ATGCTAATTTCATCCGAAGACGTCCTACACTCATGAGCTGTGCCCTCCCT
+AGGCCTAAAAACAGACGCTATCCCTGGGCGCCTAAATCAGACAACTCTCG
+TGGCCTCTCGACCAGGACTTTACTACGGTCAATGCTCAGAGATCTGCGGA
+TCAAACCACAGCTTTATACCAATTGTCCTTGAACTAGTTCCACTGAAACA
+CTTCGAAGAATGATCTGCATCAATATTATAAAGTCACTAAGAAGCTATTA
+TAGCATTAACCTTTTAAGTTAAAGATTGAGGGTTCAACCCCCTCCCTAGT
+GATATGCCACAGTTGGATACATCAACATGATTTATTAATATCGTCTCAAT
+AATCCTAACTCTATTTATTGTATTTCAACTAAAAATCTCAAAGCACTCCT
+ATCCGACACACCCAGAAGTAAAGACAACCAAAATAACAAAACACTCTGCC
+CCTTGAGAATCAAAATGAACGAAAATCTATTCGCCTCTTTCGCTACCCCA
+ACAATAGTAGGCCTCCCTATTGTAATTCTGATCATCATATTTCCCAGCAT
+CCTATTCCCCTCACCCAACCGACTAATCAACAATCGCCTAATCTCAATTC
+AACAATGGCTAGTCCAACTTACATCAAAACAAATAATAGCTATCCATAAC
+AGCAAAGGACAAACCTGAACTCTTATACTCATATCACTGATCCTATTCAT
+TGGCTCAACAAACTTATTAGGCCTACTACCTCACTCATTTACACCAACAA
+CACAACTATCAATAAACCTAGGCATAGCTATTCCCCTATGGGCAGGGACA
+GTATTCATAGGCTTTCGTCACAAAACAAAAGCAGCCCTAGCCCACTTTCT
+ACCTCAAGGGACGCCCATTTTCCTCATCCCCATACTAGTAATTATCGAGA
+CTATCAGCCTATTTATTCAACCTGTAGCCCTAGCCGTGCGGCTAACCGCT
+AACATTACCGCCGGACACCTCCTAATACACCTCATCGGAGGGGCAACACT
+AGCCCTCATAAGCATCAGCCCCTCAACAGCCCTTATTACGTTTATCATCC
+TAATTCTACTAACTATCCTCGAATTCGCAGTAGCTATAATCCAAGCCTAC
+GTATTCACTCTCCTGGTAAGCCTTTACTTACACGACAACACCTAATGACC
+CACCAAACCCACGCTTACCACATAGTAAACCCCAGCCCATGACCACTTAC
+AGGAGCCCTATCAGCCCTCCTGATAACATCAGGACTAGCCATGTGATTTC
+ACTTTAACTCAACCTTACTTCTAGCTATAGGGCTATTAACTAACATCCTT
+ACCATATATCAATGATGACGAGACATCATCCGAGAAAGCACATTCCAAGG
+CCATCACACATCAATCGTTCAAAAGGGACTCCGATATGGCATAATCCTTT
+TTATTATCTCAGAAGTCTTCTTCTTCTCTGGCTTCTTCTGAGCCTTTTAC
+CACTCAAGCCTAGCCCCCACACCCGAACTAGGCGGCTGCTGACCACCCAC
+AGGTATCCACCCCTTAAACCCCCTAGAAGTCCCCTTACTCAACACCTCAG
+TGCTCCTAGCATCTGGAGTCTCTATCACCTGAGCCCACCATAGCCTAATA
+GAAGGAAACCGTAAAAATATGCTCCAAGGCCTATTCATCACAATTTCACT
+AGGCGTATACTTCACCCTTCTCCAAGCCTCAGAATACTATGAAGCCTCAT
+TTACTATTTCAGATGGAGTATACGGATCAACATTTTTCGTAGCAACAGGG
+TTCCACGGACTACACGTAATTATCGGATCTACCTTCCTCATTGTATGTTT
+CCTACGCCAACTAAAATTCCACTTTACATCCAGCCACCACTTCGGATTCG
+AAGCAGCCGCTTGATACTGACACTTCGTCGACGTAGTCTGACTATTCTTG
+TACGTCTCTATTTATTGATGAGGATCCTATTCTTTTAGTATTGACCAGTA
+CAATTGACTTCCAATCAATCAGCTTCGGTATAACCCGAAAAAGAATAATA
+AACCTCATACTGACACTCCTCACTAACACATTACTAGCCTCGCTACTCGT
+ACTCATCGCATTCTGACTACCACAACTAAACATCTATGCAGAAAAAACCA
+GCCCATATGAATGCGGATTTGACCCTATAGGGTCAGCACGCCTCCCCTTC
+TCAATAAAATTTTTCTTAGTGGCCATTACATTTCTGCTATTCGACTTAGA
+AATTGCCCTCCTATTACCCCTTCCATGAGCATCCCAAACAACTAACCTAA
+ACACTATACTTATCATAGCACTAGTCCTAATCTCTCTTCTAGCCATCAGC
+CTAGCCTACGAATGAACCCAAAAAGGACTAGAATGAACTGAGTATGGTAA
+TTAGTTTAAACCAAAACAAATGATTTCGACTCATTAAACTATGATTAACT
+TCATAATTACCAACATGTCACTAGTCCATATTAATATCTTCCTAGCATTC
+ACAGTATCCCTCGTAGGCCTACTAATGTACCGATCCCACCTAATATCCTC
+ACTCCTATGCCTAGAAGGAATAATACTATCACTATTCGTCATAGCAACCA
+TAATAGTCCTAAACACCCACTTCACACTAGCTAGTATAATACCTATCATC
+TTACTAGTATTTGCTGCCTGCGAACGAGCTCTAGGATTATCCCTACTAGT
+CATAGTCTCCAATACTTATGGAGTAGACCACGTACAAAACCTTAACCTCC
+TCCAATGCTAAAAATTATCATTCCCACAATCATACTTATGCCCCTTACAT
+GACTATCAAAAAAGAATATAATCTGAATCAACACTACAACCTATAGTCTA
+TTAATCAGCCTTATCAGCCTATCCCTCCTAAACCAACCTAGCAACAATAG
+CCTAAACTTCTCACTAATATTCTTCTCCGATCCCCTATCAGCCCCACTTC
+TGGTGTTGACAACATGACTACTGCCACTAATACTCATAGCCAGCCAACAC
+CATCTATCTAAGGAACCACTAATCCGAAAAAAACTCTACATCACCATGCT
+AACCATACTTCAAACTTTCCTAATCATGACTTTTACCGCCACAGAACTAA
+TCTCCTTCTACATCCTATTTGAAGCCACATTAGTTCCAACACTAATTATC
+ATCACCCGCTGAGGCAACCAAACAGAACGCCTGAACGCAGGCCTCTACTT
+CCTATTCTACACACTAATAGGTTCCCTCCCACTCTTAGTTGCACTAATCT
+CTATCCAAAACCTAACAGGCTCACTAAACTTCCTATTAATTCAATACTGA
+AACCAAGCACTACCCGACTCTTGATCCAATATTTTCCTATGACTAGCATG
+TATAATAGCATTCATAGTCAAAATACCGGTATATGGTCTTCACCTCTGAC
+TCCCAAAAGCCCATGTAGAAGCCCCAATTGCCGGATCCATAGTGCTAGCA
+GCCATTCTACTAAAACTAGGAGGCTACGGAATACTACGAATTACAACAAT
+ACTAAACCCCCAAACTAGCTTTATAGCCTACCCCTTCCTCATACTATCCC
+TGTGAGGAATAATCATAACTAGTTCCATCTGCTTGCGACAAACCGATCTA
+AAATCACTTATTGCATACTCCTCTGTCAGCCACATAGCCCTAGTAATCGT
+AGCCGTCCTCATCCAAACACCATGAAGTTATATAGGAGCTACAGCCCTAA
+TAATCGCTCACGGCCTTACATCATCAATACTATTCTGCCTGGCAAACTCA
+AATTACGAACGTACCCATAGCCGAACTATAATCCTAGCCCGCGGGCTTCA
+AACACTTCTTCCCCTTATAGCAGCCTGATGACTATTAGCCAGCCTAACCA
+ACCTGGCCCTCCCTCCCAGCATTAACCTAATTGGAGAGCTATTCGTAGTA
+ATATCATCATTCTCATGATCAAATATTACCATTATCCTAATAGGAGCCAA
+TATCACCATCACCGCCCTCTACTCCCTATACATACTAATCACAACACAAC
+GAGGGAAATACACACACCATATCAACAGCATTAAACCTTCATTTACACGA
+GAAAACGCACTCATGGCCCTCCACATGACTCCCCTACTACTCCTATCACT
+TAACCCTAAAATTATCCTAGGCTTTACGTACTGTAAATATAGTTTAACAA
+AAACACTAGATTGTGGATCTAGAAACAGAAACTTAATATTTCTTATTTAC
+CGAGAAAGTATGCAAGAACTGCTAATTCATGCCCCCATGTCCAACAAACA
+TGGCTCTCTCAAACTTTTAAAGGATAGGAGCTATCCGTTGGTCTTAGGAA
+CCAAAAAATTGGTGCAACTCCAAATAAAAGTAATCAACATGTTCTCCTCC
+CTCATACTAGTTTCACTATTAGTACTAACCCTCCCAATCATATTATCAAT
+CTTCAATACCTACAAAAACAGCACGTTCCCGCATCATGTAAAAAACACTA
+TCTCATATGCCTTCATTACTAGCCTAATTCCCACTATAATATTTATTCAC
+TCTGGACAAGAAACAATTATCTCAAACTGACACTGAATAACCATACAAAC
+CCTCAAACTATCCCTAAGCTTCAAACTAGATTACTTCTCAATAATTTTCG
+TACCAGTAGCCCTATTCGTAACATGATCTATTATGGAATTCTCCCTATGA
+TACATGCACTCAGATCCTTACATTACTCGATTTTTTAAATACTTACTTAC
+ATTCCTCATCACTATAATAATTCTAGTCACAGCTAACAACCTTTTCCAAC
+TGTTCATCGGATGGGAGGGAGTAGGCATCATGTCATTCTTACTAATCGGA
+TGATGATACGGCCGAACAGATGCCAACACCGCGGCCCTTCAAGCAATCCT
+TTATAACCGCATCGGGGATATCGGCTTCATCATGGCCATAGCCTGATTCC
+TATTCAACACCAACACATGAGACCTCCAACAAATCTTCATACTCGACCCC
+AACCTTACCAACCTCCCGCTCCTAGGCCTCCTCCTAGCCGCAACTGGCAA
+ATCCGCTCAATTTGGACTCCACCCATGACTTCCTTCAGCCATAGAGGGCC
+CTACACCAGTCTCAGCCCTACTCCACTCCAGCACAATAGTTGTAGCAGGC
+GTCTTCCTGCTAATCCGCTTCCATCCACTAATAGAAAACAACAAAACAAT
+CCAGTCACTTACCCTATGCCTAGGAGCCATCACCACACTATTCACAGCAA
+TCTGCGCACTCACTCAAAACGATATCAAAAAAATCATTGCTTTCTCCACC
+TCCAGCCAACTAGGCCTGATAATCGTAACCATCGGTATCAATCAACCCTA
+CCTAGCATTCCTCCACATTTGCACTCACGCATTCTTCAAAGCTATACTAT
+TTATATGTTCCGGATCCATTATCCACAGCCTAAATGACGAGCAAGATATC
+CGAAAAATAGGCGGACTATTTAATGCAATACCCTTCACCACCACATCTCT
+AATTATTGGCAGCCTTGCACTCACCGGAATTCCTTTCCTCACAGGCTTCT
+ACTCCAAAGACCTCATCATCGAAACCGCCAACACATCGTACACCAACGCC
+TGAGCCCTACTAATAACTCTCATTGCCACATCCCTCACAGCTGTCTACAG
+TACCCGAATCATCTTCTTTGCACTCCTAGGGCAACCCCGCTTCCTCCCTC
+TGACCTCAATCAACGAAAATAACCCCTTTCTAATTAACTCCATCAAACGC
+CTCTTAATTGGCAGCATTTTTGCCGGATTCTTCATCTCCAACAATATCTA
+CCCCACAACCGTCCCAGAAATAACCATACCTACTTACATAAAACTCACCG
+CCCTCGCAGTAACCATCCTAGGATTTACACTAGCCCTAGAACTAAGCTTG
+ATAACCCATAACTTAAAACTAGAACACTCCACCAACGTATTCAAATTCTC
+CAACCTCCTAGGATACTACCCAACAATTATACACCGACTCCCACCGCTCG
+CTAACCTATCAATAAGCCAAAAATCAGCATCACTTCTACTAGACTCAATC
+TGACTAGAAAACATCCTGCCAAAATCTATCTCCCAGTTCCAAATAAAAAC
+CTCGATCCTAATTTCCACCCAAAAAGGACAAATCAAATTATATTTCCTCT
+CATTCCTCATCACCCTTACCCTAAGCATACTACTTTTTAATCTCCACGAG
+TAACCTCTAAAATTACCAAGACCCCAACAAGCAACGATCAACCAGTCACA
+ATCACAACCCAAGCCCCATAACTATACAATGCAGCAGCCCCTATAATTTC
+CTCACTAAACGCCCCAGAATCTCCAGTATCATAAATAGCTCAAGCCCCCA
+CACCACTAAACTTAAACACTACCCCCACTTCCTCACTCTTCAGAACATAT
+AAAACCAACATAACCTCCATCAACAACCCTAAAAGAAATACCCCCATAAC
+AGTCGTATTAGACACCCATACCTCAGGATACTGCTCAGTAGCCATAGCCG
+TTGTATAACCAAAAACAACCAACATTCCTCCCAAATAAATCAAAAACACC
+ATCAACCCCAAAAAGGACCCTCCAAAATTCATAATAATACCACAACCTAC
+CCCTCCACTTACAATCAGCACTAAACCCCCATAAATAGGTGAAGGTTTTG
+AAGAAAACCCCACAAAACTAACAACAAAAATAACACTCAAAATAAACACA
+ATATATGTCATCATTATTCCCACGTGGAATCTAACCACGACCAATGACAT
+GAAAAATCATCGTTGTATTTCAACTATAAGAACACCAATGACAAACATCC
+GGAAATCTCACCCACTAATTAAAATCATCAATCACTCTTTTATTGACCTA
+CCAGCCCCCTCAAACATTTCATCATGATGAAACTTCGGCTCCCTCCTAGG
+AATCTGCCTAATCCTCCAAATCTTAACAGGCCTATTCCTAGCCATACACT
+ACACATCAGACACGACAACTGCCTTCTCATCCGTCACTCACATCTGCCGA
+GACGTTAACTACGGATGAATTATTCGCTACCTCCATGCCAACGGAGCATC
+AATATTTTTTATCTGCCTCTTCATTCACGTAGGACGCGGCCTCTACTACG
+GCTCTTACACATTCCTAGAGACATGAAACATTGGAATCATCCTACTTTTC
+ACAGTTATAGCTACAGCATTCATGGGCTATGTCCTACCATGAGGCCAAAT
+ATCCTTTTGAGGAGCAACAGTCATCACGAACCTCCTATCAGCAATTCCCT
+ACATCGGTACTACCCTCGTCGAGTGAATCTGAGGTGGATTCTCAGTAGAC
+AAAGCCACCCTTACCCGATTTTTTGCTTTCCACTTCATCCTACCCTTCAT
+CATCACAGCCCTGGTAGTCGTACATTTACTATTTCTTCACGAAACAGGAT
+CTAATAACCCCTCAGGAATCCCATCCGATATGGACAAAATCCCATTCCAC
+CCATATTATACAATTAAAGACATCCTAGGACTCCTCCTCCTGATCTTGCT
+CCTACTAACTCTAGTATTATTCTCCCCCGACCTCCTAGGAGACCCAGACA
+ACTACACCCCAGCTAACCCTCTCAGCACTCCCCCTCATATTAAACCAGAA
+TGGTACTTCCTGTTTGCCTACGCCATCCTACGCTCCATTCCCAACAAACT
+AGGCGGCGTATTAGCCCTAATCCTCTCCATCCTGATCCTAGCACTCATCC
+CCACCCTCCACATATCAAAACAACGAAGCATAATATTCCGGCCTCTCAGC
+CAATGCGTATTCTGACTCTTAGTGGCAGACTTACTGACACTAACATGAAT
+CGGCGGACAGCCAGTGGAACACCCATACGTAATTATCGGCCAACTGGCCT
+CAATCCTCTACTTCTCCCTAATTCTCATTTTTATACCACTCGCAAGCACC
+ATCGAAAACAATCTTCTAAAATGAAGAGTCCCTGTAGTATATCGCACATT
+ACCCTGGTCTTGTAAACCAGAAAAGGGGGAAAACGTTTCCTCCCAAGGAC
+TATCAAGGAAGAAGCTCTAGCTCCACCATCAACACCCAAAGCTGAAATTC
+TACTTAAACTATTCCTTGATTTCTTCCCCTAAACGACAACAATTTACCCT
+CATGTGCTATGTCAGTATCAGATTATACCCCCACATAACACCATACCCAC
+CTGACATGCAATATCTTATGAATGGCCTATGTACGTCGTGCATTAAATTG
+TCTGCCCCATGAATAATAAGCATGTACATAATATCATTTATCTTACATAA
+GTACATTATATTATTGATCGTGCATACCCCATCCAAGTCAAATCATTTCC
+AGTCAACACGCATATCACAGCCCATGTTCCACGAGCTTAATCACCAAGCC
+GCGGGAAATCAGCAACCCTCCCAACTACGTGTCCCAATCCTCGCTCCGGG
+CCCATCCAAACGTGGGGGTTTCTACAATGAAACTATACCTGGCATCTGGT
+TCTTTCTTCAGGGCCATTCCCACCCAACCTCGCCCATTCTTTCCCCTTAA
+ATAAGACATCTCGATGGACTAATGACTAATCAGCCCATGCTCACACATAA
+CTGTGATTTCATGCATTTGGTATCTTTTTATATTTGGGGATGCTATGACT
+CAGCTATGGCCGTCAAAGGCCTCGACGCAGTCAATTAAATTGAAGCTGGA
+CTTAAATTGAACGTTATTCCTCCGCATCAGCAACCATAAGGTGTTATTCA
+GTCCATGGTAGCGGGACATAGGAAACAAgtgcacctgtgcacctgtgcac
+ctgtgcacctgtgcacctgtgcacctgtgcacctgtgcacctgtgcacct
+gtgcacctgtgcacctgtgcacctgtgcacctgtgcacctgtgcacctgt
+gcacctgtgcacctgtgcacctgtgcacctgtgcacctgtgcacctgtgc
+acctgtgcacctgtgcacctgtgcacctgtgcacctgtgcacctgtgcac
+ctgtgcacctACCCGCGCAGTAAGCAAGTAATATAGCTTTCTTAATCAAA
+CCCCCCCTACCCCCCATTAAACTCCACATATGTACATTCAACACAATCTT
+GCCAAACCCCAAAAACAAGACTAAACAATGCACAATACTTCATGAAGCTT
+AACCCTCGCATGCCAACCATAATAACTCAACACACCTAACAATCTTAACA
+GAACTTTCCCCCCGCCATTAATACCAACATGCTACTTTAATCAATAAAAT
+TTCCATAGACAGGCATCCCCCTAGATCTAATTTTCTAAATCTGTCAACCC
+TTCTTCCCCC
Binary file test-data/input/cram_to_bam_out.bam has changed
Binary file test-data/input/no_reads.bam has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/input/no_reads.sam	Tue Sep 28 16:18:32 2021 +0000
@@ -0,0 +1,5 @@
+@HD	VN:1.4	SO:unsorted
+@SQ	SN:CHROMOSOME_I	LN:100
+@RG	ID:UNKNOWN	SM:UNKNOWN
+@PG	ID:bowtie2	PN:bowtie2	VN:2.0.0-beta5
+@PG	ID:0	CL:aaaaa/aaa/aaaaa/aaaaaa/aaaaaaaaa/aaa/iuc/package_aaaaaaaaa_x_y/aaaaaaaaaaaa/bin/aaaaaaaaaaaaaaaaa aaaaaaaaaa /aaaa/aaaaa/aaa/aaaaaaaaaaaaaaaaaaa/tools/aaaaaaaaa/test-data/test.cram aa /aaaa/aaaaa/aaa/aaaaaaaaaaaaaaaaaaa/tools/aaaaaaaaa/test-data/test.fa -O test	PN:samtools	VN:1.2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/input/sam_to_bam_noheader_in2.sam	Tue Sep 28 16:18:32 2021 +0000
@@ -0,0 +1,10 @@
+HWI-EAS91_1_30788AAXX:1:1:1513:715	16	chrM	9563	25	36M	*	0	0	CTGACTACCACAACTAAACATCTATGCNNAAAAAAC	I+-II?IDIIIIIIIIIIIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
+HWI-EAS91_1_30788AAXX:1:1:1698:516	16	chrM	2735	25	36M	*	0	0	TTTACACTCAGAGGTTCAACTCCTCTCNNTAACAAC	I9IIIII5IIIIIIIIIIIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
+HWI-EAS91_1_30788AAXX:1:1:1491:637	16	chrM	10864	25	36M	*	0	0	TGTAGAAGCCCCAATTGCCGGATCCATNNTGCTAGC	DBAIIIIIIIIIIIFIIIIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
+HWI-EAS91_1_30788AAXX:1:1:1711:249	16	chrM	10617	25	36M	*	0	0	ACCAAACAGAACGCCTGAACGCAGGCCNNTACTTCC	IIIIIIIIIIIIIIIIIIIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
+HWI-EAS91_1_30788AAXX:1:1:1634:211	0	chrM	9350	25	36M	*	0	0	GAAGCAGNNGCTTGATACTGACACTTCGTCGACGTA	IIIIIII""IIIIIIIIIIIIIIIIIIIIII9IIDF	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
+HWI-EAS91_1_30788AAXX:1:1:1218:141	16	chrM	14062	25	36M	*	0	0	ACAAAACTAACAACAAAAATAACACTCNNAATAAAC	I+IIII1IIIIIIIIIIIIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
+HWI-EAS91_1_30788AAXX:1:1:1398:854	16	chrM	3921	25	36M	*	0	0	CACCCTTCCCGTACTAATAAATCCCCTNNTCTTCAC	IIIII=AIIIIIIIIIIIIIIBIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
+HWI-EAS91_1_30788AAXX:1:1:1310:991	16	chrM	10002	25	36M	*	0	0	CTCCTATGCCTAGAAGGAATAATACTANNACTATTC	I:2IEI:IIDIIIIII4IIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
+HWI-EAS91_1_30788AAXX:1:1:1716:413	0	chrM	6040	25	36M	*	0	0	GATCCAANNCTTTATCAACACCTATTCTGATTCTTC	IIIIIII""IIIIIIIIIIIIIIIIIIIIIIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
+HWI-EAS91_1_30788AAXX:1:1:1630:59	16	chrM	12387	25	36M	*	0	0	TCATACTCGACCCCAACCTTACCAACCNNCCGCTCC	FIIHII;IIIIIIIIIIIIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
Binary file test-data/input/sam_to_bam_out1.bam has changed
Binary file test-data/input/sam_to_bam_out2.bam has changed
Binary file test-data/input/sam_to_bam_out3.bam has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/input/tag.as.sort.expected.sam	Tue Sep 28 16:18:32 2021 +0000
@@ -0,0 +1,24 @@
+@HD	VN:1.4	SO:unknown
+@SQ	SN:insert	LN:599
+@SQ	SN:ref1	LN:45
+@SQ	SN:ref2	LN:40
+@SQ	SN:ref3	LN:4
+@PG	ID:llama
+@RG	ID:fish	PG:llama
+@RG	ID:cow	PU:13_&^&&*(:332	PG:donkey
+@RG	PU:*9u8jkjjkjd:	ID:colt
+@PG	ID:bull	PP:donkey
+@PG	ID:donkey
+@CO	Do you know?
+r006	16	ref1	29	30	6H5M	*	0	0	TAGGC	*	RG:Z:colt	PG:Z:donkey	FI:i:3
+x11	0	ref2	12	30	24M	*	0	0	AATAATTAAGTCTACAGAGCAACT	????????????????????????	RG:Z:cow	PG:Z:bull	FI:Z:a
+r007	0	ref1	16	30	6M14N1I5M	*	0	0	ATAGCTCTCAGC	*	RG:Z:colt	PG:Z:donkey	AS:i:-5	FI:f:3.5
+x10	0	ref2	10	30	25M	*	0	0	CAAATAATTAAGTCTACAGAGCAAC	?????????????????????????	RG:Z:cow	PG:Z:bull	AS:i:0	FI:A:b
+r007	0	ref1	9	30	5H6M	*	0	0	AGCTAA	*	RG:Z:colt	PG:Z:donkey	AS:i:1	FI:i:4
+r005	163	ref1	7	30	8M4I4M1D3M	=	37	39	TTAGATAAAGAGGATACTG	*	XX:B:S,12561,2,20,112	YY:i:100	RG:Z:colt	PG:Z:donkey	AS:i:10	FI:i:5
+x8	0	ref2	2	30	21M	*	0	0	GGTTTTATAAAACAAATAATT	?????????????????????	RG:Z:cow	PG:Z:bull	AS:i:10	FI:f:1.5
+r006	0	ref1	9	30	1S2I6M1P1I1P1I4M2I	*	0	0	AAAAGATAAGGGATAAA	*	XA:Z:abc	XB:i:-10	RG:Z:colt	PG:Z:donkey	AS:i:20	FI:f:4.5
+x9	0	ref2	6	30	9M4I13M	*	0	0	TTATAAAACAAATAATTAAGTCTACA	??????????????????????????	RG:Z:cow	PG:Z:bull	AS:i:20	FI:i:1
+x7	0	ref2	1	30	20M	*	0	0	AGGTTTTATAAAACAAATAA	*	RG:Z:cow	PG:Z:bull	AS:i:50	FI:i:2
+r005	83	ref1	37	30	9M	=	7	-39	CAGCGCCAT	*	RG:Z:colt	PG:Z:donkey	AS:i:100	FI:f:2.5
+x12	0	ref2	14	30	23M	*	0	0	TAATTAAGTCTACAGAGCAACTA	???????????????????????	RG:Z:cow	PG:Z:bull	AS:i:65100
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/input/tag.fi.sort.expected.sam	Tue Sep 28 16:18:32 2021 +0000
@@ -0,0 +1,24 @@
+@HD	VN:1.4	SO:unknown
+@SQ	SN:insert	LN:599
+@SQ	SN:ref1	LN:45
+@SQ	SN:ref2	LN:40
+@SQ	SN:ref3	LN:4
+@PG	ID:llama
+@RG	ID:fish	PG:llama
+@RG	ID:cow	PU:13_&^&&*(:332	PG:donkey
+@RG	PU:*9u8jkjjkjd:	ID:colt
+@PG	ID:bull	PP:donkey
+@PG	ID:donkey
+@CO	Do you know?
+x12	0	ref2	14	30	23M	*	0	0	TAATTAAGTCTACAGAGCAACTA	???????????????????????	RG:Z:cow	PG:Z:bull	AS:i:65100
+x10	0	ref2	10	30	25M	*	0	0	CAAATAATTAAGTCTACAGAGCAAC	?????????????????????????	RG:Z:cow	PG:Z:bull	AS:i:0	FI:A:b
+x11	0	ref2	12	30	24M	*	0	0	AATAATTAAGTCTACAGAGCAACT	????????????????????????	RG:Z:cow	PG:Z:bull	FI:Z:a
+x9	0	ref2	6	30	9M4I13M	*	0	0	TTATAAAACAAATAATTAAGTCTACA	??????????????????????????	RG:Z:cow	PG:Z:bull	AS:i:20	FI:i:1
+x8	0	ref2	2	30	21M	*	0	0	GGTTTTATAAAACAAATAATT	?????????????????????	RG:Z:cow	PG:Z:bull	AS:i:10	FI:f:1.5
+x7	0	ref2	1	30	20M	*	0	0	AGGTTTTATAAAACAAATAA	*	RG:Z:cow	PG:Z:bull	AS:i:50	FI:i:2
+r005	83	ref1	37	30	9M	=	7	-39	CAGCGCCAT	*	RG:Z:colt	PG:Z:donkey	AS:i:100	FI:f:2.5
+r006	16	ref1	29	30	6H5M	*	0	0	TAGGC	*	RG:Z:colt	PG:Z:donkey	FI:i:3
+r007	0	ref1	16	30	6M14N1I5M	*	0	0	ATAGCTCTCAGC	*	RG:Z:colt	PG:Z:donkey	AS:i:-5	FI:f:3.5
+r007	0	ref1	9	30	5H6M	*	0	0	AGCTAA	*	RG:Z:colt	PG:Z:donkey	AS:i:1	FI:i:4
+r006	0	ref1	9	30	1S2I6M1P1I1P1I4M2I	*	0	0	AAAAGATAAGGGATAAA	*	XA:Z:abc	XB:i:-10	RG:Z:colt	PG:Z:donkey	AS:i:20	FI:f:4.5
+r005	163	ref1	7	30	8M4I4M1D3M	=	37	39	TTAGATAAAGAGGATACTG	*	XX:B:S,12561,2,20,112	YY:i:100	RG:Z:colt	PG:Z:donkey	AS:i:10	FI:i:5
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/input/tag.rg.n.sort.expected.sam	Tue Sep 28 16:18:32 2021 +0000
@@ -0,0 +1,28 @@
+@HD	VN:1.4	SO:unknown
+@SQ	SN:insert	LN:599
+@SQ	SN:ref1	LN:45
+@SQ	SN:ref2	LN:40
+@SQ	SN:ref3	LN:4
+@RG	ID:fish	PG:donkey
+@RG	ID:cow	PU:13_&^&&*(:332
+@RG	PU:*9u8jkjjkjd:	ID:colt
+@PG	ID:bull	PP:donkey
+@PG	ID:donkey
+@PG	ID:moose
+@PG	PP:moose	ID:cow
+@CO	
+r002	0	ref1	9	30	1S2I6M1P1I1P1I4M2I	*	0	0	AAAAGATAAGGGATAAA	*	XA:Z:abc	XB:i:-10	PG:Z:colt
+u1	4	*	0	30	23M	*	0	0	TAATTAAGTCTACAGAAAAAAAA	???????????????????????
+r004	0	ref1	16	30	6M14N1I5M	*	0	0	ATAGCTCTCAGC	*	RG:Z:colt	PG:Z:colt
+x1	0	ref2	1	30	20M	*	0	0	AGGTTTTATAAAACAAATAA	*	RG:Z:colt	PG:Z:bull
+x2	0	ref2	2	30	21M	*	0	0	GGTTTTATAAAACAAATAATT	?????????????????????	RG:Z:colt	PG:Z:bull
+r000	99	insert	50	30	10M	=	80	30	ATTTAGCTAC	AAAAAAAAAA	RG:Z:cow	PG:Z:bull
+r000	211	insert	80	30	10M	=	50	-30	CCCAATCATT	AAAAAAAAAA	RG:Z:cow	PG:Z:bull
+r003	0	ref1	9	30	5H6M	*	0	0	AGCTAA	*	RG:Z:cow
+r003	16	ref1	29	30	6H5M	*	0	0	TAGGC	*	RG:Z:cow	PG:Z:colt
+x6	0	ref2	14	30	23M	*	0	0	TAATTAAGTCTACAGAGCAACTA	???????????????????????	RG:Z:cow
+r001	83	ref1	37	30	9M	=	7	-39	CAGCGCCAT	*	RG:Z:fish	PG:Z:colt
+r001	163	ref1	7	30	8M4I4M1D3M	=	37	39	TTAGATAAAGAGGATACTG	*	XX:B:S,12561,2,20,112	YY:i:100	RG:Z:fish	PG:Z:colt
+x3	0	ref2	6	30	9M4I13M	*	0	0	TTATAAAACAAATAATTAAGTCTACA	??????????????????????????	RG:Z:fish	PG:Z:bull
+x4	0	ref2	10	30	25M	*	0	0	CAAATAATTAAGTCTACAGAGCAAC	?????????????????????????	RG:Z:fish	PG:Z:bull
+x5	0	ref2	12	30	24M	*	0	0	AATAATTAAGTCTACAGAGCAACT	????????????????????????	RG:Z:fish	PG:Z:bull
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/input/tag.rg.sort.expected.sam	Tue Sep 28 16:18:32 2021 +0000
@@ -0,0 +1,28 @@
+@HD	VN:1.4	SO:unknown
+@SQ	SN:insert	LN:599
+@SQ	SN:ref1	LN:45
+@SQ	SN:ref2	LN:40
+@SQ	SN:ref3	LN:4
+@RG	ID:fish	PG:donkey
+@RG	ID:cow	PU:13_&^&&*(:332
+@RG	PU:*9u8jkjjkjd:	ID:colt
+@PG	ID:bull	PP:donkey
+@PG	ID:donkey
+@PG	ID:moose
+@PG	PP:moose	ID:cow
+@CO	
+r002	0	ref1	9	30	1S2I6M1P1I1P1I4M2I	*	0	0	AAAAGATAAGGGATAAA	*	XA:Z:abc	XB:i:-10	PG:Z:colt
+u1	4	*	0	30	23M	*	0	0	TAATTAAGTCTACAGAAAAAAAA	???????????????????????
+r004	0	ref1	16	30	6M14N1I5M	*	0	0	ATAGCTCTCAGC	*	RG:Z:colt	PG:Z:colt
+x1	0	ref2	1	30	20M	*	0	0	AGGTTTTATAAAACAAATAA	*	RG:Z:colt	PG:Z:bull
+x2	0	ref2	2	30	21M	*	0	0	GGTTTTATAAAACAAATAATT	?????????????????????	RG:Z:colt	PG:Z:bull
+r000	99	insert	50	30	10M	=	80	30	ATTTAGCTAC	AAAAAAAAAA	RG:Z:cow	PG:Z:bull
+r000	211	insert	80	30	10M	=	50	-30	CCCAATCATT	AAAAAAAAAA	RG:Z:cow	PG:Z:bull
+r003	0	ref1	9	30	5H6M	*	0	0	AGCTAA	*	RG:Z:cow
+r003	16	ref1	29	30	6H5M	*	0	0	TAGGC	*	RG:Z:cow	PG:Z:colt
+x6	0	ref2	14	30	23M	*	0	0	TAATTAAGTCTACAGAGCAACTA	???????????????????????	RG:Z:cow
+r001	163	ref1	7	30	8M4I4M1D3M	=	37	39	TTAGATAAAGAGGATACTG	*	XX:B:S,12561,2,20,112	YY:i:100	RG:Z:fish	PG:Z:colt
+r001	83	ref1	37	30	9M	=	7	-39	CAGCGCCAT	*	RG:Z:fish	PG:Z:colt
+x3	0	ref2	6	30	9M4I13M	*	0	0	TTATAAAACAAATAATTAAGTCTACA	??????????????????????????	RG:Z:fish	PG:Z:bull
+x4	0	ref2	10	30	25M	*	0	0	CAAATAATTAAGTCTACAGAGCAAC	?????????????????????????	RG:Z:fish	PG:Z:bull
+x5	0	ref2	12	30	24M	*	0	0	AATAATTAAGTCTACAGAGCAACT	????????????????????????	RG:Z:fish	PG:Z:bull
Binary file test-data/input/test.bam has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/input/test.bed	Tue Sep 28 16:18:32 2021 +0000
@@ -0,0 +1,1 @@
+CHROMOSOME_I	1	120
Binary file test-data/input/test.cram has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/input/test.fa	Tue Sep 28 16:18:32 2021 +0000
@@ -0,0 +1,3 @@
+>CHROMOSOME_I
+gcctaagcctaagcctaagcctaagcctaagcctaagcctaagcctaagc
+ctaagcctaagcctaagcctaagcctaagcctaagcctaagcctaagcct
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/input/test.fa.fai	Tue Sep 28 16:18:32 2021 +0000
@@ -0,0 +1,1 @@
+CHROMOSOME_I	100	14	50	51
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/input/test.sam	Tue Sep 28 16:18:32 2021 +0000
@@ -0,0 +1,15 @@
+@HD	VN:1.4	SO:unsorted
+@SQ	SN:CHROMOSOME_I	LN:100
+@RG	ID:UNKNOWN	SM:UNKNOWN
+@PG	ID:bowtie2	PN:bowtie2	VN:2.0.0-beta5
+@PG	ID:0	CL:aaaaa/aaa/aaaaa/aaaaaa/aaaaaaaaa/aaa/iuc/package_aaaaaaaaa_x_y/aaaaaaaaaaaa/bin/aaaaaaaaaaaaaaaaa aaaaaaaaaa /aaaa/aaaaa/aaa/aaaaaaaaaaaaaaaaaaa/tools/aaaaaaaaa/test-data/test.cram aa /aaaa/aaaaa/aaa/aaaaaaaaaaaaaaaaaaa/tools/aaaaaaaaa/test-data/test.fa -O test	PN:samtools	VN:1.2
+SRR065390.14978392	16	CHROMOSOME_I	2	1	27M1D73M	*	0	0	CCTAGCCCTAACCCTAACCCTAACCCTAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	#############################@B?8B?BA@@DDBCDDCBC@CDCDCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC	RG:Z:UNKNOWN	XG:i:1	XM:i:5	XN:i:0	XO:i:1	AS:i:-18	XS:i:-18	YT:Z:UU
+SRR065390.921023	16	CHROMOSOME_I	3	12	100M	*	0	0	CTAAGCCTAAATCTAAGCCTAACCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	###############################################???88:;98768700000<>:BBA?BBAB?BBBBBBBB>B>BB::;?:00000	RG:Z:UNKNOWN	XG:i:0	XM:i:3	XN:i:0	XO:i:0	AS:i:-6	XS:i:-13	YT:Z:UU
+SRR065390.1871511	16	CHROMOSOME_I	3	1	100M	*	0	0	CTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	<?@<@A8>0:BB@>B<=B@???@=8@B>BB@CA@DACDCBBCCCA@CCCCACCBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC	RG:Z:UNKNOWN	XG:i:0	XM:i:0	XN:i:0	XO:i:0	AS:i:0	XS:i:0	YT:Z:UU
+SRR065390.3743423	16	CHROMOSOME_I	3	1	100M	*	0	0	CTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	##################?6@:7<=@3=@ABAAB>BDBBABADABDDDBDDBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC	RG:Z:UNKNOWN	XG:i:0	XM:i:0	XN:i:0	XO:i:0	AS:i:0	XS:i:0	YT:Z:UU
+SRR065390.4251890	16	CHROMOSOME_I	3	1	100M	*	0	0	CTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	###########@BB=BCBBC?B>B;>B@@ADBBB@DBBBBDCCBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC	RG:Z:UNKNOWN	XG:i:0	XM:i:0	XN:i:0	XO:i:0	AS:i:0	XS:i:0	YT:Z:UU
+SRR065390.5238868	16	CHROMOSOME_I	3	1	100M	*	0	0	CTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	@,=@@D8D;?BBB>;?BBB==BB@D;>D>BBB>BBDDB<DABADCACDCCBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC	RG:Z:UNKNOWN	XG:i:0	XM:i:0	XN:i:0	XO:i:0	AS:i:0	XS:i:0	YT:Z:UU
+SRR065390.6023338	0	CHROMOSOME_I	3	1	100M	*	0	0	CTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAAGCTAC	CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC@CCDDDBCCABB=DABBA?################	RG:Z:UNKNOWN	XG:i:0	XM:i:3	XN:i:0	XO:i:0	AS:i:-6	XS:i:-6	YT:Z:UU
+SRR065390.6815812	16	CHROMOSOME_I	3	1	100M	*	0	0	CTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	###############?@.@?B;B0B=;<DADB@@BDDBBDDBCBCBD@CCDCCCCCCCDCCCCCCCCACCCCCCCCCCBCCCCCCDCCCCCCCCCCCBCC	RG:Z:UNKNOWN	XG:i:0	XM:i:0	XN:i:0	XO:i:0	AS:i:0	XS:i:0	YT:Z:UU
+SRR065390.6905811	16	CHROMOSOME_I	3	1	100M	*	0	0	CTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	#######################BB@>A<BC>@@BCCB@=BACBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC	RG:Z:UNKNOWN	XG:i:0	XM:i:0	XN:i:0	XO:i:0	AS:i:0	XS:i:0	YT:Z:UU
+SRR065390.8289592	16	CHROMOSOME_I	3	1	100M	*	0	0	CTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	###############################A?@C9@@BC=AABDD@A@DC@CB=@BA?6@CCAAC@+CCCCCCCCCCCCCCC@CCCCCCCCCCCCCCCC	RG:Z:UNKNOWN	XG:i:0	XM:i:0	XN:i:0	XO:i:0	AS:i:0	XS:i:0	YT:Z:UU
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/input/test.txt	Tue Sep 28 16:18:32 2021 +0000
@@ -0,0 +1,16 @@
+@HD	VN:1.0	SO:coordinate
+@SQ	SN:chrM	LN:16660	M5:732d956b0927aa063007fb18c839890a	UR:/usr/users/ga002/soranzon/software/galaxyproject_tools-iuc/tool_collections/samtools/bam_to_cram/test-data/cached_locally/chr_m.fasta
+@RG	ID:rg1	SM:s1
+@PG	ID:samtools	PN:samtools	VN:1.12	CL:samtools view -@ 0 -b -o outfile -T /home/florian/.planemo/planemo_tmp__buk0m5w/test-data/cached_locally/chr_m.fasta -t /home/florian/.planemo/planemo_tmp__buk0m5w/test-data/cached_locally/chr_m.fasta.fai infile
+@PG	ID:samtools.1	PN:samtools	PP:samtools	VN:1.12	CL:samtools sort -@ 0 -m 576M -T . -O bam -o tmpsam outfile
+@PG	ID:samtools.2	PN:samtools	PP:samtools.1	VN:1.12	CL:samtools view -h sam_to_bam_out2.bam
+HWI-EAS91_1_30788AAXX:1:1:1698:516	16	chrM	2735	25	36M	*	0	0	TTTACACTCAGAGGTTCAACTCCTCTCNNTAACAAC	I9IIIII5IIIIIIIIIIIIIIIIIII""IIIIIII	X1:i:1	MD:Z:27C0C7	NM:i:2	RG:Z:rg1
+HWI-EAS91_1_30788AAXX:1:1:1398:854	16	chrM	3921	25	36M	*	0	0	CACCCTTCCCGTACTAATAAATCCCCTNNTCTTCAC	IIIII=AIIIIIIIIIIIIIIBIIIII""IIIIIII	X1:i:1	MD:Z:27T0A7	NM:i:2	RG:Z:rg1
+HWI-EAS91_1_30788AAXX:1:1:1716:413	0	chrM	6040	25	36M	*	0	0	GATCCAANNCTTTATCAACACCTATTCTGATTCTTC	IIIIIII""IIIIIIIIIIIIIIIIIIIIIIIIIII	X1:i:1	MD:Z:7T0C27	NM:i:2	RG:Z:rg1
+HWI-EAS91_1_30788AAXX:1:1:1634:211	0	chrM	9350	25	36M	*	0	0	GAAGCAGNNGCTTGATACTGACACTTCGTCGACGTA	IIIIIII""IIIIIIIIIIIIIIIIIIIIII9IIDF	X1:i:1	MD:Z:7C0C27	NM:i:2	RG:Z:rg1
+HWI-EAS91_1_30788AAXX:1:1:1513:715	16	chrM	9563	25	36M	*	0	0	CTGACTACCACAACTAAACATCTATGCNNAAAAAAC	I+-II?IDIIIIIIIIIIIIIIIIIII""IIIIIII	X1:i:1	MD:Z:27A0G7	NM:i:2	RG:Z:rg1
+HWI-EAS91_1_30788AAXX:1:1:1310:991	16	chrM	10002	25	36M	*	0	0	CTCCTATGCCTAGAAGGAATAATACTANNACTATTC	I:2IEI:IIDIIIIII4IIIIIIIIII""IIIIIII	X1:i:1	MD:Z:27T0C7	NM:i:2	RG:Z:rg1
+HWI-EAS91_1_30788AAXX:1:1:1711:249	16	chrM	10617	25	36M	*	0	0	ACCAAACAGAACGCCTGAACGCAGGCCNNTACTTCC	IIIIIIIIIIIIIIIIIIIIIIIIIII""IIIIIII	X1:i:1	MD:Z:27T0C7	NM:i:2	RG:Z:rg1
+HWI-EAS91_1_30788AAXX:1:1:1491:637	16	chrM	10864	25	36M	*	0	0	TGTAGAAGCCCCAATTGCCGGATCCATNNTGCTAGC	DBAIIIIIIIIIIIFIIIIIIIIIIII""IIIIIII	X1:i:1	MD:Z:27A0G7	NM:i:2	RG:Z:rg1
+HWI-EAS91_1_30788AAXX:1:1:1630:59	16	chrM	12387	25	36M	*	0	0	TCATACTCGACCCCAACCTTACCAACCNNCCGCTCC	FIIHII;IIIIIIIIIIIIIIIIIIII""IIIIIII	X1:i:1	MD:Z:27T0C7	NM:i:2	RG:Z:rg1
+HWI-EAS91_1_30788AAXX:1:1:1218:141	16	chrM	14062	25	36M	*	0	0	ACAAAACTAACAACAAAAATAACACTCNNAATAAAC	I+IIII1IIIIIIIIIIIIIIIIIIII""IIIIIII	X1:i:1	MD:Z:27A0A7	NM:i:2	RG:Z:rg1
Binary file test-data/input/test2.cram has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/input/test_counts.tab	Tue Sep 28 16:18:32 2021 +0000
@@ -0,0 +1,1 @@
+10
Binary file test-data/input/test_ds.bam has changed
Binary file test-data/input/test_ds.cram has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/input/test_ds.sam	Tue Sep 28 16:18:32 2021 +0000
@@ -0,0 +1,8 @@
+@HD	VN:1.4	SO:unsorted
+@SQ	SN:CHROMOSOME_I	LN:100
+@RG	ID:UNKNOWN	SM:UNKNOWN
+@PG	ID:bowtie2	PN:bowtie2	VN:2.0.0-beta5
+@PG	ID:0	CL:aaaaa/aaa/aaaaa/aaaaaa/aaaaaaaaa/aaa/iuc/package_aaaaaaaaa_x_y/aaaaaaaaaaaa/bin/aaaaaaaaaaaaaaaaa aaaaaaaaaa /aaaa/aaaaa/aaa/aaaaaaaaaaaaaaaaaaa/tools/aaaaaaaaa/test-data/test.cram aa /aaaa/aaaaa/aaa/aaaaaaaaaaaaaaaaaaa/tools/aaaaaaaaa/test-data/test.fa -O test	PN:samtools	VN:1.2
+SRR065390.14978392	16	CHROMOSOME_I	2	1	27M1D73M	*	0	0	CCTAGCCCTAACCCTAACCCTAACCCTAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	#############################@B?8B?BA@@DDBCDDCBC@CDCDCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC	RG:Z:UNKNOWN	XG:i:1	XM:i:5	XN:i:0	XO:i:1	AS:i:-18	XS:i:-18	YT:Z:UU
+SRR065390.921023	16	CHROMOSOME_I	3	12	100M	*	0	0	CTAAGCCTAAATCTAAGCCTAACCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	###############################################???88:;98768700000<>:BBA?BBAB?BBBBBBBB>B>BB::;?:00000	RG:Z:UNKNOWN	XG:i:0	XM:i:3	XN:i:0	XO:i:0	AS:i:-6	XS:i:-13	YT:Z:UU
+SRR065390.6023338	0	CHROMOSOME_I	3	1	100M	*	0	0	CTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAAGCTAC	CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC@CCDDDBCCABB=DABBA?################	RG:Z:UNKNOWN	XG:i:0	XM:i:3	XN:i:0	XO:i:0	AS:i:-6	XS:i:-6	YT:Z:UU
Binary file test-data/input/test_input_1_a.bam has changed
Binary file test-data/no_reads.bam has changed
--- a/test-data/no_reads.sam	Mon Jan 04 10:43:33 2021 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-@HD	VN:1.4	SO:unsorted
-@SQ	SN:CHROMOSOME_I	LN:100
-@RG	ID:UNKNOWN	SM:UNKNOWN
-@PG	ID:bowtie2	PN:bowtie2	VN:2.0.0-beta5
-@PG	ID:0	CL:aaaaa/aaa/aaaaa/aaaaaa/aaaaaaaaa/aaa/iuc/package_aaaaaaaaa_x_y/aaaaaaaaaaaa/bin/aaaaaaaaaaaaaaaaa aaaaaaaaaa /aaaa/aaaaa/aaa/aaaaaaaaaaaaaaaaaaa/tools/aaaaaaaaa/test-data/test.cram aa /aaaa/aaaaa/aaa/aaaaaaaaaaaaaaaaaaa/tools/aaaaaaaaa/test-data/test.fa -O test	PN:samtools	VN:1.2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/readnames.txt	Tue Sep 28 16:18:32 2021 +0000
@@ -0,0 +1,3 @@
+SRR065390.14978392
+SRR065390.6023338
+SRR065390.8289592
--- a/test-data/sam_to_bam_in1.sam	Mon Jan 04 10:43:33 2021 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-@HD	VN:1.0	SO:coordinate
-@SQ	SN:chrM	LN:100001
-@RG	ID:rg1	SM:s1
-HWI-EAS91_1_30788AAXX:1:1:1513:715	16	chrM	9563	25	36M	*	0	0	CTGACTACCACAACTAAACATCTATGCNNAAAAAAC	I+-II?IDIIIIIIIIIIIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
-HWI-EAS91_1_30788AAXX:1:1:1698:516	16	chrM	2735	25	36M	*	0	0	TTTACACTCAGAGGTTCAACTCCTCTCNNTAACAAC	I9IIIII5IIIIIIIIIIIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
-HWI-EAS91_1_30788AAXX:1:1:1491:637	16	chrM	10864	25	36M	*	0	0	TGTAGAAGCCCCAATTGCCGGATCCATNNTGCTAGC	DBAIIIIIIIIIIIFIIIIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
-HWI-EAS91_1_30788AAXX:1:1:1711:249	16	chrM	10617	25	36M	*	0	0	ACCAAACAGAACGCCTGAACGCAGGCCNNTACTTCC	IIIIIIIIIIIIIIIIIIIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
-HWI-EAS91_1_30788AAXX:1:1:1634:211	0	chrM	9350	25	36M	*	0	0	GAAGCAGNNGCTTGATACTGACACTTCGTCGACGTA	IIIIIII""IIIIIIIIIIIIIIIIIIIIII9IIDF	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
-HWI-EAS91_1_30788AAXX:1:1:1218:141	16	chrM	14062	25	36M	*	0	0	ACAAAACTAACAACAAAAATAACACTCNNAATAAAC	I+IIII1IIIIIIIIIIIIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
-HWI-EAS91_1_30788AAXX:1:1:1398:854	16	chrM	3921	25	36M	*	0	0	CACCCTTCCCGTACTAATAAATCCCCTNNTCTTCAC	IIIII=AIIIIIIIIIIIIIIBIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
-HWI-EAS91_1_30788AAXX:1:1:1310:991	16	chrM	10002	25	36M	*	0	0	CTCCTATGCCTAGAAGGAATAATACTANNACTATTC	I:2IEI:IIDIIIIII4IIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
-HWI-EAS91_1_30788AAXX:1:1:1716:413	0	chrM	6040	25	36M	*	0	0	GATCCAANNCTTTATCAACACCTATTCTGATTCTTC	IIIIIII""IIIIIIIIIIIIIIIIIIIIIIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
-HWI-EAS91_1_30788AAXX:1:1:1630:59	16	chrM	12387	25	36M	*	0	0	TCATACTCGACCCCAACCTTACCAACCNNCCGCTCC	FIIHII;IIIIIIIIIIIIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
--- a/test-data/sam_to_bam_noheader_in2.sam	Mon Jan 04 10:43:33 2021 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-HWI-EAS91_1_30788AAXX:1:1:1513:715	16	chrM	9563	25	36M	*	0	0	CTGACTACCACAACTAAACATCTATGCNNAAAAAAC	I+-II?IDIIIIIIIIIIIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
-HWI-EAS91_1_30788AAXX:1:1:1698:516	16	chrM	2735	25	36M	*	0	0	TTTACACTCAGAGGTTCAACTCCTCTCNNTAACAAC	I9IIIII5IIIIIIIIIIIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
-HWI-EAS91_1_30788AAXX:1:1:1491:637	16	chrM	10864	25	36M	*	0	0	TGTAGAAGCCCCAATTGCCGGATCCATNNTGCTAGC	DBAIIIIIIIIIIIFIIIIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
-HWI-EAS91_1_30788AAXX:1:1:1711:249	16	chrM	10617	25	36M	*	0	0	ACCAAACAGAACGCCTGAACGCAGGCCNNTACTTCC	IIIIIIIIIIIIIIIIIIIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
-HWI-EAS91_1_30788AAXX:1:1:1634:211	0	chrM	9350	25	36M	*	0	0	GAAGCAGNNGCTTGATACTGACACTTCGTCGACGTA	IIIIIII""IIIIIIIIIIIIIIIIIIIIII9IIDF	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
-HWI-EAS91_1_30788AAXX:1:1:1218:141	16	chrM	14062	25	36M	*	0	0	ACAAAACTAACAACAAAAATAACACTCNNAATAAAC	I+IIII1IIIIIIIIIIIIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
-HWI-EAS91_1_30788AAXX:1:1:1398:854	16	chrM	3921	25	36M	*	0	0	CACCCTTCCCGTACTAATAAATCCCCTNNTCTTCAC	IIIII=AIIIIIIIIIIIIIIBIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
-HWI-EAS91_1_30788AAXX:1:1:1310:991	16	chrM	10002	25	36M	*	0	0	CTCCTATGCCTAGAAGGAATAATACTANNACTATTC	I:2IEI:IIDIIIIII4IIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
-HWI-EAS91_1_30788AAXX:1:1:1716:413	0	chrM	6040	25	36M	*	0	0	GATCCAANNCTTTATCAACACCTATTCTGATTCTTC	IIIIIII""IIIIIIIIIIIIIIIIIIIIIIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
-HWI-EAS91_1_30788AAXX:1:1:1630:59	16	chrM	12387	25	36M	*	0	0	TCATACTCGACCCCAACCTTACCAACCNNCCGCTCC	FIIHII;IIIIIIIIIIIIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27	RG:Z:rg1
Binary file test-data/sam_to_bam_out1.bam has changed
Binary file test-data/sam_to_bam_out2.bam has changed
Binary file test-data/sam_to_bam_out3.bam has changed
--- a/test-data/tag.as.sort.expected.sam	Mon Jan 04 10:43:33 2021 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-@HD	VN:1.4	SO:unknown
-@SQ	SN:insert	LN:599
-@SQ	SN:ref1	LN:45
-@SQ	SN:ref2	LN:40
-@SQ	SN:ref3	LN:4
-@PG	ID:llama
-@RG	ID:fish	PG:llama
-@RG	ID:cow	PU:13_&^&&*(:332	PG:donkey
-@RG	PU:*9u8jkjjkjd:	ID:colt
-@PG	ID:bull	PP:donkey
-@PG	ID:donkey
-@CO	Do you know?
-r006	16	ref1	29	30	6H5M	*	0	0	TAGGC	*	RG:Z:colt	PG:Z:donkey	FI:i:3
-x11	0	ref2	12	30	24M	*	0	0	AATAATTAAGTCTACAGAGCAACT	????????????????????????	RG:Z:cow	PG:Z:bull	FI:Z:a
-r007	0	ref1	16	30	6M14N1I5M	*	0	0	ATAGCTCTCAGC	*	RG:Z:colt	PG:Z:donkey	AS:i:-5	FI:f:3.5
-x10	0	ref2	10	30	25M	*	0	0	CAAATAATTAAGTCTACAGAGCAAC	?????????????????????????	RG:Z:cow	PG:Z:bull	AS:i:0	FI:A:b
-r007	0	ref1	9	30	5H6M	*	0	0	AGCTAA	*	RG:Z:colt	PG:Z:donkey	AS:i:1	FI:i:4
-r005	163	ref1	7	30	8M4I4M1D3M	=	37	39	TTAGATAAAGAGGATACTG	*	XX:B:S,12561,2,20,112	YY:i:100	RG:Z:colt	PG:Z:donkey	AS:i:10	FI:i:5
-x8	0	ref2	2	30	21M	*	0	0	GGTTTTATAAAACAAATAATT	?????????????????????	RG:Z:cow	PG:Z:bull	AS:i:10	FI:f:1.5
-r006	0	ref1	9	30	1S2I6M1P1I1P1I4M2I	*	0	0	AAAAGATAAGGGATAAA	*	XA:Z:abc	XB:i:-10	RG:Z:colt	PG:Z:donkey	AS:i:20	FI:f:4.5
-x9	0	ref2	6	30	9M4I13M	*	0	0	TTATAAAACAAATAATTAAGTCTACA	??????????????????????????	RG:Z:cow	PG:Z:bull	AS:i:20	FI:i:1
-x7	0	ref2	1	30	20M	*	0	0	AGGTTTTATAAAACAAATAA	*	RG:Z:cow	PG:Z:bull	AS:i:50	FI:i:2
-r005	83	ref1	37	30	9M	=	7	-39	CAGCGCCAT	*	RG:Z:colt	PG:Z:donkey	AS:i:100	FI:f:2.5
-x12	0	ref2	14	30	23M	*	0	0	TAATTAAGTCTACAGAGCAACTA	???????????????????????	RG:Z:cow	PG:Z:bull	AS:i:65100
--- a/test-data/tag.fi.sort.expected.sam	Mon Jan 04 10:43:33 2021 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-@HD	VN:1.4	SO:unknown
-@SQ	SN:insert	LN:599
-@SQ	SN:ref1	LN:45
-@SQ	SN:ref2	LN:40
-@SQ	SN:ref3	LN:4
-@PG	ID:llama
-@RG	ID:fish	PG:llama
-@RG	ID:cow	PU:13_&^&&*(:332	PG:donkey
-@RG	PU:*9u8jkjjkjd:	ID:colt
-@PG	ID:bull	PP:donkey
-@PG	ID:donkey
-@CO	Do you know?
-x12	0	ref2	14	30	23M	*	0	0	TAATTAAGTCTACAGAGCAACTA	???????????????????????	RG:Z:cow	PG:Z:bull	AS:i:65100
-x10	0	ref2	10	30	25M	*	0	0	CAAATAATTAAGTCTACAGAGCAAC	?????????????????????????	RG:Z:cow	PG:Z:bull	AS:i:0	FI:A:b
-x11	0	ref2	12	30	24M	*	0	0	AATAATTAAGTCTACAGAGCAACT	????????????????????????	RG:Z:cow	PG:Z:bull	FI:Z:a
-x9	0	ref2	6	30	9M4I13M	*	0	0	TTATAAAACAAATAATTAAGTCTACA	??????????????????????????	RG:Z:cow	PG:Z:bull	AS:i:20	FI:i:1
-x8	0	ref2	2	30	21M	*	0	0	GGTTTTATAAAACAAATAATT	?????????????????????	RG:Z:cow	PG:Z:bull	AS:i:10	FI:f:1.5
-x7	0	ref2	1	30	20M	*	0	0	AGGTTTTATAAAACAAATAA	*	RG:Z:cow	PG:Z:bull	AS:i:50	FI:i:2
-r005	83	ref1	37	30	9M	=	7	-39	CAGCGCCAT	*	RG:Z:colt	PG:Z:donkey	AS:i:100	FI:f:2.5
-r006	16	ref1	29	30	6H5M	*	0	0	TAGGC	*	RG:Z:colt	PG:Z:donkey	FI:i:3
-r007	0	ref1	16	30	6M14N1I5M	*	0	0	ATAGCTCTCAGC	*	RG:Z:colt	PG:Z:donkey	AS:i:-5	FI:f:3.5
-r007	0	ref1	9	30	5H6M	*	0	0	AGCTAA	*	RG:Z:colt	PG:Z:donkey	AS:i:1	FI:i:4
-r006	0	ref1	9	30	1S2I6M1P1I1P1I4M2I	*	0	0	AAAAGATAAGGGATAAA	*	XA:Z:abc	XB:i:-10	RG:Z:colt	PG:Z:donkey	AS:i:20	FI:f:4.5
-r005	163	ref1	7	30	8M4I4M1D3M	=	37	39	TTAGATAAAGAGGATACTG	*	XX:B:S,12561,2,20,112	YY:i:100	RG:Z:colt	PG:Z:donkey	AS:i:10	FI:i:5
--- a/test-data/tag.rg.n.sort.expected.sam	Mon Jan 04 10:43:33 2021 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-@HD	VN:1.4	SO:unknown
-@SQ	SN:insert	LN:599
-@SQ	SN:ref1	LN:45
-@SQ	SN:ref2	LN:40
-@SQ	SN:ref3	LN:4
-@RG	ID:fish	PG:donkey
-@RG	ID:cow	PU:13_&^&&*(:332
-@RG	PU:*9u8jkjjkjd:	ID:colt
-@PG	ID:bull	PP:donkey
-@PG	ID:donkey
-@PG	ID:moose
-@PG	PP:moose	ID:cow
-@CO	
-r002	0	ref1	9	30	1S2I6M1P1I1P1I4M2I	*	0	0	AAAAGATAAGGGATAAA	*	XA:Z:abc	XB:i:-10	PG:Z:colt
-u1	4	*	0	30	23M	*	0	0	TAATTAAGTCTACAGAAAAAAAA	???????????????????????
-r004	0	ref1	16	30	6M14N1I5M	*	0	0	ATAGCTCTCAGC	*	RG:Z:colt	PG:Z:colt
-x1	0	ref2	1	30	20M	*	0	0	AGGTTTTATAAAACAAATAA	*	RG:Z:colt	PG:Z:bull
-x2	0	ref2	2	30	21M	*	0	0	GGTTTTATAAAACAAATAATT	?????????????????????	RG:Z:colt	PG:Z:bull
-r000	99	insert	50	30	10M	=	80	30	ATTTAGCTAC	AAAAAAAAAA	RG:Z:cow	PG:Z:bull
-r000	211	insert	80	30	10M	=	50	-30	CCCAATCATT	AAAAAAAAAA	RG:Z:cow	PG:Z:bull
-r003	0	ref1	9	30	5H6M	*	0	0	AGCTAA	*	RG:Z:cow
-r003	16	ref1	29	30	6H5M	*	0	0	TAGGC	*	RG:Z:cow	PG:Z:colt
-x6	0	ref2	14	30	23M	*	0	0	TAATTAAGTCTACAGAGCAACTA	???????????????????????	RG:Z:cow
-r001	83	ref1	37	30	9M	=	7	-39	CAGCGCCAT	*	RG:Z:fish	PG:Z:colt
-r001	163	ref1	7	30	8M4I4M1D3M	=	37	39	TTAGATAAAGAGGATACTG	*	XX:B:S,12561,2,20,112	YY:i:100	RG:Z:fish	PG:Z:colt
-x3	0	ref2	6	30	9M4I13M	*	0	0	TTATAAAACAAATAATTAAGTCTACA	??????????????????????????	RG:Z:fish	PG:Z:bull
-x4	0	ref2	10	30	25M	*	0	0	CAAATAATTAAGTCTACAGAGCAAC	?????????????????????????	RG:Z:fish	PG:Z:bull
-x5	0	ref2	12	30	24M	*	0	0	AATAATTAAGTCTACAGAGCAACT	????????????????????????	RG:Z:fish	PG:Z:bull
--- a/test-data/tag.rg.sort.expected.sam	Mon Jan 04 10:43:33 2021 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-@HD	VN:1.4	SO:unknown
-@SQ	SN:insert	LN:599
-@SQ	SN:ref1	LN:45
-@SQ	SN:ref2	LN:40
-@SQ	SN:ref3	LN:4
-@RG	ID:fish	PG:donkey
-@RG	ID:cow	PU:13_&^&&*(:332
-@RG	PU:*9u8jkjjkjd:	ID:colt
-@PG	ID:bull	PP:donkey
-@PG	ID:donkey
-@PG	ID:moose
-@PG	PP:moose	ID:cow
-@CO	
-r002	0	ref1	9	30	1S2I6M1P1I1P1I4M2I	*	0	0	AAAAGATAAGGGATAAA	*	XA:Z:abc	XB:i:-10	PG:Z:colt
-u1	4	*	0	30	23M	*	0	0	TAATTAAGTCTACAGAAAAAAAA	???????????????????????
-r004	0	ref1	16	30	6M14N1I5M	*	0	0	ATAGCTCTCAGC	*	RG:Z:colt	PG:Z:colt
-x1	0	ref2	1	30	20M	*	0	0	AGGTTTTATAAAACAAATAA	*	RG:Z:colt	PG:Z:bull
-x2	0	ref2	2	30	21M	*	0	0	GGTTTTATAAAACAAATAATT	?????????????????????	RG:Z:colt	PG:Z:bull
-r000	99	insert	50	30	10M	=	80	30	ATTTAGCTAC	AAAAAAAAAA	RG:Z:cow	PG:Z:bull
-r000	211	insert	80	30	10M	=	50	-30	CCCAATCATT	AAAAAAAAAA	RG:Z:cow	PG:Z:bull
-r003	0	ref1	9	30	5H6M	*	0	0	AGCTAA	*	RG:Z:cow
-r003	16	ref1	29	30	6H5M	*	0	0	TAGGC	*	RG:Z:cow	PG:Z:colt
-x6	0	ref2	14	30	23M	*	0	0	TAATTAAGTCTACAGAGCAACTA	???????????????????????	RG:Z:cow
-r001	163	ref1	7	30	8M4I4M1D3M	=	37	39	TTAGATAAAGAGGATACTG	*	XX:B:S,12561,2,20,112	YY:i:100	RG:Z:fish	PG:Z:colt
-r001	83	ref1	37	30	9M	=	7	-39	CAGCGCCAT	*	RG:Z:fish	PG:Z:colt
-x3	0	ref2	6	30	9M4I13M	*	0	0	TTATAAAACAAATAATTAAGTCTACA	??????????????????????????	RG:Z:fish	PG:Z:bull
-x4	0	ref2	10	30	25M	*	0	0	CAAATAATTAAGTCTACAGAGCAAC	?????????????????????????	RG:Z:fish	PG:Z:bull
-x5	0	ref2	12	30	24M	*	0	0	AATAATTAAGTCTACAGAGCAACT	????????????????????????	RG:Z:fish	PG:Z:bull
Binary file test-data/test.bam has changed
Binary file test-data/test.cram has changed
--- a/test-data/test.sam	Mon Jan 04 10:43:33 2021 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-@HD	VN:1.4	SO:unsorted
-@SQ	SN:CHROMOSOME_I	LN:100
-@RG	ID:UNKNOWN	SM:UNKNOWN
-@PG	ID:bowtie2	PN:bowtie2	VN:2.0.0-beta5
-@PG	ID:0	CL:aaaaa/aaa/aaaaa/aaaaaa/aaaaaaaaa/aaa/iuc/package_aaaaaaaaa_x_y/aaaaaaaaaaaa/bin/aaaaaaaaaaaaaaaaa aaaaaaaaaa /aaaa/aaaaa/aaa/aaaaaaaaaaaaaaaaaaa/tools/aaaaaaaaa/test-data/test.cram aa /aaaa/aaaaa/aaa/aaaaaaaaaaaaaaaaaaa/tools/aaaaaaaaa/test-data/test.fa -O test	PN:samtools	VN:1.2
-SRR065390.14978392	16	CHROMOSOME_I	2	1	27M1D73M	*	0	0	CCTAGCCCTAACCCTAACCCTAACCCTAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	#############################@B?8B?BA@@DDBCDDCBC@CDCDCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC	RG:Z:UNKNOWN	XG:i:1	XM:i:5	XN:i:0	XO:i:1	AS:i:-18	XS:i:-18	YT:Z:UU
-SRR065390.921023	16	CHROMOSOME_I	3	12	100M	*	0	0	CTAAGCCTAAATCTAAGCCTAACCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	###############################################???88:;98768700000<>:BBA?BBAB?BBBBBBBB>B>BB::;?:00000	RG:Z:UNKNOWN	XG:i:0	XM:i:3	XN:i:0	XO:i:0	AS:i:-6	XS:i:-13	YT:Z:UU
-SRR065390.1871511	16	CHROMOSOME_I	3	1	100M	*	0	0	CTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	<?@<@A8>0:BB@>B<=B@???@=8@B>BB@CA@DACDCBBCCCA@CCCCACCBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC	RG:Z:UNKNOWN	XG:i:0	XM:i:0	XN:i:0	XO:i:0	AS:i:0	XS:i:0	YT:Z:UU
-SRR065390.3743423	16	CHROMOSOME_I	3	1	100M	*	0	0	CTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	##################?6@:7<=@3=@ABAAB>BDBBABADABDDDBDDBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC	RG:Z:UNKNOWN	XG:i:0	XM:i:0	XN:i:0	XO:i:0	AS:i:0	XS:i:0	YT:Z:UU
-SRR065390.4251890	16	CHROMOSOME_I	3	1	100M	*	0	0	CTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	###########@BB=BCBBC?B>B;>B@@ADBBB@DBBBBDCCBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC	RG:Z:UNKNOWN	XG:i:0	XM:i:0	XN:i:0	XO:i:0	AS:i:0	XS:i:0	YT:Z:UU
-SRR065390.5238868	16	CHROMOSOME_I	3	1	100M	*	0	0	CTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	@,=@@D8D;?BBB>;?BBB==BB@D;>D>BBB>BBDDB<DABADCACDCCBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC	RG:Z:UNKNOWN	XG:i:0	XM:i:0	XN:i:0	XO:i:0	AS:i:0	XS:i:0	YT:Z:UU
-SRR065390.6023338	0	CHROMOSOME_I	3	1	100M	*	0	0	CTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAAGCTAC	CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC@CCDDDBCCABB=DABBA?################	RG:Z:UNKNOWN	XG:i:0	XM:i:3	XN:i:0	XO:i:0	AS:i:-6	XS:i:-6	YT:Z:UU
-SRR065390.6815812	16	CHROMOSOME_I	3	1	100M	*	0	0	CTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	###############?@.@?B;B0B=;<DADB@@BDDBBDDBCBCBD@CCDCCCCCCCDCCCCCCCCACCCCCCCCCCBCCCCCCDCCCCCCCCCCCBCC	RG:Z:UNKNOWN	XG:i:0	XM:i:0	XN:i:0	XO:i:0	AS:i:0	XS:i:0	YT:Z:UU
-SRR065390.6905811	16	CHROMOSOME_I	3	1	100M	*	0	0	CTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	#######################BB@>A<BC>@@BCCB@=BACBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC	RG:Z:UNKNOWN	XG:i:0	XM:i:0	XN:i:0	XO:i:0	AS:i:0	XS:i:0	YT:Z:UU
-SRR065390.8289592	16	CHROMOSOME_I	3	1	100M	*	0	0	CTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	###############################A?@C9@@BC=AABDD@A@DC@CB=@BA?6@CCAAC@+CCCCCCCCCCCCCCC@CCCCCCCCCCCCCCCC	RG:Z:UNKNOWN	XG:i:0	XM:i:0	XN:i:0	XO:i:0	AS:i:0	XS:i:0	YT:Z:UU
Binary file test-data/test2.cram has changed
Binary file test-data/test_1.bam has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/test_11.sam	Tue Sep 28 16:18:32 2021 +0000
@@ -0,0 +1,15 @@
+@HD	VN:1.0	SO:coordinate
+@SQ	SN:chr1	LN:101
+@SQ	SN:chr7	LN:404
+@SQ	SN:chr8	LN:202
+@RG	ID:0	SM:Hi,Mom!
+@PG	ID:1	PN:Hey!	VN:2.0
+@PG	ID:samtools	PN:samtools	PP:1	VN:1.12	CL:samtools view -@ 0 -h -o outfile infile
+both_reads_align_clip_marked	83	chr7	1	255	101M	=	302	201	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
+both_reads_present_only_first_aligns	89	chr7	1	255	101M	*	0	0	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
+read_2_too_many_gaps	83	chr7	1	255	101M	=	302	201	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
+both_reads_align_clip_adapter	147	chr7	16	255	101M	=	21	-96	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
+both_reads_align_clip_adapter	99	chr7	21	255	101M	=	16	96	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
+both_reads_align_clip_marked	163	chr7	302	255	101M	=	1	-201	NCGCGGCATCNCGATTTCTTTCCGCAGCTAACCTCCCGACAGATCGGCAGCGCGTCGTGTAGGTTATTATGGTACATCTTGTCGTGCGGCNAGAGCATACA	&/15445666651/566666553+2/14/&/555512+3/)-'/-&-'*+))*''13+3)'//++''/'))/3+&*5++)&'2+&+/*&-&&*)&-./1'1	RG:Z:0
+read_2_too_many_gaps	163	chr7	302	255	10M1D10M5I76M	=	1	-201	NCGCGGCATCNCGATTTCTTTCCGCAGCTAACCTCCCGACAGATCGGCAGCGCGTCGTGTAGGTTATTATGGTACATCTTGTCGTGCGGCNAGAGCATACA	&/15445666651/566666553+2/14/&/555512+3/)-'/-&-'*+))*''13+3)'//++''/'))/3+&*5++)&'2+&+/*&-&&*)&-./1'1	RG:Z:0
+both_reads_present_only_first_aligns	165	*	0	0	*	chr7	1	0	NCGCGGCATCNCGATTTCTTTCCGCAGCTAACCTCCCGACAGATCGGCAGCGCGTCGTGTAGGTTATTATGGTACATCTTGTCGTGCGGCNAGAGCATACA	&/15445666651/566666553+2/14/&/555512+3/)-'/-&-'*+))*''13+3)'//++''/'))/3+&*5++)&'2+&+/*&-&&*)&-./1'1	RG:Z:0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/test_12.sam	Tue Sep 28 16:18:32 2021 +0000
@@ -0,0 +1,7 @@
+@HD	VN:1.0	SO:coordinate
+@SQ	SN:chr1	LN:101
+@SQ	SN:chr7	LN:404
+@SQ	SN:chr8	LN:202
+@RG	ID:0	SM:Hi,Mom!
+@PG	ID:1	PN:Hey!	VN:2.0
+@PG	ID:samtools	PN:samtools	PP:1	VN:1.12	CL:samtools view -H -o outfile infile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/test_13.sam	Tue Sep 28 16:18:32 2021 +0000
@@ -0,0 +1,8 @@
+both_reads_align_clip_marked	83	chr7	1	255	101M	=	302	201	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
+both_reads_present_only_first_aligns	89	chr7	1	255	101M	*	0	0	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
+read_2_too_many_gaps	83	chr7	1	255	101M	=	302	201	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
+both_reads_align_clip_adapter	147	chr7	16	255	101M	=	21	-96	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
+both_reads_align_clip_adapter	99	chr7	21	255	101M	=	16	96	CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN	)'.*.+2,))&&'&*/)-&*-)&.-)&)&),/-&&..)./.,.).*&&,&.&&-)&&&0*&&&&&&&&/32/,01460&&/6/*0*/2/283//36868/&	RG:Z:0
+both_reads_align_clip_marked	163	chr7	302	255	101M	=	1	-201	NCGCGGCATCNCGATTTCTTTCCGCAGCTAACCTCCCGACAGATCGGCAGCGCGTCGTGTAGGTTATTATGGTACATCTTGTCGTGCGGCNAGAGCATACA	&/15445666651/566666553+2/14/&/555512+3/)-'/-&-'*+))*''13+3)'//++''/'))/3+&*5++)&'2+&+/*&-&&*)&-./1'1	RG:Z:0
+read_2_too_many_gaps	163	chr7	302	255	10M1D10M5I76M	=	1	-201	NCGCGGCATCNCGATTTCTTTCCGCAGCTAACCTCCCGACAGATCGGCAGCGCGTCGTGTAGGTTATTATGGTACATCTTGTCGTGCGGCNAGAGCATACA	&/15445666651/566666553+2/14/&/555512+3/)-'/-&-'*+))*''13+3)'//++''/'))/3+&*5++)&'2+&+/*&-&&*)&-./1'1	RG:Z:0
+both_reads_present_only_first_aligns	165	*	0	0	*	chr7	1	0	NCGCGGCATCNCGATTTCTTTCCGCAGCTAACCTCCCGACAGATCGGCAGCGCGTCGTGTAGGTTATTATGGTACATCTTGTCGTGCGGCNAGAGCATACA	&/15445666651/566666553+2/14/&/555512+3/)-'/-&-'*+))*''13+3)'//++''/'))/3+&*5++)&'2+&+/*&-&&*)&-./1'1	RG:Z:0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/test_14.tab	Tue Sep 28 16:18:32 2021 +0000
@@ -0,0 +1,1 @@
+10
Binary file test-data/test_15.cram has changed
Binary file test-data/test_17.bam has changed
Binary file test-data/test_19.bam has changed
Binary file test-data/test_2.bam has changed
Binary file test-data/test_20.bam has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/test_21.sam	Tue Sep 28 16:18:32 2021 +0000
@@ -0,0 +1,8 @@
+@HD	VN:1.4	SO:unsorted
+@SQ	SN:CHROMOSOME_I	LN:100
+@RG	ID:UNKNOWN	SM:UNKNOWN
+@PG	ID:bowtie2	PN:bowtie2	VN:2.0.0-beta5
+@PG	ID:0	CL:aaaaa/aaa/aaaaa/aaaaaa/aaaaaaaaa/aaa/iuc/package_aaaaaaaaa_x_y/aaaaaaaaaaaa/bin/aaaaaaaaaaaaaaaaa aaaaaaaaaa /aaaa/aaaaa/aaa/aaaaaaaaaaaaaaaaaaa/tools/aaaaaaaaa/test-data/test.cram aa /aaaa/aaaaa/aaa/aaaaaaaaaaaaaaaaaaa/tools/aaaaaaaaa/test-data/test.fa -O test	PN:samtools	VN:1.2
+SRR065390.14978392	16	CHROMOSOME_I	2	1	27M1D73M	*	0	0	CCTAGCCCTAACCCTAACCCTAACCCTAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	#############################@B?8B?BA@@DDBCDDCBC@CDCDCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC	RG:Z:UNKNOWN	XG:i:1	XM:i:5	XN:i:0	XO:i:1	AS:i:-18	XS:i:-18	YT:Z:UU
+SRR065390.921023	16	CHROMOSOME_I	3	12	100M	*	0	0	CTAAGCCTAAATCTAAGCCTAACCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	###############################################???88:;98768700000<>:BBA?BBAB?BBBBBBBB>B>BB::;?:00000	RG:Z:UNKNOWN	XG:i:0	XM:i:3	XN:i:0	XO:i:0	AS:i:-6	XS:i:-13	YT:Z:UU
+SRR065390.6023338	0	CHROMOSOME_I	3	1	100M	*	0	0	CTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAAGCTAC	CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC@CCDDDBCCABB=DABBA?################	RG:Z:UNKNOWN	XG:i:0	XM:i:3	XN:i:0	XO:i:0	AS:i:-6	XS:i:-6	YT:Z:UU
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/test_22.sam	Tue Sep 28 16:18:32 2021 +0000
@@ -0,0 +1,16 @@
+@HD	VN:1.4	SO:unsorted
+@SQ	SN:CHROMOSOME_I	LN:100
+@RG	ID:UNKNOWN	SM:UNKNOWN
+@PG	ID:bowtie2	PN:bowtie2	VN:2.0.0-beta5
+@PG	ID:0	CL:aaaaa/aaa/aaaaa/aaaaaa/aaaaaaaaa/aaa/iuc/package_aaaaaaaaa_x_y/aaaaaaaaaaaa/bin/aaaaaaaaaaaaaaaaa aaaaaaaaaa /aaaa/aaaaa/aaa/aaaaaaaaaaaaaaaaaaa/tools/aaaaaaaaa/test-data/test.cram aa /aaaa/aaaaa/aaa/aaaaaaaaaaaaaaaaaaa/tools/aaaaaaaaa/test-data/test.fa -O test	PN:samtools	VN:1.2
+@PG	ID:samtools	PN:samtools	PP:0	VN:1.12	CL:samtools view -@ 0 -h -s .0 -o outfile infile
+SRR065390.14978392	16	CHROMOSOME_I	2	1	27M1D73M	*	0	0	CCTAGCCCTAACCCTAACCCTAACCCTAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	#############################@B?8B?BA@@DDBCDDCBC@CDCDCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC	RG:Z:UNKNOWN	XG:i:1	XM:i:5	XN:i:0	XO:i:1	AS:i:-18	XS:i:-18	YT:Z:UU
+SRR065390.921023	16	CHROMOSOME_I	3	12	100M	*	0	0	CTAAGCCTAAATCTAAGCCTAACCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	###############################################???88:;98768700000<>:BBA?BBAB?BBBBBBBB>B>BB::;?:00000	RG:Z:UNKNOWN	XG:i:0	XM:i:3	XN:i:0	XO:i:0	AS:i:-6	XS:i:-13	YT:Z:UU
+SRR065390.1871511	16	CHROMOSOME_I	3	1	100M	*	0	0	CTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	<?@<@A8>0:BB@>B<=B@???@=8@B>BB@CA@DACDCBBCCCA@CCCCACCBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC	RG:Z:UNKNOWN	XG:i:0	XM:i:0	XN:i:0	XO:i:0	AS:i:0	XS:i:0	YT:Z:UU
+SRR065390.3743423	16	CHROMOSOME_I	3	1	100M	*	0	0	CTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	##################?6@:7<=@3=@ABAAB>BDBBABADABDDDBDDBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC	RG:Z:UNKNOWN	XG:i:0	XM:i:0	XN:i:0	XO:i:0	AS:i:0	XS:i:0	YT:Z:UU
+SRR065390.4251890	16	CHROMOSOME_I	3	1	100M	*	0	0	CTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	###########@BB=BCBBC?B>B;>B@@ADBBB@DBBBBDCCBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC	RG:Z:UNKNOWN	XG:i:0	XM:i:0	XN:i:0	XO:i:0	AS:i:0	XS:i:0	YT:Z:UU
+SRR065390.5238868	16	CHROMOSOME_I	3	1	100M	*	0	0	CTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	@,=@@D8D;?BBB>;?BBB==BB@D;>D>BBB>BBDDB<DABADCACDCCBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC	RG:Z:UNKNOWN	XG:i:0	XM:i:0	XN:i:0	XO:i:0	AS:i:0	XS:i:0	YT:Z:UU
+SRR065390.6023338	0	CHROMOSOME_I	3	1	100M	*	0	0	CTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAAGCTAC	CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC@CCDDDBCCABB=DABBA?################	RG:Z:UNKNOWN	XG:i:0	XM:i:3	XN:i:0	XO:i:0	AS:i:-6	XS:i:-6	YT:Z:UU
+SRR065390.6815812	16	CHROMOSOME_I	3	1	100M	*	0	0	CTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	###############?@.@?B;B0B=;<DADB@@BDDBBDDBCBCBD@CCDCCCCCCCDCCCCCCCCACCCCCCCCCCBCCCCCCDCCCCCCCCCCCBCC	RG:Z:UNKNOWN	XG:i:0	XM:i:0	XN:i:0	XO:i:0	AS:i:0	XS:i:0	YT:Z:UU
+SRR065390.6905811	16	CHROMOSOME_I	3	1	100M	*	0	0	CTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	#######################BB@>A<BC>@@BCCB@=BACBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC	RG:Z:UNKNOWN	XG:i:0	XM:i:0	XN:i:0	XO:i:0	AS:i:0	XS:i:0	YT:Z:UU
+SRR065390.8289592	16	CHROMOSOME_I	3	1	100M	*	0	0	CTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	###############################A?@C9@@BC=AABDD@A@DC@CB=@BA?6@CCAAC@+CCCCCCCCCCCCCCC@CCCCCCCCCCCCCCCC	RG:Z:UNKNOWN	XG:i:0	XM:i:0	XN:i:0	XO:i:0	AS:i:0	XS:i:0	YT:Z:UU
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/test_23.sam	Tue Sep 28 16:18:32 2021 +0000
@@ -0,0 +1,7 @@
+@HD	VN:1.4	SO:unsorted
+@SQ	SN:CHROMOSOME_I	LN:100
+@RG	ID:UNKNOWN	SM:UNKNOWN
+@PG	ID:bowtie2	PN:bowtie2	VN:2.0.0-beta5
+@PG	ID:0	CL:aaaaa/aaa/aaaaa/aaaaaa/aaaaaaaaa/aaa/iuc/package_aaaaaaaaa_x_y/aaaaaaaaaaaa/bin/aaaaaaaaaaaaaaaaa aaaaaaaaaa /aaaa/aaaaa/aaa/aaaaaaaaaaaaaaaaaaa/tools/aaaaaaaaa/test-data/test.cram aa /aaaa/aaaaa/aaa/aaaaaaaaaaaaaaaaaaa/tools/aaaaaaaaa/test-data/test.fa -O test	PN:samtools	VN:1.2
+@PG	ID:samtools	PN:samtools	PP:0	VN:1.12	CL:samtools view -@ 0 -h -s .0 -o outfile infile
+@PG	ID:samtools.1	PN:samtools	PP:samtools	VN:1.12	CL:samtools view -@ 0 -h -s .0 -o outfile infile
Binary file test-data/test_24.bam has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/test_25.sam	Tue Sep 28 16:18:32 2021 +0000
@@ -0,0 +1,9 @@
+@HD	VN:1.4	SO:unsorted
+@SQ	SN:CHROMOSOME_I	LN:100
+@RG	ID:UNKNOWN	SM:UNKNOWN
+@PG	ID:bowtie2	PN:bowtie2	VN:2.0.0-beta5
+@PG	ID:0	CL:aaaaa/aaa/aaaaa/aaaaaa/aaaaaaaaa/aaa/iuc/package_aaaaaaaaa_x_y/aaaaaaaaaaaa/bin/aaaaaaaaaaaaaaaaa aaaaaaaaaa /aaaa/aaaaa/aaa/aaaaaaaaaaaaaaaaaaa/tools/aaaaaaaaa/test-data/test.cram aa /aaaa/aaaaa/aaa/aaaaaaaaaaaaaaaaaaa/tools/aaaaaaaaa/test-data/test.fa -O test	PN:samtools	VN:1.2
+@PG	ID:samtools	PN:samtools	PP:0	VN:1.12	CL:samtools view -@ 0 -h -s 7.2 -o outfile infile
+SRR065390.14978392	16	CHROMOSOME_I	2	1	27M1D73M	*	0	0	CCTAGCCCTAACCCTAACCCTAACCCTAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	#############################@B?8B?BA@@DDBCDDCBC@CDCDCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC	RG:Z:UNKNOWN	XG:i:1	XM:i:5	XN:i:0	XO:i:1	AS:i:-18	XS:i:-18	YT:Z:UU
+SRR065390.921023	16	CHROMOSOME_I	3	12	100M	*	0	0	CTAAGCCTAAATCTAAGCCTAACCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	###############################################???88:;98768700000<>:BBA?BBAB?BBBBBBBB>B>BB::;?:00000	RG:Z:UNKNOWN	XG:i:0	XM:i:3	XN:i:0	XO:i:0	AS:i:-6	XS:i:-13	YT:Z:UU
+SRR065390.6023338	0	CHROMOSOME_I	3	1	100M	*	0	0	CTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAAGCTAC	CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC@CCDDDBCCABB=DABBA?################	RG:Z:UNKNOWN	XG:i:0	XM:i:3	XN:i:0	XO:i:0	AS:i:-6	XS:i:-6	YT:Z:UU
Binary file test-data/test_26.bam has changed
Binary file test-data/test_27.bam has changed
Binary file test-data/test_28.bam has changed
Binary file test-data/test_29.bam has changed
Binary file test-data/test_3.bam has changed
Binary file test-data/test_30.bam has changed
Binary file test-data/test_31.bam has changed
Binary file test-data/test_4.bam has changed
Binary file test-data/test_5.bam has changed
Binary file test-data/test_7.bam has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/test_8.bam	Tue Sep 28 16:18:32 2021 +0000
@@ -0,0 +1,180 @@
+@HD	VN:1.3	SO:queryname
+@SQ	SN:>chrM	LN:0
+@SQ	SN:GTATTCTTACTCCATAAACACATAGGCTTGGTCCTAGCCTTTTTATTAGT	LN:0
+@SQ	SN:CTAAATCACGTCTCTACGATTAAAAGGAGCAGGTATCAAGCACACTAGAA	LN:0
+@SQ	SN:ATAAAAATTAAGCTATGAACGAAAGTTCGACTAAGTCATATTAAATAAGG	LN:0
+@SQ	SN:ATAAATCTCCGGCGTAAAGCGTGTCAAAGACTAATACCAAAATAAAGTTA	LN:0
+@SQ	SN:AAGTGACTTTAATACCTCTGACTACACGATAGCTAAGACCCAAACTGGGA	LN:0
+@SQ	SN:AAGCTATTCGCCAGAGTACTACTAGCAACAGCCTAAAACTCAAAGGACTT	LN:0
+@SQ	SN:CCGATAAACCCCACCATCCCTTGCTAATTCAGCCTATATACCGCCATCTT	LN:0
+@SQ	SN:AACGTTAGGTCAAGGTGTAGCCCATGGGATGGAGAGAAATGGGCTACATT	LN:0
+@SQ	SN:TGGAGACTAAAGGAGGATTTAGCAGTAAATTAAGAATAGAGAGCTTAATT	LN:0
+@SQ	SN:CACAAATCATAACATAACATAAAACCGTGACCCAAACATATGAAAGGAGA	LN:0
+@SQ	SN:TGTAGCTTAAACAAAGCATCCAGCTTACACCTAGAAGATTTCACTCAAAA	LN:0
+@SQ	SN:TTAGTCACTTAACTAAAACATTCACCAAACCATTAAAGTATAGGAGATAG	LN:0
+@SQ	SN:ATGCATTAAAAGTACTAAACAGCAAAGCTTACCCCTTTTACCTTTTGCAT	LN:0
+@SQ	SN:CGAAACCAGACGAGCTACCTATGAACAGTTACAAATGAACCAACTCATCT	LN:0
+@SQ	SN:AGCCTGGTGATAGCTGGTTGTCCAGAAACAGAATTTCAGTTCAAATTTAA	LN:0
+@SQ	SN:AAAGGTACAGCTTTTTAGATACAGGTTACAACCTTCATTAGAGAGTAAGA	LN:0
+@SQ	SN:TTCAAGCTCAACGACACATCTATCTTAATCCCAACAATCAACCCAAACTA	LN:0
+@SQ	SN:TTAATATGAGTAACAAGAATTATTTCTCCTTGCATAAGCTTATATCAGAA	LN:0
+@SQ	SN:TCATCTATTTAAACCATTGTTAACCCAACACAGGCATGCATCTATAAGGA	LN:0
+@SQ	SN:ACCAAAAACATCACCTCTAGCATTTCCAGTATTAGAGGCACTGCCTGCCC	LN:0
+@SQ	SN:taatcacttgttccctaaatagggacttgtatgaatggccacacgagggt	LN:0
+@SQ	SN:cgggaatgactaaataagacgagaagaccctatggagcttTAATTAACTG	LN:0
+@SQ	SN:TTGATTGAATCAGCAATTTCGGTTGGGGTGACCTCGGAGAACAAAACAAC	LN:0
+@SQ	SN:TTGATCCAAACCATTGATCAACGGAACAAGTTACCCTAGGGATAACAGCG	LN:0
+@SQ	SN:TTGGATCAAGACATCCTAATGGTGCAACCGCTATTAAGGGTTCGTTTGTT	LN:0
+@SQ	SN:CGGTTTCTATCTATTCTATACTTTTCCCAGTACGAAAGGACAAGAAAAGT	LN:0
+@SQ	SN:AATCTAACTAATTTATAACTTCTACCGCCCTAGAACAGGGCTCgttaggg	LN:0
+@SQ	SN:caactcctctccctaacaacaTGTTCATAATTAACGTCCTCCTCCTAATT	LN:0
+@SQ	SN:CTTAGGCTATATGCAACTTCGCAAAGGACCCAACATCGTAGGCCCCTATG	LN:0
+@SQ	SN:CTACAACCACTAACATCATCGACATCCATATTCATCATCGCACCAATCCT	LN:0
+@SQ	SN:CACTAATCAACATAAACCTAGGAATTCTATTCATACTAGCCATGTCCAGC	LN:0
+@SQ	SN:CGCCCTAATTGGAGCTCTACGAGCAGTAGCACAAACCATCTCATACGAAG	LN:0
+@SQ	SN:ACATTATCAACACTTATTATTACCCAAGAATACCTCTGATTAATCTTCCC	LN:0
+@SQ	SN:ACCGAGCTCCATTTGACCTAACAGAAGGAGAATCAGAACTCGTCTCTGGA	LN:0
+@SQ	SN:ATACGCAAACATCATCATGATAAACATCTTCACAACAACCCTATTTCTAG	LN:0
+@SQ	SN:ATTAAAGCTCTCCTTCTAACATGTTCCTTCCTATGAATCCGAGCATCCTA	LN:0
+@SQ	SN:TACCACTCACACTAGCCCTCTGCATATGACACGTCTCACTTCCAATCATA	LN:0
+@SQ	SN:ACTTTGATAGAGTAAAACATAGAGGCTCAAACCCTCTTATTTctagaact	LN:0
+@SQ	SN:ttacaccatgtcctaCAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCAT	LN:0
+@SQ	SN:CTTCACAACTATTCTAATAACAGTTCTTCTAGGAACTATAATCGTTATAA	LN:0
+@SQ	SN:GCCATTATCCCTATCCTAATAAAAAAGTACAATCCCCGAACCATAGAAGC	LN:0
+@SQ	SN:TAGCGATCATCATTAACCTCATACACTCAGGCCAATGAACAATCACAAAA	LN:0
+@SQ	SN:ACTTGGACTCACACCATTCCACTTCTGAGTACCCGAAGTCACACAGGGCA	LN:0
+@SQ	SN:ATATCAATCCTATATCAAATCTCACCCTCAATTAACCTAAATATCTTATT	LN:0
+@SQ	SN:AAACCCAACTACGAAAAATCATAGCATACTCGTCAATCGCGCATATAGGA	LN:0
+@SQ	SN:ATTAATTTACATTATAATAACACTCACAATATTCATACTATTTATCCACA	LN:0
+@SQ	SN:CTAACCACTACACTAATCTTAATTACCTTACTATCCATAGGAGGCCTCCC	LN:0
+@SQ	SN:AAAATAGCAGCATCATCCTCCCCACACTAATAGCCATTATAGCACTACTC	LN:0
+@SQ	SN:CCCATCCACAAACAACATAAAAATAAAATGACAATTCGAAACCAAACGAA	LN:0
+@SQ	SN:ACCCCCATACTATCAATTTTGGACTAGGAATTTAGGTTAACATCCCAGAC	LN:0
+@SQ	SN:TAAGGACTGCGAGACTCTATCTCACATCAATTGAACGCAAATCAAACTCT	LN:0
+@SQ	SN:TTTAGTTAACAGCTAAATACCCTAATCAACTGGCTTCAATCTACTTCTCC	LN:0
+@SQ	SN:TCCTTTGAATTTGCAATTCAATGTGAAAATTCACCACGGGACTTGATAAG	LN:0
+@SQ	SN:CCATCTTACCTATGTTCATCAACCGCTGACTATTTTCAACTAACCACAAA	LN:0
+@SQ	SN:AACTGCCCTAAGCCTCCTAATCCGTGCTGAATTAGGCCAACCTGGGACCC	LN:0
+@SQ	SN:GTAATAATTTTCTTTATGGTCATACCCATTATAATCGGAGGATTCGGAAA	LN:0
+@SQ	SN:TAAACAACATAAGCTTCTGATTACTTCCCCCATCATTCCTACTTCTTCTC	LN:0
+@SQ	SN:TCCTCTAGCTGGAAATCTGGCGCATGCAGGAGCCTCTGTTGACTTAACCA	LN:0
+@SQ	SN:TTTATTACCACAATCATTAACATAAAACCACCAGCCCTATCCCAATATCA	LN:0
+@SQ	SN:TAGCCCTCCCGGTCCTAGCAGCAGGCATTACCATGCTTCTCACAGACCGT	LN:0
+@SQ	SN:TTATCAACACCTATTCTGATTCTTCGGACACCCCGAAGTCTATATTCTTA	LN:0
+@SQ	SN:AAAAAGGAACCTTTTGGCTACATGGGTATAGTGTGAGCTATAATATCCAT	LN:0
+@SQ	SN:TAGACGTTGACACACGAGCATACTTCACATCAGCTACCATAATCATCGCT	LN:0
+@SQ	SN:AAATATCAAATGATCTCCAGCTATACTCTGAGCTCTAGGCTTCATCTTCT	LN:0
+@SQ	SN:GATATTGTTCTCCACGATACTTATTATGTAGTAGCACATTTCCATTATGT	LN:0
+@SQ	SN:TCCCTCTATTCTCAGGATACACACTCAACCAAACCTGAGCAAAAATCCAC	LN:0
+@SQ	SN:CCTTGGCCTCTCAGGAATGCCACGACGCTATTCTGATTATCCAGACGCAT	LN:0
+@SQ	SN:GCAGTGATACTAATAATTTTCATAATTTGAGAAGCGTTCGCATCCAAACG	LN:0
+@SQ	SN:GATGCCCCCCACCATACCACACATTTGAAGAACCCACCTACGTAAACCTA	LN:0
+@SQ	SN:tcataaccactatgtctttctcCATCAATTGAGGTATTAGTAAAAATTAC	LN:0
+@SQ	SN:GCCTACCCCTTCCAACTAGGATTCCAAGACGCAACATCCCCTATTATAGA	LN:0
+@SQ	SN:GCTCTCTAGTATTATATATTATCTCATCAATACTAACAACTAAATTAACC	LN:0
+@SQ	SN:ACCAGCCATCATCCTTATTCTAATCGCCCTCCCATCCCTACGAATTCTAT	LN:0
+@SQ	SN:CACCAATGATACTGAAGCTACGAGTATACCGATTACGAAGACTTGACCTT	LN:0
+@SQ	SN:TTCTAGAAGTCGACAATCGAGTGGTTCTCCCCATAGAAATAACCATCCGA	LN:0
+@SQ	SN:AGGCCTAAAAACAGACGCTATCCCTGGGCGCCTAAATCAGACAACTCTCG	LN:0
+@SQ	SN:TCAAACCACAGCTTTATACCAATTGTCCTTGAACTAGTTCCACTGAAACA	LN:0
+@SQ	SN:TAGCATTAACCTTTTAAGTTAAAGATTGAGGGTTCAACCCCCTCCCTAGT	LN:0
+@SQ	SN:AATCCTAACTCTATTTATTGTATTTCAACTAAAAATCTCAAAGCACTCCT	LN:0
+@SQ	SN:CCTTGAGAATCAAAATGAACGAAAATCTATTCGCCTCTTTCGCTACCCCA	LN:0
+@SQ	SN:CCTATTCCCCTCACCCAACCGACTAATCAACAATCGCCTAATCTCAATTC	LN:0
+@SQ	SN:AGCAAAGGACAAACCTGAACTCTTATACTCATATCACTGATCCTATTCAT	LN:0
+@SQ	SN:CACAACTATCAATAAACCTAGGCATAGCTATTCCCCTATGGGCAGGGACA	LN:0
+@SQ	SN:ACCTCAAGGGACGCCCATTTTCCTCATCCCCATACTAGTAATTATCGAGA	LN:0
+@SQ	SN:AACATTACCGCCGGACACCTCCTAATACACCTCATCGGAGGGGCAACACT	LN:0
+@SQ	SN:TAATTCTACTAACTATCCTCGAATTCGCAGTAGCTATAATCCAAGCCTAC	LN:0
+@SQ	SN:CACCAAACCCACGCTTACCACATAGTAAACCCCAGCCCATGACCACTTAC	LN:0
+@SQ	SN:ACTTTAACTCAACCTTACTTCTAGCTATAGGGCTATTAACTAACATCCTT	LN:0
+@SQ	SN:CCATCACACATCAATCGTTCAAAAGGGACTCCGATATGGCATAATCCTTT	LN:0
+@SQ	SN:CACTCAAGCCTAGCCCCCACACCCGAACTAGGCGGCTGCTGACCACCCAC	LN:0
+@SQ	SN:TGCTCCTAGCATCTGGAGTCTCTATCACCTGAGCCCACCATAGCCTAATA	LN:0
+@SQ	SN:AGGCGTATACTTCACCCTTCTCCAAGCCTCAGAATACTATGAAGCCTCAT	LN:0
+@SQ	SN:TTCCACGGACTACACGTAATTATCGGATCTACCTTCCTCATTGTATGTTT	LN:0
+@SQ	SN:AAGCAGCCGCTTGATACTGACACTTCGTCGACGTAGTCTGACTATTCTTG	LN:0
+@SQ	SN:CAATTGACTTCCAATCAATCAGCTTCGGTATAACCCGAAAAAGAATAATA	LN:0
+@SQ	SN:ACTCATCGCATTCTGACTACCACAACTAAACATCTATGCAGAAAAAACCA	LN:0
+@SQ	SN:TCAATAAAATTTTTCTTAGTGGCCATTACATTTCTGCTATTCGACTTAGA	LN:0
+@SQ	SN:ACACTATACTTATCATAGCACTAGTCCTAATCTCTCTTCTAGCCATCAGC	LN:0
+@SQ	SN:TTAGTTTAAACCAAAACAAATGATTTCGACTCATTAAACTATGATTAACT	LN:0
+@SQ	SN:ACAGTATCCCTCGTAGGCCTACTAATGTACCGATCCCACCTAATATCCTC	LN:0
+@SQ	SN:TAATAGTCCTAAACACCCACTTCACACTAGCTAGTATAATACCTATCATC	LN:0
+@SQ	SN:CATAGTCTCCAATACTTATGGAGTAGACCACGTACAAAACCTTAACCTCC	LN:0
+@SQ	SN:GACTATCAAAAAAGAATATAATCTGAATCAACACTACAACCTATAGTCTA	LN:0
+@SQ	SN:CCTAAACTTCTCACTAATATTCTTCTCCGATCCCCTATCAGCCCCACTTC	LN:0
+@SQ	SN:CATCTATCTAAGGAACCACTAATCCGAAAAAAACTCTACATCACCATGCT	LN:0
+@SQ	SN:TCTCCTTCTACATCCTATTTGAAGCCACATTAGTTCCAACACTAATTATC	LN:0
+@SQ	SN:CCTATTCTACACACTAATAGGTTCCCTCCCACTCTTAGTTGCACTAATCT	LN:0
+@SQ	SN:AACCAAGCACTACCCGACTCTTGATCCAATATTTTCCTATGACTAGCATG	LN:0
+@SQ	SN:TCCCAAAAGCCCATGTAGAAGCCCCAATTGCCGGATCCATAGTGCTAGCA	LN:0
+@SQ	SN:ACTAAACCCCCAAACTAGCTTTATAGCCTACCCCTTCCTCATACTATCCC	LN:0
+@SQ	SN:AAATCACTTATTGCATACTCCTCTGTCAGCCACATAGCCCTAGTAATCGT	LN:0
+@SQ	SN:TAATCGCTCACGGCCTTACATCATCAATACTATTCTGCCTGGCAAACTCA	LN:0
+@SQ	SN:AACACTTCTTCCCCTTATAGCAGCCTGATGACTATTAGCCAGCCTAACCA	LN:0
+@SQ	SN:ATATCATCATTCTCATGATCAAATATTACCATTATCCTAATAGGAGCCAA	LN:0
+@SQ	SN:GAGGGAAATACACACACCATATCAACAGCATTAAACCTTCATTTACACGA	LN:0
+@SQ	SN:TAACCCTAAAATTATCCTAGGCTTTACGTACTGTAAATATAGTTTAACAA	LN:0
+@SQ	SN:CGAGAAAGTATGCAAGAACTGCTAATTCATGCCCCCATGTCCAACAAACA	LN:0
+@SQ	SN:CCAAAAAATTGGTGCAACTCCAAATAAAAGTAATCAACATGTTCTCCTCC	LN:0
+@SQ	SN:CTTCAATACCTACAAAAACAGCACGTTCCCGCATCATGTAAAAAACACTA	LN:0
+@SQ	SN:TCTGGACAAGAAACAATTATCTCAAACTGACACTGAATAACCATACAAAC	LN:0
+@SQ	SN:TACCAGTAGCCCTATTCGTAACATGATCTATTATGGAATTCTCCCTATGA	LN:0
+@SQ	SN:ATTCCTCATCACTATAATAATTCTAGTCACAGCTAACAACCTTTTCCAAC	LN:0
+@SQ	SN:TGATGATACGGCCGAACAGATGCCAACACCGCGGCCCTTCAAGCAATCCT	LN:0
+@SQ	SN:TATTCAACACCAACACATGAGACCTCCAACAAATCTTCATACTCGACCCC	LN:0
+@SQ	SN:ATCCGCTCAATTTGGACTCCACCCATGACTTCCTTCAGCCATAGAGGGCC	LN:0
+@SQ	SN:GTCTTCCTGCTAATCCGCTTCCATCCACTAATAGAAAACAACAAAACAAT	LN:0
+@SQ	SN:TCTGCGCACTCACTCAAAACGATATCAAAAAAATCATTGCTTTCTCCACC	LN:0
+@SQ	SN:CCTAGCATTCCTCCACATTTGCACTCACGCATTCTTCAAAGCTATACTAT	LN:0
+@SQ	SN:CGAAAAATAGGCGGACTATTTAATGCAATACCCTTCACCACCACATCTCT	LN:0
+@SQ	SN:ACTCCAAAGACCTCATCATCGAAACCGCCAACACATCGTACACCAACGCC	LN:0
+@SQ	SN:TACCCGAATCATCTTCTTTGCACTCCTAGGGCAACCCCGCTTCCTCCCTC	LN:0
+@SQ	SN:CTCTTAATTGGCAGCATTTTTGCCGGATTCTTCATCTCCAACAATATCTA	LN:0
+@SQ	SN:CCCTCGCAGTAACCATCCTAGGATTTACACTAGCCCTAGAACTAAGCTTG	LN:0
+@SQ	SN:CAACCTCCTAGGATACTACCCAACAATTATACACCGACTCCCACCGCTCG	LN:0
+@SQ	SN:TGACTAGAAAACATCCTGCCAAAATCTATCTCCCAGTTCCAAATAAAAAC	LN:0
+@SQ	SN:CATTCCTCATCACCCTTACCCTAAGCATACTACTTTTTAATCTCCACGAG	LN:0
+@SQ	SN:ATCACAACCCAAGCCCCATAACTATACAATGCAGCAGCCCCTATAATTTC	LN:0
+@SQ	SN:CACCACTAAACTTAAACACTACCCCCACTTCCTCACTCTTCAGAACATAT	LN:0
+@SQ	SN:AGTCGTATTAGACACCCATACCTCAGGATACTGCTCAGTAGCCATAGCCG	LN:0
+@SQ	SN:ATCAACCCCAAAAAGGACCCTCCAAAATTCATAATAATACCACAACCTAC	LN:0
+@SQ	SN:AAGAAAACCCCACAAAACTAACAACAAAAATAACACTCAAAATAAACACA	LN:0
+@SQ	SN:GAAAAATCATCGTTGTATTTCAACTATAAGAACACCAATGACAAACATCC	LN:0
+@SQ	SN:CCAGCCCCCTCAAACATTTCATCATGATGAAACTTCGGCTCCCTCCTAGG	LN:0
+@SQ	SN:ACACATCAGACACGACAACTGCCTTCTCATCCGTCACTCACATCTGCCGA	LN:0
+@SQ	SN:AATATTTTTTATCTGCCTCTTCATTCACGTAGGACGCGGCCTCTACTACG	LN:0
+@SQ	SN:ACAGTTATAGCTACAGCATTCATGGGCTATGTCCTACCATGAGGCCAAAT	LN:0
+@SQ	SN:ACATCGGTACTACCCTCGTCGAGTGAATCTGAGGTGGATTCTCAGTAGAC	LN:0
+@SQ	SN:CATCACAGCCCTGGTAGTCGTACATTTACTATTTCTTCACGAAACAGGAT	LN:0
+@SQ	SN:CCATATTATACAATTAAAGACATCCTAGGACTCCTCCTCCTGATCTTGCT	LN:0
+@SQ	SN:ACTACACCCCAGCTAACCCTCTCAGCACTCCCCCTCATATTAAACCAGAA	LN:0
+@SQ	SN:AGGCGGCGTATTAGCCCTAATCCTCTCCATCCTGATCCTAGCACTCATCC	LN:0
+@SQ	SN:CAATGCGTATTCTGACTCTTAGTGGCAGACTTACTGACACTAACATGAAT	LN:0
+@SQ	SN:CAATCCTCTACTTCTCCCTAATTCTCATTTTTATACCACTCGCAAGCACC	LN:0
+@SQ	SN:ACCCTGGTCTTGTAAACCAGAAAAGGGGGAAAACGTTTCCTCCCAAGGAC	LN:0
+@SQ	SN:TACTTAAACTATTCCTTGATTTCTTCCCCTAAACGACAACAATTTACCCT	LN:0
+@SQ	SN:CTGACATGCAATATCTTATGAATGGCCTATGTACGTCGTGCATTAAATTG	LN:0
+@SQ	SN:GTACATTATATTATTGATCGTGCATACCCCATCCAAGTCAAATCATTTCC	LN:0
+@SQ	SN:GCGGGAAATCAGCAACCCTCCCAACTACGTGTCCCAATCCTCGCTCCGGG	LN:0
+@SQ	SN:TCTTTCTTCAGGGCCATTCCCACCCAACCTCGCCCATTCTTTCCCCTTAA	LN:0
+@SQ	SN:CTGTGATTTCATGCATTTGGTATCTTTTTATATTTGGGGATGCTATGACT	LN:0
+@SQ	SN:CTTAAATTGAACGTTATTCCTCCGCATCAGCAACCATAAGGTGTTATTCA	LN:0
+@SQ	SN:ctgtgcacctgtgcacctgtgcacctgtgcacctgtgcacctgtgcacct	LN:0
+@SQ	SN:gcacctgtgcacctgtgcacctgtgcacctgtgcacctgtgcacctgtgc	LN:0
+@SQ	SN:ctgtgcacctACCCGCGCAGTAAGCAAGTAATATAGCTTTCTTAATCAAA	LN:0
+@SQ	SN:GCCAAACCCCAAAAACAAGACTAAACAATGCACAATACTTCATGAAGCTT	LN:0
+@SQ	SN:GAACTTTCCCCCCGCCATTAATACCAACATGCTACTTTAATCAATAAAAT	LN:0
+@SQ	SN:TTCTTCCCCC	LN:0
+@PG	ID:samtools	PN:samtools	VN:1.12	CL:samtools view -@ 0 -h -o outfile infile
+HWI-EAS91_1_30788AAXX:1:1:1218:141	16	*	14062	25	36M	*	0	0	ACAAAACTAACAACAAAAATAACACTCNNAATAAAC	I+IIII1IIIIIIIIIIIIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27
+HWI-EAS91_1_30788AAXX:1:1:1310:991	16	*	10002	25	36M	*	0	0	CTCCTATGCCTAGAAGGAATAATACTANNACTATTC	I:2IEI:IIDIIIIII4IIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27
+HWI-EAS91_1_30788AAXX:1:1:1398:854	16	*	3921	25	36M	*	0	0	CACCCTTCCCGTACTAATAAATCCCCTNNTCTTCAC	IIIII=AIIIIIIIIIIIIIIBIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27
+HWI-EAS91_1_30788AAXX:1:1:1491:637	16	*	10864	25	36M	*	0	0	TGTAGAAGCCCCAATTGCCGGATCCATNNTGCTAGC	DBAIIIIIIIIIIIFIIIIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27
+HWI-EAS91_1_30788AAXX:1:1:1513:715	16	*	9563	25	36M	*	0	0	CTGACTACCACAACTAAACATCTATGCNNAAAAAAC	I+-II?IDIIIIIIIIIIIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27
+HWI-EAS91_1_30788AAXX:1:1:1630:59	16	*	12387	25	36M	*	0	0	TCATACTCGACCCCAACCTTACCAACCNNCCGCTCC	FIIHII;IIIIIIIIIIIIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27
+HWI-EAS91_1_30788AAXX:1:1:1634:211	0	*	9350	25	36M	*	0	0	GAAGCAGNNGCTTGATACTGACACTTCGTCGACGTA	IIIIIII""IIIIIIIIIIIIIIIIIIIIII9IIDF	NM:i:1	X1:i:1	MD:Z:7N0N27
+HWI-EAS91_1_30788AAXX:1:1:1698:516	16	*	2735	25	36M	*	0	0	TTTACACTCAGAGGTTCAACTCCTCTCNNTAACAAC	I9IIIII5IIIIIIIIIIIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27
+HWI-EAS91_1_30788AAXX:1:1:1711:249	16	*	10617	25	36M	*	0	0	ACCAAACAGAACGCCTGAACGCAGGCCNNTACTTCC	IIIIIIIIIIIIIIIIIIIIIIIIIII""IIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27
+HWI-EAS91_1_30788AAXX:1:1:1716:413	0	*	6040	25	36M	*	0	0	GATCCAANNCTTTATCAACACCTATTCTGATTCTTC	IIIIIII""IIIIIIIIIIIIIIIIIIIIIIIIIII	NM:i:1	X1:i:1	MD:Z:7N0N27
--- a/test-data/test_counts.tab	Mon Jan 04 10:43:33 2021 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-10
Binary file test-data/test_ds.bam has changed
Binary file test-data/test_ds.cram has changed
--- a/test-data/test_ds.sam	Mon Jan 04 10:43:33 2021 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-@HD	VN:1.4	SO:unsorted
-@SQ	SN:CHROMOSOME_I	LN:100
-@RG	ID:UNKNOWN	SM:UNKNOWN
-@PG	ID:bowtie2	PN:bowtie2	VN:2.0.0-beta5
-@PG	ID:0	CL:aaaaa/aaa/aaaaa/aaaaaa/aaaaaaaaa/aaa/iuc/package_aaaaaaaaa_x_y/aaaaaaaaaaaa/bin/aaaaaaaaaaaaaaaaa aaaaaaaaaa /aaaa/aaaaa/aaa/aaaaaaaaaaaaaaaaaaa/tools/aaaaaaaaa/test-data/test.cram aa /aaaa/aaaaa/aaa/aaaaaaaaaaaaaaaaaaa/tools/aaaaaaaaa/test-data/test.fa -O test	PN:samtools	VN:1.2
-SRR065390.14978392	16	CHROMOSOME_I	2	1	27M1D73M	*	0	0	CCTAGCCCTAACCCTAACCCTAACCCTAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	#############################@B?8B?BA@@DDBCDDCBC@CDCDCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC	RG:Z:UNKNOWN	XG:i:1	XM:i:5	XN:i:0	XO:i:1	AS:i:-18	XS:i:-18	YT:Z:UU
-SRR065390.921023	16	CHROMOSOME_I	3	12	100M	*	0	0	CTAAGCCTAAATCTAAGCCTAACCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAA	###############################################???88:;98768700000<>:BBA?BBAB?BBBBBBBB>B>BB::;?:00000	RG:Z:UNKNOWN	XG:i:0	XM:i:3	XN:i:0	XO:i:0	AS:i:-6	XS:i:-13	YT:Z:UU
-SRR065390.6023338	0	CHROMOSOME_I	3	1	100M	*	0	0	CTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAGCCTAAAGCTAC	CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC@CCDDDBCCABB=DABBA?################	RG:Z:UNKNOWN	XG:i:0	XM:i:3	XN:i:0	XO:i:0	AS:i:-6	XS:i:-6	YT:Z:UU
Binary file test-data/test_input_1_a.bam has changed