Skip to content
Commits on Source (4)
libmaus2 (2.0.663-1) unstable; urgency=medium
* allow registering files as temp files in SerialisingSortingBufferedOutputFileArray
-- German Tischler-Höhle <germant@miltenyibiotec.de> Tue, 27 Aug 2019 14:29:45 +0200
libmaus2 (2.0.662-1) unstable; urgency=medium
* add ArrayErase specialisation for std::atomic
-- German Tischler-Höhle <germant@miltenyibiotec.de> Tue, 27 Aug 2019 09:31:33 +0200
libmaus2 (2.0.661-1) unstable; urgency=medium
* fix broken handling of deletions in MD/NM calculation after adjusting interpretation of position field of BAM records
* fix recalculateCigar function in BamAlignmentDecoderBase
* fix doWrite function in PosixFdOutputStreamBuffer
* change interpretation of BAM position such that it concerns the first reference base concerned (i.e. include deletions, do not skip to the first match/mismatch)
-- German Tischler-Höhle <germant@miltenyibiotec.de> Thu, 22 Aug 2019 08:24:12 +0200
libmaus2 (2.0.660-1) unstable; urgency=medium
* implement storing of long names in FastAIndexGenerator
-- German Tischler-Höhle <germant@miltenyibiotec.de> Wed, 21 Aug 2019 09:17:02 +0200
libmaus2 (2.0.659-1) unstable; urgency=medium
* fix number width in AlignmentPrint for large positions
-- German Tischler-Höhle <germant@miltenyibiotec.de> Tue, 20 Aug 2019 15:29:21 +0200
libmaus2 (2.0.658-1) unstable; urgency=medium
* fix comparison with max value in KmerBase
-- German Tischler-Höhle <germant@miltenyibiotec.de> Tue, 20 Aug 2019 09:41:26 +0200
libmaus2 (2.0.657-1) unstable; urgency=medium
* allow limiting parallelism in fragment merging of BlockSortControl (implicitely reduces number of open files)
......
@%:@! /bin/sh
@%:@ Guess values for system-dependent variables and create Makefiles.
@%:@ Generated by GNU Autoconf 2.69 for libmaus2 2.0.656.
@%:@ Generated by GNU Autoconf 2.69 for libmaus2 2.0.662.
@%:@
@%:@ Report bugs to <tischler@mpi-cbg.de>.
@%:@
......@@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='libmaus2'
PACKAGE_TARNAME='libmaus2'
PACKAGE_VERSION='2.0.656'
PACKAGE_STRING='libmaus2 2.0.656'
PACKAGE_VERSION='2.0.662'
PACKAGE_STRING='libmaus2 2.0.662'
PACKAGE_BUGREPORT='tischler@mpi-cbg.de'
PACKAGE_URL='https://github.com/gt1/libmaus2'
 
......@@ -1609,7 +1609,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures libmaus2 2.0.656 to adapt to many kinds of systems.
\`configure' configures libmaus2 2.0.662 to adapt to many kinds of systems.
 
Usage: $0 [OPTION]... [VAR=VALUE]...
 
......@@ -1681,7 +1681,7 @@ fi
 
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of libmaus2 2.0.656:";;
short | recursive ) echo "Configuration of libmaus2 2.0.662:";;
esac
cat <<\_ACEOF
 
......@@ -1851,7 +1851,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
libmaus2 configure 2.0.656
libmaus2 configure 2.0.662
generated by GNU Autoconf 2.69
 
Copyright (C) 2012 Free Software Foundation, Inc.
......@@ -2724,7 +2724,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
 
It was created by libmaus2 $as_me 2.0.656, which was
It was created by libmaus2 $as_me 2.0.662, which was
generated by GNU Autoconf 2.69. Invocation command line was
 
$ $0 $@
......@@ -3072,7 +3072,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
LIBRARY_VERSION=2:656:0
LIBRARY_VERSION=2:662:0
{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring for source in directory ${srcdir}" >&5
$as_echo "$as_me: Configuring for source in directory ${srcdir}" >&6;}
ac_aux_dir=
......@@ -12628,7 +12628,7 @@ fi
 
# Define the identity of the package.
PACKAGE='libmaus2'
VERSION='2.0.656'
VERSION='2.0.662'
 
 
cat >>confdefs.h <<_ACEOF
......@@ -28157,7 +28157,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by libmaus2 $as_me 2.0.656, which was
This file was extended by libmaus2 $as_me 2.0.662, which was
generated by GNU Autoconf 2.69. Invocation command line was
 
CONFIG_FILES = $CONFIG_FILES
......@@ -28224,7 +28224,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
libmaus2 config.status 2.0.656
libmaus2 config.status 2.0.662
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
 
......
@%:@! /bin/sh
@%:@ Guess values for system-dependent variables and create Makefiles.
@%:@ Generated by GNU Autoconf 2.69 for libmaus2 2.0.657.
@%:@ Generated by GNU Autoconf 2.69 for libmaus2 2.0.663.
@%:@
@%:@ Report bugs to <tischler@mpi-cbg.de>.
@%:@
......@@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='libmaus2'
PACKAGE_TARNAME='libmaus2'
PACKAGE_VERSION='2.0.657'
PACKAGE_STRING='libmaus2 2.0.657'
PACKAGE_VERSION='2.0.663'
PACKAGE_STRING='libmaus2 2.0.663'
PACKAGE_BUGREPORT='tischler@mpi-cbg.de'
PACKAGE_URL='https://github.com/gt1/libmaus2'
 
......@@ -1609,7 +1609,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures libmaus2 2.0.657 to adapt to many kinds of systems.
\`configure' configures libmaus2 2.0.663 to adapt to many kinds of systems.
 
Usage: $0 [OPTION]... [VAR=VALUE]...
 
......@@ -1681,7 +1681,7 @@ fi
 
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of libmaus2 2.0.657:";;
short | recursive ) echo "Configuration of libmaus2 2.0.663:";;
esac
cat <<\_ACEOF
 
......@@ -1851,7 +1851,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
libmaus2 configure 2.0.657
libmaus2 configure 2.0.663
generated by GNU Autoconf 2.69
 
Copyright (C) 2012 Free Software Foundation, Inc.
......@@ -2724,7 +2724,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
 
It was created by libmaus2 $as_me 2.0.657, which was
It was created by libmaus2 $as_me 2.0.663, which was
generated by GNU Autoconf 2.69. Invocation command line was
 
$ $0 $@
......@@ -3072,7 +3072,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
LIBRARY_VERSION=2:657:0
LIBRARY_VERSION=2:663:0
{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring for source in directory ${srcdir}" >&5
$as_echo "$as_me: Configuring for source in directory ${srcdir}" >&6;}
ac_aux_dir=
......@@ -12628,7 +12628,7 @@ fi
 
# Define the identity of the package.
PACKAGE='libmaus2'
VERSION='2.0.657'
VERSION='2.0.663'
 
 
cat >>confdefs.h <<_ACEOF
......@@ -28157,7 +28157,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by libmaus2 $as_me 2.0.657, which was
This file was extended by libmaus2 $as_me 2.0.663, which was
generated by GNU Autoconf 2.69. Invocation command line was
 
CONFIG_FILES = $CONFIG_FILES
......@@ -28224,7 +28224,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
libmaus2 config.status 2.0.657
libmaus2 config.status 2.0.663
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
 
......
@%:@! /bin/sh
@%:@ Guess values for system-dependent variables and create Makefiles.
@%:@ Generated by GNU Autoconf 2.69 for libmaus2 2.0.657.
@%:@ Generated by GNU Autoconf 2.69 for libmaus2 2.0.663.
@%:@
@%:@ Report bugs to <tischler@mpi-cbg.de>.
@%:@
......@@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='libmaus2'
PACKAGE_TARNAME='libmaus2'
PACKAGE_VERSION='2.0.657'
PACKAGE_STRING='libmaus2 2.0.657'
PACKAGE_VERSION='2.0.663'
PACKAGE_STRING='libmaus2 2.0.663'
PACKAGE_BUGREPORT='tischler@mpi-cbg.de'
PACKAGE_URL='https://github.com/gt1/libmaus2'
 
......@@ -1609,7 +1609,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures libmaus2 2.0.657 to adapt to many kinds of systems.
\`configure' configures libmaus2 2.0.663 to adapt to many kinds of systems.
 
Usage: $0 [OPTION]... [VAR=VALUE]...
 
......@@ -1681,7 +1681,7 @@ fi
 
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of libmaus2 2.0.657:";;
short | recursive ) echo "Configuration of libmaus2 2.0.663:";;
esac
cat <<\_ACEOF
 
......@@ -1851,7 +1851,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
libmaus2 configure 2.0.657
libmaus2 configure 2.0.663
generated by GNU Autoconf 2.69
 
Copyright (C) 2012 Free Software Foundation, Inc.
......@@ -2724,7 +2724,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
 
It was created by libmaus2 $as_me 2.0.657, which was
It was created by libmaus2 $as_me 2.0.663, which was
generated by GNU Autoconf 2.69. Invocation command line was
 
$ $0 $@
......@@ -3072,7 +3072,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
LIBRARY_VERSION=2:657:0
LIBRARY_VERSION=2:663:0
{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring for source in directory ${srcdir}" >&5
$as_echo "$as_me: Configuring for source in directory ${srcdir}" >&6;}
ac_aux_dir=
......@@ -12628,7 +12628,7 @@ fi
 
# Define the identity of the package.
PACKAGE='libmaus2'
VERSION='2.0.657'
VERSION='2.0.663'
 
 
cat >>confdefs.h <<_ACEOF
......@@ -28157,7 +28157,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by libmaus2 $as_me 2.0.657, which was
This file was extended by libmaus2 $as_me 2.0.663, which was
generated by GNU Autoconf 2.69. Invocation command line was
 
CONFIG_FILES = $CONFIG_FILES
......@@ -28224,7 +28224,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
libmaus2 config.status 2.0.657
libmaus2 config.status 2.0.663
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
 
......
This diff is collapsed.
......@@ -4,7 +4,7 @@ m4trace:aclocal.m4:1460: -1- m4_include([m4/ltoptions.m4])
m4trace:aclocal.m4:1461: -1- m4_include([m4/ltsugar.m4])
m4trace:aclocal.m4:1462: -1- m4_include([m4/ltversion.m4])
m4trace:aclocal.m4:1463: -1- m4_include([m4/lt~obsolete.m4])
m4trace:configure.ac:1: -1- AC_INIT([libmaus2], [2.0.657], [tischler@mpi-cbg.de], [libmaus2], [https://github.com/gt1/libmaus2])
m4trace:configure.ac:1: -1- AC_INIT([libmaus2], [2.0.663], [tischler@mpi-cbg.de], [libmaus2], [https://github.com/gt1/libmaus2])
m4trace:configure.ac:1: -1- m4_pattern_forbid([^_?A[CHUM]_])
m4trace:configure.ac:1: -1- m4_pattern_forbid([_AC_])
m4trace:configure.ac:1: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for libmaus2 2.0.657.
# Generated by GNU Autoconf 2.69 for libmaus2 2.0.663.
#
# Report bugs to <tischler@mpi-cbg.de>.
#
......@@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='libmaus2'
PACKAGE_TARNAME='libmaus2'
PACKAGE_VERSION='2.0.657'
PACKAGE_STRING='libmaus2 2.0.657'
PACKAGE_VERSION='2.0.663'
PACKAGE_STRING='libmaus2 2.0.663'
PACKAGE_BUGREPORT='tischler@mpi-cbg.de'
PACKAGE_URL='https://github.com/gt1/libmaus2'
 
......@@ -1609,7 +1609,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures libmaus2 2.0.657 to adapt to many kinds of systems.
\`configure' configures libmaus2 2.0.663 to adapt to many kinds of systems.
 
Usage: $0 [OPTION]... [VAR=VALUE]...
 
......@@ -1681,7 +1681,7 @@ fi
 
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of libmaus2 2.0.657:";;
short | recursive ) echo "Configuration of libmaus2 2.0.663:";;
esac
cat <<\_ACEOF
 
......@@ -1851,7 +1851,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
libmaus2 configure 2.0.657
libmaus2 configure 2.0.663
generated by GNU Autoconf 2.69
 
Copyright (C) 2012 Free Software Foundation, Inc.
......@@ -2724,7 +2724,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
 
It was created by libmaus2 $as_me 2.0.657, which was
It was created by libmaus2 $as_me 2.0.663, which was
generated by GNU Autoconf 2.69. Invocation command line was
 
$ $0 $@
......@@ -3072,7 +3072,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
LIBRARY_VERSION=2:657:0
LIBRARY_VERSION=2:663:0
{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring for source in directory ${srcdir}" >&5
$as_echo "$as_me: Configuring for source in directory ${srcdir}" >&6;}
ac_aux_dir=
......@@ -12628,7 +12628,7 @@ fi
 
# Define the identity of the package.
PACKAGE='libmaus2'
VERSION='2.0.657'
VERSION='2.0.663'
 
 
cat >>confdefs.h <<_ACEOF
......@@ -28157,7 +28157,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by libmaus2 $as_me 2.0.657, which was
This file was extended by libmaus2 $as_me 2.0.663, which was
generated by GNU Autoconf 2.69. Invocation command line was
 
CONFIG_FILES = $CONFIG_FILES
......@@ -28224,7 +28224,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
libmaus2 config.status 2.0.657
libmaus2 config.status 2.0.663
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
 
......
AC_INIT(libmaus2,2.0.657,[tischler@mpi-cbg.de],[libmaus2],[https://github.com/gt1/libmaus2])
LIBRARY_VERSION=2:657:0
AC_INIT(libmaus2,2.0.663,[tischler@mpi-cbg.de],[libmaus2],[https://github.com/gt1/libmaus2])
LIBRARY_VERSION=2:663:0
AC_MSG_NOTICE([Configuring for source in directory ${srcdir}])
AC_CANONICAL_SYSTEM
AC_CANONICAL_HOST
......
libmaus2 (2.0.663-1) unstable; urgency=medium
* Team upload.
* New upstream version
* TODO: Added override to debian sharedlibs helper that should go in
a later upload
-- Steffen Moeller <moeller@debian.org> Wed, 28 Aug 2019 15:05:00 +0200
libmaus2 (2.0.657-1) unstable; urgency=medium
* New upstream version
......
......@@ -13,10 +13,13 @@ export LC_ALL=C.UTF-8
override_dh_install:
dh_install
# following override suggestion from suggestion of Andreas to Michael
# to overcome d-shlibmove bug on Jan 4, 2019
d-shlibmove --commit \
--multiarch \
--devunversioned \
--exclude-la \
--override s/libdeflate0-dev/libdeflate-dev/ \
--movedev debian/tmp/usr/include/* usr/include \
--movedev "debian/tmp/usr/lib/*/pkgconfig/*.pc" usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig \
debian/tmp/usr/lib/*/*.so
......
......@@ -251,6 +251,7 @@ namespace libmaus2
assert ( w <= static_cast<int64_t>(n) );
n -= w;
writepos += w;
p += w;
}
}
}
......
......@@ -410,6 +410,20 @@ namespace libmaus2
static void erase(std::unique_ptr<N> * array, uint64_t const n);
};
/**
* class for erasing an array of std::atomic objects
**/
template<typename N>
struct ArrayErase< std::atomic<N> >
{
/**
* erase an array of n elements of type std::atomic<N>
* @param array to be erased
* @param n number of elements in array
**/
static void erase(std::atomic<N> * array, uint64_t const n);
};
template<typename N, alloc_type atype>
struct AutoArrayAllocate
{
......@@ -1890,6 +1904,13 @@ namespace libmaus2
array[i] = UNIQUE_PTR_MOVE(std::unique_ptr<N>());
}
template<typename N>
void ArrayErase< std::atomic<N> >::erase(std::atomic<N> * array, uint64_t const n)
{
for ( uint64_t i = 0; i < n; ++i )
std::atomic_init(&array[i],N());
}
template<typename N, alloc_type atype>
bool operator==(AutoArray<N,atype> const & A, AutoArray<N,atype> const & B)
{
......
......@@ -472,7 +472,7 @@ namespace libmaus2
{
if ( isMapped() )
{
it += getPos() - getFrontDel();
it += getPos();
std::string const R = getRead();
std::string::const_iterator itr = R.begin();
......@@ -1837,7 +1837,7 @@ namespace libmaus2
return libmaus2::math::IntegerInterval<int64_t>::empty();
else
{
int64_t const start = getPos() - getFrontDel();
int64_t const start = getPos();
int64_t const end = start + getReferenceLength();
return libmaus2::math::IntegerInterval<int64_t>(start,end-1);
}
......@@ -2375,11 +2375,11 @@ namespace libmaus2
}
/**
* @return getPos() - getFrontDel()
* @return getPos()
**/
int64_t getRefStart() const
{
return getPos() - getFrontDel();
return getPos();
}
/**
......@@ -3017,7 +3017,7 @@ namespace libmaus2
if ( ! reflen )
return libmaus2::math::IntegerInterval<int64_t>::empty();
int64_t const start = getNextPos() - getNextFrontDel(Aop);
int64_t const start = getNextPos();
int64_t const end = start + reflen;
return libmaus2::math::IntegerInterval<int64_t>(start,end-1);
}
......
......@@ -4534,7 +4534,7 @@ namespace libmaus2
{
true, // LIBMAUS2_BAMBAM_CMATCH = 0,
false, // LIBMAUS2_BAMBAM_CINS = 1,
false, // LIBMAUS2_BAMBAM_CDEL = 2,
true, // LIBMAUS2_BAMBAM_CDEL = 2,
false, // LIBMAUS2_BAMBAM_CREF_SKIP = 3,
false, // LIBMAUS2_BAMBAM_CSOFT_CLIP = 4,
false, // LIBMAUS2_BAMBAM_CHARD_CLIP = 5,
......@@ -4670,7 +4670,7 @@ namespace libmaus2
{
true, // LIBMAUS2_BAMBAM_CMATCH = 0,
false, // LIBMAUS2_BAMBAM_CINS = 1,
false, // LIBMAUS2_BAMBAM_CDEL = 2,
true, // LIBMAUS2_BAMBAM_CDEL = 2,
false, // LIBMAUS2_BAMBAM_CREF_SKIP = 3,
false, // LIBMAUS2_BAMBAM_CSOFT_CLIP = 4,
false, // LIBMAUS2_BAMBAM_CHARD_CLIP = 5,
......@@ -4805,7 +4805,7 @@ namespace libmaus2
{
true, // LIBMAUS2_BAMBAM_CMATCH = 0,
false, // LIBMAUS2_BAMBAM_CINS = 1,
false, // LIBMAUS2_BAMBAM_CDEL = 2,
true, // LIBMAUS2_BAMBAM_CDEL = 2,
false, // LIBMAUS2_BAMBAM_CREF_SKIP = 3,
false, // LIBMAUS2_BAMBAM_CSOFT_CLIP = 4,
false, // LIBMAUS2_BAMBAM_CHARD_CLIP = 5,
......@@ -4919,7 +4919,7 @@ namespace libmaus2
}
assert ( readpos == getLseq(B) );
assert ( refpos == static_cast<int64_t>(getPos(B)) + static_cast<int64_t>(getReferenceAdvance(B)) );
assert ( refpos == static_cast<int64_t>(getPos(B)) + static_cast<int64_t>(getReferenceLength(B)) );
if ( Vout.size() > cigopin.size() )
cigopin.resize(Vout.size());
......@@ -4952,7 +4952,7 @@ namespace libmaus2
std::ostream * errstr = &std::cerr
)
{
static const bool calmd_preterm[] =
static const bool calmd_matchop[] =
{
true, // LIBMAUS2_BAMBAM_CMATCH = 0,
false, // LIBMAUS2_BAMBAM_CINS = 1,
......@@ -5040,7 +5040,7 @@ namespace libmaus2
int32_t const cigo = cigop[cigi].first;
uint64_t const cigp = cigop[cigi].second;
if ( calmd_preterm[cigo] )
if ( calmd_matchop[cigo] )
{
uint64_t l = 0;
while ( l != cigp )
......@@ -5191,7 +5191,7 @@ namespace libmaus2
{
true, // LIBMAUS2_BAMBAM_CMATCH = 0,
false, // LIBMAUS2_BAMBAM_CINS = 1,
false, // LIBMAUS2_BAMBAM_CDEL = 2,
true, // LIBMAUS2_BAMBAM_CDEL = 2,
false, // LIBMAUS2_BAMBAM_CREF_SKIP = 3,
false, // LIBMAUS2_BAMBAM_CSOFT_CLIP = 4,
false, // LIBMAUS2_BAMBAM_CHARD_CLIP = 5,
......
......@@ -340,8 +340,7 @@ namespace libmaus2
{
int64_t const refid = libmaus2::bambam::BamAlignmentDecoderBase::getRefID(D);
int64_t const pos =
libmaus2::bambam::BamAlignmentDecoderBase::getPos(D) -
libmaus2::bambam::BamAlignmentDecoderBase::getFrontDel(D)
libmaus2::bambam::BamAlignmentDecoderBase::getPos(D)
;
int64_t const refend = pos + libmaus2::bambam::BamAlignmentDecoderBase::getReferenceLength(D);
std::string const & ref = loadReference(refid);
......
......@@ -89,12 +89,12 @@ namespace libmaus2
if ( fword <= rword )
{
if ( (fword>>hashshift) >= minhash && (fword>>hashshift) < maxhash )
if ( (fword>>hashshift) >= minhash && (fword>>hashshift) <= maxhash )
callback(fword);
}
else
{
if ( (rword>>hashshift) >= minhash && (rword>>hashshift) < maxhash )
if ( (rword>>hashshift) >= minhash && (rword>>hashshift) <= maxhash )
callback(rword);
}
}
......@@ -165,12 +165,12 @@ namespace libmaus2
if ( fword <= rword )
{
if ( (fword>>hashshift) >= minhash && (fword>>hashshift) < maxhash )
if ( (fword>>hashshift) >= minhash && (fword>>hashshift) <= maxhash )
callback(fword,z,false);
}
else
{
if ( (rword>>hashshift) >= minhash && (rword>>hashshift) < maxhash )
if ( (rword>>hashshift) >= minhash && (rword>>hashshift) <= maxhash )
callback(rword,z,true);
}
}
......@@ -240,12 +240,12 @@ namespace libmaus2
if ( fword <= rword )
{
if ( (fword>>hashshift) >= minhash && (fword>>hashshift) < maxhash )
if ( (fword>>hashshift) >= minhash && (fword>>hashshift) <= maxhash )
callback(fword,z,false);
}
else
{
if ( (rword>>hashshift) >= minhash && (rword>>hashshift) < maxhash )
if ( (rword>>hashshift) >= minhash && (rword>>hashshift) <= maxhash )
callback(rword,z,true);
}
}
......@@ -308,7 +308,7 @@ namespace libmaus2
{
uint64_t const fword = forw.buffer;
if ( (fword>>hashshift) >= minhash && (fword>>hashshift) < maxhash )
if ( (fword>>hashshift) >= minhash && (fword>>hashshift) <= maxhash )
callback(fword,z);
}
......@@ -365,7 +365,7 @@ namespace libmaus2
{
uint64_t const fword = forw.buffer;
if ( (fword>>hashshift) >= minhash && (fword>>hashshift) < maxhash )
if ( (fword>>hashshift) >= minhash && (fword>>hashshift) <= maxhash )
callback(fword,z);
}
......@@ -430,7 +430,7 @@ namespace libmaus2
{
uint64_t const fword = forw.buffer;
if ( (fword>>hashshift) >= minhash && (fword>>hashshift) < maxhash )
if ( (fword>>hashshift) >= minhash && (fword>>hashshift) <= maxhash )
callback(fword,-static_cast<int>(z)-1);
}
}
......@@ -479,7 +479,7 @@ namespace libmaus2
{
uint64_t const fword = forw.buffer;
if ( (fword>>hashshift) >= minhash && (fword>>hashshift) < maxhash )
if ( (fword>>hashshift) >= minhash && (fword>>hashshift) <= maxhash )
callback(fword,z);
}
......
/*
libmaus2
Copyright (C) 2016 German Tischler
Copyright (C) 2016-2019 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
......@@ -20,10 +20,13 @@
#include <libmaus2/aio/InputStreamInstance.hpp>
#include <libmaus2/aio/OutputStreamInstance.hpp>
#include <libmaus2/aio/OutputStreamFactoryContainer.hpp>
#include <libmaus2/fastx/FastAIndex.hpp>
#include <libmaus2/fastx/SpaceTable.hpp>
#include <libmaus2/util/ArgInfo.hpp>
#include <libmaus2/util/GetFileSize.hpp>
#include <libmaus2/util/LineBuffer.hpp>
#include <libmaus2/util/TempFileRemovalContainer.hpp>
namespace libmaus2
{
......@@ -31,22 +34,61 @@ namespace libmaus2
{
struct FastAIndexGenerator
{
static void generate(std::string const & fastaname, std::string const & fainame, int const verbose)
static bool needRun(
std::string const & fastaname, std::string const & fainame, std::string const * plongnamefn
)
{
if ( (! libmaus2::util::GetFileSize::fileExists(fainame)) || (libmaus2::util::GetFileSize::isOlder(fainame,fastaname) ) )
return true;
if ( plongnamefn )
{
std::string const & longnamefn = *plongnamefn;
if ( (! libmaus2::util::GetFileSize::fileExists(longnamefn)) || (libmaus2::util::GetFileSize::isOlder(longnamefn,fastaname) ) )
return true;
}
return false;
}
static void generate(
std::string const & fastaname,
std::string const & fainame,
int const verbose,
std::string const * plongnamefn = NULL,
std::string const * ptmpprefix = NULL
)
{
if ( needRun(fastaname,fainame,plongnamefn) )
{
if ( verbose > 0 )
std::cerr << "[V] generating " << fainame << "...";
std::string const tmpprefix = ptmpprefix ? (*ptmpprefix) : libmaus2::util::ArgInfo::getDefaultTmpFileName(fainame);
std::string const fainametmp = tmpprefix + ".faitmp";
libmaus2::util::TempFileRemovalContainer::addTempFile(fainametmp);
std::string const longnametmp = tmpprefix + ".longnametmp";
libmaus2::util::TempFileRemovalContainer::addTempFile(longnametmp);
libmaus2::aio::InputStreamInstance ISI(fastaname);
libmaus2::aio::OutputStreamInstance OSI(fainame);
libmaus2::aio::OutputStreamInstance::unique_ptr_type OSI(new libmaus2::aio::OutputStreamInstance(fainametmp));
libmaus2::util::LineBuffer LB(ISI, 8*1024);
libmaus2::fastx::SpaceTable ST;
libmaus2::aio::OutputStreamInstance::unique_ptr_type longOSI;
if ( plongnamefn )
{
libmaus2::aio::OutputStreamInstance::unique_ptr_type tOSI(new libmaus2::aio::OutputStreamInstance(longnametmp));
longOSI = UNIQUE_PTR_MOVE(tOSI);
}
char const * a = 0;
char const * e = 0;
std::string seqname;
std::string longname;
int64_t linewidth = -1;
int64_t linelength = -1;
uint64_t seqlength = 0;
......@@ -58,9 +100,14 @@ namespace libmaus2
if ( e-a && *a == '>' )
{
if ( seqname.size() )
OSI << seqname << "\t" << seqlength << "\t" << seqoffset << "\t" << linewidth << "\t" << linelength << std::endl;
{
(*OSI) << seqname << "\t" << seqlength << "\t" << seqoffset << "\t" << linewidth << "\t" << linelength << "\n";
if ( longOSI )
*longOSI << longname << "\n";
}
seqname = libmaus2::fastx::FastAIndex::computeShortName(std::string(a+1,e));
longname = std::string(a+1,e);
seqname = libmaus2::fastx::FastAIndex::computeShortName(longname);
linewidth = -1;
linelength = -1;
seqlength = 0;
......@@ -89,7 +136,50 @@ namespace libmaus2
o += (e-a)+1;
}
if ( seqname.size() )
OSI << seqname << "\t" << seqlength << "\t" << seqoffset << "\t" << linewidth << "\t" << linelength << std::endl;
{
(*OSI) << seqname << "\t" << seqlength << "\t" << seqoffset << "\t" << linewidth << "\t" << linelength << "\n";
if ( longOSI )
*longOSI << longname << "\n";
}
OSI->flush();
if ( ! *OSI )
{
libmaus2::exception::LibMausException lme;
lme.getStream() << "[E] FastAIndexGenerator::generate: unable to write output" << std::endl;
lme.finish();
throw lme;
}
OSI.reset();
libmaus2::aio::OutputStreamFactoryContainer::rename(
fainametmp,
fainame
);
if ( longOSI )
{
longOSI->flush();
if ( ! *longOSI )
{
libmaus2::exception::LibMausException lme;
lme.getStream() << "[E] FastAIndexGenerator::generate: unable to write output" << std::endl;
lme.finish();
throw lme;
}
longOSI.reset();
assert ( plongnamefn );
libmaus2::aio::OutputStreamFactoryContainer::rename(
longnametmp,
*plongnamefn
);
}
if ( verbose > 0 )
std::cerr << "done." << std::endl;
......
......@@ -21,6 +21,7 @@
#define LIBMAUS2_LCS_ALIGNMENTPRINT_HPP
#include <libmaus2/lcs/BaseConstants.hpp>
#include <libmaus2/util/NumberSerialisation.hpp>
#include <iostream>
#include <sstream>
......@@ -288,12 +289,13 @@ namespace libmaus2
uint64_t const numlines = (std::max(aa.size(),ba.size()) + linewidth-1) / linewidth;
uint64_t posa = rposa;
uint64_t posb = rposb;
uint64_t const numwidth = libmaus2::util::NumberSerialisation::formatNumber(std::max(rposa+an,rposb+bn),6).size();
for ( uint64_t i = 0; i < numlines; ++i )
{
uint64_t pl = i*linewidth;
out << "A " << std::setw(6) << posa << std::setw(0) << " ";
out << "A " << std::setw(numwidth) << posa << std::setw(0) << " ";
if ( pl < aa.size() )
{
uint64_t const alen = std::min(linewidth,aa.size()-pl);
......@@ -305,7 +307,7 @@ namespace libmaus2
}
out << std::endl;
out << "B " << std::setw(6) << posb << std::setw(0) << " ";
out << "B " << std::setw(numwidth) << posb << std::setw(0) << " ";
if ( pl < ba.size() )
{
uint64_t const blen = std::min(linewidth,ba.size()-pl);
......@@ -317,7 +319,7 @@ namespace libmaus2
}
out << std::endl;
out << std::string(9,' ');
out << std::string(numwidth + 3,' ');
if ( pl < ca.size() )
{
uint64_t const clen = std::min(linewidth,ca.size()-pl);
......@@ -427,6 +429,7 @@ namespace libmaus2
std::string const ca = cstr.str();
uint64_t const linewidth = rlinewidth-2;
uint64_t const numlines = (std::max(aa.size(),ba.size()) + linewidth-1) / linewidth;
uint64_t const numwidth = libmaus2::util::NumberSerialisation::formatNumber(std::max(rposa+an,rposb+bn),6).size();
uint64_t posa = rposa;
uint64_t posb = rposb;
......@@ -435,7 +438,7 @@ namespace libmaus2
{
uint64_t pl = i*linewidth;
out << paid << ' ' << std::setw(6) << posa << std::setw(0) << " ";
out << paid << ' ' << std::setw(numwidth) << posa << std::setw(0) << " ";
if ( pl < aa.size() )
{
uint64_t const alen = std::min(linewidth,aa.size()-pl);
......@@ -447,7 +450,7 @@ namespace libmaus2
}
out << std::endl;
out << pbid << ' ' << std::setw(6) << posb << std::setw(0) << " ";
out << pbid << ' ' << std::setw(numwidth) << posb << std::setw(0) << " ";
if ( pl < ba.size() )
{
uint64_t const blen = std::min(linewidth,ba.size()-pl);
......@@ -462,7 +465,7 @@ namespace libmaus2
out
<< std::string(midlen,' ') // id
<< std::string(1,' ') // space
<< std::string(6,' ') // pos
<< std::string(numwidth,' ') // pos
<< std::string(1,' ') // space
;
if ( pl < ca.size() )
......
......@@ -388,7 +388,7 @@ namespace libmaus2
typedef typename sorter_type::unique_ptr_type sorter_ptr_type;
libmaus2::autoarray::AutoArray < sorter_ptr_type > ASO;
static std::vector < std::string > computeVfn(std::string const & s, uint64_t const n)
static std::vector < std::string > computeVfn(std::string const & s, uint64_t const n, bool const registertmp)
{
std::vector < std::string > Vfn(n);
for ( uint64_t i = 0; i < n; ++i )
......@@ -396,6 +396,9 @@ namespace libmaus2
std::ostringstream ostr;
ostr << s << "_" << std::setw(6) << std::setfill('0') << i;
Vfn[i] = ostr.str();
if ( registertmp )
libmaus2::util::TempFileRemovalContainer::addTempFile(Vfn[i]);
}
return Vfn;
}
......@@ -411,14 +414,24 @@ namespace libmaus2
}
}
SerialisingSortingBufferedOutputFileArray(std::string const & rfilename, uint64_t const n, uint64_t const bufsize = 1024ull)
: Vfn(computeVfn(rfilename,n)), Porder(new order_type), order(*Porder), filename(rfilename), ASO(n)
static uint64_t getDefaultBufSize()
{
return 1024ull;
}
static bool getDefaultRegisterTmp()
{
return false;
}
SerialisingSortingBufferedOutputFileArray(std::string const & rfilename, uint64_t const n, uint64_t const bufsize = getDefaultBufSize(), bool const registertmp = getDefaultRegisterTmp())
: Vfn(computeVfn(rfilename,n,registertmp)), Porder(new order_type), order(*Porder), filename(rfilename), ASO(n)
{
setupFileArray(bufsize);
}
SerialisingSortingBufferedOutputFileArray(std::string const & rfilename, uint64_t const n, order_type & rorder, uint64_t const bufsize = 1024ull)
: Vfn(computeVfn(rfilename,n)), Porder(), order(rorder), filename(rfilename), ASO(n)
SerialisingSortingBufferedOutputFileArray(std::string const & rfilename, uint64_t const n, order_type & rorder, uint64_t const bufsize = getDefaultBufSize(), bool const registertmp = getDefaultRegisterTmp())
: Vfn(computeVfn(rfilename,n,registertmp)), Porder(), order(rorder), filename(rfilename), ASO(n)
{
setupFileArray(bufsize);
}
......
......@@ -46,7 +46,7 @@ int main(int argc, char * argv[])
// check the alignment
bool const algnok = algn.checkCigar(Vref.at(algn.getRefID()).begin());
assert ( algnok );
std::string const cref = Vref[algn.getRefID()].substr(algn.getPos()-algn.getFrontDel(),algn.getReferenceLength());
std::string const cref = Vref[algn.getRefID()].substr(algn.getPos(),algn.getReferenceLength());
std::string const sref = algn.getReferenceRegionViaMd();
if ( sref == cref )
......