outHeader.close();
- vector<unsigned long long> positions = m->divideFile(fastaFileNames[s], processors);
-
- for (int i = 0; i < (positions.size()-1); i++) {
- lines.push_back(new linePair(positions[i], positions[(i+1)]));
- }
+
//break up file
#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ vector<unsigned long long> positions = m->divideFile(fastaFileNames[s], processors);
+
+ for (int i = 0; i < (positions.size()-1); i++) {
+ lines.push_back(new linePair(positions[i], positions[(i+1)]));
+ }
+
if(processors == 1){
numSeqs = driver(lines[0], outputFileName, fastaFileNames[s], accnosFileName);
}
#else
+ lines.push_back(new linePair(0, 1000));
numSeqs = driver(lines[0], outputFileName, fastaFileNames[s], accnosFileName);
if (m->control_pressed) { m->mothurRemove(outputFileName); m->mothurRemove(tempHeader); m->mothurRemove(accnosFileName); for (int j = 0; j < outputNames.size(); j++) { m->mothurRemove(outputNames[j]); } for (int i = 0; i < lines.size(); i++) { delete lines[i]; } outputTypes.clear(); lines.clear(); delete chimera; return 0; }
MPI_Barrier(MPI_COMM_WORLD); //make everyone wait - just in case
#else
- vector<unsigned long long> positions = m->divideFile(fastaFileNames[i], processors);
-
- for (int s = 0; s < (positions.size()-1); s++) {
- lines.push_back(new linePair(positions[s], positions[(s+1)]));
- }
+
//break up file
#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ vector<unsigned long long> positions = m->divideFile(fastaFileNames[i], processors);
+
+ for (int s = 0; s < (positions.size()-1); s++) {
+ lines.push_back(new linePair(positions[s], positions[(s+1)]));
+ }
+
if(processors == 1){
numSeqs = driver(lines[0], outputFileName, fastaFileNames[i]);
}
#else
+ lines.push_back(new linePair(0, 1000));
numSeqs = driver(lines[0], outputFileName, fastaFileNames[i]);
if (m->control_pressed) { for (int j = 0; j < lines.size(); j++) { delete lines[j]; } lines.clear(); for (int j = 0; j < outputNames.size(); j++) { m->mothurRemove(outputNames[j]); } outputTypes.clear(); delete chimera; return 0; }
MPI_File_close(&outMPIAccnos);
MPI_Barrier(MPI_COMM_WORLD); //make everyone wait - just in case
#else
- vector<unsigned long long> positions = m->divideFile(fastaFileNames[s], processors);
-
- for (int i = 0; i < (positions.size()-1); i++) {
- lines.push_back(new linePair(positions[i], positions[(i+1)]));
- }
-
+
//break up file
#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ vector<unsigned long long> positions = m->divideFile(fastaFileNames[s], processors);
+
+ for (int i = 0; i < (positions.size()-1); i++) {
+ lines.push_back(new linePair(positions[i], positions[(i+1)]));
+ }
+
if(processors == 1){
numSeqs = driver(lines[0], outputFileName, fastaFileNames[s], accnosFileName);
}
#else
+ lines.push_back(new linePair(0, 1000));
numSeqs = driver(lines[0], outputFileName, fastaFileNames[s], accnosFileName);
if (m->control_pressed) { outputTypes.clear(); m->mothurRemove(outputFileName); m->mothurRemove(accnosFileName); for (int j = 0; j < outputNames.size(); j++) { m->mothurRemove(outputNames[j]); } for (int i = 0; i < lines.size(); i++) { delete lines[i]; } lines.clear(); delete chimera; return 0; }
}
if (stopSpot == 0) { temp = ""; }
- else { temp = temp.substr(0, stopSpot); }
+ else { temp = temp.substr(0, stopSpot+1); }
}else {
if (!Short) { temp = ""; } //sequence too short
}
if (stopSpot == 0) { temp = ""; }
- else { temp = temp.substr(0, stopSpot); }
+ else { temp = temp.substr(0, stopSpot+1); }
}else {
if (!Short) { temp = ""; } //sequence too short
}
if (stopSpot == 0) { temp = ""; }
- else { temp = temp.substr(stopSpot+1); }
+ else { temp = temp.substr(stopSpot); }
}else {
if (!Short) { temp = ""; } //sequence too short
}
/***********************************************************************/
string BatchEngine::getNextCommand(ifstream& inputBatchFile) {
try {
-
+
string nextcommand = "";
if (inputBatchFile.eof()) { nextcommand = "quit()"; }
MPI_Barrier(MPI_COMM_WORLD); //make everyone wait - just in case
#else
+
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
vector<unsigned long long> positions = m->divideFile(fastafileNames[s], processors);
-
+
for (int i = 0; i < (positions.size()-1); i++) {
lines.push_back(new linePair(positions[i], positions[(i+1)]));
}
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+
if(processors == 1){
int numFastaSeqs = driverRunFilter(filter, filteredFasta, fastafileNames[s], lines[0]);
numSeqs += numFastaSeqs;
if (m->control_pressed) { return 1; }
#else
+ lines.push_back(new linePair(0, 1000));
int numFastaSeqs = driverRunFilter(filter, filteredFasta, fastafileNames[s], lines[0]);
numSeqs += numFastaSeqs;
MPI_Barrier(MPI_COMM_WORLD); //make everyone wait - just in case
#else
- vector<unsigned long long> positions = m->divideFile(fastafileNames[s], processors);
- for (int i = 0; i < (positions.size()-1); i++) {
- lines.push_back(new linePair(positions[i], positions[(i+1)]));
- }
+
#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ vector<unsigned long long> positions = m->divideFile(fastafileNames[s], processors);
+ for (int i = 0; i < (positions.size()-1); i++) {
+ lines.push_back(new linePair(positions[i], positions[(i+1)]));
+ }
+
if(processors == 1){
int numFastaSeqs = driverCreateFilter(F, fastafileNames[s], lines[0]);
numSeqs += numFastaSeqs;
if (m->control_pressed) { return filterString; }
#else
+ lines.push_back(new linePair(0, 1000));
int numFastaSeqs = driverCreateFilter(F, fastafileNames[s], lines[0]);
numSeqs += numFastaSeqs;
if (m->control_pressed) { return filterString; }
*/
#include "getgroupcommand.h"
+#include "inputdata.h"
//**********************************************************************************************************************
vector<string> GetgroupCommand::setParameters(){
try {
if (abort == true) { if (calledHelp) { return 0; } return 2; }
-
- //open shared file
- m->openInputFile(sharedfile, in);
//open output file
outputFile = outputDir + m->getRootName(m->getSimpleName(sharedfile)) + "bootGroups";
m->openOutputFile(outputFile, out);
-
- int num, inputData, count;
- count = 0;
- string holdLabel, nextLabel, groupN, label;
-
- //read in first row since you know there is at least 1 group.
- in >> label >> groupN >> num;
- holdLabel = label;
-
- //output first group
- m->mothurOut(groupN); m->mothurOutEndLine();
- out << groupN << '\t' << groupN << endl;
-
- //get rest of line
- for(int i=0;i<num;i++){
- in >> inputData;
- }
- if (m->control_pressed) { outputTypes.clear(); in.close(); out.close(); m->mothurRemove(outputFile); return 0; }
-
- if (in.eof() != true) { in >> nextLabel; }
+ InputData input(sharedfile, "sharedfile");
+ vector<SharedRAbundVector*> lookup = input.getSharedRAbundVectors();
- //read the rest of the groups info in
- while ((nextLabel == holdLabel) && (in.eof() != true)) {
- if (m->control_pressed) { outputTypes.clear(); in.close(); out.close(); m->mothurRemove(outputFile); return 0; }
-
- in >> groupN >> num;
- count++;
-
- //output next group
- m->mothurOut(groupN); m->mothurOutEndLine();
- out << groupN << '\t' << groupN << endl;
-
- //fill vector.
- for(int i=0;i<num;i++){
- in >> inputData;
- }
-
- if (in.eof() != true) { in >> nextLabel; }
+ for (int i = 0; i < lookup.size(); i++) {
+ out << lookup[i]->getGroup() << '\t' << lookup[i]->getGroup() << endl;
+ m->mothurOut(lookup[i]->getGroup()); m->mothurOutEndLine();
+ delete lookup[i];
}
- in.close();
out.close();
if (m->control_pressed) { m->mothurRemove(outputFile); return 0; }
}
}
+ //from R code - replacing with spline and splint below
//vector<double> f_spline = smoothSpline(lambdas, pi0_hat, 3);
//double pi0 = f_spline[(f_spline.size()-1)]; // this is the essential pi0_hat value
int permute_matrix(vector<double>&, vector<double>&, int, vector<double>&, vector<double>&, vector<double>&);
int permute_array(vector<int>&);
int calc_twosample_ts(vector<double>&, int, vector<double>&, vector<double>&, vector<double>&);
+ vector<double> smoothSpline(vector<double>, vector<double>, int);
+ vector<double> calc_qvalues(vector<double>&);
+ vector<double> sknot1(vector<double>);
+ int nkn(int);
+ int OrderPValues(int, int, vector<double>&, vector<int>&);
+ int swapElements(int, int, vector<double>&, vector<int>&);
+ vector<int> getSequence(int, int, int);
+
+ int spline(vector<double>&, vector<double>&, int, int, vector<double>&);
+ int splint(vector<double>&, vector<double>&, double&, double&, vector<double>&);
+
+
};
#endif
vector<unsigned long long> MothurOut::divideFile(string filename, int& proc) {
try{
-
vector<unsigned long long> filePos;
filePos.push_back(0);
unsigned long long size;
filename = getFullPathName(filename);
-
+
//get num bytes in file
pFile = fopen (filename.c_str(),"rb");
if (pFile==NULL) perror ("Error opening file");
size=ftell (pFile);
fclose (pFile);
}
-
+
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+
//estimate file breaks
unsigned long long chunkSize = 0;
chunkSize = size / proc;
unsigned long long newSpot = spot;
while (!in.eof()) {
char c = in.get();
+
if (c == '>') { in.putback(c); newSpot = in.tellg(); break; }
+ else if (int(c) == -1) { break; }
+
}
//there was not another sequence before the end of the file
}
proc = (filePos.size() - 1);
-
+#else
+ mothurOut("[ERROR]: Windows version should not be calling the divideFile function."); mothurOutEndLine();
+ proc=1;
+ filePos.push_back(size);
+#endif
return filePos;
}
catch(exception& e) {
vector<string> tempOutNames;
outputTypes["fasta"] = tempOutNames;
outputTypes["name"] = tempOutNames;
+ outputTypes["map"] = tempOutNames;
}
catch(exception& e) {
m->errorOut(e, "PreClusterCommand", "PreClusterCommand");
vector<string> tempOutNames;
outputTypes["fasta"] = tempOutNames;
outputTypes["name"] = tempOutNames;
+ outputTypes["map"] = tempOutNames;
//if the user changes the input directory command factory will send this info to us in the output parameter
string inputDir = validParameter.validFile(parameters, "inputdir", false);
string fileroot = outputDir + m->getRootName(m->getSimpleName(fastafile));
string newFastaFile = fileroot + "precluster" + m->getExtension(fastafile);
string newNamesFile = fileroot + "precluster.names";
+ string newMapFile = fileroot + "precluster.map"; //add group name if by group
+ outputNames.push_back(newFastaFile); outputTypes["fasta"].push_back(newFastaFile);
+ outputNames.push_back(newNamesFile); outputTypes["name"].push_back(newNamesFile);
+
if (bygroup) {
//clear out old files
ofstream outFasta; m->openOutputFile(newFastaFile, outFasta); outFasta.close();
ofstream outNames; m->openOutputFile(newNamesFile, outNames); outNames.close();
+ newMapFile = fileroot + "precluster.";
//parse fasta and name file by group
SequenceParser* parser;
vector<string> groups = parser->getNamesOfGroups();
-//#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
- if(processors == 1) { driverGroups(parser, newFastaFile, newNamesFile, 0, groups.size(), groups); }
- else { createProcessesGroups(parser, newFastaFile, newNamesFile, groups); }
-//#else
-// driverGroups(parser, newFastaFile, newNamesFile, 0, groups.size(), groups);
-//#endif
+ if(processors == 1) { driverGroups(parser, newFastaFile, newNamesFile, newMapFile, 0, groups.size(), groups); }
+ else { createProcessesGroups(parser, newFastaFile, newNamesFile, newMapFile, groups); }
delete parser;
- if (m->control_pressed) { m->mothurRemove(newFastaFile); m->mothurRemove(newNamesFile); return 0; }
+ if (m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } return 0; }
//run unique.seqs for deconvolute results
string inputString = "fasta=" + newFastaFile;
//reads fasta file and return number of seqs
int numSeqs = readFASTA(); //fills alignSeqs and makes all seqs active
- if (m->control_pressed) { return 0; }
+ if (m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } return 0; }
if (numSeqs == 0) { m->mothurOut("Error reading fasta file...please correct."); m->mothurOutEndLine(); return 0; }
if (diffs > length) { m->mothurOut("Error: diffs is greater than your sequence length."); m->mothurOutEndLine(); return 0; }
- int count = process();
+ int count = process(newMapFile);
+ outputNames.push_back(newMapFile); outputTypes["map"].push_back(newMapFile);
- if (m->control_pressed) { return 0; }
+ if (m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } return 0; }
m->mothurOut("Total number of sequences before precluster was " + toString(alignSeqs.size()) + "."); m->mothurOutEndLine();
m->mothurOut("pre.cluster removed " + toString(count) + " sequences."); m->mothurOutEndLine(); m->mothurOutEndLine();
m->mothurOut("It took " + toString(time(NULL) - start) + " secs to cluster " + toString(numSeqs) + " sequences."); m->mothurOutEndLine();
}
-
- if (m->control_pressed) { m->mothurRemove(newFastaFile); m->mothurRemove(newNamesFile); return 0; }
+
+ if (m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } return 0; }
m->mothurOutEndLine();
m->mothurOut("Output File Names: "); m->mothurOutEndLine();
- m->mothurOut(newFastaFile); m->mothurOutEndLine(); outputNames.push_back(newFastaFile); outputTypes["fasta"].push_back(newFastaFile);
- m->mothurOut(newNamesFile); m->mothurOutEndLine(); outputNames.push_back(newNamesFile); outputTypes["name"].push_back(newNamesFile);
+ for (int i = 0; i < outputNames.size(); i++) { m->mothurOut(outputNames[i]); m->mothurOutEndLine(); }
m->mothurOutEndLine();
//set fasta file as new current fastafile
}
}
/**************************************************************************************************/
-int PreClusterCommand::createProcessesGroups(SequenceParser* parser, string newFName, string newNName, vector<string> groups) {
+int PreClusterCommand::createProcessesGroups(SequenceParser* parser, string newFName, string newNName, string newMFile, vector<string> groups) {
try {
vector<int> processIDS;
processIDS.push_back(pid); //create map from line number to pid so you can append files in correct order later
process++;
}else if (pid == 0){
- num = driverGroups(parser, newFName + toString(getpid()) + ".temp", newNName + toString(getpid()) + ".temp", lines[process].start, lines[process].end, groups);
+ num = driverGroups(parser, newFName + toString(getpid()) + ".temp", newNName + toString(getpid()) + ".temp", newMFile, lines[process].start, lines[process].end, groups);
exit(0);
}else {
m->mothurOut("[ERROR]: unable to spawn the necessary processes."); m->mothurOutEndLine();
}
//do my part
- num = driverGroups(parser, newFName, newNName, lines[0].start, lines[0].end, groups);
+ num = driverGroups(parser, newFName, newNName, newMFile, lines[0].start, lines[0].end, groups);
//force parent to wait until all the processes are done
for (int i=0;i<processIDS.size();i++) {
// Allocate memory for thread data.
string extension = toString(i) + ".temp";
- preClusterData* tempPreCluster = new preClusterData(fastafile, namefile, groupfile, (newFName+extension), (newNName+extension), groups, m, lines[i].start, lines[i].end, diffs, i);
+ preClusterData* tempPreCluster = new preClusterData(fastafile, namefile, groupfile, (newFName+extension), (newNName+extension), newMFile, groups, m, lines[i].start, lines[i].end, diffs, i);
pDataArray.push_back(tempPreCluster);
processIDS.push_back(i);
//using the main process as a worker saves time and memory
- num = driverGroups(parser, newFName, newNName, lines[0].start, lines[0].end, groups);
+ num = driverGroups(parser, newFName, newNName, newMFile, lines[0].start, lines[0].end, groups);
//Wait until all threads have terminated.
WaitForMultipleObjects(processors-1, hThreadArray, TRUE, INFINITE);
//Close all thread handles and free memory allocations.
for(int i=0; i < pDataArray.size(); i++){
+ for (int j = 0; j < pDataArray[i]->mapFileNames.size(); j++) {
+ outputNames.push_back(pDataArray[i]->mapFileNames[j]); outputTypes["map"].push_back(pDataArray[i]->mapFileNames[j]);
+ }
CloseHandle(hThreadArray[i]);
delete pDataArray[i];
}
}
}
/**************************************************************************************************/
-int PreClusterCommand::driverGroups(SequenceParser* parser, string newFFile, string newNFile, int start, int end, vector<string> groups){
+int PreClusterCommand::driverGroups(SequenceParser* parser, string newFFile, string newNFile, string newMFile, int start, int end, vector<string> groups){
try {
int numSeqs = 0;
if (diffs > length) { m->mothurOut("Error: diffs is greater than your sequence length."); m->mothurOutEndLine(); m->control_pressed = true; return 0; }
- int count = process();
+ int count = process(newMFile+groups[i]+".map");
+ outputNames.push_back(newMFile+groups[i]+".map"); outputTypes["map"].push_back(newMFile+groups[i]+".map");
if (m->control_pressed) { return 0; }
}
}
/**************************************************************************************************/
-int PreClusterCommand::process(){
+int PreClusterCommand::process(string newMapFile){
try {
+ ofstream out;
+ m->openOutputFile(newMapFile, out);
//sort seqs by number of identical seqs
sort(alignSeqs.begin(), alignSeqs.end(), comparePriority);
if (alignSeqs[i].active) { //this sequence has not been merged yet
+ string chunk = alignSeqs[i].seq.getName() + "\t" + toString(alignSeqs[i].numIdentical) + "\t" + toString(0) + "\t" + alignSeqs[i].seq.getAligned() + "\n";
+
//try to merge it with all smaller seqs
for (int j = i+1; j < numSeqs; j++) {
- if (m->control_pressed) { return 0; }
+ if (m->control_pressed) { out.close(); return 0; }
if (alignSeqs[j].active) { //this sequence has not been merged yet
//are you within "diff" bases
alignSeqs[i].names += ',' + alignSeqs[j].names;
alignSeqs[i].numIdentical += alignSeqs[j].numIdentical;
+ chunk += alignSeqs[j].seq.getName() + "\t" + toString(alignSeqs[j].numIdentical) + "\t" + toString(mismatch) + "\t" + alignSeqs[j].seq.getAligned() + "\n";
+
alignSeqs[j].active = 0;
alignSeqs[j].numIdentical = 0;
count++;
}
}//end if j active
- }//end if i != j
+ }//end for loop j
//remove from active list
alignSeqs[i].active = 0;
+ out << "ideal_seq_" << (i+1) << '\t' << alignSeqs[i].numIdentical << endl << chunk << endl;;
+
}//end if active i
if(i % 100 == 0) { m->mothurOut(toString(i) + "\t" + toString(numSeqs - count) + "\t" + toString(count)); m->mothurOutEndLine(); }
}
+ out.close();
if(numSeqs % 100 != 0) { m->mothurOut(toString(numSeqs) + "\t" + toString(numSeqs - count) + "\t" + toString(count)); m->mothurOutEndLine(); }
m->openOutputFile(newfasta, outFasta);
m->openOutputFile(newname, outNames);
}
-
+
for (int i = 0; i < alignSeqs.size(); i++) {
if (alignSeqs[i].numIdentical != 0) {
alignSeqs[i].seq.printSequence(outFasta);
Sequence seq;
string names;
bool active;
+ int diffs;
seqPNode() {}
- seqPNode(int n, Sequence s, string nm) : numIdentical(n), seq(s), names(nm), active(1) {}
+ seqPNode(int n, Sequence s, string nm) : numIdentical(n), seq(s), names(nm), active(1) { diffs = 0; }
~seqPNode() {}
};
/************************************************************/
//int readNamesFASTA();
int calcMisMatches(string, string);
void printData(string, string); //fasta filename, names file name
- int process();
+ int process(string);
int loadSeqs(map<string, string>&, vector<Sequence>&);
- int driverGroups(SequenceParser*, string, string, int, int, vector<string> groups);
- int createProcessesGroups(SequenceParser*, string, string, vector<string>);
+ int driverGroups(SequenceParser*, string, string, string, int, int, vector<string> groups);
+ int createProcessesGroups(SequenceParser*, string, string, string, vector<string>);
};
/**************************************************************************************************/
string fastafile;
string namefile;
string groupfile;
- string newFName, newNName;
+ string newFName, newNName, newMName;
MothurOut* m;
int start;
int end;
int diffs, threadID;
vector<string> groups;
+ vector<string> mapFileNames;
preClusterData(){}
- preClusterData(string f, string n, string g, string nff, string nnf, vector<string> gr, MothurOut* mout, int st, int en, int d, int tid) {
+ preClusterData(string f, string n, string g, string nff, string nnf, string nmf, vector<string> gr, MothurOut* mout, int st, int en, int d, int tid) {
fastafile = f;
namefile = n;
groupfile = g;
newFName = nff;
newNName = nnf;
+ newMName = nmf;
m = mout;
start = st;
end = en;
////////////////////////////////////////////////////
//int count = process(); - same function below
+ ofstream out;
+ pDataArray->m->openOutputFile(pDataArray->newMName+pDataArray->groups[k]+".map", out);
+ pDataArray->mapFileNames.push_back(pDataArray->newMName+pDataArray->groups[k]+".map");
+
//sort seqs by number of identical seqs
sort(alignSeqs.begin(), alignSeqs.end(), comparePriority);
if (alignSeqs[i].active) { //this sequence has not been merged yet
+ string chunk = alignSeqs[i].seq.getName() + "\t" + toString(alignSeqs[i].numIdentical) + "\t" + toString(0) + "\t" + alignSeqs[i].seq.getAligned() + "\n";
+
//try to merge it with all smaller seqs
for (int j = i+1; j < numSeqs; j++) {
alignSeqs[j].active = 0;
alignSeqs[j].numIdentical = 0;
+ alignSeqs[j].diffs = mismatch;
count++;
+ chunk += alignSeqs[j].seq.getName() + "\t" + toString(alignSeqs[j].numIdentical) + "\t" + toString(mismatch) + "\t" + alignSeqs[j].seq.getAligned() + "\n";
}
}//end if j active
- }//end if i != j
+ }//end for loop j
//remove from active list
alignSeqs[i].active = 0;
+ out << "ideal_seq_" << (i+1) << '\t' << alignSeqs[i].numIdentical << endl << chunk << endl;
+
}//end if active i
if(i % 100 == 0) { pDataArray->m->mothurOut(toString(i) + "\t" + toString(numSeqs - count) + "\t" + toString(count)); pDataArray->m->mothurOutEndLine(); }
}
-
+ out.close();
if(numSeqs % 100 != 0) { pDataArray->m->mothurOut(toString(numSeqs) + "\t" + toString(numSeqs - count) + "\t" + toString(count)); pDataArray->m->mothurOutEndLine(); }
////////////////////////////////////////////////////
getSummary(positions);
}
else {
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
positions = m->divideFile(fastafile, processors);
for (int i = 0; i < (positions.size()-1); i++) {
lines.push_back(new linePair(positions[i], positions[(i+1)]));
- }
+ }
+ #else
+ positions.push_back(0); positions.push_back(1000);
+ lines.push_back(new linePair(0, 1000));
+ #endif
}
string goodSeqFile = outputDir + m->getRootName(m->getSimpleName(fastafile)) + "good" + m->getExtension(fastafile);
vector<int> ambigBases;
vector<int> longHomoPolymer;
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
vector<unsigned long long> positions = m->divideFile(fastafile, processors);
-
+
for (int i = 0; i < (positions.size()-1); i++) {
lines.push_back(new linePair(positions[i], positions[(i+1)]));
}
-
+#else
+ lines.push_back(new linePair(0, 1000));
+#endif
#ifdef USE_MPI
int pid;
count++;
}
-
+ //if((count) % 100 == 0){ m->mothurOut("Optimizing sequence: " + toString(count)); m->mothurOutEndLine(); }
#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
unsigned long long pos = in.tellg();
if ((pos == -1) || (pos >= filePos->end)) { break; }
// ...at some point should added some additional type checking...
string temp;
temp = validParameter.validFile(parameters, "flip", false);
- if (temp == "not found"){ flip = 0; }
- else if(m->isTrue(temp)) { flip = 1; }
+ if (temp == "not found") { flip = 0; }
+ else { flip = m->isTrue(temp); }
temp = validParameter.validFile(parameters, "oligos", true);
if (temp == "not found"){ oligoFile = ""; }