Skip to content

Commit

Permalink
Error msg on bad rules script
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremiah Wala committed Apr 28, 2016
1 parent ae7a4bf commit 3091d64
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion SnowTools
2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions src/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down
15 changes: 9 additions & 6 deletions src/VariantBamWalker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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<int>(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());
Expand Down

0 comments on commit 3091d64

Please sign in to comment.