From 3091d64076bb833af08ad693272c1d010a93bdca Mon Sep 17 00:00:00 2001 From: Jeremiah Wala Date: Thu, 28 Apr 2016 15:43:49 -0400 Subject: [PATCH] Error msg on bad rules script --- Makefile.am | 2 +- Makefile.in | 2 +- SnowTools | 2 +- configure | 2 +- configure.ac | 2 +- src/Makefile.am | 3 +-- src/Makefile.in | 4 ++-- src/VariantBamWalker.cpp | 15 +++++++++------ 8 files changed, 17 insertions(+), 15 deletions(-) diff --git a/Makefile.am b/Makefile.am index b96077f..0caad9f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,3 +1,3 @@ AUTOMAKE_OPTIONS = foreign ##SUBDIRS = SnowTools/blat SnowTools/multifast-v1.4.2/ahocorasick SnowTools/SGA/Util SnowTools/SGA/SQG SnowTools/SGA/Bigraph SnowTools/SGA/Algorithm SnowTools/SGA/StringGraph SnowTools/SGA/SuffixTools SnowTools/bwa SnowTools/htslib SnowTools/src src -SUBDIRS = SnowTools/blat SnowTools/multifast-v1.4.2/ahocorasick SnowTools/bwa SnowTools/htslib SnowTools/src src +SUBDIRS = SnowTools/multifast-v1.4.2/ahocorasick SnowTools/htslib SnowTools/src src diff --git a/Makefile.in b/Makefile.in index 359f25b..526ba3f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -193,7 +193,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign -SUBDIRS = SnowTools/blat SnowTools/multifast-v1.4.2/ahocorasick SnowTools/bwa SnowTools/htslib SnowTools/src src +SUBDIRS = SnowTools/multifast-v1.4.2/ahocorasick SnowTools/htslib SnowTools/src src all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive diff --git a/SnowTools b/SnowTools index 67fe11e..816348e 160000 --- a/SnowTools +++ b/SnowTools @@ -1 +1 @@ -Subproject commit 67fe11ea3326aa6143894aa6f295fc6f0c90fbaf +Subproject commit 816348e57aa00098559dd2608e9bf31352dbc485 diff --git a/configure b/configure index 215a16a..faad473 100755 --- a/configure +++ b/configure @@ -5124,7 +5124,7 @@ CFLAGS="$CFLAGS -O3" CPPFLAGS="$CPPFLAGS $boost_include" -LDFLAGS="$LDFLAGS -L. $boost_lib_flag" +LDFLAGS="$LDFLAGS $boost_lib_flag" LIBS="$LIBS -lpthread -lboost_regex" diff --git a/configure.ac b/configure.ac index 258b569..c3d13e7 100644 --- a/configure.ac +++ b/configure.ac @@ -47,7 +47,7 @@ AC_SUBST(AM_CXXFLAGS, "-g -std=c++11 -Wall -Wextra $fail_on_warning -Wno-unknown AC_SUBST(CXXFLAGS, "$CXXFLAGS -O3") AC_SUBST(CFLAGS, "$CFLAGS -O3") AC_SUBST(CPPFLAGS, "$CPPFLAGS $boost_include") -AC_SUBST(LDFLAGS, "$LDFLAGS -L. $boost_lib_flag") +AC_SUBST(LDFLAGS, "$LDFLAGS $boost_lib_flag") AC_SUBST(LIBS, "$LIBS -lpthread -lboost_regex") # Make sure the bamtools headers can be found diff --git a/src/Makefile.am b/src/Makefile.am index 469eefa..5a259e2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -8,11 +8,10 @@ variant_CPPFLAGS = \ variant_LDADD = \ $(top_builddir)/SnowTools/src/libsnowtools.a \ - $(top_builddir)/SnowTools/bwa/libbwa.a \ $(top_builddir)/SnowTools/htslib/libhts.a \ $(top_builddir)/SnowTools/multifast-v1.4.2/ahocorasick/build/libahocorasick.a ##variant_LDFLAGS = -Wl,-Bstatic -lboost_regex -##@boost_lib@/libboost_regex.a +#variant_LDFLAGS = @boost_lib@/libboost_regex.a variant_SOURCES = variant.cpp VariantBamWalker.cpp diff --git a/src/Makefile.in b/src/Makefile.in index f55923e..b3cd06e 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -49,7 +49,6 @@ am_variant_OBJECTS = variant-variant.$(OBJEXT) \ variant-VariantBamWalker.$(OBJEXT) variant_OBJECTS = $(am_variant_OBJECTS) variant_DEPENDENCIES = $(top_builddir)/SnowTools/src/libsnowtools.a \ - $(top_builddir)/SnowTools/bwa/libbwa.a \ $(top_builddir)/SnowTools/htslib/libhts.a \ $(top_builddir)/SnowTools/multifast-v1.4.2/ahocorasick/build/libahocorasick.a DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) @@ -167,10 +166,11 @@ variant_CPPFLAGS = \ variant_LDADD = \ $(top_builddir)/SnowTools/src/libsnowtools.a \ - $(top_builddir)/SnowTools/bwa/libbwa.a \ $(top_builddir)/SnowTools/htslib/libhts.a \ $(top_builddir)/SnowTools/multifast-v1.4.2/ahocorasick/build/libahocorasick.a + +#variant_LDFLAGS = @boost_lib@/libboost_regex.a variant_SOURCES = variant.cpp VariantBamWalker.cpp all: all-am diff --git a/src/VariantBamWalker.cpp b/src/VariantBamWalker.cpp index 4a26c03..9daa5b5 100644 --- a/src/VariantBamWalker.cpp +++ b/src/VariantBamWalker.cpp @@ -32,7 +32,7 @@ void VariantBamWalker::writeVariantBam() buffer_size = std::max((int32_t)r.Length() * 5, buffer_size); //std::cerr << "...r " << r << " rule " << rule << std::endl; - TrackSeenRead(r); + //TrackSeenRead(r); // add coverage if (max_cov != 0) { @@ -138,15 +138,18 @@ void VariantBamWalker::TrackSeenRead(SnowTools::BamRead &r) void VariantBamWalker::printMessage(const SnowTools::BamRead &r) const { - if (rc_main.total <= 0) { - std::cerr << "NO READS FOUND" << std::endl; - return; - } - char buffer[90]; std::string posstring = SnowTools::AddCommas(r.Position()); std::string chrname; try { chrname = SnowTools::GenomicRegion::chrToString(r.ChrID()); } catch(...) { chrname = "CHR_NAME_FAIL"; } + + if (rc_main.total <= 0) { + std::sprintf(buffer, "NO READS FOUND at %2s:%-11s",chrname.c_str(), posstring.c_str()); + std::string outr(buffer); + std::cerr << outr << SnowTools::displayRuntime(start) << std::endl; + return; + } + std::sprintf (buffer, "Read %11s at %2s:%-11s. Kept %10s (%2d%%) -- ", rc_main.totalString().c_str(), chrname.c_str(), posstring.c_str(), rc_main.keepString().c_str(), rc_main.percent());