m->mothurOut("Generating search database... "); cout.flush();
#ifdef USE_MPI
int pid, processors;
- vector<long> positions;
+ vector<unsigned long int> positions;
int tag = 2001;
MPI_Status status;
if (method == "suffix") {
ifstream inFASTA;
openInputFile(tempFile, inFASTA);
- numSeqs = count(istreambuf_iterator<char>(inFASTA),istreambuf_iterator<char>(), '>');
+ getNumSeqs(inFASTA, numSeqs);
inFASTA.close();
}
gobble(fastaFile);
names.push_back(temp.getName());
-
+
database->addSequence(temp);
}
fastaFile.close();
}else if ((method == "kmer") && (!needToGenerate)) {
ifstream kmerFileTest(kmerDBName.c_str());
database->readKmerDB(kmerFileTest);
-
+
ifstream fastaFile;
openInputFile(tempFile, fastaFile);
}
fastaFile.close();
}
-#endif
+#endif
+
database->setNumSeqs(names.size());
+ //sanity check
+ bool okay = phyloTree->ErrorCheck(names);
+
+ if (!okay) { m->control_pressed = true; }
+
m->mothurOut("DONE."); m->mothurOutEndLine();
m->mothurOut("It took " + toString(time(NULL) - start) + " seconds generate search database. "); m->mothurOutEndLine();
#ifdef USE_MPI
int pid, num, processors;
- vector<long> positions;
+ vector<unsigned long int> positions;
int tag = 2001;
MPI_Status status;