From 3fbab281da3880f174a8a425221dc11eca6fc01b Mon Sep 17 00:00:00 2001 From: Jeremiah Wala Date: Thu, 13 Oct 2016 14:11:22 -0400 Subject: [PATCH] fixed bwa link collision. trimmed warnings --- SeqLib/GenomicRegionCollection.cpp | 2 -- bwa | 2 +- src/Makefile.am | 2 +- src/Makefile.in | 2 +- src/seqtools.cpp | 57 +++++------------------------- 5 files changed, 11 insertions(+), 54 deletions(-) diff --git a/SeqLib/GenomicRegionCollection.cpp b/SeqLib/GenomicRegionCollection.cpp index fc53ddd9d..30423b939 100644 --- a/SeqLib/GenomicRegionCollection.cpp +++ b/SeqLib/GenomicRegionCollection.cpp @@ -178,7 +178,6 @@ bool GenomicRegionCollection::ReadBED(const std::string & file, const BamHead } // http://www.lemoda.net/c/gzfile-read/ - size_t c = 0; while (1) { int err; @@ -245,7 +244,6 @@ bool GenomicRegionCollection::ReadVCF(const std::string & file, const BamHead } // http://www.lemoda.net/c/gzfile-read/ - size_t c = 0; while (1) { int err; diff --git a/bwa b/bwa index 88a5ca582..c02766e3c 160000 --- a/bwa +++ b/bwa @@ -1 +1 @@ -Subproject commit 88a5ca582908ffc5dde06e5843068a6db561cdc5 +Subproject commit c02766e3c34ac3f4af9842e20a54b7f9f4b36d0b diff --git a/src/Makefile.am b/src/Makefile.am index 973a12de9..50afae05f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,6 @@ noinst_LIBRARIES = libseqlib.a -libseqlib_a_CPPFLAGS = -I../ -I../htslib +libseqlib_a_CPPFLAGS = -I../ -I../htslib -Wno-sign-compare libseqlib_a_SOURCES = FastqReader.cpp BFC.cpp ReadFilter.cpp SeqPlot.cpp jsoncpp.cpp ssw_cpp.cpp ssw.c \ GenomicRegion.cpp RefGenome.cpp BamWriter.cpp BamReader.cpp \ diff --git a/src/Makefile.in b/src/Makefile.in index c7a289b53..15ad8ba73 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -179,7 +179,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libseqlib.a -libseqlib_a_CPPFLAGS = -I../ -I../htslib +libseqlib_a_CPPFLAGS = -I../ -I../htslib -Wno-sign-compare libseqlib_a_SOURCES = FastqReader.cpp BFC.cpp ReadFilter.cpp SeqPlot.cpp jsoncpp.cpp ssw_cpp.cpp ssw.c \ GenomicRegion.cpp RefGenome.cpp BamWriter.cpp BamReader.cpp \ BWAWrapper.cpp BamRecord.cpp FermiAssembler.cpp BamHeader.cpp diff --git a/src/seqtools.cpp b/src/seqtools.cpp index 5dbb8223f..cf6aeab6c 100644 --- a/src/seqtools.cpp +++ b/src/seqtools.cpp @@ -37,17 +37,6 @@ static const char *BFC_USAGE_MESSAGE = " --reference, -G Reference genome if using BWA-MEM realignment\n" "\nReport bugs to jwala@broadinstitute.org \n\n"; -static const char *GOFISH_USAGE_MESSAGE = -"Program: seqtools gofish \n" -"Contact: Jeremiah Wala [ jwala@broadinstitute.org ]\n" -"Description: Enrich for reads that align to a target\n" -"Usage: seqtools gofish [options]\n\n" -"Commands:\n" -" --verbose, -v Set verbose output\n" -" --infasta, -F Input a FASTA insted of BAM/SAM/CRAM stream\n" -" --target, -T Target sequence to index and enrich for\n" -"\nReport bugs to jwala@broadinstitute.org \n\n"; - static const char *FML_USAGE_MESSAGE = "Program: seqtools fml \n" "Contact: Jeremiah Wala [ jwala@broadinstitute.org ]\n" @@ -64,7 +53,6 @@ static const char *FML_USAGE_MESSAGE = void runbfc(int argc, char** argv); void runfml(int argc, char** argv); -void rungofish(int argc, char** argv); void parseOptions(int argc, char** argv, const char* msg); namespace opt { @@ -90,8 +78,6 @@ static const struct option longopts[] = { { NULL, 0, NULL, 0 } }; -static void* gofish_worker(void* shared, int step, void *_data); - int main(int argc, char** argv) { if (argc <= 1) { @@ -106,8 +92,6 @@ int main(int argc, char** argv) { runbfc(argc -1, argv + 1); } else if (command == "fml") { runfml(argc -1, argv + 1); - } else if (command == "gofish") { - rungofish(argc - 1, argv + 1); } else { std::cerr << SEQTOOLS_USAGE_MESSAGE; return 0; @@ -209,11 +193,11 @@ void runfml(int argc, char** argv) { std::stringstream ss; for (std::vector::const_iterator i = contigs.begin(); i != contigs.end(); ++i) { SeqLib::BamRecordVector brv; - bool hardclip = false; - double frac = 0.9; - int max_secondary = 10; + const bool hardclip = false; + const double frac = 0.9; ss << "contig" << ++count; - bwa.AlignSequence(*i, ss.str(), brv, false, frac, 10); + const int max_secondary = 10; + bwa.AlignSequence(*i, ss.str(), brv, hardclip, frac, max_secondary); ss.str(std::string()); for (SeqLib::BamRecordVector::iterator r = brv.begin(); r != brv.end(); ++r) { @@ -320,10 +304,10 @@ void runbfc(int argc, char** argv) { // run through and read for (SeqLib::UnalignedSequenceVector::const_iterator i = u.begin(); i != u.end(); ++i) { SeqLib::BamRecordVector brv; - bool hardclip = false; - double frac = 0.9; - int max_secondary = 10; - bwa.AlignSequence(i->Seq, i->Name, brv, false, frac, 10); + const bool hardclip = false; + const double frac = 0.9; + const int max_secondary = 10; + bwa.AlignSequence(i->Seq, i->Name, brv, hardclip, frac, max_secondary); for (SeqLib::BamRecordVector::iterator r = brv.begin(); r != brv.end(); ++r) { if (!i->Qual.empty()) @@ -333,18 +317,6 @@ void runbfc(int argc, char** argv) { } } - -// fish for target sequence -void rungofish(int argc, char** argv) { - - parseOptions(argc, argv, GOFISH_USAGE_MESSAGE); - - const int n_threads = 1; - //kt_pipeline(n_threads, gofish_worker, &aux, 3); - - -} - // parse the command line options void parseOptions(int argc, char** argv, const char* msg) { @@ -377,16 +349,3 @@ void parseOptions(int argc, char** argv, const char* msg) { exit(EXIT_SUCCESS); } } - -typedef struct { - bseq1_t *seqs; - int n_seqs; -} fish_data_t; - - -// gofish process -static void* gofish_worker(void* shared, int step, void *_data) { - - - -}