diff --git a/RELEASE_HISTORY b/RELEASE_HISTORY index 5ec35e98f37cd45d0f9408343ef46f6d26fc2b67..2705a60ee808cc482825eb30a9ebcc7d366c75c1 100644 --- a/RELEASE_HISTORY +++ b/RELEASE_HISTORY @@ -1,3 +1,6 @@ +Version 2.5.4 (Mar-3-2010) +1. Fixed an insidious bug that caused malformed BAM output from intersectBed and pairToBed. The previous BAM files worked fine with samtools as BAM input, but when piped in as SAM, there was an extra tab that thwarted conversion from SAM back to BAM. Many thanks to Ivan Gregoretti for reporting this bug. I had never used the BAM output in this way and thus never caught the bug! + Version 2.5.3 (Feb-19-2010) 1. Fixed bug to "re-allow" track and "browser" lines. 2. Fixed bug in reporting BEDPE overlaps. diff --git a/src/intersectBed/intersectBed.cpp b/src/intersectBed/intersectBed.cpp index d9df8815c1f360f44123593276eaa44bf512c83d..afee563c5e96955d23062effc0cd86d93a9fa822 100755 --- a/src/intersectBed/intersectBed.cpp +++ b/src/intersectBed/intersectBed.cpp @@ -132,7 +132,7 @@ bool BedIntersect::FindOverlaps(const BED &a, vector<BED> &hits) { else if (noHit && (numOverlaps == 0)) { bedA->reportBedNewLine(a); } - + return hitsFound; } diff --git a/src/mergeBed/mergeBed.cpp b/src/mergeBed/mergeBed.cpp index 7e6159698b25e07feccb50fd9c0ea5a81949f39b..e1ca8e998ded0d92ff8fd0e1014ef212267bd31e 100755 --- a/src/mergeBed/mergeBed.cpp +++ b/src/mergeBed/mergeBed.cpp @@ -268,7 +268,7 @@ void BedMerge::MergeBedStranded() { names.clear(); // add the name of the - names.push_back(bedList[prev].name); + names.push_back(bedList[curr].name); } prev = curr; } diff --git a/src/subtractBed/subtractBed.cpp b/src/subtractBed/subtractBed.cpp index 8380428dccddf9287d6cbe2a93b416328de06caf..c3c82de74528ade98efb6f8d367a3b191086d667 100755 --- a/src/subtractBed/subtractBed.cpp +++ b/src/subtractBed/subtractBed.cpp @@ -35,7 +35,6 @@ BedSubtract::~BedSubtract(void) { } - void BedSubtract::FindOverlaps(BED &a, vector<BED> &hits) { // find all of the overlaps between a and B. diff --git a/src/utils/lineFileUtilities/lineFileUtilities.cpp b/src/utils/lineFileUtilities/lineFileUtilities.cpp index d22e55244a8ae79fe6e41f4c2b6a5e37cf2561a3..dfbdf77a19ba1691f8c0f1a87a7a6ee06250011a 100755 --- a/src/utils/lineFileUtilities/lineFileUtilities.cpp +++ b/src/utils/lineFileUtilities/lineFileUtilities.cpp @@ -14,9 +14,7 @@ // lineFileUtilities: // Common Functions //*********************************************** - -void Tokenize(string str, vector<string>& tokens) -{ +void Tokenize(string str, vector<string> &tokens, const string &delimiter) { /* //method to tokenize on any whitespace @@ -28,18 +26,18 @@ void Tokenize(string str, vector<string>& tokens) */ // Skip delimiters at beginning. - string::size_type lastPos = str.find_first_not_of("\t", 0); + string::size_type lastPos = str.find_first_not_of(delimiter, 0); // Find first "non-delimiter". - string::size_type pos = str.find_first_of("\t", lastPos); + string::size_type pos = str.find_first_of(delimiter, lastPos); while (string::npos != pos || string::npos != lastPos) { // Found a token, add it to the vector. tokens.push_back(str.substr(lastPos, pos - lastPos)); // Skip delimiters. Note the "not_of" - lastPos = str.find_first_not_of("\t", pos); + lastPos = str.find_first_not_of(delimiter, pos); // Find next "non-delimiter" - pos = str.find_first_of("\t", lastPos); + pos = str.find_first_of(delimiter, lastPos); } } diff --git a/src/utils/lineFileUtilities/lineFileUtilities.h b/src/utils/lineFileUtilities/lineFileUtilities.h index e384dc392d007d84b8c4e039a682548df4080240..c4ab8a48751e56fcad95749fc0d73ef45262db7c 100755 --- a/src/utils/lineFileUtilities/lineFileUtilities.h +++ b/src/utils/lineFileUtilities/lineFileUtilities.h @@ -9,7 +9,7 @@ using namespace std; // split a line from a file into a vector of strings. token = "\t" -void Tokenize(string str, vector<string>& tokens); +void Tokenize(string str, vector<string>& tokens, const string &delimiter = "\t"); #endif /* LINEFILEUTILITIES_H */