Loading .project 0 → 100644 +11 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>Sniffles</name> <comment></comment> <projects> </projects> <buildSpec> </buildSpec> <natures> </natures> </projectDescription> CMakeLists.txt +2 −2 Original line number Diff line number Diff line Loading @@ -7,9 +7,9 @@ option(STATIC "Build static binary" OFF) set( SNIF_VERSION_MINOR 0 ) IF(CMAKE_BUILD_TYPE STREQUAL "Debug") message(STATUS "Building in debug mode!") set( SNIF_VERSION_BUILD 8-debug ) set( SNIF_VERSION_BUILD 10-debug ) else() set( SNIF_VERSION_BUILD 8 ) set( SNIF_VERSION_BUILD 10 ) ENDIF() Loading README.md +20 −2 Original line number Diff line number Diff line Loading @@ -4,6 +4,24 @@ Sniffles is a structural variation caller using third generation sequencing (Pac Please see our github wiki for more information (https://github.com/fritzsedlazeck/Sniffles/wiki) # How to build Sniffles <pre>wget https://github.com/fritzsedlazeck/Sniffles/archive/master.tar.gz -O Sniffles.tar.gz tar xzvf Sniffles.tar.gz cd Sniffles-master/ mkdir -p build/ cd build/ cmake .. make cd ../bin/sniffles* ./sniffles</pre> Note Mac users often have to provide parameters to the cmake command: <pre>cmake -D CMAKE_C_COMPILER=/opt/local/bin/gcc-mp-4.7 -D CMAKE_CXX_COMPILER=/opt/local/bin/g++-mp-4.7 .. </pre> ************************************** ## NGMLR Sniffles performs best with the mappings of NGMLR our novel long read mapping method. Loading @@ -12,8 +30,8 @@ https://github.com/philres/ngmlr **************************************** ## Citation: Please see and cite our preprint: http://www.biorxiv.org/content/early/2017/07/28/169557 Please see and cite our paper: https://www.nature.com/articles/s41592-018-0001-7 ************************************** ## Poster & Talks: Loading src/Alignment.cpp +63 −54 Original line number Diff line number Diff line Loading @@ -136,6 +136,7 @@ vector<differences_str> Alignment::summarizeAlignment(std::vector<indel_str> &de if (al->CigarData[0].Type == 'S') { read_pos += al->CigarData[0].Length; } for (size_t i = 0; i < al->CigarData.size(); i++) { if (al->CigarData[i].Type == 'M') { pos += al->CigarData[i].Length; Loading Loading @@ -176,15 +177,16 @@ vector<differences_str> Alignment::summarizeAlignment(std::vector<indel_str> &de } } /*if (flag) { //exit(0); if (flag) { std::cout << "FIRST:" << std::endl; for (size_t i = 0; i < events.size(); i++) { if (abs(events[i].type) > 200) { // if (abs(events[i].type) > 200) { cout << events[i].position << " " << events[i].type << endl; } // } } cout << endl; }*/ } //set ref length requ. later on: this->ref_len = pos - getPosition(); //TODO compare to get_length! Loading Loading @@ -676,6 +678,7 @@ bool Alignment::overlapping_segments(vector<aln_str> entries) { return (entries.size() == 2 && abs(entries[0].pos - entries[1].pos) < 100); } vector<aln_str> Alignment::getSA(RefVector ref) { string sa; vector<aln_str> entries; if (al->GetTag("SA", sa) && !sa.empty()) { Loading @@ -690,7 +693,7 @@ vector<aln_str> Alignment::getSA(RefVector ref) { uint32_t sv; al->GetTag("SV", sv); tmp.cross_N = ((sv & Ns_CLIPPED)); bool flag = strcmp(getName().c_str(), Parameter::Instance()->read_name.c_str()) == 0; bool flag = strcmp(getName().c_str(),"0bac61ef-7819-462b-ae3d-32c68fe580c0")==0; //Parameter::Instance()->read_name.c_str()) == 0; get_coords(tmp, tmp.read_pos_start, tmp.read_pos_stop); if (flag) { Loading Loading @@ -791,8 +794,7 @@ vector<aln_str> Alignment::getSA(RefVector ref) { double Alignment::get_scrore_ratio() { uint score = -1; uint subscore = -1; if (al->GetTag("AS", score)) { al->GetTag("XS", subscore); if (al->GetTag("AS", score) && al->GetTag("XS", subscore)) { if (subscore == 0) { subscore = 1; } Loading @@ -804,6 +806,7 @@ bool Alignment::get_is_save() { string sa; double score = get_scrore_ratio(); //TODO should I use this again for bwa? // cout<<score<<endl; return !((al->GetTag("XA", sa) && !sa.empty()) || (al->GetTag("XT", sa) && !sa.empty())) && (score == -1 || score > Parameter::Instance()->score_treshold); //|| //TODO: 7.5 } Loading Loading @@ -923,6 +926,7 @@ std::string Alignment::get_md() { return md; } else { std::cerr << "No MD string detected! Check bam file! Otherwise generate using e.g. samtools." << std::endl; cout<<"MD: TEST" << this->getName()<<endl; exit(0); } return md; Loading Loading @@ -1056,6 +1060,8 @@ vector<int> Alignment::get_avg_diff(double & dist, double & avg_del, double & av //computeAlignment(); //cout<<alignment.first<<endl; //cout<<alignment.second<<endl; avg_del = 0; avg_ins = 0; vector<int> mis_per_window; std::vector<indel_str> dels; vector<differences_str> event_aln = summarizeAlignment(dels); Loading @@ -1070,6 +1076,7 @@ vector<int> Alignment::get_avg_diff(double & dist, double & avg_del, double & av double del = 0; double ins = 0; double mis = 0; if (event_aln.size() > 1) { double length = event_aln[event_aln.size() - 1].position - event_aln[0].position; for (size_t i = 0; i < event_aln.size(); i++) { if (i != 0) { Loading @@ -1092,12 +1099,14 @@ vector<int> Alignment::get_avg_diff(double & dist, double & avg_del, double & av avg_ins += event_aln[i].type * -1; } } //cout << "len: " << length << endl; avg_ins = avg_ins / length; avg_del = avg_del / length; dist = dist / (double) event_aln.size(); } plane->finalyze(); return mis_per_window; //total_num /num; } Loading @@ -1108,12 +1117,12 @@ vector<str_event> Alignment::get_events_Aln() { //clock_t comp_aln = clock(); std::vector<indel_str> dels; vector<differences_str> event_aln; if (Parameter::Instance()->cs_string) { /* if (Parameter::Instance()->cs_string) { cout<<"run cs check "<<std::endl; event_aln = summarize_csstring(dels); } else { } else {*/ event_aln = summarizeAlignment(dels); } // } //double time2 = Parameter::Instance()->meassure_time(comp_aln, "\tcompAln Events: "); vector<str_event> events; Loading src/ArgParseOutput.h +3 −2 Original line number Diff line number Diff line Loading @@ -11,8 +11,7 @@ using std::cerr; using std::cout; using std::endl; class ArgParseOutput : public TCLAP::StdOutput { class ArgParseOutput: public TCLAP::StdOutput { private: std::string usageStr; Loading @@ -36,6 +35,8 @@ public: cerr << endl; cerr << "Short usage:" << endl; cerr << " sniffles [options] -m <sorted.bam> -v <output.vcf> " << endl; cerr << "Version: " << Parameter::Instance()->version << std::endl; cerr << "Contact: fritz.sedlazeck@gmail.com" << std::endl; cerr << endl; cerr << "For complete USAGE and HELP type:" << endl; cerr << " sniffles --help" << endl; Loading Loading
.project 0 → 100644 +11 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>Sniffles</name> <comment></comment> <projects> </projects> <buildSpec> </buildSpec> <natures> </natures> </projectDescription>
CMakeLists.txt +2 −2 Original line number Diff line number Diff line Loading @@ -7,9 +7,9 @@ option(STATIC "Build static binary" OFF) set( SNIF_VERSION_MINOR 0 ) IF(CMAKE_BUILD_TYPE STREQUAL "Debug") message(STATUS "Building in debug mode!") set( SNIF_VERSION_BUILD 8-debug ) set( SNIF_VERSION_BUILD 10-debug ) else() set( SNIF_VERSION_BUILD 8 ) set( SNIF_VERSION_BUILD 10 ) ENDIF() Loading
README.md +20 −2 Original line number Diff line number Diff line Loading @@ -4,6 +4,24 @@ Sniffles is a structural variation caller using third generation sequencing (Pac Please see our github wiki for more information (https://github.com/fritzsedlazeck/Sniffles/wiki) # How to build Sniffles <pre>wget https://github.com/fritzsedlazeck/Sniffles/archive/master.tar.gz -O Sniffles.tar.gz tar xzvf Sniffles.tar.gz cd Sniffles-master/ mkdir -p build/ cd build/ cmake .. make cd ../bin/sniffles* ./sniffles</pre> Note Mac users often have to provide parameters to the cmake command: <pre>cmake -D CMAKE_C_COMPILER=/opt/local/bin/gcc-mp-4.7 -D CMAKE_CXX_COMPILER=/opt/local/bin/g++-mp-4.7 .. </pre> ************************************** ## NGMLR Sniffles performs best with the mappings of NGMLR our novel long read mapping method. Loading @@ -12,8 +30,8 @@ https://github.com/philres/ngmlr **************************************** ## Citation: Please see and cite our preprint: http://www.biorxiv.org/content/early/2017/07/28/169557 Please see and cite our paper: https://www.nature.com/articles/s41592-018-0001-7 ************************************** ## Poster & Talks: Loading
src/Alignment.cpp +63 −54 Original line number Diff line number Diff line Loading @@ -136,6 +136,7 @@ vector<differences_str> Alignment::summarizeAlignment(std::vector<indel_str> &de if (al->CigarData[0].Type == 'S') { read_pos += al->CigarData[0].Length; } for (size_t i = 0; i < al->CigarData.size(); i++) { if (al->CigarData[i].Type == 'M') { pos += al->CigarData[i].Length; Loading Loading @@ -176,15 +177,16 @@ vector<differences_str> Alignment::summarizeAlignment(std::vector<indel_str> &de } } /*if (flag) { //exit(0); if (flag) { std::cout << "FIRST:" << std::endl; for (size_t i = 0; i < events.size(); i++) { if (abs(events[i].type) > 200) { // if (abs(events[i].type) > 200) { cout << events[i].position << " " << events[i].type << endl; } // } } cout << endl; }*/ } //set ref length requ. later on: this->ref_len = pos - getPosition(); //TODO compare to get_length! Loading Loading @@ -676,6 +678,7 @@ bool Alignment::overlapping_segments(vector<aln_str> entries) { return (entries.size() == 2 && abs(entries[0].pos - entries[1].pos) < 100); } vector<aln_str> Alignment::getSA(RefVector ref) { string sa; vector<aln_str> entries; if (al->GetTag("SA", sa) && !sa.empty()) { Loading @@ -690,7 +693,7 @@ vector<aln_str> Alignment::getSA(RefVector ref) { uint32_t sv; al->GetTag("SV", sv); tmp.cross_N = ((sv & Ns_CLIPPED)); bool flag = strcmp(getName().c_str(), Parameter::Instance()->read_name.c_str()) == 0; bool flag = strcmp(getName().c_str(),"0bac61ef-7819-462b-ae3d-32c68fe580c0")==0; //Parameter::Instance()->read_name.c_str()) == 0; get_coords(tmp, tmp.read_pos_start, tmp.read_pos_stop); if (flag) { Loading Loading @@ -791,8 +794,7 @@ vector<aln_str> Alignment::getSA(RefVector ref) { double Alignment::get_scrore_ratio() { uint score = -1; uint subscore = -1; if (al->GetTag("AS", score)) { al->GetTag("XS", subscore); if (al->GetTag("AS", score) && al->GetTag("XS", subscore)) { if (subscore == 0) { subscore = 1; } Loading @@ -804,6 +806,7 @@ bool Alignment::get_is_save() { string sa; double score = get_scrore_ratio(); //TODO should I use this again for bwa? // cout<<score<<endl; return !((al->GetTag("XA", sa) && !sa.empty()) || (al->GetTag("XT", sa) && !sa.empty())) && (score == -1 || score > Parameter::Instance()->score_treshold); //|| //TODO: 7.5 } Loading Loading @@ -923,6 +926,7 @@ std::string Alignment::get_md() { return md; } else { std::cerr << "No MD string detected! Check bam file! Otherwise generate using e.g. samtools." << std::endl; cout<<"MD: TEST" << this->getName()<<endl; exit(0); } return md; Loading Loading @@ -1056,6 +1060,8 @@ vector<int> Alignment::get_avg_diff(double & dist, double & avg_del, double & av //computeAlignment(); //cout<<alignment.first<<endl; //cout<<alignment.second<<endl; avg_del = 0; avg_ins = 0; vector<int> mis_per_window; std::vector<indel_str> dels; vector<differences_str> event_aln = summarizeAlignment(dels); Loading @@ -1070,6 +1076,7 @@ vector<int> Alignment::get_avg_diff(double & dist, double & avg_del, double & av double del = 0; double ins = 0; double mis = 0; if (event_aln.size() > 1) { double length = event_aln[event_aln.size() - 1].position - event_aln[0].position; for (size_t i = 0; i < event_aln.size(); i++) { if (i != 0) { Loading @@ -1092,12 +1099,14 @@ vector<int> Alignment::get_avg_diff(double & dist, double & avg_del, double & av avg_ins += event_aln[i].type * -1; } } //cout << "len: " << length << endl; avg_ins = avg_ins / length; avg_del = avg_del / length; dist = dist / (double) event_aln.size(); } plane->finalyze(); return mis_per_window; //total_num /num; } Loading @@ -1108,12 +1117,12 @@ vector<str_event> Alignment::get_events_Aln() { //clock_t comp_aln = clock(); std::vector<indel_str> dels; vector<differences_str> event_aln; if (Parameter::Instance()->cs_string) { /* if (Parameter::Instance()->cs_string) { cout<<"run cs check "<<std::endl; event_aln = summarize_csstring(dels); } else { } else {*/ event_aln = summarizeAlignment(dels); } // } //double time2 = Parameter::Instance()->meassure_time(comp_aln, "\tcompAln Events: "); vector<str_event> events; Loading
src/ArgParseOutput.h +3 −2 Original line number Diff line number Diff line Loading @@ -11,8 +11,7 @@ using std::cerr; using std::cout; using std::endl; class ArgParseOutput : public TCLAP::StdOutput { class ArgParseOutput: public TCLAP::StdOutput { private: std::string usageStr; Loading @@ -36,6 +35,8 @@ public: cerr << endl; cerr << "Short usage:" << endl; cerr << " sniffles [options] -m <sorted.bam> -v <output.vcf> " << endl; cerr << "Version: " << Parameter::Instance()->version << std::endl; cerr << "Contact: fritz.sedlazeck@gmail.com" << std::endl; cerr << endl; cerr << "For complete USAGE and HELP type:" << endl; cerr << " sniffles --help" << endl; Loading