diff --git a/Makefile b/Makefile index 348ace53..ce37ffc0 100644 --- a/Makefile +++ b/Makefile @@ -147,7 +147,7 @@ scriptToBin: $(BINS) GIT_VERSION := $(shell git describe --abbrev=4 --dirty --always) -CXXFLAGS = -O3 -D_FILE_OFFSET_BITS=64 -std=c++0x +CXXFLAGS = -O3 -D_FILE_OFFSET_BITS=64 -std=c++11 -ggdb #CXXFLAGS = -O2 #CXXFLAGS = -pedantic -Wall -Wshadow -Wpointer-arith -Wcast-qual diff --git a/intervaltree b/intervaltree index 17ddd578..8fc4be91 160000 --- a/intervaltree +++ b/intervaltree @@ -1 +1 @@ -Subproject commit 17ddd578a455fe6c10e3ecde1c67121d4412bcec +Subproject commit 8fc4be91866237995e1105689d84bece619f4663 diff --git a/src/Variant.cpp b/src/Variant.cpp index e676e560..5f98efd6 100644 --- a/src/Variant.cpp +++ b/src/Variant.cpp @@ -314,6 +314,7 @@ bool Variant::canonicalizable(){ if (svtype.empty()){ // We have no SV type, so we can't interpret things. + cerr << "No SV type information. Variant cannot be canonicalized: " << *this << endl; return false; } @@ -388,10 +389,10 @@ bool Variant::canonicalize(FastaReference& fasta_reference, vectorinfo.count("END") && !this->info.at("END").empty(); // Where is the end, or where should it be? - long info_end = 0; + int64_t info_end = 0; if (has_end) { // Get the END from the tag - info_end = stol(this->info.at("END")[0]); + info_end = stoull(this->info.at("END")[0]); } else if(ref_valid && !place_seq) { // Get the END from the reference sequence, which is ready. @@ -421,13 +422,13 @@ bool Variant::canonicalize(FastaReference& fasta_reference, vectorinfo.at("SVLEN")[0])); + info_len = abs(stoll(this->info.at("SVLEN")[0])); } else if ((svtype == "INS" || svtype == "DEL") && has_span){ - info_len = abs(stol(this->info.at("SPAN")[0])); + info_len = abs(stoll(this->info.at("SPAN")[0])); } else if (svtype == "DEL"){ // We always have the end by now @@ -462,7 +463,7 @@ bool Variant::canonicalize(FastaReference& fasta_reference, vectorinfo.at("SVLEN")[0])); diff --git a/src/vcfnormalizesvs.cpp b/src/vcfnormalizesvs.cpp index 63a6d591..b70c342e 100644 --- a/src/vcfnormalizesvs.cpp +++ b/src/vcfnormalizesvs.cpp @@ -92,7 +92,10 @@ int main(int argc, char** argv) { Variant var; while (variantFile.getNextVariant(var)) { - bool valid = var.canonicalize(ref, insertions, replace_sequences, min_size); + bool valid = false; + if (var.canonicalizable()){ + valid = var.canonicalize(ref, insertions, replace_sequences, min_size); + } if (!valid){ cerr << "Variant could not be normalized" << var << endl; }