Skip to content
Snippets Groups Projects
Commit 235f6e7a authored by Aaron's avatar Aaron
Browse files

Version 2.1.1

	1. Added limits.h to bedFile.h to prevent compilation errors on some systems.
	2. Fixed the bedFile.cpp parsing logic to allow proper parsing of track and browser lines
parent cc7e9cdd
No related branches found
No related tags found
No related merge requests found
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
...@@ -376,12 +376,11 @@ void BedFile::loadBedFileIntoMapNoBin() { ...@@ -376,12 +376,11 @@ void BedFile::loadBedFileIntoMapNoBin() {
while (getline(bed, bedLine)) { while (getline(bed, bedLine)) {
if ((bedLine.find_first_of("track") == 1) || (bedLine.find_first_of("browser") == 1)) { if ((bedLine.find("track") != string::npos) || (bedLine.find("browser") != string::npos)) {
continue; continue;
} }
else { else {
Tokenize(bedLine,bedFields); Tokenize(bedLine,bedFields);
lineNum++; lineNum++;
if (parseBedLine(bedEntry, bedFields, lineNum)) { if (parseBedLine(bedEntry, bedFields, lineNum)) {
...@@ -398,7 +397,7 @@ void BedFile::loadBedFileIntoMapNoBin() { ...@@ -398,7 +397,7 @@ void BedFile::loadBedFileIntoMapNoBin() {
while (getline(cin, bedLine)) { while (getline(cin, bedLine)) {
if ((bedLine.find_first_of("track") == 1) || (bedLine.find_first_of("browser") == 1)) { if ((bedLine.find("track") != string::npos) || (bedLine.find("browser") != string::npos)) {
continue; continue;
} }
else { else {
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <sstream> #include <sstream>
#include <cstring> #include <cstring>
#include <algorithm> #include <algorithm>
#include <limits.h>
using namespace std; using namespace std;
......
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
// //
#include "lineFileUtilities.h" #include "lineFileUtilities.h"
//*********************************************** //***********************************************
// lineFileUtilities: // lineFileUtilities:
// Common Functions // Common Functions
...@@ -18,6 +16,20 @@ ...@@ -18,6 +16,20 @@
void Tokenize(const string& str, vector<string>& tokens) void Tokenize(const string& str, vector<string>& tokens)
{ {
/*
string::size_type start = 0;
string::size_type end = 0;
cout << str << endl;
while ((start = str.find_first_not_of(" ", start)) != string::npos) {
end = str.find_first_of(" ", start);
cout << start << ":" << end << endl;
tokens.push_back(str.substr(start, end - start));
start = end;
}
*/
// Skip delimiters at beginning. // Skip delimiters at beginning.
string::size_type lastPos = str.find_first_not_of("\t", 0); string::size_type lastPos = str.find_first_not_of("\t", 0);
// Find first "non-delimiter". // Find first "non-delimiter".
...@@ -32,6 +44,7 @@ void Tokenize(const string& str, vector<string>& tokens) ...@@ -32,6 +44,7 @@ void Tokenize(const string& str, vector<string>& tokens)
// Find next "non-delimiter" // Find next "non-delimiter"
pos = str.find_first_of("\t", lastPos); pos = str.find_first_of("\t", lastPos);
} }
} }
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <string> #include <string>
#include <algorithm> #include <algorithm>
using namespace std; using namespace std;
// split a line from a file into a vector of strings. token = "\t" // split a line from a file into a vector of strings. token = "\t"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment