Commit 750f1ab9 authored by Paul Costea's avatar Paul Costea

Gene loading bug fix

parent 6fb74df4
...@@ -130,7 +130,6 @@ bool indexGenomeAndGenes(FILE* refGenome, FILE* refGenes) { ...@@ -130,7 +130,6 @@ bool indexGenomeAndGenes(FILE* refGenome, FILE* refGenes) {
filePosStart = strlen(line);//This includes the \n filePosStart = strlen(line);//This includes the \n
filePosition p1; filePosition p1;
while (fgets(line,10000,refGenes)) { while (fgets(line,10000,refGenes)) {
fileConsumed += strlen(line);
int pos = 0; int pos = 0;
const char* rest = toksplit(line,'\t',tok,10000); const char* rest = toksplit(line,'\t',tok,10000);
while (*rest) { while (*rest) {
...@@ -152,6 +151,7 @@ bool indexGenomeAndGenes(FILE* refGenome, FILE* refGenes) { ...@@ -152,6 +151,7 @@ bool indexGenomeAndGenes(FILE* refGenome, FILE* refGenes) {
++pos; ++pos;
rest = toksplit(rest,'\t',tok,10000); rest = toksplit(rest,'\t',tok,10000);
} }
fileConsumed += strlen(line);
lineCount += 1; lineCount += 1;
} }
//Add the last one! //Add the last one!
...@@ -248,7 +248,7 @@ bool loadGenome(std::string gName, FILE* refGenes, bool* hasGenes) { ...@@ -248,7 +248,7 @@ bool loadGenome(std::string gName, FILE* refGenes, bool* hasGenes) {
} }
if (pos == 2) {//This is the name! if (pos == 2) {//This is the name!
if (gName.compare(tok) != 0) { if (gName.compare(tok) != 0) {
fprintf(stderr,"Reading wrong gene defintions"); fprintf(stderr,"Reading wrong gene defintion for %s\n. Scafold supposed to be %s, but is %s\n.",geneName.c_str(),tok,gName.c_str());
break; break;
} }
} else if (pos == 6) {//Start } else if (pos == 6) {//Start
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment