[med-svn] [Git][med-team/biobambam2][master] 7 commits: routine-update: New upstream version

Étienne Mollier (@emollier) gitlab at salsa.debian.org
Tue Jun 29 22:37:13 BST 2021



Étienne Mollier pushed to branch master at Debian Med / biobambam2


Commits:
ab59bdfb by Étienne Mollier at 2021-06-29T22:17:41+02:00
routine-update: New upstream version

- - - - -
09fe9354 by Étienne Mollier at 2021-06-29T22:17:42+02:00
New upstream version 2.0.182+ds
- - - - -
5895e33c by Étienne Mollier at 2021-06-29T22:17:43+02:00
Update upstream source from tag 'upstream/2.0.182+ds'

Update to upstream version '2.0.182+ds'
with Debian dir ea2832d51a480958703d79cf3da787aed75beb4d
- - - - -
7c45285b by Étienne Mollier at 2021-06-29T22:18:48+02:00
remove manuals.patch; applied upstream

- - - - -
0ca7388e by Étienne Mollier at 2021-06-29T22:19:32+02:00
remove spelling-error-in-binary.patch

applied upstream

- - - - -
b9d8a988 by Étienne Mollier at 2021-06-29T23:20:38+02:00
update changelog

- - - - -
fa497f90 by Étienne Mollier at 2021-06-29T23:21:52+02:00
ready to upload to experimental

- - - - -


27 changed files:

- ChangeLog
- configure.ac
- debian/changelog
- − debian/patches/manuals.patch
- − debian/patches/series
- − debian/patches/spelling-error-in-binary.patch
- src/Makefile.am
- + src/programs/bamadapterhistogram.cpp
- src/programs/bamalignfrac.1
- src/programs/bamauxmerge.1
- src/programs/bamauxmerge.cpp
- src/programs/bamauxmerge2.1
- src/programs/bamcollate2.1
- src/programs/bamconsensus.1
- src/programs/bamfastcat.cpp
- src/programs/bammarkduplicates.1
- src/programs/bammarkduplicates2.1
- src/programs/bammarkduplicatesopt.1
- src/programs/bammaskflags.1
- src/programs/bammdnm.1
- src/programs/bamreset.1
- + src/programs/bamsalvage.cpp
- src/programs/bamsort.1
- src/programs/bamstreamingmarkduplicates.1
- src/programs/bamvalidate.cpp
- src/programs/fastqtobam.1
- src/programs/fastqtobam2.cpp


Changes:

=====================================
ChangeLog
=====================================
@@ -1,3 +1,21 @@
+biobambam2 (2.0.182-1) unstable; urgency=medium
+
+  * Add O (output file) option for bamfastcat
+
+ -- German Tischler-Höhle <germant at miltenyibiotec.de>  Sun, 11 Apr 2021 23:40:35 +0200
+
+biobambam2 (2.0.181-1) unstable; urgency=medium
+
+  * Add clipslashid and patchne flags in fastqtobam2
+
+ -- German Tischler-Höhle <germant at miltenyibiotec.de>  Fri, 02 Apr 2021 15:57:51 +0200
+
+biobambam2 (2.0.180-1) unstable; urgency=medium
+
+  * bump libmaus2 version due to fixes for io_lib(cram) and tmp file generation in libmaus2
+
+ -- German Tischler-Höhle <germant at miltenyibiotec.de>  Mon, 15 Mar 2021 23:05:17 +0100
+
 biobambam2 (2.0.178-1) unstable; urgency=medium
 
   * Add bamaddne


=====================================
configure.ac
=====================================
@@ -1,4 +1,4 @@
-AC_INIT(biobambam2,2.0.179,[germant at miltenyibiotec.de],[biobambam2],[https://gitlab.com/german.tischler/biobambam2])
+AC_INIT(biobambam2,2.0.182,[germant at miltenyibiotec.de],[biobambam2],[https://gitlab.com/german.tischler/biobambam2])
 AC_CANONICAL_SYSTEM
 AC_PROG_LIBTOOL
 
@@ -165,7 +165,7 @@ if test ! -z "${with_libmaus2}" ; then
 	fi
 fi
 
-PKG_CHECK_MODULES([libmaus2],[libmaus2 >= 2.0.767])
+PKG_CHECK_MODULES([libmaus2],[libmaus2 >= 2.0.774])
 
 if test ! -z "${with_libmaus2}" ; then
 	if test ! -z "${PKGCONFIGPATHSAVE}" ; then
@@ -268,57 +268,6 @@ if test "${have_libmaus2_iolib}" = "yes" ; then
 	LIBMAUS2IOLIBDEFINE="#define BIOBAMBAM_LIBMAUS2_HAVE_IO_LIB"
 fi
 
-## zzzz
-
-AC_LANG_PUSH([C++])
-AC_MSG_CHECKING([whether libmaus2 has support for iRODS])
-	AC_LINK_IFELSE([AC_LANG_SOURCE([
-#include <libmaus2/LibMausConfig.hpp>
-
-				int main(int argc, char * argv[[]]) {
-					#if ! defined(LIBMAUS2_HAVE_IRODS)
-					#error "installed libmaus2 does not support iRODS"
-					#endif
-					return 0;
-			}])],
-			have_libmaus2_irods=yes,
-			have_libmaus2_irods=no
-		)
-AC_LANG_POP
-AC_MSG_RESULT($have_libmaus2_irods)
-
-LIBMAUS2IRODSDEFINE=
-LIBMAUS2IRODSCPPFLAGS=
-LIBMAUS2IRODSLIBS=
-if test "${have_libmaus2_irods}" = "yes" ; then
-	if test ! -z "${with_libmaus2}" ; then
-		PKGCONFIGPATHSAVE="${PKG_CONFIG_PATH}"
-		if test -z "${PKG_CONFIG_PATH}" ; then
-			export PKG_CONFIG_PATH="${with_libmaus2}/lib/pkgconfig"
-		else
-			export PKG_CONFIG_PATH="${with_libmaus2}/lib/pkgconfig:${PKG_CONFIG_PATH}"
-		fi
-	fi
-
-	PKG_CHECK_MODULES([libmaus2irods],[libmaus2irods >= 2.0.749])
-
-	LIBMAUS2IRODSCPPFLAGS="${libmaus2irods_CFLAGS}"
-	LIBMAUS2IRODSLIBS="${libmaus2irods_LIBS}"
-
-	LIBMAUS2CPPFLAGS="${LIBMAUS2CPPFLAGS} ${LIBMAUS2IRODSCPPFLAGS}"
-	LIBMAUS2LIBS="${LIBMAUS2LIBS} ${LIBMAUS2IRODSLIBS}"
-	CPPFLAGS="${CPPFLAGS} ${LIBMAUS2IRODSCPPFLAGS}"
-	LIBS="${LIBS} ${LIBMAUS2IRODSLIBS}"
-
-	if test ! -z "${with_libmaus2}" ; then
-		if test ! -z "${PKGCONFIGPATHSAVE}" ; then
-			export PKG_CONFIG_PATH="${PKGCONFIGPATHSAVE}"
-		fi
-	fi
-
-	LIBMAUS2IRODSDEFINE="#define BIOBAMBAM_LIBMAUS2_HAVE_IRODS"
-fi
-
 CPPFLAGS="${CPPFLAGS_SAVE}"
 LDFLAGS="${LDFLAGS_SAVE}"
 LIBS="${LIBS_SAVE}"
@@ -463,7 +412,7 @@ AC_ARG_ENABLE(install_uncommon,
         AS_HELP_STRING([--enable-install-uncommon],[enable installation of some uncommon programs (default no)]),
         [install_uncommon=${enableval}],[install_uncommon=no])
 
-UNCOMMON="bamfilter bamfilterbyname bamfixmatecoordinates bamfixmatecoordinatesnamesorted bamtoname bamdisthist fastabgzfextract bamheap bamfrontback bamrandomtag bamheap2 bamheap3 bamtagconversion fastqtobampar bambisect vcffilterinfo vcfpatchcontigprepend vcfconcat vcfsort filtergtf bamconsensus vcfreplacecontigs vcffiltersamples bamexploderg bamexondepth bamheadercat bammarkduplicatesoptdist vcfdiff bamsimpledepth bamdepthmerge bamcountflags vcffilterfilterflags vcfreplacecontigsmap fastaselectreg bamdifference bamaddne"
+UNCOMMON="bamfilter bamfilterbyname bamfixmatecoordinates bamfixmatecoordinatesnamesorted bamtoname bamdisthist fastabgzfextract bamheap bamfrontback bamrandomtag bamheap2 bamheap3 bamtagconversion fastqtobampar bambisect vcffilterinfo vcfpatchcontigprepend vcfconcat vcfsort filtergtf bamconsensus vcfreplacecontigs vcffiltersamples bamexploderg bamexondepth bamheadercat bammarkduplicatesoptdist vcfdiff bamsimpledepth bamdepthmerge bamcountflags vcffilterfilterflags vcfreplacecontigsmap fastaselectreg bamdifference bamaddne bamadapterhistogram bamsalvage"
 UNCOMMONINSTALLED=
 UNCOMMONUNINSTALLED=
 if test "${install_uncommon}" = "yes" ; then


=====================================
debian/changelog
=====================================
@@ -1,9 +1,10 @@
-biobambam2 (2.0.179+ds-2) UNRELEASED; urgency=medium
+biobambam2 (2.0.182+ds-1~0exp0) experimental; urgency=medium
 
-  * Patches forwarded upstream.
+  * New upstream version
+  * all patches removed after application upstream
   * d/control: updated my uploader address
 
- -- Étienne Mollier <etienne.mollier at mailoo.org>  Sun, 27 Jun 2021 09:34:47 +0200
+ -- Étienne Mollier <emollier at debian.org>  Tue, 29 Jun 2021 23:14:44 +0200
 
 biobambam2 (2.0.179+ds-1) unstable; urgency=medium
 


=====================================
debian/patches/manuals.patch deleted
=====================================
@@ -1,442 +0,0 @@
-Description: miscellaneous manual pages fixes
-Author: Étienne Mollier <etienne.mollier at mailoo.org>
-Forwarded: https://gitlab.com/german.tischler/biobambam2/-/merge_requests/41
-Last-Update: 2021-02-20
----
-This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
---- biobambam2.orig/src/programs/bamalignfrac.1
-+++ biobambam2/src/programs/bamalignfrac.1
-@@ -1,6 +1,6 @@
- .TH BAMALIGNFRAC 1 "July 2019" BIOBAMBAM
- .SH NAME
--bamalignfrac - compute fraction of aligned bases in alignment file
-+bamalignfrac \- compute fraction of aligned bases in alignment file
- .SH SYNOPSIS
- .PP
- .B bamalignfrac
-@@ -10,30 +10,31 @@
- bamalignfrac reads a SAM/BAM/CRAM file, computes a set of statistical values
- and outputs these on the standard output channel. The values produced are
- 
--.It Cm
--* the number of names passing a given regex filter
-+.IP *
-+the number of names passing a given regex filter
- 
--.It Cm
--* the number of primary alignments
-+.IP *
-+the number of primary alignments
- 
--.It Cm
--* the number of total alignments
-+.IP *
-+the number of total alignments
- 
--.It Cm
--* the total number of bases
-+.IP *
-+the total number of bases
- 
--.It Cm
--* the total number of aligned bases
-+.IP *
-+the total number of aligned bases
- 
--.It Cm
--* the fraction of aligned bases
-+.IP *
-+the fraction of aligned bases
- 
--.It Cm
--* the total number of clipped/unaligned bases
-+.IP *
-+the total number of clipped/unaligned bases
- 
--.It Cm
--* the number of unmapped reads
-+.IP *
-+the number of unmapped reads
- 
-+.PP
- These values are printed on the standard output channel at the end of the
- program run in the last line printed by the program. The program prints a
- set of line description line prior to that.
-@@ -42,8 +43,12 @@
- The input file needs to be provied in query name sorted order, which can be
- obtained via e.g.
- 
--bamsort SO=queryname
-+.PP
-+.EX
-+        $ bamsort SO=queryname
-+.EE
- 
-+.PP
- right before being passed to bamalignfrac.
- 
- The following key=value pairs can be given:
---- biobambam2.orig/src/programs/bamauxmerge.1
-+++ biobambam2/src/programs/bamauxmerge.1
-@@ -8,34 +8,33 @@
- in_unmapped in_mapped
- .SH DESCRIPTION
- bamauxmerge reads and merges two SAM/BAM/CRAM files which are expected to have the
--following properties
-+following properties:
- 
--.It Cm
--* the first file contains only unmapped reads and it's header contains no SQ lines
-+.IP *
-+the first file contains only unmapped reads and it's header contains no SQ lines
- 
--.It Cm
--* the second file was produced by an aligner based on the content of the first file.
--
--.It Cm
--* the order of the reads is the same in the first an second file
-+.IP *
-+the second file was produced by an aligner based on the content of the first file.
- 
-+.IP *
-+the order of the reads is the same in the first an second file
- into a single alignment file.
--
-+.PP
- The headers of the two files are merged in the following file:
- 
--.It Cm
--* the SQ lines contained in the header of the second file are appended to the header of the first file to obtain the header of the output file
--
--.It
--* all other header information from the second file is discarded
-+.IP *
-+the SQ lines contained in the header of the second file are appended to the header of the first file to obtain the header of the output file
- 
-+.IP *
-+all other header information from the second file is discarded
-+.PP
- The output records are constructed in the following way:
- 
--.It Cm
--1. Take a record from the second file
-+.IP 1.
-+Take a record from the second file
- 
--.It Cm
--2. Copy all aux fields from the corresponding record in the first file which are not already present.
-+.IP 2.
-+Copy all aux fields from the corresponding record in the first file which are not already present.
- 
- .PP
- The following key=value pairs can be given:
---- biobambam2.orig/src/programs/bamauxmerge2.1
-+++ biobambam2/src/programs/bamauxmerge2.1
-@@ -10,46 +10,44 @@
- bamauxmerge2 reads and merges two BAM files which are expected to have the
- following properties
- 
--.It Cm
--* the first file contains only unmapped reads and it's header contains no SQ lines
-+.IP *
-+the first file contains only unmapped reads and it's header contains no SQ lines
- 
--.It Cm
--* the second file was produced by an aligner based on the content of the first file.
-+.IP *
-+the second file was produced by an aligner based on the content of the first file.
- 
--.It Cm
--* both files are sorted in query name order
--
--into a single alignment file.
-+.IP *
-+both files are sorted in query name order into a single alignment file.
- 
-+.PP
- The headers of the two files are merged in the following file:
-+.IP *
-+the SQ lines contained in the header of the second file are appended to the header of the first file to obtain the header of the output file
- 
--.It Cm
--* the SQ lines contained in the header of the second file are appended to the header of the first file to obtain the header of the output file
--
--.It
--* all other header information from the second file is discarded
--
-+.IP *
-+all other header information from the second file is discarded
-+.PP
- The output records are constructed in the following way:
- 
--.It Cm
--1. Take a record from the second file
-+.IP 1.
-+Take a record from the second file
- 
--.It Cm
--2. Copy all aux fields from the corresponding record in the first file which are not already present.
-+.IP 2.
-+Copy all aux fields from the corresponding record in the first file which are not already present.
- 
--.It Cm
--3. Reinsert clipped adapter bases/quality values stored in the qs/qq by
-+.IP 3.
-+Reinsert clipped adapter bases/quality values stored in the qs/qq by
- aux fields by fastqtobam2 and remove the qs/qq aux fields while inserting
- appropriate soft clipping CIGAR operations.
- 
--.It Cm
--4. Fix mate information like bamfixmateinformation.
-+.IP 4.
-+Fix mate information like bamfixmateinformation.
- 
--.It Cm
--5. Insert the mate CIGAR information fields MC and MS if the mate is aligned.
-+.IP 5.
-+Insert the mate CIGAR information fields MC and MS if the mate is aligned.
- 
--.It Cm
--6. Insert the MQ (mate quality) aux field.
-+.IP 6.
-+Insert the MQ (mate quality) aux field.
- 
- .PP
- The following key=value pairs can be given:
---- biobambam2.orig/src/programs/bamcollate2.1
-+++ biobambam2/src/programs/bamcollate2.1
-@@ -196,7 +196,7 @@
- the input SAM/BAM/CRAM file is used (and filtered in case of reset=1)..
- .PP
- .B resetaux=<0|1>:
--remove auxilliary fields if resetaux=1. This key is only available for
-+remove auxiliary fields if resetaux=1. This key is only available for
- reset=1. If reset=1 then the default is to remove all aux fields.
- .PP
- .B auxfilter=<>:
---- biobambam2.orig/src/programs/bamconsensus.1
-+++ biobambam2/src/programs/bamconsensus.1
-@@ -25,7 +25,7 @@
- .PP
- .B E is the end position on the reference sequence (exclusive)
- .PP
--The reference key specifiying the name of a FastA reference sequence file
-+The reference key specifying the name of a FastA reference sequence file
- is required. The consensus is constructed by computing heavy paths in local
- DeBruijn graphs. Consequently it is usually a patchwork of the haplotypes
- present for diploid/polyploid genomes.
---- biobambam2.orig/src/programs/bammarkduplicates.1
-+++ biobambam2/src/programs/bammarkduplicates.1
-@@ -95,7 +95,7 @@
- .IP 0:
- duplicates will be retained in the output file and have the duplication flag set
- .IP 1:
--duplicates will be remove when writing the output file
-+duplicates will be removed when writing the output file
- .PP
- .B md5=<0|1>:
- md5 checksum creation for output file. Valid values are
-@@ -133,11 +133,11 @@
- this option works like the tag option but is restricted to sequences of
- nucleotides (A,C,G or T) as tags. The length of each tag sequence is not
- allowed to exceed 15 bases. All tags are required to have the same length.
--Each non nucleotide symbol is mapped to A. In constrast to the tag option, 
-+Each non nucleotide symbol is mapped to A. In contrast to the tag option,
- nucltag uses less memory for processing and can be expected to be faster.
- .PP
- .B D
--ouptut file name for removed duplicates if rmdup=1. By default the reads and
-+output file name for removed duplicates if rmdup=1. By default the reads and
- read pairs marked as duplicates are discarded when rmdup=1. If the D key is
- set, then the sequence of reads which is not written to the output file is
- written to a separate file. The name of this separate file is the value of
---- biobambam2.orig/src/programs/bammarkduplicates2.1
-+++ biobambam2/src/programs/bammarkduplicates2.1
-@@ -96,7 +96,7 @@
- .IP 0:
- duplicates will be retained in the output file and have the duplication flag set
- .IP 1:
--duplicates will be remove when writing the output file
-+duplicates will be removed when writing the output file
- .PP
- .B maxreadlength=<[500]>:
- maximum read length in input. This value can be set higher than the actual
-@@ -138,11 +138,11 @@
- this option works like the tag option but is restricted to sequences of
- nucleotides (A,C,G or T) as tags. The length of each tag sequence is not
- allowed to exceed 15 bases. All tags are required to have the same length.
--Each non nucleotide symbol is mapped to A. In constrast to the tag option, 
-+Each non nucleotide symbol is mapped to A. In contrast to the tag option,
- nucltag uses less memory for processing and can be expected to be faster.
- .PP
- .B D
--ouptut file name for removed duplicates if rmdup=1. By default the reads and
-+output file name for removed duplicates if rmdup=1. By default the reads and
- read pairs marked as duplicates are discarded when rmdup=1. If the D key is
- set, then the sequence of reads which is not written to the output file is
- written to a separate file. The name of this separate file is the value of
---- biobambam2.orig/src/programs/bammarkduplicatesopt.1
-+++ biobambam2/src/programs/bammarkduplicatesopt.1
-@@ -98,7 +98,7 @@
- .IP 0:
- duplicates will be retained in the output file and have the duplication flag set
- .IP 1:
--duplicates will be remove when writing the output file
-+duplicates will be removed when writing the output file
- .PP
- .B md5=<0|1>:
- md5 checksum creation for output file. Valid values are
-@@ -136,11 +136,11 @@
- this option works like the tag option but is restricted to sequences of
- nucleotides (A,C,G or T) as tags. The length of each tag sequence is not
- allowed to exceed 15 bases. All tags are required to have the same length.
--Each non nucleotide symbol is mapped to A. In constrast to the tag option, 
-+Each non nucleotide symbol is mapped to A. In contrast to the tag option,
- nucltag uses less memory for processing and can be expected to be faster.
- .PP
- .B D
--ouptut file name for removed duplicates if rmdup=1. By default the reads and
-+output file name for removed duplicates if rmdup=1. By default the reads and
- read pairs marked as duplicates are discarded when rmdup=1. If the D key is
- set, then the sequence of reads which is not written to the output file is
- written to a separate file. The name of this separate file is the value of
---- biobambam2.orig/src/programs/bammaskflags.1
-+++ biobambam2/src/programs/bammaskflags.1
-@@ -1,6 +1,6 @@
- .TH BAMMASKFLAGS 1 "July 2013" BIOBAMBAM
- .SH NAME
--bammaskflags - remove flags from alignments
-+bammaskflags \- remove flags from alignments
- .SH SYNOPSIS
- .PP
- .B bammaskflags
-@@ -24,7 +24,9 @@
- zlib/gzip level 9 (best) compression
- .P
- If libmaus has been compiled with support for igzip (see
--https://software.intel.com/en-us/articles/igzip-a-high-performance-deflate-compressor-with-optimizations-for-genomic-data)
-+.UR https://software.intel.com/en-us/articles/igzip-a-high-performance-deflate-compressor-with-optimizations-for-genomic-data
-+Intel article on igzip
-+.UE )
- then an additional valid value is
- .IP 11:
- igzip compression
-@@ -34,30 +36,42 @@
- complement of this number and the flag field of the reads/alignments in the
- input BAM file). This value can be obtained by adding up the following
- values of the flags:
--.IP PAIRED (paired in sequencing):
-+.TP
- 1
--.IP PROPER_PAIR (mapped as a proper pair):
-+PAIRED (paired in sequencing)
-+.TP
- 2
--.IP UNMAP (unmapped):
-+PROPER_PAIR (mapped as a proper pair)
-+.TP
- 4
--.IP MUNMAP (mate unmapped):
-+UNMAP (unmapped)
-+.TP
- 8
--.IP REVERSE (mapped to the reverse strand):
-+MUNMAP (mate unmapped)
-+.TP
- 16
--.IP MREVERSE (mate mapped to the reverse strand):
-+REVERSE (mapped to the reverse strand)
-+.TP
- 32
--.IP READ1 (first read of pair):
-+MREVERSE (mate mapped to the reverse strand)
-+.TP
- 64
--.IP READ2 (second read of pair):
-+READ1 (first read of pair)
-+.TP
- 128
--.IP SECONDARY (secondary alignment):
-+READ2 (second read of pair)
-+.TP
- 256
--.IP QCFAIL (failed quality control):
-+SECONDARY (secondary alignment)
-+.TP
- 512
--.IP DUP (duplicate):
-+QCFAIL (failed quality control)
-+.TP
- 1024
--.IP SUPPLEMENTARY (supplementary):
-+DUP (duplicate)
-+.TP
- 2048
-+SUPPLEMENTARY (supplementary)
- .PP
- .B tmpfile=<filename>: 
- prefix for temporary files. By default the temporary files are created in the current directory
---- biobambam2.orig/src/programs/bammdnm.1
-+++ biobambam2/src/programs/bammdnm.1
-@@ -7,7 +7,7 @@
- [options]
- .SH DESCRIPTION
- bammdnm reads a coordinate sorted BAM file from standard input, fills the
--MD and NM auxilliary fields for each mapped read fragment and writes
-+MD and NM auxiliary fields for each mapped read fragment and writes
- the resulting data to a BAM file on standard output.
- .PP
- The following key=value pairs can be given:
---- biobambam2.orig/src/programs/bamreset.1
-+++ biobambam2/src/programs/bamreset.1
-@@ -109,7 +109,7 @@
- read is marked as supplementary alignment
- .PP
- .B resetaux=<0|1>:
--auxilliary fields (default).
-+auxiliary fields (default).
- .PP
- .B resetsortorder=<0|1>:
- set sort order to unknown if resetsortorder=1 (default) and leave as it is
---- biobambam2.orig/src/programs/bamsort.1
-+++ biobambam2/src/programs/bamsort.1
-@@ -220,7 +220,7 @@
- this option works like the tag option but is restricted to sequences of
- nucleotides (A,C,G or T) as tags. The length of each tag sequence is not
- allowed to exceed 15 bases. All tags are required to have the same length.
--Each non nucleotide symbol is mapped to A. In constrast to the tag option, 
-+Each non nucleotide symbol is mapped to A. In contrast to the tag option,
- nucltag uses less memory for processing and can be expected to be faster.
- .PP
- .B M=<stderr>: 
---- biobambam2.orig/src/programs/bamstreamingmarkduplicates.1
-+++ biobambam2/src/programs/bamstreamingmarkduplicates.1
-@@ -11,7 +11,7 @@
- adddupmarksupport=1, marks duplicate read pairs and reads and writes the
- resulting file in BAM, SAM or CRAM format. The preprocessing of the file
- using bamsort with the stated options is mandatory, i.e.
--bamstreamingmarkduplicates will fail without it. In constrast to
-+bamstreamingmarkduplicates will fail without it. In contrast to
- bammarkduplicates and bammarkduplicates2 the streaming variant
- bamstreamingmarkduplicates processes the file in a single pass.
- bamstreamingmarkduplicates cannot handle files containing orphan pair ends
-@@ -129,7 +129,7 @@
- this option works like the tag option but is restricted to sequences of
- nucleotides (A,C,G or T) as tags. The length of each tag sequence is not
- allowed to exceed 15 bases. All tags are required to have the same length.
--Each non nucleotide symbol is mapped to A. In constrast to the tag option, 
-+Each non nucleotide symbol is mapped to A. In contrast to the tag option,
- nucltag uses less memory for processing and can be expected to be faster.
- .PP
- .B filterdupmarktags=<[0]>:
---- biobambam2.orig/src/programs/fastqtobam.1
-+++ biobambam2/src/programs/fastqtobam.1
-@@ -63,7 +63,7 @@
- additional BAM encoding helper threads.
- .PP
- .B PGID=<>
--read group identifier for reads. By default no read group identifer is set.
-+read group identifier for reads. By default no read group identifier is set.
- The fields CN, DS, DT, FO, KS, LB, PG, PI, PL, PU and SM of the
- corresponding @RG header line can be set by using the keys RGCN, RGDS, etc.
- respectively.


=====================================
debian/patches/series deleted
=====================================
@@ -1,2 +0,0 @@
-manuals.patch
-spelling-error-in-binary.patch


=====================================
debian/patches/spelling-error-in-binary.patch deleted
=====================================
@@ -1,19 +0,0 @@
-Description: fix spelling-error-in-binary
-Author: Étienne Mollier <etienne.mollier at mailoo.org>
-Forwarded: https://gitlab.com/german.tischler/biobambam2/-/merge_requests/41
-Last-Update: 2021-02-20
----
-This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
---- biobambam2.orig/src/programs/bamvalidate.cpp
-+++ biobambam2/src/programs/bamvalidate.cpp
-@@ -282,8 +282,8 @@
- 
- 				std::vector< std::pair<std::string,std::string> > V;
- 
--				V.push_back ( std::pair<std::string,std::string> ( "verbose=<["+::biobambam2::Licensing::formatNumber(getDefaultVerbose())+"]>", "print stats at the end of a successfull run" ) );
--				V.push_back ( std::pair<std::string,std::string> ( "basequalhist=<["+::biobambam2::Licensing::formatNumber(getDefaultBaseQualHist())+"]>", "print base quality histogram at end of a successfull run" ) );
-+				V.push_back ( std::pair<std::string,std::string> ( "verbose=<["+::biobambam2::Licensing::formatNumber(getDefaultVerbose())+"]>", "print stats at the end of a successful run" ) );
-+				V.push_back ( std::pair<std::string,std::string> ( "basequalhist=<["+::biobambam2::Licensing::formatNumber(getDefaultBaseQualHist())+"]>", "print base quality histogram at end of a successful run" ) );
- 				V.push_back ( std::pair<std::string,std::string> ( "passthrough=<["+::biobambam2::Licensing::formatNumber(getDefaultPassThrough())+"]>", "write alignments to standard output (default: do not pass through)" ) );
- 				V.push_back ( std::pair<std::string,std::string> ( "tmpfile=<filename>", "prefix for temporary files, default: create files in current directory (passthrough=1, index=1 only)" ) );
- 				V.push_back ( std::pair<std::string,std::string> ( "md5=<["+::biobambam2::Licensing::formatNumber(getDefaultMD5())+"]>", "create md5 check sum (default: 0, passthrough=1 only)" ) );


=====================================
src/Makefile.am
=====================================
@@ -155,7 +155,9 @@ EXTRA_PROGRAMS = blastnxmltobam \
 	bamdepthmerge \
 	bamcountflags \
 	fastaselectreg \
-	bamaddne
+	bamaddne \
+	bamadapterhistogram \
+	bamsalvage
 
 populaterefcache_SOURCES = programs/populaterefcache.cpp biobambam2/Licensing.cpp
 populaterefcache_LDADD = ${LIBMAUS2LIBS}
@@ -721,3 +723,13 @@ bamaddne_SOURCES = programs/bamaddne.cpp biobambam2/Licensing.cpp
 bamaddne_LDADD = ${LIBMAUS2LIBS}
 bamaddne_LDFLAGS = ${AM_CPPFLAGS} ${LIBMAUS2CPPFLAGS} ${LIBMAUS2LDFLAGS} ${AM_LDFLAGS}
 bamaddne_CPPFLAGS = ${AM_CPPFLAGS} ${LIBMAUS2CPPFLAGS}
+
+bamadapterhistogram_SOURCES = programs/bamadapterhistogram.cpp biobambam2/Licensing.cpp
+bamadapterhistogram_LDADD = ${LIBMAUS2LIBS}
+bamadapterhistogram_LDFLAGS = ${AM_CPPFLAGS} ${LIBMAUS2CPPFLAGS} ${LIBMAUS2LDFLAGS} ${AM_LDFLAGS}
+bamadapterhistogram_CPPFLAGS = ${AM_CPPFLAGS} ${LIBMAUS2CPPFLAGS}
+
+bamsalvage_SOURCES = programs/bamsalvage.cpp biobambam2/Licensing.cpp
+bamsalvage_LDADD = ${LIBMAUS2LIBS}
+bamsalvage_LDFLAGS = ${AM_CPPFLAGS} ${LIBMAUS2CPPFLAGS} ${LIBMAUS2LDFLAGS} ${AM_LDFLAGS}
+bamsalvage_CPPFLAGS = ${AM_CPPFLAGS} ${LIBMAUS2CPPFLAGS}


=====================================
src/programs/bamadapterhistogram.cpp
=====================================
@@ -0,0 +1,180 @@
+/**
+    bambam
+    Copyright (C) 2009-2013 German Tischler
+    Copyright (C) 2011-2013 Genome Research Limited
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>..
+**/
+#include "config.h"
+
+#include <iostream>
+#include <queue>
+
+#include <libmaus2/aio/OutputStreamInstance.hpp>
+
+#include <libmaus2/bambam/AdapterFilter.hpp>
+#include <libmaus2/bambam/BamAlignment.hpp>
+#include <libmaus2/bambam/BamBlockWriterBaseFactory.hpp>
+#include <libmaus2/bambam/BamMultiAlignmentDecoderFactory.hpp>
+#include <libmaus2/bambam/BamWriter.hpp>
+#include <libmaus2/bambam/ProgramHeaderLineSet.hpp>
+#include <libmaus2/fastx/acgtnMap.hpp>
+#include <libmaus2/rank/popcnt.hpp>
+#include <libmaus2/util/ArgInfo.hpp>
+#include <libmaus2/util/Histogram.hpp>
+#include <libmaus2/bambam/BamDefaultAdapters.hpp>
+#include <biobambam2/Licensing.hpp>
+
+static int getDefaultVerbose() { return 1; }
+
+int bamadapterhistogram(::libmaus2::util::ArgInfo const & arginfo)
+{
+	{
+		std::istringstream istr(libmaus2::bambam::BamDefaultAdapters::getDefaultAdapters());
+		libmaus2::bambam::BamDecoder bamdec(istr);
+		libmaus2::bambam::BamAlignment const & algn = bamdec.getAlignment();
+
+		while ( bamdec.readAlignment() )
+			std::cout << algn.getName() << "\t" << algn.getRead() << "\n";
+	}
+
+	if ( isatty(STDIN_FILENO) )
+	{
+		::libmaus2::exception::LibMausException se;
+		se.getStream() << "Refusing to read binary data from terminal, please redirect standard input to pipe or file." << std::endl;
+		se.finish();
+		throw se;
+	}
+
+	int const verbose = arginfo.getValue<int>("verbose",getDefaultVerbose());
+
+	libmaus2::bambam::BamAlignmentDecoderWrapper::unique_ptr_type decwrapper(
+		libmaus2::bambam::BamMultiAlignmentDecoderFactory::construct(
+			arginfo
+		)
+	);
+	libmaus2::bambam::BamAlignmentDecoder & bamdec = decwrapper->getDecoder();
+	libmaus2::bambam::BamAlignment const & algn = bamdec.getAlignment();
+
+	uint64_t alcnt = 0;
+	uint64_t lastalcnt = 0;
+	uint64_t numadpt = 0;
+	unsigned int const bshift = 20;
+	std::vector<uint64_t> RLhist;
+	std::vector<uint64_t> Ahist;
+	std::map<std::string,uint64_t> M;
+
+	while ( bamdec.readAlignment() )
+	{
+		if ( verbose && ( (alcnt >> bshift) != (lastalcnt >> bshift) ) )
+		{
+			std::cerr << "[V]\t" << alcnt << "\t" << numadpt << std::endl;
+			lastalcnt = alcnt;
+		}
+
+		uint64_t const lseq = algn.getLseq();
+
+		while ( ! (lseq < RLhist.size() ) )
+			RLhist.push_back(0);
+
+		RLhist[lseq]++;
+
+		if ( algn.hasAux("qs") )
+		{
+			numadpt++;
+		}
+
+		if ( algn.hasAux("aa") )
+		{
+			numadpt++;
+			std::string const qs = algn.getAuxAsString("aa");
+
+			auto it = M.find(qs);
+
+			if ( it == M.end() )
+			{
+				uint64_t const id = M.size();
+				M[qs] = id;
+				it = M.find(qs);
+			}
+
+			assert ( it != M.end() );
+
+			while ( !(it->second < Ahist.size()) )
+				Ahist.push_back(0);
+			Ahist[it->second] += 1;
+		}
+
+		alcnt++;
+	}
+
+	std::cout << "[V] processed " << alcnt << "\t" << numadpt << std::endl;
+
+	for ( uint64_t i = 0; i < RLhist.size(); ++i )
+		if ( RLhist[i] )
+			std::cout << "RLhist[" << i << "]=" << RLhist[i] << std::endl;
+
+	for ( auto P : M )
+	{
+		std::cout << "Ahist[" << P.first << "]=" << Ahist[P.second] << std::endl;
+	}
+
+	return EXIT_SUCCESS;
+}
+
+int main(int argc, char * argv[])
+{
+	try
+	{
+		::libmaus2::util::ArgInfo const arginfo(argc,argv);
+
+		for ( uint64_t i = 0; i < arginfo.restargs.size(); ++i )
+			if (
+				arginfo.restargs[i] == "-v"
+				||
+				arginfo.restargs[i] == "--version"
+			)
+			{
+				std::cerr << ::biobambam2::Licensing::license();
+				return EXIT_SUCCESS;
+			}
+			else if (
+				arginfo.restargs[i] == "-h"
+				||
+				arginfo.restargs[i] == "--help"
+			)
+			{
+				std::cerr << ::biobambam2::Licensing::license();
+				std::cerr << std::endl;
+				std::cerr << "Key=Value pairs:" << std::endl;
+				std::cerr << std::endl;
+
+				std::vector< std::pair<std::string,std::string> > V;
+
+				V.push_back ( std::pair<std::string,std::string> ( "verbose=<["+::biobambam2::Licensing::formatNumber(getDefaultVerbose())+"]>", "print progress report" ) );
+
+				::biobambam2::Licensing::printMap(std::cerr,V);
+
+				std::cerr << std::endl;
+				return EXIT_SUCCESS;
+			}
+
+		return bamadapterhistogram(arginfo);
+	}
+	catch(std::exception const & ex)
+	{
+		std::cerr << ex.what() << std::endl;
+		return EXIT_FAILURE;
+	}
+}


=====================================
src/programs/bamalignfrac.1
=====================================
@@ -1,6 +1,6 @@
 .TH BAMALIGNFRAC 1 "July 2019" BIOBAMBAM
 .SH NAME
-bamalignfrac - compute fraction of aligned bases in alignment file
+bamalignfrac \- compute fraction of aligned bases in alignment file
 .SH SYNOPSIS
 .PP
 .B bamalignfrac
@@ -10,30 +10,31 @@ bamalignfrac - compute fraction of aligned bases in alignment file
 bamalignfrac reads a SAM/BAM/CRAM file, computes a set of statistical values
 and outputs these on the standard output channel. The values produced are
 
-.It Cm
-* the number of names passing a given regex filter
+.IP *
+the number of names passing a given regex filter
 
-.It Cm
-* the number of primary alignments
+.IP *
+the number of primary alignments
 
-.It Cm
-* the number of total alignments
+.IP *
+the number of total alignments
 
-.It Cm
-* the total number of bases
+.IP *
+the total number of bases
 
-.It Cm
-* the total number of aligned bases
+.IP *
+the total number of aligned bases
 
-.It Cm
-* the fraction of aligned bases
+.IP *
+the fraction of aligned bases
 
-.It Cm
-* the total number of clipped/unaligned bases
+.IP *
+the total number of clipped/unaligned bases
 
-.It Cm
-* the number of unmapped reads
+.IP *
+the number of unmapped reads
 
+.PP
 These values are printed on the standard output channel at the end of the
 program run in the last line printed by the program. The program prints a
 set of line description line prior to that.
@@ -42,8 +43,12 @@ set of line description line prior to that.
 The input file needs to be provied in query name sorted order, which can be
 obtained via e.g.
 
-bamsort SO=queryname
+.PP
+.EX
+        $ bamsort SO=queryname
+.EE
 
+.PP
 right before being passed to bamalignfrac.
 
 The following key=value pairs can be given:


=====================================
src/programs/bamauxmerge.1
=====================================
@@ -8,34 +8,33 @@ bamauxmerge - merge information in unmapped and mapped alignment files
 in_unmapped in_mapped
 .SH DESCRIPTION
 bamauxmerge reads and merges two SAM/BAM/CRAM files which are expected to have the
-following properties
+following properties:
 
-.It Cm
-* the first file contains only unmapped reads and it's header contains no SQ lines
+.IP *
+the first file contains only unmapped reads and it's header contains no SQ lines
 
-.It Cm
-* the second file was produced by an aligner based on the content of the first file.
-
-.It Cm
-* the order of the reads is the same in the first an second file
+.IP *
+the second file was produced by an aligner based on the content of the first file.
 
+.IP *
+the order of the reads is the same in the first an second file
 into a single alignment file.
-
+.PP
 The headers of the two files are merged in the following file:
 
-.It Cm
-* the SQ lines contained in the header of the second file are appended to the header of the first file to obtain the header of the output file
-
-.It
-* all other header information from the second file is discarded
+.IP *
+the SQ lines contained in the header of the second file are appended to the header of the first file to obtain the header of the output file
 
+.IP *
+all other header information from the second file is discarded
+.PP
 The output records are constructed in the following way:
 
-.It Cm
-1. Take a record from the second file
+.IP 1.
+Take a record from the second file
 
-.It Cm
-2. Copy all aux fields from the corresponding record in the first file which are not already present.
+.IP 2.
+Copy all aux fields from the corresponding record in the first file which are not already present.
 
 .PP
 The following key=value pairs can be given:


=====================================
src/programs/bamauxmerge.cpp
=====================================
@@ -62,7 +62,13 @@ int bamauxmerge(::libmaus2::util::ArgInfo const & arginfo)
 
 	// construct output header by appending SQ lines from B to header in A
 	std::ostringstream outhdrostr;
-	outhdrostr << header_a.text;
+
+	outhdrostr << "@HD"
+		<< "\tVN:" << libmaus2::bambam::BamHeader::getVersionStatic(header_a.text)
+		<< "\tSO:" << header_b.getSortOrder()
+		<< "\n";
+
+	outhdrostr << libmaus2::bambam::BamHeader::filterHeader(header_a.text);
 
 	for ( uint64_t i = 0; i < VSQ.size(); ++i )
 		outhdrostr << VSQ[i].line << "\n";


=====================================
src/programs/bamauxmerge2.1
=====================================
@@ -10,46 +10,44 @@ in_unmapped in_mapped
 bamauxmerge2 reads and merges two BAM files which are expected to have the
 following properties
 
-.It Cm
-* the first file contains only unmapped reads and it's header contains no SQ lines
+.IP *
+the first file contains only unmapped reads and it's header contains no SQ lines
 
-.It Cm
-* the second file was produced by an aligner based on the content of the first file.
+.IP *
+the second file was produced by an aligner based on the content of the first file.
 
-.It Cm
-* both files are sorted in query name order
-
-into a single alignment file.
+.IP *
+both files are sorted in query name order into a single alignment file.
 
+.PP
 The headers of the two files are merged in the following file:
+.IP *
+the SQ lines contained in the header of the second file are appended to the header of the first file to obtain the header of the output file
 
-.It Cm
-* the SQ lines contained in the header of the second file are appended to the header of the first file to obtain the header of the output file
-
-.It
-* all other header information from the second file is discarded
-
+.IP *
+all other header information from the second file is discarded
+.PP
 The output records are constructed in the following way:
 
-.It Cm
-1. Take a record from the second file
+.IP 1.
+Take a record from the second file
 
-.It Cm
-2. Copy all aux fields from the corresponding record in the first file which are not already present.
+.IP 2.
+Copy all aux fields from the corresponding record in the first file which are not already present.
 
-.It Cm
-3. Reinsert clipped adapter bases/quality values stored in the qs/qq by
+.IP 3.
+Reinsert clipped adapter bases/quality values stored in the qs/qq by
 aux fields by fastqtobam2 and remove the qs/qq aux fields while inserting
 appropriate soft clipping CIGAR operations.
 
-.It Cm
-4. Fix mate information like bamfixmateinformation.
+.IP 4.
+Fix mate information like bamfixmateinformation.
 
-.It Cm
-5. Insert the mate CIGAR information fields MC and MS if the mate is aligned.
+.IP 5.
+Insert the mate CIGAR information fields MC and MS if the mate is aligned.
 
-.It Cm
-6. Insert the MQ (mate quality) aux field.
+.IP 6.
+Insert the MQ (mate quality) aux field.
 
 .PP
 The following key=value pairs can be given:


=====================================
src/programs/bamcollate2.1
=====================================
@@ -196,7 +196,7 @@ file name for replacement SAM header. By default the header of
 the input SAM/BAM/CRAM file is used (and filtered in case of reset=1).
 .PP
 .B resetaux=<0|1>:
-remove auxilliary fields if resetaux=1. This key is only available for
+remove auxiliary fields if resetaux=1. This key is only available for
 reset=1. If reset=1 then the default is to remove all aux fields.
 .PP
 .B auxfilter=<>:


=====================================
src/programs/bamconsensus.1
=====================================
@@ -25,7 +25,7 @@ where
 .PP
 .B E is the end position on the reference sequence (exclusive)
 .PP
-The reference key specifiying the name of a FastA reference sequence file
+The reference key specifying the name of a FastA reference sequence file
 is required. The consensus is constructed by computing heavy paths in local
 DeBruijn graphs. Consequently it is usually a patchwork of the haplotypes
 present for diploid/polyploid genomes.


=====================================
src/programs/bamfastcat.cpp
=====================================
@@ -29,6 +29,9 @@
 #include <libmaus2/util/PrefixSums.hpp>
 #include <libmaus2/aio/TempFileArray.hpp>
 
+#include <chrono>
+#include <thread>
+
 #include <biobambam2/BamBamConfig.hpp>
 #include <biobambam2/Licensing.hpp>
 #include <biobambam2/ReadHeader.hpp>
@@ -161,6 +164,21 @@ void updateMap(
 	libmaus2::aio::OutputStreamFactoryContainer::rename(tmpfn,indexfn);
 }
 
+/**
+ * concatenate a set of BAM files sharing the same header (sequence dictionary) information
+ * without recompressing (most of) the data blocks
+ *
+ * The program does NOT check the input data for actually sharing compatible headers
+ *
+ * The main purpose of this program is to perform a gather type operation in a scatter/gather approach
+ *
+ * The first argument is the file name of a text file containing input BAM file names
+ *
+ * An optional second argument can be used to provide a SAM file header which will be used
+ * as a replacement in the output. If not given then the header from the first input BAM file
+ * will be used. If the append flag is set (append=1), then the given SAM header will be appended
+ * to the first BAM file header instead of replacing it
+ **/
 int bamfastcat(libmaus2::util::ArgInfo const & arginfo)
 {
 	uint64_t const numrest = arginfo.getNumRestArgs();
@@ -200,12 +218,26 @@ int bamfastcat(libmaus2::util::ArgInfo const & arginfo)
 
 	biobambam2::ReHeaderUpdate RH(headertext,append);
 
+	libmaus2::aio::OutputStreamInstance::unique_ptr_type pOut;
+	bool const haveO = arginfo.hasArg("O");
+
+	if ( haveO )
+	{
+		libmaus2::aio::OutputStreamInstance::unique_ptr_type tOut(new libmaus2::aio::OutputStreamInstance(arginfo.getUnparsedValue("O",std::string())));
+		pOut = std::move(tOut);
+	}
+
+	std::ostream & outstr = pOut ? (*pOut) : std::cout;
+
 	if ( ! Vinfn.size() )
 	{
-		libmaus2::lz::BgzfOutputStream out(std::cout,level);
+		libmaus2::lz::BgzfOutputStream out(outstr,level);
 		libmaus2::bambam::BamHeader const header(headertext);
 		header.serialise(out);
 		out.addEOFBlock();
+		out.flush();
+
+		pOut.reset();
 	}
 	else
 	{
@@ -351,14 +383,14 @@ int bamfastcat(libmaus2::util::ArgInfo const & arginfo)
 				);
 			}
 
-			std::cout.write(compdata.second.c_str(),compdata.second.size());
+			outstr.write(compdata.second.c_str(),compdata.second.size());
 			coutp += compdata.second.size();
 
 			while ( ISI.peek() != std::istream::traits_type::eof() )
 			{
 				libmaus2::lz::BgzfInflateBase::BaseBlockInfo BBI = BIB.readBlock(ISI);
 				if ( BBI.uncompdatasize )
-					coutp += BIB.writeBlock(std::cout,BBI);
+					coutp += BIB.writeBlock(outstr,BBI);
 			}
 		}
 
@@ -381,25 +413,32 @@ int bamfastcat(libmaus2::util::ArgInfo const & arginfo)
 				);
 			}
 
-			std::cout.write(compdata.second.c_str(),compdata.second.size());
+			outstr.write(compdata.second.c_str(),compdata.second.size());
 			coutp += compdata.second.size();
 
 			while ( ISI.peek() != std::istream::traits_type::eof() )
 			{
 				libmaus2::lz::BgzfInflateBase::BaseBlockInfo BBI = BIB.readBlock(ISI);
 				if ( BBI.uncompdatasize )
-					coutp += BIB.writeBlock(std::cout,BBI);
+					coutp += BIB.writeBlock(outstr,BBI);
 			}
 		}
 
 		std::string const eofblock = libmaus2::lz::BgzfDeflateBase::getEOFBlock();
-		std::cout.write(eofblock.c_str(),eofblock.size());
+		outstr.write(eofblock.c_str(),eofblock.size());
 		coutp += eofblock.size();
 
-		std::cout.flush();
+		outstr.flush();
+
+		pOut.reset();
 
 		if ( pTFA && numerical.size() )
 		{
+			// sleep for 5 seconds so index does not appear to be older than BAM file
+			// this only makes sense if we do not write to the standard output channel
+			if ( haveO )
+				std::this_thread::sleep_for (std::chrono::seconds(5));
+
 			libmaus2::aio::OutputStreamInstance::unique_ptr_type pOSI(
 				new libmaus2::aio::OutputStreamInstance(numerical)
 			);
@@ -427,6 +466,9 @@ int bamfastcat(libmaus2::util::ArgInfo const & arginfo)
 			}
 
 			assert ( blockcnt == totalblocks );
+
+			pOSI->flush();
+			pOSI.reset();
 		}
 	}
 


=====================================
src/programs/bammarkduplicates.1
=====================================
@@ -95,7 +95,7 @@ sets how duplicates are handled
 .IP 0:
 duplicates will be retained in the output file and have the duplication flag set
 .IP 1:
-duplicates will be remove when writing the output file
+duplicates will be removed when writing the output file
 .PP
 .B md5=<0|1>:
 md5 checksum creation for output file. Valid values are
@@ -133,11 +133,11 @@ second mate are concatenated to obtain the tag of the pair.
 this option works like the tag option but is restricted to sequences of
 nucleotides (A,C,G or T) as tags. The length of each tag sequence is not
 allowed to exceed 15 bases. All tags are required to have the same length.
-Each non nucleotide symbol is mapped to A. In constrast to the tag option, 
+Each non nucleotide symbol is mapped to A. In contrast to the tag option,
 nucltag uses less memory for processing and can be expected to be faster..
 .PP
 .B D
-ouptut file name for removed duplicates if rmdup=1. By default the reads and
+output file name for removed duplicates if rmdup=1. By default the reads and
 read pairs marked as duplicates are discarded when rmdup=1. If the D key is
 set, then the sequence of reads which is not written to the output file is
 written to a separate file. The name of this separate file is the value of


=====================================
src/programs/bammarkduplicates2.1
=====================================
@@ -96,7 +96,7 @@ sets how duplicates are handled
 .IP 0:
 duplicates will be retained in the output file and have the duplication flag set
 .IP 1:
-duplicates will be remove when writing the output file
+duplicates will be removed when writing the output file
 .PP
 .B maxreadlength=<[500]>:
 maximum read length in input. This value can be set higher than the actual
@@ -138,11 +138,11 @@ second mate are concatenated to obtain the tag of the pair.
 this option works like the tag option but is restricted to sequences of
 nucleotides (A,C,G or T) as tags. The length of each tag sequence is not
 allowed to exceed 15 bases. All tags are required to have the same length.
-Each non nucleotide symbol is mapped to A. In constrast to the tag option, 
+Each non nucleotide symbol is mapped to A. In contrast to the tag option,
 nucltag uses less memory for processing and can be expected to be faster..
 .PP
 .B D
-ouptut file name for removed duplicates if rmdup=1. By default the reads and
+output file name for removed duplicates if rmdup=1. By default the reads and
 read pairs marked as duplicates are discarded when rmdup=1. If the D key is
 set, then the sequence of reads which is not written to the output file is
 written to a separate file. The name of this separate file is the value of


=====================================
src/programs/bammarkduplicatesopt.1
=====================================
@@ -98,7 +98,7 @@ sets how duplicates are handled
 .IP 0:
 duplicates will be retained in the output file and have the duplication flag set
 .IP 1:
-duplicates will be remove when writing the output file
+duplicates will be removed when writing the output file
 .PP
 .B md5=<0|1>:
 md5 checksum creation for output file. Valid values are
@@ -136,11 +136,11 @@ second mate are concatenated to obtain the tag of the pair.
 this option works like the tag option but is restricted to sequences of
 nucleotides (A,C,G or T) as tags. The length of each tag sequence is not
 allowed to exceed 15 bases. All tags are required to have the same length.
-Each non nucleotide symbol is mapped to A. In constrast to the tag option, 
+Each non nucleotide symbol is mapped to A. In contrast to the tag option,
 nucltag uses less memory for processing and can be expected to be faster..
 .PP
 .B D
-ouptut file name for removed duplicates if rmdup=1. By default the reads and
+output file name for removed duplicates if rmdup=1. By default the reads and
 read pairs marked as duplicates are discarded when rmdup=1. If the D key is
 set, then the sequence of reads which is not written to the output file is
 written to a separate file. The name of this separate file is the value of


=====================================
src/programs/bammaskflags.1
=====================================
@@ -1,6 +1,6 @@
 .TH BAMMASKFLAGS 1 "July 2013" BIOBAMBAM
 .SH NAME
-bammaskflags - remove flags from alignments
+bammaskflags \- remove flags from alignments
 .SH SYNOPSIS
 .PP
 .B bammaskflags
@@ -24,7 +24,9 @@ zlib/gzip level 1 (fast) compression
 zlib/gzip level 9 (best) compression
 .P
 If libmaus has been compiled with support for igzip (see
-https://software.intel.com/en-us/articles/igzip-a-high-performance-deflate-compressor-with-optimizations-for-genomic-data)
+.UR https://software.intel.com/en-us/articles/igzip-a-high-performance-deflate-compressor-with-optimizations-for-genomic-data
+Intel article on igzip
+.UE )
 then an additional valid value is
 .IP 11:
 igzip compression
@@ -34,30 +36,42 @@ mask of flags to be removed (a bit wise and is computed between the bit
 complement of this number and the flag field of the reads/alignments in the
 input BAM file). This value can be obtained by adding up the following
 values of the flags:
-.IP PAIRED (paired in sequencing):
+.TP
 1
-.IP PROPER_PAIR (mapped as a proper pair):
+PAIRED (paired in sequencing)
+.TP
 2
-.IP UNMAP (unmapped):
+PROPER_PAIR (mapped as a proper pair)
+.TP
 4
-.IP MUNMAP (mate unmapped):
+UNMAP (unmapped)
+.TP
 8
-.IP REVERSE (mapped to the reverse strand):
+MUNMAP (mate unmapped)
+.TP
 16
-.IP MREVERSE (mate mapped to the reverse strand):
+REVERSE (mapped to the reverse strand)
+.TP
 32
-.IP READ1 (first read of pair):
+MREVERSE (mate mapped to the reverse strand)
+.TP
 64
-.IP READ2 (second read of pair):
+READ1 (first read of pair)
+.TP
 128
-.IP SECONDARY (secondary alignment):
+READ2 (second read of pair)
+.TP
 256
-.IP QCFAIL (failed quality control):
+SECONDARY (secondary alignment)
+.TP
 512
-.IP DUP (duplicate):
+QCFAIL (failed quality control)
+.TP
 1024
-.IP SUPPLEMENTARY (supplementary):
+DUP (duplicate)
+.TP
 2048
+SUPPLEMENTARY (supplementary)
 .PP
 .B tmpfile=<filename>: 
 prefix for temporary files. By default the temporary files are created in the current directory


=====================================
src/programs/bammdnm.1
=====================================
@@ -7,7 +7,7 @@ bammdnm - compute MD and NM fields
 [options]
 .SH DESCRIPTION
 bammdnm reads a coordinate sorted BAM file from standard input, fills the
-MD and NM auxilliary fields for each mapped read fragment and writes
+MD and NM auxiliary fields for each mapped read fragment and writes
 the resulting data to a BAM file on standard output.
 .PP
 The following key=value pairs can be given:


=====================================
src/programs/bamreset.1
=====================================
@@ -109,7 +109,7 @@ read is marked as a duplicate of another read in the same file (see bammarkdupli
 read is marked as supplementary alignment
 .PP
 .B resetaux=<0|1>:
-auxilliary fields (default).
+auxiliary fields (default).
 .PP
 .B resetsortorder=<0|1>:
 set sort order to unknown if resetsortorder=1 (default) and leave as it is


=====================================
src/programs/bamsalvage.cpp
=====================================
@@ -0,0 +1,231 @@
+/**
+    bambam
+    Copyright (C) 2021 German Tischler-Höhle
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>..
+**/
+#include "config.h"
+
+#include <iostream>
+#include <queue>
+
+#include <libmaus2/util/ArgInfo.hpp>
+#include <libmaus2/util/ArgParser.hpp>
+#include <libmaus2/timing/RealTimeClock.hpp>
+#include <libmaus2/bambam/BamBlockWriterBaseFactory.hpp>
+#include <libmaus2/bambam/BamMergeCoordinate.hpp>
+#include <libmaus2/bambam/BamMergeQueryName.hpp>
+#include <libmaus2/bambam/BamWriter.hpp>
+#include <libmaus2/bambam/BamRawDecoder.hpp>
+#include <libmaus2/bambam/BamMultiAlignmentDecoderFactory.hpp>
+#include <libmaus2/lz/BgzfDeflateOutputCallbackMD5.hpp>
+#include <libmaus2/bambam/BgzfDeflateOutputCallbackBamIndex.hpp>
+
+#include <biobambam2/Licensing.hpp>
+
+static int getDefaultVerbose() { return 1; }
+
+::libmaus2::bambam::BamHeader::unique_ptr_type updateHeader(
+	::libmaus2::util::ArgParser const & arg,
+	::libmaus2::bambam::BamHeader const & header
+)
+{
+	std::string const headertext(header.text);
+
+	// add PG line to header
+	std::string const upheadtext = ::libmaus2::bambam::ProgramHeaderLineSet::addProgramLine(
+		headertext,
+		"bamsalvage", // ID
+		"bamsalvage", // PN
+		arg.commandline, // CL
+		::libmaus2::bambam::ProgramHeaderLineSet(headertext).getLastIdInChain(), // PP
+		std::string(PACKAGE_VERSION) // VN
+	);
+	// construct new header
+	::libmaus2::bambam::BamHeader::unique_ptr_type uphead(new ::libmaus2::bambam::BamHeader(upheadtext));
+
+	return uphead;
+}
+
+/**
+ * save as much data as possible from a damaged BAM file equipped with a .bai index
+ **/
+int bamsalvage(libmaus2::util::ArgParser const & arg)
+{
+	std::string const infn = arg[0];
+
+	arg.printArgs(std::cerr);
+
+	int const verbose = arg.getParsedArgOrDefault<int>("verbose",getDefaultVerbose());
+
+	::libmaus2::bambam::BamHeader::shared_ptr_type sheader;
+
+	// load BAM header
+	{
+		libmaus2::bambam::BamDecoder dec(infn);
+		::libmaus2::bambam::BamHeader::unique_ptr_type uphead(updateHeader(arg,dec.getHeader()));
+		::libmaus2::bambam::BamHeader::shared_ptr_type tptr(uphead->sclone());
+		sheader = tptr;
+	}
+
+	libmaus2::bambam::BamIndex const index(infn);
+	libmaus2::autoarray::AutoArray<libmaus2::bambam::BamIndexRef> const & refs = index.getRefs();
+
+
+	libmaus2::bambam::BamBlockWriterBase::unique_ptr_type Pwriter(
+		libmaus2::bambam::BamBlockWriterBaseFactory::construct(*sheader,arg,nullptr));
+
+	libmaus2::aio::InputStreamInstance ISI(infn);
+	uint64_t galcnt = 0;
+
+	for ( uint64_t refid = 0; refid < refs.size(); ++refid )
+	{
+		if ( verbose )
+			std::cerr << "[V] refid=" << refid << " sequence=" << sheader->getRefIDName(refid) << std::endl;
+
+		auto const & ref = refs[refid];
+		auto const & lin = ref.lin;
+		auto const & intervals = lin.intervals;
+
+		// extract values from linear index which are not null pointers (undefined)
+		std::vector<uint64_t> Voff;
+		for ( std::size_t i = 0; i < intervals.size(); ++i )
+			if ( intervals[i] )
+				Voff.push_back(intervals[i]);
+
+		// check sanity of index values
+		for ( std::size_t i = 1; i < Voff.size(); ++i )
+			assert ( Voff[i-1] <= Voff[i] );
+
+		for ( std::size_t i = 0; i < Voff.size(); ++i )
+		{
+			uint64_t const low = Voff[i];
+			uint64_t const high = (i+1<Voff.size()) ? Voff[i+1] : std::numeric_limits<uint64_t>::max();
+
+			if ( low != 0 )
+			{
+				libmaus2::bambam::BamRawDecoder dec(
+					ISI,false,
+					std::make_pair(
+						low>>16,
+						low&0xFFFFull
+					)
+				);
+
+				std::pair<uint64_t,uint64_t> const E(
+					high>>16,
+					high&0xFFFFull
+				);
+
+				try
+				{
+					std::pair<
+						std::pair<uint8_t const *,uint64_t>,
+						libmaus2::bambam::BamRawDecoderBase::RawInterval
+					> P;
+
+
+					while ( (P=dec.getPos()).first.first )
+					{
+						if (
+							P.second.start == E
+							||
+							(
+								libmaus2::bambam::BamAlignmentDecoderBase::getRefID(P.first.first)
+								!=
+								static_cast<int64_t>(refid)
+							)
+						)
+							break;
+
+						assert (
+							((P.second.start.first << 16) | (P.second.start.second))
+							<
+							high
+						);
+
+						Pwriter->writeBamBlock(P.first.first,P.first.second);
+
+						uint64_t const lgalcnt = ++galcnt;
+
+						if ( verbose && ((lgalcnt % (1024*1024)) == 0) )
+							std::cerr << "[V] " << lgalcnt << std::endl;
+
+						if ( P.second.end == E )
+							break;
+					}
+				}
+				catch(std::exception const & ex)
+				{
+					std::cerr
+						<< "low=(" << (low>>16) << "," << (low&0xFFFF) << ") "
+						<< "high=(" << (high>>16) << "," << (high&0xFFFF) << ")"
+						<< std::endl;
+					std::cerr << ex.what() << std::endl;
+				}
+			}
+		}
+	}
+
+	if ( verbose )
+		std::cerr << "[V] " << galcnt << std::endl;
+
+	Pwriter.reset();
+
+	std::cout << libmaus2::lz::BgzfDeflate<std::ostream>::getEOFBlock();
+	std::cout.flush();
+
+	return EXIT_SUCCESS;
+}
+
+int main(int argc, char * argv[])
+{
+	try
+	{
+		std::vector<libmaus2::util::ArgParser::ArgumentDefinition> Vformatcons;
+		Vformatcons.push_back(libmaus2::util::ArgParser::ArgumentDefinition("v","verbose",true));
+
+		Vformatcons.push_back(libmaus2::util::ArgParser::ArgumentDefinition("h","help",true));
+
+		std::vector<libmaus2::util::ArgParser::ArgumentDefinition> const Vformatout = libmaus2::bambam::BamBlockWriterBaseFactory::getArgumentDefinitions();
+
+		std::vector<libmaus2::util::ArgParser::ArgumentDefinition> Vformat = libmaus2::util::ArgParser::mergeFormat(Vformatout,Vformatcons);
+
+		libmaus2::util::ArgParser const arg(argc,argv,Vformat);
+
+		if ( arg.uniqueArgPresent("help") || arg.size() < 1 )
+		{
+			std::cerr << ::biobambam2::Licensing::license();
+			std::cerr << std::endl;
+
+			std::vector< std::pair<std::string,std::string> > V;
+
+			V.push_back ( std::pair<std::string,std::string> ( "-v/--verbose=0/1", "print progress report" ) );
+
+			std::cerr << "usage: " << arg.progname << " [args] <in.bam>\n\n";
+
+			::biobambam2::Licensing::printMap(std::cerr,V);
+
+			std::cerr << std::endl;
+			return EXIT_SUCCESS;
+		}
+
+		return bamsalvage(arg);
+	}
+	catch(std::exception const & ex)
+	{
+		std::cerr << ex.what() << std::endl;
+		return EXIT_FAILURE;
+	}
+}


=====================================
src/programs/bamsort.1
=====================================
@@ -220,7 +220,7 @@ second mate are concatenated to obtain the tag of the pair.
 this option works like the tag option but is restricted to sequences of
 nucleotides (A,C,G or T) as tags. The length of each tag sequence is not
 allowed to exceed 15 bases. All tags are required to have the same length.
-Each non nucleotide symbol is mapped to A. In constrast to the tag option, 
+Each non nucleotide symbol is mapped to A. In contrast to the tag option,
 nucltag uses less memory for processing and can be expected to be faster..
 .PP
 .B M=<stderr>: 


=====================================
src/programs/bamstreamingmarkduplicates.1
=====================================
@@ -11,7 +11,7 @@ previously processed by bamsort using the options fixmates=1 and
 adddupmarksupport=1, marks duplicate read pairs and reads and writes the
 resulting file in BAM, SAM or CRAM format. The preprocessing of the file
 using bamsort with the stated options is mandatory, i.e.
-bamstreamingmarkduplicates will fail without it. In constrast to
+bamstreamingmarkduplicates will fail without it. In contrast to
 bammarkduplicates and bammarkduplicates2 the streaming variant
 bamstreamingmarkduplicates processes the file in a single pass.
 bamstreamingmarkduplicates cannot handle files containing orphan pair ends
@@ -129,7 +129,7 @@ second mate are concatenated to obtain the tag of the pair.
 this option works like the tag option but is restricted to sequences of
 nucleotides (A,C,G or T) as tags. The length of each tag sequence is not
 allowed to exceed 15 bases. All tags are required to have the same length.
-Each non nucleotide symbol is mapped to A. In constrast to the tag option, 
+Each non nucleotide symbol is mapped to A. In contrast to the tag option,
 nucltag uses less memory for processing and can be expected to be faster..
 .PP
 .B filterdupmarktags=<[0]>:


=====================================
src/programs/bamvalidate.cpp
=====================================
@@ -151,6 +151,8 @@ int bamvalidateTemplate(::libmaus2::util::ArgInfo const & arginfo)
 	::libmaus2::autoarray::AutoArray<char> qual;
 	libmaus2::autoarray::AutoArray<uint64_t> H(static_cast<uint64_t>(std::numeric_limits<uint8_t>::max())+1);
 	std::fill(H.begin(),H.end(),0ull);
+	bool acopyvalid = false;
+	libmaus2::bambam::BamAlignment acopy;
 
 	try
 	{
@@ -174,11 +176,15 @@ int bamvalidateTemplate(::libmaus2::util::ArgInfo const & arginfo)
 			std::copy(name,name+lname+1,lastvalidname.begin());
 
 			alsok += 1;
+			acopy.copyFrom(algn);
+			acopyvalid = true;
 		}
 	}
 	catch(std::exception const & ex)
 	{
 		std::cerr << "[E] name of last valid alignment was " << lastvalidname.begin() << std::endl;
+		if ( acopyvalid )
+			std::cerr << "[E] last alignment " << acopy.formatAlignment(header) << std::endl;
 		std::cerr << "[E] read " << alsok << " valid alignments" << std::endl;
 		throw;
 	}
@@ -282,8 +288,8 @@ int main(int argc, char * argv[])
 
 				std::vector< std::pair<std::string,std::string> > V;
 
-				V.push_back ( std::pair<std::string,std::string> ( "verbose=<["+::biobambam2::Licensing::formatNumber(getDefaultVerbose())+"]>", "print stats at the end of a successfull run" ) );
-				V.push_back ( std::pair<std::string,std::string> ( "basequalhist=<["+::biobambam2::Licensing::formatNumber(getDefaultBaseQualHist())+"]>", "print base quality histogram at end of a successfull run" ) );
+				V.push_back ( std::pair<std::string,std::string> ( "verbose=<["+::biobambam2::Licensing::formatNumber(getDefaultVerbose())+"]>", "print stats at the end of a successful run" ) );
+				V.push_back ( std::pair<std::string,std::string> ( "basequalhist=<["+::biobambam2::Licensing::formatNumber(getDefaultBaseQualHist())+"]>", "print base quality histogram at end of a successful run" ) );
 				V.push_back ( std::pair<std::string,std::string> ( "passthrough=<["+::biobambam2::Licensing::formatNumber(getDefaultPassThrough())+"]>", "write alignments to standard output (default: do not pass through)" ) );
 				V.push_back ( std::pair<std::string,std::string> ( "tmpfile=<filename>", "prefix for temporary files, default: create files in current directory (passthrough=1, index=1 only)" ) );
 				V.push_back ( std::pair<std::string,std::string> ( "md5=<["+::biobambam2::Licensing::formatNumber(getDefaultMD5())+"]>", "create md5 check sum (default: 0, passthrough=1 only)" ) );


=====================================
src/programs/fastqtobam.1
=====================================
@@ -63,7 +63,7 @@ input is gzip compressed FastQ. By default input is assumed to be uncompressed F
 additional BAM encoding helper threads.
 .PP
 .B PGID=<>
-read group identifier for reads. By default no read group identifer is set.
+read group identifier for reads. By default no read group identifier is set.
 The fields CN, DS, DT, FO, KS, LB, PG, PI, PL, PU and SM of the
 corresponding @RG header line can be set by using the keys RGCN, RGDS, etc.
 respectively.


=====================================
src/programs/fastqtobam2.cpp
=====================================
@@ -1896,6 +1896,8 @@ struct BlockProcessBamEncodePackageDispatcher : public libmaus2::parallel::Simpl
 	NumberEncodeTable const NET;
 	bool const zz;
 	bool const adaptercheck;
+	bool const clipslashid;
+	bool const patchne;
 
 	BlockProcessBamEncodePackageDispatcher(
 		libmaus2::parallel::LockedGrowingFreeList<
@@ -1908,10 +1910,15 @@ struct BlockProcessBamEncodePackageDispatcher : public libmaus2::parallel::Simpl
 		AdapterMatchParameters const & rAMP,
 		bool const rzz,
 		bool const radaptercheck,
+		bool const rclipslashid,
+		bool const rpatchne,
 		BlockReadStreamInfoVector * rBRSIV,
 		BlockProcessBamEncodePackageReturnEvent & rBPBEPRE,
 		BlockProcessBamEncodePackageFinishedEvent & rBPBEPFE
-	) : BRSIV(rBRSIV), BPBEPRE(rBPBEPRE), BPBEPFE(rBPBEPFE), rginfo(rrginfo), rgid(rginfo.ID), checksumsFreeList(rchecksumsFreeList), AF(rAF), AMP(rAMP), NET(), zz(rzz), adaptercheck(radaptercheck)
+	) : BRSIV(rBRSIV), BPBEPRE(rBPBEPRE),
+	    BPBEPFE(rBPBEPFE), rginfo(rrginfo), rgid(rginfo.ID),
+	    checksumsFreeList(rchecksumsFreeList), AF(rAF), AMP(rAMP), NET(), zz(rzz), adaptercheck(radaptercheck),
+	    clipslashid(rclipslashid), patchne(rpatchne)
 	{
 
 	}
@@ -1930,6 +1937,7 @@ struct BlockProcessBamEncodePackageDispatcher : public libmaus2::parallel::Simpl
 		libmaus2::bambam::parallel::FragmentAlignmentBuffer & fragmentBuffer = *(ptr->fragmentBuffer);
 		libmaus2::bambam::parallel::FragmentAlignmentBufferFragment & fragment = *(fragmentBuffer[BP->i]);
 		fragment.reset();
+		std::string sne("1:N:0:AAAAAAAA");
 
 		uint64_t const packagelow = BP->low;
 		uint64_t const numfq = fqptrlist->Ao;
@@ -1970,6 +1978,13 @@ struct BlockProcessBamEncodePackageDispatcher : public libmaus2::parallel::Simpl
 				0
 			)
 			;
+		bool const isread1 = (mapflags & libmaus2::bambam::BamFlagBase::LIBMAUS2_BAMBAM_FREAD1) ? 1 : 0;
+		bool const isread2 = (mapflags & libmaus2::bambam::BamFlagBase::LIBMAUS2_BAMBAM_FREAD2) ? 1 : 0;
+
+		if ( isread1 )
+			sne[0] = '1';
+		else
+			sne[0] = '2';
 
 		ChecksumsTypeInfo::pointer_type chksums = checksumsFreeList.get();
 		libmaus2::autoarray::AutoArray<char> Aextra;
@@ -1993,6 +2008,23 @@ struct BlockProcessBamEncodePackageDispatcher : public libmaus2::parallel::Simpl
 			while ( nameextrastart < nameend && ::isspace(*nameextrastart) )
 				++nameextrastart;
 
+			if (
+				clipslashid
+				&&
+				(namestop-namestart >= 2)
+				&&
+				(namestop[-2] == '/')
+				&&
+				(
+					(isread1 && namestop[-1] == '1')
+					||
+					(isread2 && namestop[-1] == '2')
+				)
+			)
+			{
+				namestop -= 2;
+			}
+
 			libmaus2::bambam::BamAlignmentEncoderBase::encodeAlignment(
 				ubuffer,
 				seqenc,
@@ -2044,6 +2076,14 @@ struct BlockProcessBamEncodePackageDispatcher : public libmaus2::parallel::Simpl
 					Aextra.begin()
 				);
 			}
+			else if ( patchne )
+			{
+				libmaus2::bambam::BamAlignmentEncoderBase::putAuxString(
+					ubuffer,
+					"ne",
+					sne.c_str()
+				);
+			}
 
 			bool const foundadapter = adaptercheck && AF.searchAdapters(
 				reinterpret_cast<uint8_t const *>(ptr->c + FQP.basestart),
@@ -2981,6 +3021,8 @@ struct BlockReadControl :
 		AdapterMatchParameters const & rAMP,
 		bool const rzz,
 		bool const radaptercheck,
+		bool const rclipslashid,
+		bool const rpatchne,
 		AdapterOverlapParams const & rAOP,
 		uint64_t const newlineputback,
 		uint64_t const rblocksize,
@@ -3017,7 +3059,7 @@ struct BlockReadControl :
 	    BPNCP(&BRSIV,*this,*this),
 	    BPNSP(&BRSIV,*this,*this),
 	    BPLPP(&BRSIV,*this,*this),
-	    BPBEP(checksumsFreeList,rginfo,rAF,rAMP,rzz,radaptercheck,&BRSIV,*this,*this),
+	    BPBEP(checksumsFreeList,rginfo,rAF,rAMP,rzz,radaptercheck,rclipslashid,rpatchne,&BRSIV,*this,*this),
 	    BSMP(rAOP,&BRSIV,*this,*this,*this,radaptercheck),
 	    BBCP(deflateFreeList,&BRSIV,*this,*this),
 	    eofcnt(0),
@@ -4030,6 +4072,8 @@ int fastqtobam2(libmaus2::util::ArgInfo const & arginfo)
 
 	bool const zz = arginfo.getValue<int>("zz",0);
 	bool const adaptercheck = arginfo.getValue<int>("adaptercheck",1);
+	bool const clipslashid = arginfo.getValue<int>("clipslashid",0);
+	bool const patchne = arginfo.getValue<int>("patchne",0);
 
 	uint64_t const adpmatchminscore  = arginfo.getValue<uint64_t>("adpmatchminscore",getDefaultMatchMinScore());
 	double   const adpmatchminfrac   = arginfo.getValue<double>("adpmatchminfrac",getDefaultMatchMinFrac());
@@ -4173,7 +4217,7 @@ int fastqtobam2(libmaus2::util::ArgInfo const & arginfo)
 			reinterpret_cast<uint8_t const *>(bgzfhead.c_str()),bgzfhead.size()
 		);
 
-		BlockReadControl BRC(out,STP,Vfn,level /* level */,rginfo,hash,&header,filedigest,numindexgen,AF,AMP,zz,adaptercheck,AOP,16 /* newline putback */, 1024*1024,100);
+		BlockReadControl BRC(out,STP,Vfn,level /* level */,rginfo,hash,&header,filedigest,numindexgen,AF,AMP,zz,adaptercheck,clipslashid,patchne,AOP,16 /* newline putback */, 1024*1024,100);
 
 		while ( ! BRC.isEOF() && ! STP.isInPanicMode() )
 		{



View it on GitLab: https://salsa.debian.org/med-team/biobambam2/-/compare/a7187460ddd91aa555f9af7a077b203fd5cb9018...fa497f90a61fb1729332a02478f88bb242f45e42

-- 
View it on GitLab: https://salsa.debian.org/med-team/biobambam2/-/compare/a7187460ddd91aa555f9af7a077b203fd5cb9018...fa497f90a61fb1729332a02478f88bb242f45e42
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20210629/27cf1ed0/attachment-0001.htm>


More information about the debian-med-commit mailing list