GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"MOTHUR_FILES=\"\\\"../release\\\"\"",
- "VERSION=\"\\\"1.23.0\\\"\"",
- "RELEASE_DATE=\"\\\"1/9/2012\\\"\"",
+ "VERSION=\"\\\"1.24.0\\\"\"",
+ "RELEASE_DATE=\"\\\"3/12/2012\\\"\"",
);
"GCC_VERSION[arch=*]" = "";
GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
GCC_MODEL_TUNING = "";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
- "VERSION=\"\\\"1.19.0\\\"\"",
- "RELEASE_DATE=\"\\\"5/9/2011\\\"\"",
+ "VERSION=\"\\\"1.24.0\\\"\"",
+ "RELEASE_DATE=\"\\\"3/12/2012\\\"\"",
);
GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
#else
vector<unsigned long long> positions;
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
positions = m->divideFile(candidateFileNames[s], 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));
}else {
positions = m->setFilePosFasta(candidateFileNames[s], numFastaSeqs);
-
+ if (positions.size() < processors) { processors = positions.size(); }
+
//figure out how many sequences you have to process
int numSeqsPerProcessor = numFastaSeqs / processors;
for (int i = 0; i < processors; i++) {
}
delete candidateSeq;
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
unsigned long long pos = inFASTA.tellg();
if ((pos == -1) || (pos >= filePos->end)) { break; }
#else
try {
int num = 0;
processIDS.resize(0);
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
int process = 1;
//loop through and create all the processes you want
};
/**************************************************************************************************/
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
#else
static DWORD WINAPI MyAlignThreadFunction(LPVOID lpParam){
alignData* pDataArray;
istringstream iss (tempBuf,istringstream::in);
float probTemp;
iss >> zeroCountProb[i] >> numbers[i] >> probTemp;
- WordPairDiffArr[i].prob = tempProb;
+ WordPairDiffArr[i].prob = probTemp;
}
#else
//divide breakpoints between processors
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
if(processors == 1){
lines.push_back(linePair(0, iters));
int Bellerophon::createProcesses(vector<int> mid) {
try {
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
int process = 0;
int exitCommand = 1;
vector<int> processIDS;
int randNumber = rand();
//int randNumber = 12345;
string pid = "";
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
pid += getpid();
#else
pid += toString(threadID);
for (int i = 0; i < path.length(); i++) { tempPath[i] = tolower(path[i]); }
path = path.substr(0, (tempPath.find_last_of('m')));
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
path += "blast/bin/";
#else
path += "blast\\bin\\";
string formatdbCommand;
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
formatdbCommand = path + "formatdb"; // format the database, -o option gives us the ability
#else
formatdbCommand = path + "formatdb.exe";
if(ableToOpen == 1) { m->mothurOut("[ERROR]: " + formatdbCommand + " file does not exist. mothur requires formatdb.exe."); m->mothurOutEndLine(); m->control_pressed = true; }
string blastCommand;
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
blastCommand = path + "blastall"; // format the database, -o option gives us the ability
#else
blastCommand = path + "blastall.exe";
string megablastCommand;
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
megablastCommand = path + "megablast"; // format the database, -o option gives us the ability
#else
megablastCommand = path + "megablast.exe";
for (int i = 0; i < path.length(); i++) { tempPath[i] = tolower(path[i]); }
path = path.substr(0, (tempPath.find_last_of('m')));
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
path += "blast/bin/";
#else
path += "blast\\bin\\";
int randNumber = rand();
string pid = "";
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
pid += getpid();
#else
pid += toString(threadID);
blastFileName = pid + toString(randNumber) + ".blast";
string formatdbCommand;
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
formatdbCommand = path + "formatdb"; // format the database, -o option gives us the ability
#else
formatdbCommand = path + "formatdb.exe";
if(ableToOpen == 1) { m->mothurOut("[ERROR]: " + formatdbCommand + " file does not exist. mothur requires formatdb.exe."); m->mothurOutEndLine(); m->control_pressed = true; }
string blastCommand;
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
blastCommand = path + "blastall"; // format the database, -o option gives us the ability
#else
blastCommand = path + "blastall.exe";
string megablastCommand;
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
megablastCommand = path + "megablast"; // format the database, -o option gives us the ability
#else
megablastCommand = path + "megablast.exe";
// long. With this setting, it seems comparable in speed to the suffix tree approach.
string blastCommand;
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
blastCommand = path + "blastall -p blastn -d " + dbFileName + " -m 8 -W 28 -v " + toString(n) + " -b " + toString(n);
blastCommand += (" -i " + (queryFileName+pid+toString(randNumber)) + " -o " + blastFileName+pid+toString(randNumber));
// long. With this setting, it seems comparable in speed to the suffix tree approach.
//7000004128189528left 0 100 66 0 0 1 66 61 126 1e-31 131
string blastCommand;
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
blastCommand = path + "megablast -e 1e-10 -d " + dbFileName + " -m 8 -b " + toString(n) + " -v " + toString(n); //-W 28 -p blastn
blastCommand += (" -i " + (queryFileName+pid+toString(randNumber)) + " -o " + blastFileName+pid+toString(randNumber));
#else
string formatdbCommand;
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
formatdbCommand = path + "formatdb -p F -o T -i " + dbFileName; // format the database, -o option gives us the ability
#else
//formatdbCommand = path + "blast\\bin\\formatdb -p F -o T -i " + dbFileName; // format the database, -o option gives us the ability
savedOutputDir = outputDir;
string catchAllCommandExe = "";
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
catchAllCommandExe += "mono " + path + "CatchAllcmdL.exe ";
if (outputDir == "") { outputDir = "./"; } //force full pathname to be created for catchall, this is necessary because if catchall is in the path it will look for input file whereever the exe is and not the cwd.
#else
//create system command
string catchAllCommand = "";
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
catchAllCommand += catchAllCommandExe + filename + " " + outputPath + " 1";
#else
if (outputPath.length() > 0) { outputPath = outputPath.substr(0, outputPath.length()-1); }
//create system command
string catchAllCommand = "";
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
catchAllCommand += catchAllCommandExe + filename + " " + outputPath + " 1";
#else
if (outputPath.length() > 0) { outputPath = outputPath.substr(0, outputPath.length()-1); }
//create system command
string catchAllCommand = "";
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
catchAllCommand += catchAllCommandExe + filename + " " + outputPath + " 1";
#else
if (outputPath.length() > 0) { outputPath = outputPath.substr(0, outputPath.length()-1); }
//break up file
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
vector<unsigned long long> positions = m->divideFile(fastaFileNames[s], processors);
for (int i = 0; i < (positions.size()-1); i++) {
}
delete candidateSeq;
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
unsigned long long pos = inFASTA.tellg();
if ((pos == -1) || (pos >= filePos->end)) { break; }
#else
int ChimeraCcodeCommand::createProcesses(string outputFileName, string filename, string accnos) {
try {
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
int process = 0;
int num = 0;
//break up file
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
vector<unsigned long long> positions = m->divideFile(fastaFileNames[i], processors);
for (int s = 0; s < (positions.size()-1); s++) {
}
delete candidateSeq;
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
unsigned long long pos = inFASTA.tellg();
if ((pos == -1) || (pos >= filePos->end)) { break; }
#else
int ChimeraCheckCommand::createProcesses(string outputFileName, string filename) {
try {
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
int process = 0;
int num = 0;
lines.push_back(linePair(startIndex, endIndex));
}
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
//loop through and create all the processes you want
while (process != processors) {
}
};
/**************************************************************************************************/
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
#else
static DWORD WINAPI MyPerseusThreadFunction(LPVOID lpParam){
perseusData* pDataArray;
#else
//break up file
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
vector<unsigned long long> positions = m->divideFile(fastaFileNames[s], processors);
for (int i = 0; i < (positions.size()-1); i++) {
}
delete candidateSeq;
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
unsigned long long pos = inFASTA.tellg();
if ((pos == -1) || (pos >= filePos->end)) { break; }
#else
int ChimeraPintailCommand::createProcesses(string outputFileName, string filename, string accnos) {
try {
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
int process = 0;
int num = 0;
else {
//add / to name if needed
string lastChar = blastlocation.substr(blastlocation.length()-1);
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
if (lastChar != "/") { blastlocation += "/"; }
#else
if (lastChar != "\\") { blastlocation += "\\"; }
#endif
blastlocation = m->getFullPathName(blastlocation);
string formatdbCommand = "";
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
formatdbCommand = blastlocation + "formatdb";
#else
formatdbCommand = blastlocation + "formatdb.exe";
if(ableToOpen == 1) { m->mothurOut("[ERROR]: " + formatdbCommand + " file does not exist. mothur requires formatdb.exe to run chimera.slayer."); m->mothurOutEndLine(); abort = true; }
string blastCommand = "";
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
blastCommand = blastlocation + "megablast";
#else
blastCommand = blastlocation + "megablast.exe";
if (hasGroup && (templatefile != "self")) { m->mothurOut("You have provided a group file and the reference parameter is not set to self. I am not sure what reference you are trying to use, aborting."); m->mothurOutEndLine(); abort=true; }
//until we resolve the issue 10-18-11
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
#else
//processors=1;
#endif
#else
//break up file
vector<unsigned long long> positions;
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
positions = m->divideFile(thisFastaName, processors);
for (int i = 0; i < (positions.size()-1); i++) { lines.push_back(linePair(positions[i], positions[(i+1)])); }
#else
if (processors == 1) { lines.push_back(linePair(0, 1000)); }
else {
positions = m->setFilePosFasta(thisFastaName, numSeqs);
+ if (positions.size() < processors) { processors = positions.size(); }
//figure out how many sequences you have to process
int numSeqsPerProcessor = numSeqs / processors;
map<string, string> uniqueNames = parser->getAllSeqsMap();
map<string, string>::iterator itUnique;
int total = 0;
+
+ if (trimera) { //add in more potential uniqueNames
+ map<string, string> newUniqueNames = uniqueNames;
+ for (map<string, string>::iterator it = uniqueNames.begin(); it != uniqueNames.end(); it++) {
+ newUniqueNames[(it->first)+"_LEFT"] = (it->first)+"_LEFT";
+ newUniqueNames[(it->first)+"_RIGHT"] = (it->first)+"_RIGHT";
+ }
+ uniqueNames = newUniqueNames;
+ newUniqueNames.clear();
+ }
//edit accnos file
ifstream in2;
m->mothurOutEndLine(); m->mothurOut("Checking sequences from group: " + fileGroup[thisFastaName] + "."); m->mothurOutEndLine();
lines.clear();
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
int proc = 1;
vector<unsigned long long> positions = m->divideFile(thisFastaName, proc);
lines.push_back(linePair(positions[0], positions[1]));
breakUp.push_back(thisFileToPriority);
}
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
//loop through and create all the processes you want
while (process != processors) {
int pid = fork();
count++;
}
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
unsigned long long pos = inFASTA.tellg();
if ((pos == -1) || (pos >= filePos.end)) { break; }
#else
int num = 0;
processIDS.clear();
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
//loop through and create all the processes you want
while (process != processors) {
int pid = fork();
};
/**************************************************************************************************/
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
#else
static DWORD WINAPI MySlayerThreadFunction(LPVOID lpParam){
slayerData* pDataArray;
path = path.substr(0, (tempPath.find_last_of('m')));
string uchimeCommand;
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
uchimeCommand = path + "uchime"; // format the database, -o option gives us the ability
#else
uchimeCommand = path + "uchime.exe";
path = path.substr(0, (tempPath.find_last_of('m')));
string uchimeCommand = path;
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
uchimeCommand += "uchime ";
#else
uchimeCommand += "uchime";
//uchime_main(numArgs, uchimeParameters);
//cout << "commandString = " << commandString << endl;
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
#else
commandString = "\"" + commandString + "\"";
#endif
int num = 0;
vector<string> files;
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
//break up file into multiple files
m->divideFile(filename, processors, files);
lines.push_back(linePair(startIndex, endIndex));
}
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
//loop through and create all the processes you want
while (process != processors) {
};
/**************************************************************************************************/
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
#else
static DWORD WINAPI MyUchimeThreadFunction(LPVOID lpParam){
uchimeData* pDataArray;
path = path.substr(0, (tempPath.find_last_of('m')));
string uchimeCommand = path;
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
uchimeCommand += "uchime ";
#else
uchimeCommand += "uchime";
//uchime_main(numArgs, uchimeParameters);
//cout << "commandString = " << commandString << endl;
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
#else
commandString = "\"" + commandString + "\"";
#endif
#else
vector<unsigned long long> positions;
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
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)])); }
#else
lines.push_back(new linePair(0, 1000));
}else {
positions = m->setFilePosFasta(fastaFileNames[s], numFastaSeqs);
+ if (positions.size() < processors) { processors = positions.size(); }
//figure out how many sequences you have to process
int numSeqsPerProcessor = numFastaSeqs / processors;
int num = 0;
processIDS.clear();
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
int process = 1;
//loop through and create all the processes you want
}
delete candidateSeq;
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
unsigned long long pos = inFASTA.tellg();
if ((pos == -1) || (pos >= filePos->end)) { break; }
#else
};
/**************************************************************************************************/
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
#else
static DWORD WINAPI MyClassThreadFunction(LPVOID lpParam){
classifyData* pDataArray;
//sanity check
if (processors > distName.size()) { processors = distName.size(); }
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
if(processors == 1){
listFileNames = cluster(distName, labels); //clusters individual files and returns names of list files
}else{
if (m->control_pressed) { return listFiles; }
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
int process = 1;
processIDS.clear();
};
/**************************************************************************************************/
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
#else
static DWORD WINAPI MyClusterThreadFunction(LPVOID lpParam){
clusterData* pDataArray;
//reset groups parameter
delete input;
+ m->clearGroups();
m->mothurOutEndLine();
m->mothurOut("Output File Names: "); m->mothurOutEndLine();
int CooccurrenceCommand::getCooccurrence(vector<SharedRAbundVector*>& thisLookUp, ofstream& out){
try {
int numOTUS = thisLookUp[0]->getNumBins();
- vector< vector<int> > initmatrix (thisLookUp.size());
- vector< vector<int> > co_matrix (thisLookUp[0]->getNumBins());
+ vector< vector<int> > initmatrix; initmatrix.resize(thisLookUp.size());
+ vector< vector<int> > co_matrix; co_matrix.resize(thisLookUp[0]->getNumBins());
for (int i = 0; i < thisLookUp[0]->getNumBins(); i++) { co_matrix[i].resize((thisLookUp.size()), 0); }
for (int i = 0; i < thisLookUp.size(); i++) { initmatrix[i].resize((thisLookUp[i]->getNumBins()), 0); }
- vector<int> columntotal(thisLookUp.size(), 0);
- vector<int> rowtotal(numOTUS, 0);
+ vector<int> columntotal; columntotal.resize(thisLookUp.size(), 0);
+ vector<int> rowtotal; rowtotal.resize(numOTUS, 0);
int rowcount = 0;
for (int i = 0; i < thisLookUp.size(); i++) {
//nrows is ncols of inital matrix. All the functions need this value. They assume the transposition has already taken place and nrows and ncols refer to that matrix.
//comatrix and initmatrix are still vectors of vectors of ints as in the original script. The abundancevector is only what was read in ie not a co-occurrence matrix!
int ncols = numOTUS;//rows of inital matrix
- int nrows = thisLookUp.size();//OTUs
+ int nrows = thisLookUp.size();//groups
double initscore = 0.0;
//transpose matrix
int newmatrows = ncols;
nrows = newmatrows;//ncols;
ncols = newmatcols;//nrows;
- vector<int> initcolumntotal(ncols, 0);
- vector<int> initrowtotal(nrows, 0);
+ vector<int> initcolumntotal; initcolumntotal.resize(ncols, 0);
+ vector<int> initrowtotal; initrowtotal.resize(nrows, 0);
vector<double> stats;
TrialSwap2 trial;
MPI_Barrier(MPI_COMM_WORLD); //make everyone wait - just in case
#else
- //#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ //#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
//if you don't need to fork anything
if(processors == 1){
if (output != "square") { driver(0, numSeqs, outputFile, cutoff); }
/**************************************************************************************************/
void DistanceCommand::createProcesses(string filename) {
try {
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
int process = 1;
processIDS.clear();
string outfile = m->getRootName(outputFile) + "sorted.dist.temp";
//use the unix sort
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
string command = "sort -n " + outputFile + " -o " + outfile;
system(command.c_str());
#else //sort using windows sort
string outfile = m->getRootName(outputFile) + "sorted.dist.temp";
//use the unix sort
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
string command = "sort -n " + outputFile + " -o " + outfile;
system(command.c_str());
#else //sort using windows sort
};
/**************************************************************************************************/
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
#else
static DWORD WINAPI MyDistThreadFunction(LPVOID lpParam){
distanceData* pDataArray;
//delimiting path char
char delim;
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
delim = ':';
#else
delim = ';';
if (mothurPath != "") {
//add mothur so it looks like what argv would look like
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
mothurPath += "/mothur";
#else
mothurPath += "\\mothur";
//is this mothurs path?
ifstream in;
string tempIn = dirs[i];
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
tempIn += "/mothur";
#else
tempIn += "\\mothur";
string Engine::getCommand() {
try {
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
#ifdef USE_READLINE
char* nextCommand = NULL;
nextCommand = readline("mothur > ");
vector<unsigned long long> positions;
if (savedPositions.size() != 0) { positions = savedPositions[s]; }
else {
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
positions = m->divideFile(fastafileNames[s], processors);
#else
if(processors != 1){
int numFastaSeqs = 0;
positions = m->setFilePosFasta(fastafileNames[s], numFastaSeqs);
+ if (positions.size() < processors) { processors = positions.size(); }
}
#endif
}
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
//vector<unsigned long long> positions = m->divideFile(fastafileNames[s], processors);
for (int i = 0; i < (positions.size()-1); i++) {
count++;
}
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
unsigned long long pos = in.tellg();
if ((pos == -1) || (pos >= filePos->end)) { break; }
#else
int num = 0;
processIDS.clear();
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
//loop through and create all the processes you want
#else
vector<unsigned long long> positions;
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
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)]));
}else {
int numFastaSeqs = 0;
positions = m->setFilePosFasta(fastafileNames[s], numFastaSeqs);
+ if (positions.size() < processors) { processors = positions.size(); }
//figure out how many sequences you have to process
int numSeqsPerProcessor = numFastaSeqs / processors;
count++;
}
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
unsigned long long pos = in.tellg();
if ((pos == -1) || (pos >= filePos->end)) { break; }
#else
int num = 0;
processIDS.clear();
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
//loop through and create all the processes you want
while (process != processors) {
};\r
\r
/**************************************************************************************************/\r
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)\r
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)\r
#else\r
static DWORD WINAPI MyCreateFilterThreadFunction(LPVOID lpParam){ \r
filterData* pDataArray;\r
string outfile = m->getRootName(squareFile) + "sorted.dist.temp";
//use the unix sort
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
string command = "sort -n " + squareFile + " -o " + outfile;
system(command.c_str());
#else //sort using windows sort
string outfile = m->getRootName(tempFile) + "sorted.dist.temp";
//use the unix sort
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
string command = "sort -n " + tempFile + " -o " + outfile;
system(command.c_str());
#else //sort using windows sort
try {
vector<float> pvalues;
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
if(processors == 1){
pvalues = driver(groupings, groupingsMap, num, indicatorValues, iters);
for (int i = 0; i < pvalues.size(); i++) { pvalues[i] /= (double)iters; }
try {
vector<float> pvalues;
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
if(processors == 1){
pvalues = driver(groupings, groupingsMap, num, indicatorValues, iters);
for (int i = 0; i < pvalues.size(); i++) { pvalues[i] /= (double)iters; }
# Macros
#
-USEMPI ?= no
+USEMPI ?= yes
64BIT_VERSION ?= yes
-USEREADLINE ?= yes
+USEREADLINE ?= no
CYGWIN_BUILD ?= no
USECOMPRESSION ?= no
MOTHUR_FILES="\"Enter_your_default_path_here\""
-RELEASE_DATE = "\"1/9/2012\""
-VERSION = "\"1.23.0\""
-FORTAN_COMPILER = gfortran
+RELEASE_DATE = "\"3/12/2012\""
+VERSION = "\"1.24.4\""
+FORTAN_COMPILER = /usr/local/gfortran/bin/gfortran
# Optimize to level 3:
CXXFLAGS += -O3
#if you are a linux user use the following line
#CXXFLAGS += -mtune=native -march=native -m64
- CXXFLAGS += -DBIT_VERSION
+ CXXFLAGS += -DBIT_VERSION
endif
$(CXX) $(LDFLAGS) $(TARGET_ARCH) -o $@ $(OBJECTS) $(LIBS)
strip mothur
-
+
uchime:
cd uchime_src && ./mk && mv uchime .. && cd ..
fortranSource:
- ${FORTAN_COMPILER} -c *.f
+ ${FORTAN_COMPILER} -c -m64 *.f
install : mothur
# cp mothur ../Release/mothur
int process = 1;
vector<int> processIDS;
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
//loop through and create all the processes you want
while (process != processors) {
int pid = fork();
}
};
/**************************************************************************************************/
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
#else
static DWORD WINAPI MyDistSharedThreadFunction(LPVOID lpParam){
distSharedData* pDataArray;
}else{
int process = 1;
vector<int> processIDS;
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
//loop through and create all the processes you want
while (process != processors) {
int pid = fork();
}
};
/**************************************************************************************************/
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
#else
static DWORD WINAPI MyMetastatsThreadFunction(LPVOID lpParam){
metastatsData* pDataArray;
m->setFileName(logFileName);
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
system("clear");
#else
system("CLS");
//add / to name if needed
string lastChar = temp.substr(temp.length()-1);
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
if (lastChar != "/") { temp += "/"; }
#else
if (lastChar != "\\") { temp += "\\"; }
if (outputHeader) {
//version
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
#if defined (__APPLE__) || (__MACH__)
m->mothurOutJustToLog("Mac version");
m->mothurOutEndLine(); m->mothurOutEndLine();
#endif
/***********************************************************************/
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
#include <sys/wait.h>
#include <sys/time.h>
#include <sys/resource.h>
//add / to name if needed
string lastChar = pathname.substr(pathname.length()-1);
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
if (lastChar != "/") { pathname += "/"; }
#else
if (lastChar != "\\") { pathname += "\\"; }
//
// On failure, returns 0.0, 0.0
int MothurOut::mem_usage(double& vm_usage, double& resident_set) {
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
vm_usage = 0.0;
resident_set = 0.0;
}
/***********************************************************************/
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
#ifdef USE_COMPRESSION
inline bool endsWith(string s, const char * suffix){
size_t suffixLength = strlen(suffix);
string rootName = longName;
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
#ifdef USE_COMPRESSION
if (endsWith(rootName, ".gz") || endsWith(rootName, ".bz2")) {
int pos = rootName.find_last_of('.');
string cwd;
//get current working directory
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
if (path.find("~") != -1) { //go to home directory
string homeDir;
try {
//get full path name
string completeFileName = getFullPathName(fileName);
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
#ifdef USE_COMPRESSION
// check for gzipped or bzipped file
if (endsWith(completeFileName, ".gz") || endsWith(completeFileName, ".bz2")) {
//get full path name
string completeFileName = getFullPathName(fileName);
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
#ifdef USE_COMPRESSION
// check for gzipped or bzipped file
if (endsWith(completeFileName, ".gz") || endsWith(completeFileName, ".bz2")) {
int exist = openInputFile(newName, inTest, "");
inTest.close();
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
if (exist == 0) { //you could open it so you want to delete it
string command = "rm " + newName;
system(command.c_str());
try {
string completeFileName = getFullPathName(fileName);
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
#ifdef USE_COMPRESSION
// check for gzipped file
if (endsWith(completeFileName, ".gz") || endsWith(completeFileName, ".bz2")) {
//if you can, use the unix sort since its been optimized for years
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
string command = "sort -n -k +3 " + distFile + " -o " + outfile;
system(command.c_str());
#else //you are stuck with my best attempt...
fclose (pFile);
}
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
//estimate file breaks
unsigned long long chunkSize = 0;
/**************************************************************************************************/
int correctDist::execute(string distanceFileName){
try {
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
#else
processors = 1;
#endif
int correctDist::createProcess(string distanceFileName){
try {
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
int process = 1;
vector<int> processIDs;
#include <signal.h>\r
#include <float.h>\r
\r
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)\r
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)\r
#include <sys/time.h>\r
#include <sys/resource.h>\r
#include <unistd.h>\r
return isatty(fd) != 0;\r
}\r
\r
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)\r
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)\r
#else\r
//#ifdef BIT_VERSION\r
//#include <io.h>\r
Log("fpos %ld (retval %d)\n", (long) fpos, fgetpos_retval);\r
// Log("eof %d\n", _eof(fd));\r
#endif\r
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)\r
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)\r
#else\r
#ifdef BIT_VERSION\r
__int64 pos64 = _ftelli64(f);\r
fprintf(stderr, "\n---Fatal error---\n%s\n", szStr);\r
Log("\n---Fatal error---\n%s\n", szStr);\r
\r
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)\r
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)\r
#else\r
//if (IsDebuggerPresent())\r
// __debugbreak();\r
g_Opts.insert(Opt);\r
}\r
\r
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)\r
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)\r
#else\r
#pragma warning(disable: 4505) // unreferenced local function\r
#endif\r
for (int k = 0; k < i; k++) {
if (m->control_pressed) { out.close(); return 0; }
-
- /*cout << m->binLabelsInFile[i] << " <- c(" << xy[i][0];
- for (int l = 1; l < xy[i].size(); l++){
- cout << ", " << xy[i][l];
- }
- cout << ")\n";
-
- cout << m->binLabelsInFile[k] << " <- c(" << xy[k][0];
- for (int l = 1; l < xy[k].size(); l++){
- cout << ", " << xy[k][l];
- }
- cout << ")\n";*/
double coef = 0.0;
double sig = 0.0;
if (output != "square"){ driverMPI(start, end, (outputFile + toString(pid) + ".temp"), size); }
else { driverMPI(start, end, (outputFile + toString(pid) + ".temp"), size, output); }
- if (m->control_pressed) { delete distCalculator; return 0; }
+ if (m->control_pressed) { return 0; }
//tell parent you are done.
MPI_Send(&size, 1, MPI_LONG, 0, tag, MPI_COMM_WORLD);
MPI_Barrier(MPI_COMM_WORLD); //make everyone wait - just in case
#else
- //#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ //#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
//if you don't need to fork anything
if(processors == 1){
if (output != "square") { driver(0, numSeqs, outputFile, cutoff); }
int process = 1;
processIDS.clear();
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
//loop through and create all the processes you want
alignment = new NeedlemanOverlap(gapOpen, match, misMatch, longestBase);
}
+ ValidCalculators validCalculator;
+ Dist* distCalculator;
+ if (countends) {
+ if (validCalculator.isValidCalculator("distance", Estimators[0]) == true) {
+ if (Estimators[0] == "nogaps") { distCalculator = new ignoreGaps(); }
+ else if (Estimators[0] == "eachgap") { distCalculator = new eachGapDist(); }
+ else if (Estimators[0] == "onegap") { distCalculator = new oneGapDist(); }
+ }
+ }else {
+ if (validCalculator.isValidCalculator("distance", Estimators[0]) == true) {
+ if (Estimators[0] == "nogaps") { distCalculator = new ignoreGaps(); }
+ else if (Estimators[0] == "eachgap"){ distCalculator = new eachGapIgnoreTermGapDist(); }
+ else if (Estimators[0] == "onegap") { distCalculator = new oneGapIgnoreTermGapDist(); }
+ }
+ }
+
string outputString = "";
size = 0;
};
/**************************************************************************************************/
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
#else
static DWORD WINAPI MyPairwiseSquareThreadFunction(LPVOID lpParam){
pairwiseData* pDataArray;
try {
string helpString = "";
helpString += "The fastq.info command reads a fastq file and creates a fasta and quality file.\n";
- helpString += "The fastq.info command parameter is fastq, and it is required.\n";
+ helpString += "The fastq.info command parameters are fastq, fasta and qfile; fastq is required.\n";
helpString += "The fastq.info command should be in the following format: fastq.info(fastaq=yourFastaQFile).\n";
+ helpString += "The fasta parameter allows you to indicate whether you want a fasta file generated. Default=T.\n";
+ helpString += "The qfile parameter allows you to indicate whether you want a quality file generated. Default=T.\n";
helpString += "Example fastq.info(fastaq=test.fastaq).\n";
helpString += "Note: No spaces between parameter labels (i.e. fastq), '=' and yourFastQFile.\n";
return helpString;
}
}
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
if(processors == 1){
data = driver(t, namesOfGroupCombos, 0, namesOfGroupCombos.size());
}else{
EstOutput Parsimony::createProcesses(Tree* t, vector< vector<string> > namesOfGroupCombos) {
try {
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
int process = 1;
vector<int> processIDS;
if (numSampledList.count(diversity[mGroups[j]].size()-1) == 0) { numSampledList.insert(diversity[mGroups[j]].size()-1); }
}
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
if(processors == 1){
driver(trees[i], diversity, sumDiversity, iters, increment, randomLeaf, numSampledList, outCollect, outSum, true);
}else{
//**********************************************************************************************************************
int PhyloDiversityCommand::createProcesses(vector<int>& procIters, Tree* t, map< string, vector<float> >& div, map<string, vector<float> >& sumDiv, int numIters, int increment, vector<int>& randomLeaf, set<int>& numSampledList, ofstream& outCollect, ofstream& outSum){
try {
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
int process = 1;
vector<int> processIDS;
#ifdef USE_MPI
//do nothing
#else
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
//find breakup of templatefile for quantiles
if (processors == 1) { templateLines.push_back(new linePair(0, templateSeqs.size())); }
else {
//**************************************************************************************************
void Pintail::createProcessesQuan() {
try {
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
int process = 1;
vector<int> processIDS;
lines.push_back(linePair(startIndex, endIndex));
}
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
//loop through and create all the processes you want
while (process != processors) {
};
/**************************************************************************************************/
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
#else
static DWORD WINAPI MyPreclusterThreadFunction(LPVOID lpParam){
preClusterData* pDataArray;
if (percentFreq < 1.0) { increment = numSeqs * percentFreq; }
else { increment = percentFreq; }
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
if(processors == 1){
driver(rcd, increment, nIters);
}else{
int Rarefact::createProcesses(vector<int>& procIters, RarefactionCurveData* rcd, int increment) {
try {
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
int process = 1;
vector<int> processIDS;
if (m->control_pressed) { return 0; }
- map<string, string> nameMap;
+ map<int, string> file2Group; //index in outputNames[i] -> group
for (int p = 0; p < inputFileNames.size(); p++) {
string fileNameRoot = outputDir + m->getRootName(m->getSimpleName(inputFileNames[p]));
if (inputFileNames.size() > 1) {
m->mothurOutEndLine(); m->mothurOut("Processing group " + groups[p]); m->mothurOutEndLine(); m->mothurOutEndLine();
- nameMap[fileNameRoot] = groups[p];
}
int i;
ValidCalculators validCalculator;
rDisplays.push_back(new RareDisplay(new NSeqs(), new ThreeColumnFile(fileNameRoot+"r_nseqs")));
outputNames.push_back(fileNameRoot+"r_nseqs"); outputTypes["r_nseqs"].push_back(fileNameRoot+"r_nseqs");
}
+ file2Group[outputNames.size()-1] = groups[p];
}
}
if (m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } return 0; }
//create summary file containing all the groups data for each label - this function just combines the info from the files already created.
- if ((sharedfile != "") && (groupMode)) { outputNames = createGroupFile(outputNames, nameMap); }
+ if ((sharedfile != "") && (groupMode)) { outputNames = createGroupFile(outputNames, file2Group); }
if (m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } return 0; }
}
}
//**********************************************************************************************************************
-vector<string> RareFactCommand::createGroupFile(vector<string>& outputNames, map<string, string> nameMap) {
+vector<string> RareFactCommand::createGroupFile(vector<string>& outputNames, map<int, string> file2Group) {
try {
vector<string> newFileNames;
newLine += "\tGroup" + labels.substr(labels.find_first_of('\t'));
- typesFiles[extension].push_back(outputNames[i]);
+ typesFiles[extension].push_back(outputNames[i]+"_"+file2Group[i]);
string combineFileName = outputDir + m->getRootName(m->getSimpleName(sharedfile)) + "groups" + extension;
int maxLines = 0;
int numColumns = 0;
for (int i=0; i<thisTypesFiles.size(); i++) {
-
+
+ string thisfilename = thisTypesFiles[i].substr(0, thisTypesFiles[i].find_last_of('_'));
+ string group = thisTypesFiles[i].substr(thisTypesFiles[i].find_last_of('_')+1);
+
ifstream temp;
- m->openInputFile(thisTypesFiles[i], temp);
+ m->openInputFile(thisfilename, temp);
//read through first line - labels
m->getline(temp); m->gobble(temp);
vector<string> thisFilesLines;
- string fileNameRoot = m->getRootName(thisTypesFiles[i]);
- map<string, string>::iterator itName = nameMap.find(fileNameRoot);
- string group = "";
- if (itName != nameMap.end()) {
- group = itName->second;
- }else {
- group = "not found" + i;
- m->mothurOut("[ERROR]: can't parse filename."); m->mothurOutEndLine();
- }
+ //string fileNameRoot = m->getRootName(thisTypesFiles[i]);
+ //map<string, string>::iterator itName = nameMap.find(fileNameRoot);
+ //string group = "";
+ //if (itName != nameMap.end()) {
+ // group = itName->second;
+ //}else {
+ // group = "not found" + i;
+ // m->mothurOut("[ERROR]: can't parse filename."); m->mothurOutEndLine();
+ //}
thisFilesLines.push_back(group);
int count = 1;
if (maxLines < thisFilesLines.size()) { maxLines = thisFilesLines.size(); }
temp.close();
- m->mothurRemove(thisTypesFiles[i]);
+ m->mothurRemove(thisfilename);
}
string outputDir;
vector<string> parseSharedFile(string);
- vector<string> createGroupFile(vector<string>&, map<string, string>);
+ vector<string> createGroupFile(vector<string>&, map<int, string>);
};
#endif
getSummary(positions);
}
else {
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
positions = m->divideFile(fastafile, processors);
for (int i = 0; i < (positions.size()-1); i++) { lines.push_back(linePair(positions[i], positions[(i+1)])); }
#else
else {
int numFastaSeqs = 0;
positions = m->setFilePosFasta(fastafile, numFastaSeqs);
+ if (positions.size() < processors) { processors = positions.size(); }
//figure out how many sequences you have to process
int numSeqsPerProcessor = numFastaSeqs / processors;
vector<int> longHomoPolymer;
vector<unsigned long long> positions;
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
positions = m->divideFile(fastafile, processors);
for (int i = 0; i < (positions.size()-1); i++) { lines.push_back(linePair(positions[i], positions[(i+1)])); }
#else
else {
int numFastaSeqs = 0;
positions = m->setFilePosFasta(fastafile, numFastaSeqs);
+ if (positions.size() < processors) { processors = positions.size(); }
//figure out how many sequences you have to process
int numSeqsPerProcessor = numFastaSeqs / processors;
driverCreateSummary(startPosition, endPosition, seqLength, ambigBases, longHomoPolymer, fastafile, lines[0]);
#else
int numSeqs = 0;
- //#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ //#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
if(processors == 1){
numSeqs = driverCreateSummary(startPosition, endPosition, seqLength, ambigBases, longHomoPolymer, fastafile, lines[0]);
}else{
count++;
}
//if((count) % 100 == 0){ m->mothurOut("Optimizing sequence: " + toString(count)); m->mothurOutEndLine(); }
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
unsigned long long pos = in.tellg();
if ((pos == -1) || (pos >= filePos.end)) { break; }
#else
int num = 0;
vector<int> processIDS;
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
//loop through and create all the processes you want
while (process != processors) {
count++;
}
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
unsigned long long pos = inFASTA.tellg();
if ((pos == -1) || (pos >= filePos.end)) { break; }
#else
int process = 1;
int num = 0;
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
//loop through and create all the processes you want
while (process != processors) {
/**************************************************************************************************/
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
#else
static DWORD WINAPI MySumThreadFunction(LPVOID lpParam){
sumData* pDataArray;
if(qualFileName == "") { qLines = lines; rLines = lines; } //fills with duds
int numSeqs = 0;
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
if(processors == 1){
numSeqs = driver(queryFileName, qualFileName, reportFileName, errorSummaryFileName, errorSeqFileName, errorChimeraFileName, lines[0], qLines[0], rLines[0]);
}else{
processIDS.clear();
map<char, vector<int> >::iterator it;
int num = 0;
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
//loop through and create all the processes you want
while (process != processors) {
index++;
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
unsigned long long pos = queryFile.tellg();
if ((pos == -1) || (pos >= line.end)) { break; }
#else
int SeqErrorCommand::setLines(string filename, string qfilename, string rfilename, vector<unsigned long long>& fastaFilePos, vector<unsigned long long>& qfileFilePos, vector<unsigned long long>& rfileFilePos) {
try {
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
//set file positions for fasta file
fastaFilePos = m->divideFile(filename, processors);
MPI_Barrier(MPI_COMM_WORLD); //make everyone wait - just in case
#else
vector<unsigned long long> positions;
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
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 = m->setFilePosFasta(fastafile, numSeqs);
+ if (positions.size() < processors) { processors = positions.size(); }
//figure out how many sequences you have to process
int numSeqsPerProcessor = numSeqs / processors;
outSummary << current.getLongHomoPolymer() << '\t' << num << endl;
}
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
unsigned long long pos = in.tellg();
if ((pos == -1) || (pos >= filePos->end)) { break; }
#else
int num = 0;
processIDS.clear();
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
//loop through and create all the processes you want
while (process != processors) {
};
/**************************************************************************************************/
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
#else
static DWORD WINAPI MySeqSumThreadFunction(LPVOID lpParam){
seqSumData* pDataArray;
}else {
//add / to name if needed
string lastChar = output.substr(output.length()-1);
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
if (lastChar != "/") { output += "/"; }
#else
if (lastChar != "\\") { output += "\\"; }
}else {
//add / to name if needed
string lastChar = input.substr(input.length()-1);
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
if (lastChar != "/") { input += "/"; }
#else
if (lastChar != "\\") { input += "\\"; }
}else {
//add / to name if needed
string lastChar = tempdefault.substr(tempdefault.length()-1);
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
if (lastChar != "/") { tempdefault += "/"; }
#else
if (lastChar != "\\") { tempdefault += "\\"; }
//**********************************************************************************************************************
int SffInfoCommand::execute(){
try {
-
if (abort == true) { if (calledHelp) { return 0; } return 2; }
for (int s = 0; s < filenames.size(); s++) {
//read data
seqRead read;
readSeqData(in, read, header.numFlowsPerRead, readheader.numBases);
-
+ bool okay = sanityCheck(readheader, read);
+ if (!okay) { break; }
+
//if you have provided an accosfile and this seq is not in it, then dont print
if (seqNames.size() != 0) { if (seqNames.count(readheader.name) == 0) { print = false; } }
in.read(buffer, 2);
read.flowgram[i] = be_int2(*(unsigned short *)(&buffer));
}
-
+
//read flowIndex
read.flowIndex.resize(numBases);
for (int i = 0; i < numBases; i++) {
exit(1);
}
}
-
+//**********************************************************************************************************************
+bool SffInfoCommand::sanityCheck(Header& header, seqRead& read) {
+ try {
+ bool okay = true;
+ string message = "[WARNING]: Your sff file may be corrupted! Sequence: " + header.name + "\n";
+
+ if (header.clipQualLeft > read.bases.length()) {
+ okay = false; message += "Clip Qual Left = " + toString(header.clipQualLeft) + ", but we only read " + toString(read.bases.length()) + " bases.\n";
+ }
+ if (header.clipQualRight > read.bases.length()) {
+ okay = false; message += "Clip Qual Right = " + toString(header.clipQualRight) + ", but we only read " + toString(read.bases.length()) + " bases.\n";
+ }
+ if (header.clipQualLeft > read.qualScores.size()) {
+ okay = false; message += "Clip Qual Left = " + toString(header.clipQualLeft) + ", but we only read " + toString(read.qualScores.size()) + " quality scores.\n";
+ }
+ if (header.clipQualRight > read.qualScores.size()) {
+ okay = false; message += "Clip Qual Right = " + toString(header.clipQualRight) + ", but we only read " + toString(read.qualScores.size()) + " quality scores.\n";
+ }
+
+ if (okay == false) {
+ m->mothurOut(message); m->mothurOutEndLine();
+ }
+
+ return okay;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "SffInfoCommand", "sanityCheck");
+ exit(1);
+ }
+}
//**********************************************************************************************************************
int SffInfoCommand::printSffTxtSeqData(ofstream& out, seqRead& read, Header& header) {
try {
-
out << "Flowgram: ";
for (int i = 0; i < read.flowgram.size(); i++) { out << setprecision(2) << (read.flowgram[i]/(float)100) << '\t'; }
//**********************************************************************************************************************
int SffInfoCommand::printFastaSeqData(ofstream& out, seqRead& read, Header& header) {
try {
-
string seq = read.bases;
- if (trim) {
+ if (trim) {
if(header.clipQualRight < header.clipQualLeft){
seq = "NNNN";
}
bool abort, fasta, qual, trim, flow, sfftxt, hasAccnos;
int mycount;
set<string> seqNames;
-
+
//extract sff file functions
int extractSffInfo(string, string);
int readCommonHeader(ifstream&, CommonHeader&);
int printQualSeqData(ofstream&, seqRead&, Header&);
int readAccnosFile(string);
int parseSffTxt();
-
+ bool sanityCheck(Header&, seqRead&);
+
//parsesfftxt file functions
int parseHeaderLineToInt(ifstream&);
vector<unsigned short> parseHeaderLineToFloatVector(ifstream&, int);
if (numFiles < processors) { processors = numFiles; }
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
if (processors == 1) { driver(flowFileVector, compositeFASTAFileName, compositeNamesFileName, 0, flowFileVector.size()); }
else { createProcesses(flowFileVector); } //each processor processes one file
#else
lines.push_back(linePair(startIndex, endIndex));
}
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
//loop through and create all the processes you want
while (process != processors) {
};
/**************************************************************************************************/
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
#else
static DWORD WINAPI ShhhFlowsThreadFunction(LPVOID lpParam){
shhhFlowsData* pDataArray;
lines.push_back(linePair(startIndex, endIndex));
}
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
//loop through and create all the processes you want
while (process != processors) {
};
/**************************************************************************************************/
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
#else
static DWORD WINAPI MyShhhSeqsThreadFunction(LPVOID lpParam){
shhhseqsData* pDataArray;
if (namefile != "") { nameMap = m->readNames(namefile); }
vector<unsigned long long> positions;
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
positions = m->divideFile(qualfile, processors);
for (int i = 0; i < (positions.size()-1); i++) { lines.push_back(linePair(positions[i], positions[(i+1)])); }
#else
lines.push_back(linePair(0, 1000));
}else {
positions = m->setFilePosFasta(qualfile, numSeqs);
+ if (positions.size() < processors) { processors = positions.size(); }
//figure out how many sequences you have to process
int numSeqsPerProcessor = numSeqs / processors;
count += num;
}
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
unsigned long long pos = in.tellg();
if ((pos == -1) || (pos >= filePos.end)) { break; }
#else
int numSeqs = 0;
processIDS.clear();
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
//loop through and create all the processes you want
while (process != processors) {
};
/**************************************************************************************************/
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
#else
static DWORD WINAPI MySeqSumQualThreadFunction(LPVOID lpParam){
seqSumQualData* pDataArray;
int process = 1;
vector<int> processIDS;
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
//loop through and create all the processes you want
while (process != processors) {
int pid = fork();
}
};
/**************************************************************************************************/
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
#else
static DWORD WINAPI MySummarySharedThreadFunction(LPVOID lpParam){
summarySharedData* pDataArray;
//The sum_of_squares, havel_hakimi and calc_c_score algorithms have been adapted from I. Miklos and J. Podani. 2004. Randomization of presence-absence matrices: comments and new algorithms. Ecology 85:86-92.
-/**************************************************************************************************/
+/**************************************************************************************************
int TrialSwap2::intrand(int n){
try {
double z;
}
}
/**************************************************************************************************/
-int TrialSwap2::havel_hakimi(vector<int> rowtotal,vector<int> columntotal,vector<vector<int> > &co_matrix)
-{
- try {
- int nrows = co_matrix.size();
- int ncols = co_matrix[0].size();
- int i,j,k;
- vector<int> r1; r1.resize(nrows,0);
- vector<int> c; c.resize(ncols,0);
- vector<int> c1; c1.resize(ncols,0);
-
-
- for(i=0;i<nrows;i++) {
- for(j=0;j<ncols;j++) {
- co_matrix[i][j]=0;
- }
- }
- for(i=0;i<nrows;i++) {
- r1[i]=1;
- }
-
- for(i=0;i<ncols;i++)
- {
- c[i]=columntotal[i];
- c1[i]=i;
- }
-
- for(k=0;k<nrows;k++)
- {
- if (m->control_pressed) { return 0; }
- i=intrand(nrows);
- while(r1[i]==0) {
- if (m->control_pressed) { return 0; }
- i=intrand(nrows);
- }
- r1[i]=0;
- sho(c,c1,ncols);
- for(j=0;j<rowtotal[i];j++)
- {
- if (m->control_pressed) { return 0; }
- co_matrix[i][c1[j]]=1;
- c[j]--;
- if(c[j]<0)
- m->mothurOut("Uhh! " + toString(c1[j]) + "\n");
- }
- }
- return 0;
- }
- catch(exception& e) {
- m->errorOut(e, "TrialSwap2", "havel_hakimi");
- exit(1);
- }
-}
-/**************************************************************************************************/
-int TrialSwap2::sho(vector<int> c, vector<int> c1, int k)
-{
- try {
- int i,j,temp;
-
- for(j=k-1;j>0;j--)
- {
- if (m->control_pressed) { return 0; }
- for(i=0;i<j;i++)
- {
- if(c[i]<c[i+1])
- {
- temp=c[i];
- c[i]=c[i+1];
- c[i+1]=temp;
- temp=c1[i];
- c1[i]=c1[i+1];
- c1[i+1]=temp;
- }
- }
- }
- for(j=1;j<1000;j++)
- {
- if (m->control_pressed) { return 0; }
- i=intrand(k-1);
- if(c[i]==c[i+1])
- {
- temp=c[i];
- c[i]=c[i+1];
- c[i+1]=temp;
- temp=c1[i];
- c1[i]=c1[i+1];
- c1[i+1]=temp;
- }
- }
- return(0);
- }
- catch(exception& e) {
- m->errorOut(e, "TrialSwap2", "sho");
- exit(1);
- }
-}
-/**************************************************************************************************/
double TrialSwap2::calc_c_score (vector<vector<int> > &co_matrix,vector<int> rowtotal)
{
try {
double normcscore = 0.0;
int nonzeros = 0;
int ncols = co_matrix[0].size(); int nrows = rowtotal.size();
- vector<vector<double> > s(nrows, vector<double>(nrows,0.0)); //only fill half the matrix
+ vector<vector<double> > s; s.resize(nrows);
+ for (int i = 0; i < nrows; i++) { s[i].resize(nrows,0.0); }//only fill half the matrix
+
for(int i=0;i<nrows-1;i++)
{
int cunits=0;
//int s[nrows][ncols];
int ncols = co_matrix[0].size(); int nrows = rowtotal.size();
- vector<vector<int> > s(nrows, vector<int>(nrows,0)); //only fill half the matrix
+ vector<vector<int> > s; s.resize(nrows);
+ for (int i = 0; i < nrows; i++) { s[i].resize(nrows,0); }//only fill half the matrix
for(int i=0;i<nrows-1;i++)
{
try {
int ncols = co_matrix[0].size(); int nrows = co_matrix.size();
int i, j, k, l;
- i=intrand(nrows);
- while((j = intrand(nrows) ) == i ) {;if (m->control_pressed) { return 0; }}
- k=intrand(ncols);
- while((l = intrand(ncols) ) == k ) {;if (m->control_pressed) { return 0; }}
+ i = m->getRandomIndex(nrows-1);
+ while((j = m->getRandomIndex(nrows-1) ) == i ) {;if (m->control_pressed) { return 0; }}
+ k = m->getRandomIndex(ncols-1);
+ while((l = m->getRandomIndex(ncols-1)) == k ) {;if (m->control_pressed) { return 0; }}
+
//cout << co_matrix[i][k] << " " << co_matrix[j][l] << endl;
//cout << co_matrix[i][l] << " " << co_matrix[j][k] << endl;
//cout << co_matrix[i][l] << " " << co_matrix[j][k] << endl;
//generate (columntotal.begin(), columntotal.end(), 0);
int nrows = co_matrix.size();
int ncols = co_matrix[0].size();
- vector<int> tmpcolumntotal(ncols, 0);
- vector<int> tmprowtotal(nrows, 0);
+ vector<int> tmpcolumntotal; tmpcolumntotal.resize(ncols, 0);
+ vector<int> tmprowtotal; tmprowtotal.resize(nrows, 0);
int rowcount = 0;
}
}
/**************************************************************************************************/
-/*int main(int argc, char *argv[])
-{
- srand (time(0));
- char* input_filename = argv[1];
- std::ifstream infile (input_filename);
-
- //skip the first line of headers
- getline(infile, line);
- //get the first line of data
- getline(infile, line);
-
- nrows = 0;
- ncols = 0;
-
- //int numspaces = 0;
- char nextChar;
-
- for (int i=0; i<int(line.length()); i++)
- {
- nextChar = line.at(i); // gets a character
- if (isspace(line[i]))
- ncols++;
- }
-
- ncols = ncols-3;
-
- cout << "number of OTUs: ";
- cout << ncols << endl;
-
- infile.close();
-
- std::ifstream infile2 (input_filename);
-
- //skip first line of headers
- getline(infile2, line);
-
- while (!infile2.eof())
- {
- getline(infile2, line);
- if (!line.empty())
- nrows++;
- }
-
- cout << "number of sites: ";
- cout << nrows << endl;
-
- infile2.close();
-
- std::ifstream infile3 (input_filename);
-
- //skip first line
- getline(infile3, line);
-
- //variables that depend on info from initial matrix
- vector<vector<int> > co_matrix;//[nrows][ncols];
- vector<vector<int> > initmatrix;
- vector<int> tmprow;
- vector<double> stats;
- int tmpnrows = nrows;
-
- for (int row1=0; row1<nrows; row1++) // first line was skipped when counting, so we can start from 0
- {
- //ignore first 3 cols in each row, data starts on the 3th col
- for (int i = 0; i < 3; i++)
- infile3 >> tmp;
-
- for (int col=0; col<ncols; col++)
- {
- infile3 >> tmp;
- //cout << tmp << endl;
- if (atoi(tmp.c_str()) > 0)
- tmprow.push_back(1);
- else
- tmprow.push_back(0);
- }
- if (accumulate( tmprow.begin(), tmprow.end(), 0 ) == 0)
- {
- tmpnrows--;
- }
- else
- initmatrix.push_back(tmprow);
- //add the row to the matrix
- //initmatrix.push_back(tmprow);
- tmprow.clear();
- //cout << tmprow << endl;
- }
-
- infile3.close();
- nrows = tmpnrows;
-
- //print init matrix
- /* cout << "original matrix:" << endl;
-
- for (int i = 0; i < nrows; i++)
- {
- for (int j = 0; j < ncols; j++)
- {
- cout << initmatrix[i][j];
- }
- cout << endl;
- } */
-
- //for (i=0;i<ncols;i++)
- //cout << "col "<< i<< ": " << columntotal[i] << endl;
-
- //co_matrix is now initmatrix and newmatrix is now co_matrix
-
- //remove cols where sum is 0
-
- //transpose matrix
- /* int newmatrows = ncols;
- int newmatcols = nrows;
- int initcols = ncols; //for the combo metric
- int initrows = nrows; //for the combo metric
- //swap for transposed matrix
- nrows = newmatrows;//ncols;
- ncols = newmatcols;//nrows;
-
- vector<int> columntotal(ncols, 0);
- vector<int> initcolumntotal(ncols, 0);
- vector<int> initrowtotal(nrows, 0);
- vector<int> rowtotal(nrows, 0);
-
- transpose_matrix(initmatrix,co_matrix);
- //remove degenerate rows and cols
-
- //cout << "transposed matrix:" << endl;
- int rowcount = 0;
- for (int i = 0; i < nrows; i++)
- {
- for (int j = 0; j < ncols; j++)
- {
- if (co_matrix[i][j] == 1)
- {
- rowcount++;
- columntotal[j]++;
- }
- //cout << co_matrix[i][j];
- }
- //cout << " row total: " << rowcount << endl;
- //cout << endl;
- rowtotal[i] = rowcount;
- rowcount = 0;
- }
-
- initcolumntotal = rowtotal;
- initrowtotal = columntotal;
-
- cout << endl;
-
- runs = atol(argv[2]);
- int metric = atol(argv[3]);
- int nullModel = atol(argv[4]);
- double initscore;
- update_row_col_totals(co_matrix, rowtotal, columntotal, ncols, nrows);
- //do initial metric: checker, c score, v ratio or combo
- switch(metric)
- {
- case 1:
- //c score
- initscore = calc_c_score(co_matrix, rowtotal);
- cout << "initial c score: " << initscore << endl;
- //print_matrix(co_matrix, nrows, ncols);
- break;
-
- case 2:
- //checker
- initscore = calc_checker(co_matrix, rowtotal);
- cout << "initial checker score: " << initscore << endl;
- break;
-
- case 3:
- //v ratio
- initscore = calc_vratio(nrows, ncols, rowtotal, columntotal);
- cout << "initial v ratio: " << initscore << endl;
- break;
-
- case 4:
- //combo
- initscore = calc_combo(initrows, initcols, initmatrix);
- cout << "initial combo score: " << initscore << endl;
- //set co_matrix equal to initmatrix because combo requires row comparisons
- co_matrix = initmatrix;
- break;
-
- case 5:
- //test!
-
- //print_matrix(co_matrix, nrows, ncols);
- //sim1(nrows, ncols, co_matrix);
- //sim2(nrows, ncols, co_matrix);
- //sim3(initrows, initcols, initmatrix);
- //sim4(columntotal, rowtotal, co_matrix);
- //sim5(initcolumntotal, initmatrix);
- //sim6(columntotal, co_matrix);
- //sim7(initcolumntotal, initmatrix);
- sim8(columntotal, rowtotal, co_matrix);
- //print_matrix(initmatrix, initrows, initcols);
- //print_matrix(co_matrix, nrows, ncols);
-
- break;
-
- default:
- cout << "no metric selected!" << endl;
- return 1;
-
- }
-
- //matrix initialization
- //havel_hakimi(nrows, ncols, rowtotal, columntotal, co_matrix);
- //sum_of_square(nrows, ncols, rowtotal, columntotal, co_matrix);
- //co-matrix is now a random matrix with the same row and column totals as the initial matrix
-
- //null matrix burn in
- cout << "initializing null matrix...";
- for(int l=0;l<10000;l++)
- {
- //swap_checkerboards (co_matrix);
- //if(l%10 == 0)
- switch(nullModel)
- {
- case 1:
- //
- sim1(nrows, ncols, co_matrix);
- break;
-
- case 2:
- //sim2
- sim2(nrows, ncols, co_matrix);
- //sim2plus(nrows, ncols, initrowtotal, co_matrix);
- break;
-
- case 3:
- //sim3
- sim3(initrows, initcols, initmatrix);
- //transpose_matrix(initmatrix,co_matrix);
- co_matrix = initmatrix;
- break;
-
- case 4:
- //sim4
- sim4(columntotal, rowtotal, co_matrix);
- break;
-
- case 5:
- //sim5
- sim5(initcolumntotal, initrowtotal, initmatrix);
- transpose_matrix(initmatrix,co_matrix);
- //co_matrix = initmatrix;
- break;
-
- case 6:
- sim6(columntotal, co_matrix);
- break;
-
- case 7:
- //sim7(ncols, nrows, initrowtotal, co_matrix);
- //transpose_matrix(initmatrix,co_matrix);
- //co_matrix = initmatrix;
- break;
-
- case 8:
- sim8(columntotal, rowtotal, co_matrix);
- break;
-
- case 9:
- //swap_checkerboards
- swap_checkerboards (co_matrix);
- break;
- default:
- cout << "no null model selected!" << endl;
- return 1;
- }
- }
- cout << "done!" << endl;
-
- //generate null matrices and calculate the metrics
-
- cout << "run: " << endl;
- for(int trial=0;trial<runs;trial++) //runs
- {
- printf("\b\b\b\b\b\b\b%7d",trial+1);
- fflush(stdout);
-
- switch(nullModel)
- {
- case 1:
- //
- sim1(nrows, ncols, co_matrix);
- break;
-
- case 2:
- //sim2
- sim2(nrows, ncols, co_matrix);
- //for(int i=0;i<nrows;i++)
- //cout << rowtotal[i] << " ";
- //sim2plus(nrows, ncols, initrowtotal, co_matrix);
- break;
-
- case 3:
- //sim3
- for(int i=0;i<nrows;i++)
- cout << " " << rowtotal[i];
- sim3(initrows, initcols, initmatrix);
- transpose_matrix(initmatrix,co_matrix);
- break;
-
- case 4:
- //sim4
- sim4(columntotal, rowtotal, co_matrix);
- break;
-
- case 5:
- //sim5
- sim5(initcolumntotal, initrowtotal, initmatrix);
- transpose_matrix(initmatrix,co_matrix);
- break;
-
- case 6:
- sim6(columntotal, co_matrix);
- break;
- case 7:
- sim7(ncols, nrows, initrowtotal, co_matrix);
- //print_matrix(co_matrix, nrows, ncols);
- //transpose_matrix(initmatrix,co_matrix);
- break;
- case 8:
- //sim8(initcolumntotal, initrowtotal, co_matrix);
- //initrow and initcol are flipped because of transposition. this is super ugly!
- sim8(initrowtotal, initcolumntotal, co_matrix);
- break;
-
- case 9:
- //swap_checkerboards
- swap_checkerboards (co_matrix);
- break;
-
- default:
- cout << "no null model selected!" << endl;
- return 1;
- }
-
- //cout << endl;
- //print_matrix(co_matrix, nrows, ncols);
- update_row_col_totals(co_matrix, rowtotal, columntotal, ncols, nrows);
- //cout << columntotal[1]<<endl;
- double tmp;
- switch(metric)
- {
- case 1:
- //c score
- //swap_checkerboards(co_matrix);
- //cout << "%" << tmp << " nrows " << nrows << " ncols " << ncols << " rowtotals ";
- //for(int i = 0; i<nrows; i++) { cout << rowtotal[i]; }
- //cout << endl;
- tmp = calc_c_score(co_matrix, rowtotal);
- //cout << "%" << tmp << " ";
- stats.push_back(tmp);
- //cout << "%" << tmp << " ";
- //print_matrix(co_matrix, nrows, ncols);
- break;
-
- case 2:
- //checker
- //swap_checkerboards(co_matrix);
- //cout << "%" << tmp << " nrows " << nrows << " ncols " << ncols << " rowtotals ";
- //for(int i = 0; i<nrows; i++) { cout << rowtotal[i]; }
- //cout << endl;
- tmp = calc_checker(co_matrix, rowtotal);
- stats.push_back(tmp);
- //cout << "%" << tmp << endl;
- break;
-
- case 3:
- //v ratio
- stats.push_back(calc_vratio(nrows, ncols, rowtotal, columntotal));
- break;
-
- case 4:
- //combo
- stats.push_back(calc_combo(nrows, ncols, co_matrix));
- break;
-
- case 5:
- //test!
- break;
-
- default:
- cout << "no metric selected!" << endl;
- return 1;
-
- }
-
- //print_matrix(co_matrix, nrows, ncols);
- //print_matrix(initmatrix, initrows, initcols);
-
- }
-
- cout << endl;
-
- double total = 0.0;
- for (int i=0; i<stats.size();i++)
- {
- total+=stats[i];
- }
-
- double nullMean = double (total/stats.size());
-
- cout << '\n' << "average metric score: " << nullMean << endl;
-
- //cout << "t-test: " << t_test(initscore, runs, nullMean, stats) << endl;
-
- if (metric == 1 || metric == 2)
- cout << "pvalue: " << calc_pvalue_greaterthan (stats, initscore) << endl;
- else
- cout << "pvalue: " << calc_pvalue_lessthan (stats, initscore) << endl;
-
- //print_matrix(co_matrix, nrows, ncols);
-
- return 0;
-
-}*/
-/**************************************************************************************************/
double calc_vratio (vector<int>, vector<int>);
int calc_checker (vector<vector<int> > &,vector<int>);
double calc_c_score (vector<vector<int> > &,vector<int>);
- int sho(vector<int>,vector<int>,int k);
- int havel_hakimi(vector<int>,vector<int>,vector<vector<int> > &);
- int intrand(int);
int sim1 (vector<vector<int> > &);
void sim2(vector<vector<int> >&);
}
vector<unsigned long long> flowFilePos;
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
flowFilePos = getFlowFileBreaks();
for (int i = 0; i < (flowFilePos.size()-1); i++) {
lines.push_back(new linePair(flowFilePos[i], flowFilePos[(i+1)]));
//report progress
if((count) % 10000 == 0){ m->mothurOut(toString(count)); m->mothurOutEndLine(); }
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
unsigned long long pos = flowFile.tellg();
if ((pos == -1) || (pos >= line->end)) { break; }
processIDS.clear();
int exitCommand = 1;
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
int process = 1;
//loop through and create all the processes you want
};
/**************************************************************************************************/
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
#else
static DWORD WINAPI MyTrimFlowThreadFunction(LPVOID lpParam){
trimFlowData* pDataArray;
count++;
}
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
unsigned long long pos = inFASTA.tellg();
if ((pos == -1) || (pos >= line.end)) { break; }
int exitCommand = 1;
processIDS.clear();
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
//loop through and create all the processes you want
while (process != processors) {
int pid = fork();
}
}
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
if(createGroup){
ifstream in;
string tempFile = filename + toString(processIDS[i]) + ".num.temp";
vector<unsigned long long> fastaFilePos;
vector<unsigned long long> qfileFilePos;
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
//set file positions for fasta file
fastaFilePos = m->divideFile(filename, processors);
}else{
int numFastaSeqs = 0;
fastaFilePos = m->setFilePosFasta(filename, numFastaSeqs);
+ if (fastaFilePos.size() < processors) { processors = fastaFilePos.size(); }
if (qfilename != "") {
int numQualSeqs = 0;
}
};
/**************************************************************************************************/
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
#else
static DWORD WINAPI MyTrimThreadFunction(LPVOID lpParam){
trimData* pDataArray;
lines.clear();
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
if(processors != 1){
int numPairs = namesOfGroupCombos.size();
int numPairsPerProcessor = numPairs / processors;
//get scores for random trees
for (int j = 0; j < iters; j++) {
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
if(processors == 1){
driver(T[i], namesOfGroupCombos, 0, namesOfGroupCombos.size(), rScores);
}else{
int UnifracWeightedCommand::createProcesses(Tree* t, vector< vector<string> > namesOfGroupCombos, vector< vector<double> >& scores) {
try {
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
int process = 1;
vector<int> processIDS;
}
}
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
if(processors == 1){
data = driver(t, namesOfGroupCombos, 0, namesOfGroupCombos.size());
}else{
EstOutput Unweighted::createProcesses(Tree* t, vector< vector<string> > namesOfGroupCombos) {
try {
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
int process = 1;
vector<int> processIDS;
}
}
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
if(processors == 1){
data = driver(t, namesOfGroupCombos, 0, namesOfGroupCombos.size(), true);
}else{
EstOutput Unweighted::createProcesses(Tree* t, vector< vector<string> > namesOfGroupCombos, bool usingGroups) {
try {
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
int process = 1;
vector<int> processIDS;
}
}
- #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
if(processors == 1){
data = driver(t, namesOfGroupCombos, 0, namesOfGroupCombos.size());
}else{
EstOutput Weighted::createProcesses(Tree* t, vector< vector<string> > namesOfGroupCombos) {
try {
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
int process = 1;
vector<int> processIDS;