Skip to content
Commits on Source (2)
......@@ -25,7 +25,7 @@ LOGFILE_NAME ?= yes
BOOST_LIBRARY_DIR="\"Enter_your_boost_library_path_here\""
BOOST_INCLUDE_DIR="\"Enter_your_boost_include_path_here\""
MOTHUR_FILES="\"Enter_your_default_path_here\""
VERSION = "\"1.40.3\""
VERSION = "\"1.40.4\""
ifeq ($(strip $(64BIT_VERSION)),yes)
CXXFLAGS += -DBIT_VERSION
......
......@@ -889,6 +889,7 @@
48789AF22061776100A7D848 /* unchecked.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = unchecked.h; path = source/unchecked.h; sourceTree = SOURCE_ROOT; };
487C5A851AB88B93002AF48A /* mimarksattributescommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mimarksattributescommand.cpp; path = source/commands/mimarksattributescommand.cpp; sourceTree = SOURCE_ROOT; };
487C5A861AB88B93002AF48A /* mimarksattributescommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mimarksattributescommand.h; path = source/commands/mimarksattributescommand.h; sourceTree = SOURCE_ROOT; };
48883FFB20C6D6C000CAF112 /* compare.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = compare.h; path = source/datastructures/compare.h; sourceTree = SOURCE_ROOT; };
488841631CC6C34900C5E972 /* renamefilecommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = renamefilecommand.cpp; path = source/commands/renamefilecommand.cpp; sourceTree = SOURCE_ROOT; };
488841641CC6C34900C5E972 /* renamefilecommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = renamefilecommand.h; path = source/commands/renamefilecommand.h; sourceTree = SOURCE_ROOT; };
4889EA201E8962D50054E0BB /* summary.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = summary.cpp; path = source/summary.cpp; sourceTree = SOURCE_ROOT; };
......@@ -896,7 +897,7 @@
48910D411D5243E500F60EDB /* mergecountcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mergecountcommand.cpp; path = source/commands/mergecountcommand.cpp; sourceTree = SOURCE_ROOT; };
48910D421D5243E500F60EDB /* mergecountcommand.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = mergecountcommand.hpp; path = source/commands/mergecountcommand.hpp; sourceTree = SOURCE_ROOT; };
48910D451D58CAD700F60EDB /* opticluster.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opticluster.cpp; path = source/opticluster.cpp; sourceTree = "<group>"; };
48910D491D58CBA300F60EDB /* optimatrix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = optimatrix.cpp; path = source/datastructures/optimatrix.cpp; sourceTree = "<group>"; };
48910D491D58CBA300F60EDB /* optimatrix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = optimatrix.cpp; path = source/datastructures/optimatrix.cpp; sourceTree = SOURCE_ROOT; };
48910D4A1D58CBA300F60EDB /* optimatrix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = optimatrix.h; path = source/datastructures/optimatrix.h; sourceTree = "<group>"; };
48910D4C1D58CBFC00F60EDB /* opticluster.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = opticluster.h; path = source/opticluster.h; sourceTree = "<group>"; };
48910D4D1D58E26C00F60EDB /* testopticluster.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = testopticluster.cpp; sourceTree = "<group>"; };
......@@ -918,7 +919,7 @@
48B662021BBB1B6600997EE4 /* testrenameseqscommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = testrenameseqscommand.h; path = TestMothur/testcommands/testrenameseqscommand.h; sourceTree = SOURCE_ROOT; };
48BDDA6F1EC9D31400F0F6C0 /* sharedrabundvectors.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = sharedrabundvectors.cpp; path = source/datastructures/sharedrabundvectors.cpp; sourceTree = SOURCE_ROOT; };
48BDDA701EC9D31400F0F6C0 /* sharedrabundvectors.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = sharedrabundvectors.hpp; path = source/datastructures/sharedrabundvectors.hpp; sourceTree = "<group>"; };
48BDDA731ECA067000F0F6C0 /* sharedrabundfloatvectors.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = sharedrabundfloatvectors.cpp; path = source/datastructures/sharedrabundfloatvectors.cpp; sourceTree = "<group>"; };
48BDDA731ECA067000F0F6C0 /* sharedrabundfloatvectors.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = sharedrabundfloatvectors.cpp; path = source/datastructures/sharedrabundfloatvectors.cpp; sourceTree = SOURCE_ROOT; };
48BDDA741ECA067000F0F6C0 /* sharedrabundfloatvectors.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = sharedrabundfloatvectors.hpp; path = source/datastructures/sharedrabundfloatvectors.hpp; sourceTree = "<group>"; };
48BDDA771ECA3B8E00F0F6C0 /* rabundfloatvector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = rabundfloatvector.cpp; path = source/datastructures/rabundfloatvector.cpp; sourceTree = SOURCE_ROOT; };
48BDDA781ECA3B8E00F0F6C0 /* rabundfloatvector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = rabundfloatvector.hpp; path = source/datastructures/rabundfloatvector.hpp; sourceTree = "<group>"; };
......@@ -2584,6 +2585,7 @@
A7E9B66312D37EC400DA6239 /* blastalign.hpp */,
A7E9B66412D37EC400DA6239 /* blastdb.cpp */,
A7E9B66512D37EC400DA6239 /* blastdb.hpp */,
48883FFB20C6D6C000CAF112 /* compare.h */,
A74D59A6159A1E3600043046 /* counttable.h */,
A74D59A3159A1E2000043046 /* counttable.cpp */,
A7E9B6BE12D37EC400DA6239 /* database.hpp */,
......@@ -3685,7 +3687,7 @@
GCC_C_LANGUAGE_STANDARD = "compiler-default";
GCC_DYNAMIC_NO_PIC = NO;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 3;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"MOTHUR_FILES=\"\\\"/Users/sarahwestcott/desktop/release\\\"\"",
"VERSION=\"\\\"1.40.3\\\"\"",
......@@ -3718,7 +3720,7 @@
DSTROOT = TARGET_BUILD_DIR;
GCC_C_LANGUAGE_STANDARD = "compiler-default";
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 3;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"MOTHUR_FILES=\"\\\"/Users/sarahwestcott/desktop/release\\\"\"",
"VERSION=\"\\\"1.40.3\\\"\"",
......@@ -3761,10 +3763,10 @@
GCC_ENABLE_SSE41_EXTENSIONS = NO;
GCC_ENABLE_SSE42_EXTENSIONS = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 3;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"MOTHUR_FILES=\"\\\"/Users/sarahwestcott/desktop/release\\\"\"",
"VERSION=\"\\\"1.40.3\\\"\"",
"VERSION=\"\\\"1.40.4\\\"\"",
"LOGFILE_NAME=\"\\\"./mothur.logfile\\\"\"",
);
GCC_VERSION = "";
......@@ -3828,9 +3830,9 @@
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_MODEL_TUNING = "";
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 3;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"VERSION=\"\\\"1.40.3\\\"\"",
"VERSION=\"\\\"1.40.4\\\"\"",
"MOTHUR_FILES=\"\\\"/Users/sarahwestcott/desktop/release\\\"\"",
"LOGFILE_NAME=\"\\\"./mothur.logfile\\\"\"",
);
......
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
......@@ -1050,7 +1050,7 @@ int ChimeraVsearchCommand::driver(string outputFName, string filename, string ac
*tempR = '\0'; strncat(tempR, templatefile.c_str(), templatefile.length());
cPara.push_back(tempR);
char* tempIn = new char[8];
char* tempIn = new char[13];
*tempIn = '\0'; strncat(tempIn, "--uchime_ref", 12);
cPara.push_back(tempIn);
char* temp = new char[filename.length()+1];
......
......@@ -476,13 +476,11 @@ int ClassifySeqsCommand::execute(){
numFastaSeqs = createProcesses(newTaxonomyFile, tempTaxonomyFile, newaccnosFile, fastaFileNames[s]);
if (!util.isBlank(newaccnosFile)) { m->mothurOutEndLine(); m->mothurOut("[WARNING]: mothur reversed some your sequences for a better classification. If you would like to take a closer look, please check " + newaccnosFile + " for the list of the sequences."); m->mothurOutEndLine();
if (!util.isBlank(newaccnosFile)) { m->mothurOut("\n[WARNING]: mothur reversed some your sequences for a better classification. If you would like to take a closer look, please check " + newaccnosFile + " for the list of the sequences.\n");
outputNames.push_back(newaccnosFile); outputTypes["accnos"].push_back(newaccnosFile);
}else { util.mothurRemove(newaccnosFile); }
m->mothurOutEndLine();
m->mothurOut("It took " + toString(time(NULL) - start) + " secs to classify " + toString(numFastaSeqs) + " sequences."); m->mothurOutEndLine(); m->mothurOutEndLine();
m->mothurOut("\nIt took " + toString(time(NULL) - start) + " secs to classify " + toString(numFastaSeqs) + " sequences.\n\n");
start = time(NULL);
//read namefile
......@@ -564,14 +562,12 @@ int ClassifySeqsCommand::execute(){
if (groupMap != NULL) { delete groupMap; } delete taxaSum;
util.mothurRemove(tempTaxonomyFile);
m->mothurOutEndLine();
m->mothurOut("It took " + toString(time(NULL) - start) + " secs to create the summary file for " + toString(numFastaSeqs) + " sequences."); m->mothurOutEndLine(); m->mothurOutEndLine();
m->mothurOut("\nIt took " + toString(time(NULL) - start) + " secs to create the summary file for " + toString(numFastaSeqs) + " sequences.\n\n");
}
delete classify;
m->mothurOutEndLine();
m->mothurOut("Output File Names: "); m->mothurOutEndLine();
m->mothurOut("\nOutput File Names: \n");
for (int i = 0; i < outputNames.size(); i++) { m->mothurOut(outputNames[i]); m->mothurOutEndLine(); }
m->mothurOutEndLine();
......
......@@ -273,7 +273,7 @@ ClusterCommand::ClusterCommand(string option) {
}
}
}
if ((method != "agc") || (method != "dgc")) {
if ((method != "agc") && (method != "dgc")) {
if ((columnfile == "") && (phylipfile == "")) {
m->mothurOut("[ERROR]: You must provide a distance file unless you are using the agc, dgc or unique clustering methods, aborting\n."); abort = true;
}
......@@ -715,6 +715,7 @@ int ClusterCommand::runMothurCluster(){
start = time(NULL);
loops = 0;
double saveCutoff = cutoff;
bool printHeaders = true;
while (matrix->getSmallDist() < cutoff && matrix->getNNodes() > 0){
......@@ -740,10 +741,10 @@ int ClusterCommand::runMothurCluster(){
float rndDist = util.ceilDist(dist, precision);
if(previousDist <= 0.0000 && dist != previousDist){
printData("unique", counts);
printData("unique", counts, printHeaders);
}
else if(rndDist != rndPreviousDist){
printData(toString(rndPreviousDist, length-1), counts);
printData(toString(rndPreviousDist, length-1), counts, printHeaders);
}
previousDist = dist;
......@@ -760,10 +761,10 @@ int ClusterCommand::runMothurCluster(){
}
if(previousDist <= 0.0000){
printData("unique", counts);
printData("unique", counts, printHeaders);
}
else if(rndPreviousDist<cutoff){
printData(toString(rndPreviousDist, length-1), counts);
printData(toString(rndPreviousDist, length-1), counts, printHeaders);
}
delete matrix;
......@@ -790,8 +791,10 @@ int ClusterCommand::runMothurCluster(){
}
//**********************************************************************************************************************
void ClusterCommand::printData(string label, map<string, int>& counts){
void ClusterCommand::printData(string label, map<string, int>& counts, bool& ph){
try {
oldList.setPrintedLabels(ph); ph = false;
if (util.isTrue(timing)) {
m->mothurOut("\tTime: " + toString(time(NULL) - start) + "\tsecs for " + toString(oldRAbund.getNumBins())
+ "\tclusters. Updates: " + toString(loops)); m->mothurOutEndLine();
......
......@@ -70,7 +70,7 @@ private:
time_t start;
unsigned long loops;
void printData(string label, map<string, int>&);
void printData(string label, map<string, int>&, bool&);
vector<string> outputNames;
int createRabund(CountTable*&, ListVector*&, RAbundVector*&);
......
......@@ -263,7 +263,7 @@ int ClusterDoturCommand::execute(){
oldRAbund = *rabund;
oldList = *list;
//double saveCutoff = cutoff;
bool printHeaders = true;
int estart = time(NULL);
......@@ -277,10 +277,10 @@ int ClusterDoturCommand::execute(){
float rndDist = util.ceilDist(dist, precision);
if(previousDist <= 0.0000 && dist != previousDist){
printData("unique", counts);
printData("unique", counts, printHeaders);
}
else if(rndDist != rndPreviousDist){
printData(toString(rndPreviousDist, length-1), counts);
printData(toString(rndPreviousDist, length-1), counts, printHeaders);
}
previousDist = dist;
......@@ -290,10 +290,10 @@ int ClusterDoturCommand::execute(){
}
if(previousDist <= 0.0000){
printData("unique", counts);
printData("unique", counts, printHeaders);
}
else if(rndPreviousDist<cutoff){
printData(toString(rndPreviousDist, length-1), counts);
printData(toString(rndPreviousDist, length-1), counts, printHeaders);
}
if (countfile == "") {
......@@ -332,8 +332,10 @@ int ClusterDoturCommand::execute(){
//**********************************************************************************************************************
void ClusterDoturCommand::printData(string label, map<string, int>& counts){
void ClusterDoturCommand::printData(string label, map<string, int>& counts, bool& ph){
try {
oldList.setPrintedLabels(ph); ph = false;
oldRAbund.setLabel(label);
if (countfile == "") {
oldRAbund.print(rabundFile);
......
......@@ -48,7 +48,7 @@ private:
RAbundVector oldRAbund;
ListVector oldList;
void printData(string label, map<string, int>&);
void printData(string label, map<string, int>&, bool&);
vector<string> outputNames;
};
......
......@@ -573,7 +573,7 @@ int ClusterSplitCommand::execute(){
}
//****************** break up files between processes and cluster each file set ******************************//
///////////////////// WINDOWS CAN ONLY USE 1 PROCESSORS ACCESS VIOLATION UNRESOLVED ///////////////////////
listFileNames = createProcesses(distName, labels);
if (m->getControl_pressed()) { for (int i = 0; i < listFileNames.size(); i++) { util.mothurRemove(listFileNames[i]); } return 0; }
......@@ -666,7 +666,6 @@ map<double, int> ClusterSplitCommand::completeListFile(vector<string> listNames,
}else{ listSingle = NULL; numSingleBins = 0; }
//go through users set and make them floats so we can sort them
double tcutoff = cutoff * 1000; tcutoff = ceil(tcutoff);
for(set<string>::iterator it = userLabels.begin(); it != userLabels.end(); ++it) {
double temp = -10.0;
......@@ -675,7 +674,10 @@ map<double, int> ClusterSplitCommand::completeListFile(vector<string> listNames,
double ttemp = temp * 1000; ttemp = ceil(temp);
if (ttemp <= tcutoff) {
if (temp < cutoff) {
orderFloat.push_back(temp);
labelBin[temp] = numSingleBins; //initialize numbins
}else if (fabs(cutoff - temp) < 0.0001) {
orderFloat.push_back(temp);
labelBin[temp] = numSingleBins; //initialize numbins
}
......@@ -701,6 +703,7 @@ map<double, int> ClusterSplitCommand::completeListFile(vector<string> listNames,
string filledInList = listNames[k] + "filledInTemp";
ofstream outFilled;
util.openOutputFile(filledInList, outFilled);
bool printHeaders = true;
//for each label needed
for(int l = 0; l < orderFloat.size(); l++){
......@@ -729,7 +732,8 @@ map<double, int> ClusterSplitCommand::completeListFile(vector<string> listNames,
//print to new file
list->setLabel(thisLabel);
list->print(outFilled, true);
list->setPrintedLabels(printHeaders);
list->print(outFilled, true); printHeaders = false;
//update labelBin
labelBin[orderFloat[l]] += list->getNumBins();
......@@ -786,6 +790,7 @@ int ClusterSplitCommand::mergeLists(vector<string> listNames, map<double, int> u
util.openOutputFile(listFileName, outList);
outputNames.push_back(listFileName); outputTypes["list"].push_back(listFileName);
bool printHeaders = true;
//for each label needed
for(map<double, int>::iterator itLabel = userLabels.begin(); itLabel != userLabels.end(); itLabel++) {
......@@ -826,7 +831,6 @@ int ClusterSplitCommand::mergeLists(vector<string> listNames, map<double, int> u
if (list == NULL) { m->mothurOut("Error merging listvectors in file " + listNames[k]); m->mothurOutEndLine(); }
else {
for (int j = 0; j < list->getNumBins(); j++) {
//outList << list->get(j) << '\t';
completeList.push_back(list->get(j));
if (countfile == "") { rabund->push_back(util.getNumNames(list->get(j))); }
}
......@@ -841,9 +845,10 @@ int ClusterSplitCommand::mergeLists(vector<string> listNames, map<double, int> u
rabund->print(outRabund);
}
if (countfile == "") { completeList.print(outList); }
else if ((file == "") && (countfile != "")) { completeList.print(outList, counts); }
else { completeList.print(outList); }
completeList.setPrintedLabels(printHeaders);
if (countfile == "") { completeList.print(outList); printHeaders = false; }
else if ((file == "") && (countfile != "")) { completeList.print(outList, counts); printHeaders = false; }
else { completeList.print(outList); printHeaders = false; }
if (rabund != NULL) { delete rabund; }
}
......@@ -975,6 +980,7 @@ string clusterClassicFile(string thisDistFile, string thisNamefile, double& smal
float previousDist = 0.00000;
float rndPreviousDist = 0.00000;
bool printHeaders = true;
oldList = *list;
params->m->mothurOut("\nClustering " + thisDistFile + "\n");
......@@ -990,12 +996,14 @@ string clusterClassicFile(string thisDistFile, string thisNamefile, double& smal
if(previousDist <= 0.0000 && dist != previousDist){
oldList.setLabel("unique");
oldList.print(listFile);
oldList.setPrintedLabels(printHeaders);
oldList.print(listFile); printHeaders = false;
if (params->labels.count("unique") == 0) { params->labels.insert("unique"); }
}
else if(rndDist != rndPreviousDist){
oldList.setLabel(toString(rndPreviousDist, params->length-1));
oldList.print(listFile);
oldList.setPrintedLabels(printHeaders);
oldList.print(listFile); printHeaders = false;
if (params->labels.count(toString(rndPreviousDist, params->length-1)) == 0) { params->labels.insert(toString(rndPreviousDist, params->length-1)); }
}
......@@ -1007,12 +1015,14 @@ string clusterClassicFile(string thisDistFile, string thisNamefile, double& smal
if(previousDist <= 0.0000){
oldList.setLabel("unique");
oldList.print(listFile);
oldList.setPrintedLabels(printHeaders);
oldList.print(listFile); printHeaders = false;
if (params->labels.count("unique") == 0) { params->labels.insert("unique"); }
}
else if(rndPreviousDist<params->cutoff){
oldList.setLabel(toString(rndPreviousDist, params->length-1));
oldList.print(listFile);
oldList.setPrintedLabels(printHeaders);
oldList.print(listFile); printHeaders = false;
if (params->labels.count(toString(rndPreviousDist, params->length-1)) == 0) { params->labels.insert(toString(rndPreviousDist, params->length-1)); }
}
listFile.close();
......@@ -1343,8 +1353,7 @@ string clusterFile(string thisDistFile, string thisNamefile, double& smallestCut
float previousDist = 0.00000;
float rndPreviousDist = 0.00000;
oldList = *list;
bool printHeaders = true;
time_t start = time(NULL);
double saveCutoff = params->cutoff;
......@@ -1365,12 +1374,14 @@ string clusterFile(string thisDistFile, string thisNamefile, double& smallestCut
if(previousDist <= 0.0000 && dist != previousDist){
oldList.setLabel("unique");
oldList.print(listFile);
oldList.setPrintedLabels(printHeaders);
oldList.print(listFile); printHeaders = false;
if (params->labels.count("unique") == 0) { params->labels.insert("unique"); }
}
else if(rndDist != rndPreviousDist){
oldList.setLabel(toString(rndPreviousDist, params->length-1));
oldList.print(listFile);
oldList.setPrintedLabels(printHeaders);
oldList.print(listFile); printHeaders = false;
if (params->labels.count(toString(rndPreviousDist, params->length-1)) == 0) { params->labels.insert(toString(rndPreviousDist, params->length-1)); }
}
......@@ -1382,12 +1393,14 @@ string clusterFile(string thisDistFile, string thisNamefile, double& smallestCut
if(previousDist <= 0.0000){
oldList.setLabel("unique");
oldList.print(listFile);
oldList.setPrintedLabels(printHeaders);
oldList.print(listFile); printHeaders = false;
if (params->labels.count("unique") == 0) { params->labels.insert("unique"); }
}
else if(rndPreviousDist<params->cutoff){
oldList.setLabel(toString(rndPreviousDist, params->length-1));
oldList.print(listFile);
oldList.setPrintedLabels(printHeaders);
oldList.print(listFile); printHeaders = false;
if (params->labels.count(toString(rndPreviousDist, params->length-1)) == 0) { params->labels.insert(toString(rndPreviousDist, params->length-1)); }
}
......
......@@ -1066,7 +1066,7 @@ int GetLineageCommand::readTax(){
}
in.close();
out.close();
names.insert(name); out << name << '\t' << tax << endl;
if (names.size() == 0) { m->mothurOut("Your taxonomy file does not contain any sequences from " + taxons + ".\n"); }
outputNames.push_back(outputFileName); outputTypes["taxonomy"].push_back(outputFileName);
......
......@@ -340,6 +340,16 @@ int GetMetaCommunityCommand::createProcesses(SharedRAbundVectors*& thislookup){
matrix.resize(1);
int minPartition = 0;
for (int i=1; i<=maxpartitions; i++) {
int processToAssign = 1;
dividedPartitions[(processToAssign-1)].push_back(i);
variables["[tag]"] = toString(i);
string relName = getOutputFileName("relabund", variables);
string mName = getOutputFileName("matrix", variables);
rels[(processToAssign-1)].push_back(relName);
matrix[(processToAssign-1)].push_back(mName);
}
m->mothurOut("K\tNLE\t\tlogDet\tBIC\t\tAIC\t\tLaplace\n");
minPartition = processDriver(thislookup, dividedPartitions[0], outputFileName, rels[0], matrix[0], doneFlags, 0);
......
Source diff could not be displayed: it is too large. Options to address this: view the blob.
......@@ -69,7 +69,7 @@ private:
char delim;
bool abort, allFiles, trimOverlap, createFileGroup, createOligosGroup, makeCount, noneOk, reorient, gz;
string outputDir, ffastqfile, rfastqfile, align, oligosfile, rfastafile, ffastafile, rqualfile, fqualfile, findexfile, rindexfile, file, format, inputDir;
float match, misMatch, gapOpen, gapExtend;
float match, misMatch, gapOpen, gapExtend, maxee;
int processors, longestBase, insert, tdiffs, bdiffs, pdiffs, ldiffs, sdiffs, deltaq, kmerSize, nameType, offByOneTrimLength;
vector<string> outputNames;
set<string> badNames;
......@@ -92,4 +92,3 @@ private:
/**************************************************************************************************/
#endif
......@@ -300,8 +300,10 @@ int MGClusterCommand::execute(){
}
}
//**********************************************************************************************************************
void MGClusterCommand::printData(ListVector* mergedList, map<string, int>& counts){
void MGClusterCommand::printData(ListVector* mergedList, map<string, int>& counts, bool& ph){
try {
mergedList->setPrintedLabels(ph); ph = false;
if (countfile != "") {
mergedList->print(listFile, counts);
}else { mergedList->print(listFile, true); }
......@@ -578,6 +580,7 @@ int MGClusterCommand::runMothurCluster(){
}
double saveCutoff = cutoff;
bool printHeaders = true;
//get distmatrix and overlap
SparseDistanceMatrix* distMatrix = read->getDistMatrix();
......@@ -619,7 +622,7 @@ int MGClusterCommand::runMothurCluster(){
if(previousDist <= 0.0000 && dist != previousDist){
oldList.setLabel("unique");
printData(&oldList, counts);
printData(&oldList, counts, printHeaders);
}
else if(rndDist != rndPreviousDist){
if (merge) {
......@@ -633,11 +636,11 @@ int MGClusterCommand::runMothurCluster(){
}
temp->setLabel(toString(rndPreviousDist, precisionLength-1));
printData(temp, counts);
printData(temp, counts, printHeaders);
delete temp;
}else{
oldList.setLabel(toString(rndPreviousDist, precisionLength-1));
printData(&oldList, counts);
printData(&oldList, counts, printHeaders);
}
}
......@@ -650,7 +653,7 @@ int MGClusterCommand::runMothurCluster(){
if(previousDist <= 0.0000){
oldList.setLabel("unique");
printData(&oldList, counts);
printData(&oldList, counts, printHeaders);
}
else if(rndPreviousDist<cutoff){
if (merge) {
......@@ -664,11 +667,11 @@ int MGClusterCommand::runMothurCluster(){
}
temp->setLabel(toString(rndPreviousDist, precisionLength-1));
printData(temp, counts);
printData(temp, counts, printHeaders);
delete temp;
}else{
oldList.setLabel(toString(rndPreviousDist, precisionLength-1));
printData(&oldList, counts);
printData(&oldList, counts, printHeaders);
}
}
......
......@@ -60,7 +60,7 @@ private:
int precision, length, precisionLength, maxIters;
bool abort, minWanted, hclusterWanted, merge, cutoffSet;
void printData(ListVector*, map<string, int>&);
void printData(ListVector*, map<string, int>&, bool&);
ListVector* mergeOPFs(map<string, int>, float);
vector<seqDist> getSeqs(ifstream&);
void createRabund(CountTable*&, ListVector*&, RAbundVector*&);
......
......@@ -16,13 +16,14 @@ NoCommand::NoCommand(string option) {}
//**********************************************************************************************************************
int NoCommand::execute(){
//Could choose to give more help here?fdsah
cout << "Invalid command.\n";
MothurOut* m = MothurOut::getInstance();
//Could choose to give more help here?
m->mothurOut("[ERROR]: Invalid command.\n");
CommandFactory* valid = CommandFactory::getInstance();
valid->printCommands(cout);
return 0;
return 2;
}
//**********************************************************************************************************************
......@@ -340,15 +340,16 @@ int PcrSeqsCommand::execute(){
if (outputDir == "") { thisOutputDir += util.hasPath(fastafile); }
variables["[filename]"] = thisOutputDir + util.getRootName(util.getSimpleName(fastafile));
string outputFileName = getOutputFileName("accnos",variables);
outputNames.push_back(outputFileName); outputTypes["accnos"].push_back(outputFileName);
//don't write or keep if blank
if (badNames.size() != 0) { writeAccnos(badNames, outputFileName); }
bool wroteAccnos = false;
if (badNames.size() != 0) { writeAccnos(badNames, outputFileName); wroteAccnos = true; outputNames.push_back(outputFileName); outputTypes["accnos"].push_back(outputFileName); }
else { m->mothurOut("[NOTE]: no sequences were bad, removing " + outputFileName + "\n\n"); }
if (util.isBlank(badSeqFile)) { util.mothurRemove(badSeqFile); }
else { outputNames.push_back(badSeqFile); outputTypes["fasta"].push_back(badSeqFile); }
if (wroteAccnos) {
string inputStringTemp = "";
if (countfile != "") { inputStringTemp += ", count=" + countfile; }
else{
......@@ -359,8 +360,8 @@ int PcrSeqsCommand::execute(){
string inputString = "accnos=" + outputFileName + inputStringTemp;
if (inputStringTemp != "") {
m->mothurOut("/******************************************/"); m->mothurOutEndLine();
m->mothurOut("Running command: remove.seqs(" + inputString + ")"); m->mothurOutEndLine();
m->mothurOut("/******************************************/\n");
m->mothurOut("Running command: remove.seqs(" + inputString + ")\n");
current->setMothurCalling(true);
Command* removeCommand = new RemoveSeqsCommand(inputString);
......@@ -409,7 +410,7 @@ int PcrSeqsCommand::execute(){
}
m->mothurOut("/******************************************/"); m->mothurOutEndLine();
}
}
if (m->getControl_pressed()) { for (int i = 0; i < outputNames.size(); i++) { util.mothurRemove(outputNames[i]); } return 0; }
m->mothurOut("It took " + toString(time(NULL) - start) + " secs to screen " + toString(numFastaSeqs) + " sequences.\n");
......
......@@ -547,6 +547,7 @@ vector<seqPNode*> readFASTA(CountTable ct, preClusterData* params, long long& nu
Sequence seq(inFasta); params->util.gobble(inFasta);
if (seq.getName() != "") { //can get "" if commented line is at end of fasta file
if (params->hasName) {
it = nameMap.find(seq.getName());
......@@ -578,6 +579,8 @@ vector<seqPNode*> readFASTA(CountTable ct, preClusterData* params, long long& nu
if (params->topdown) { sort(alignSeqs.begin(), alignSeqs.end(), comparePriorityTopDown); }
else { sort(alignSeqs.begin(), alignSeqs.end(), comparePriorityDownTop); }
num = alignSeqs.size();
return alignSeqs;
}
catch(exception& e) {
......@@ -616,7 +619,7 @@ void print(string newfasta, string newname, preClusterData* params){
}
catch(exception& e) {
params->m->errorOut(e, "PreClusterCommand", "printData");
params->m->errorOut(e, "PreClusterCommand", "print");
exit(1);
}
}
......@@ -654,9 +657,9 @@ int PreClusterCommand::execute(){
//run unique.seqs for deconvolute results
string inputString = "fasta=" + newFastaFile;
if (namefile != "") { inputString += ", name=" + newNamesFile; }
m->mothurOutEndLine();
m->mothurOut("/******************************************/"); m->mothurOutEndLine();
m->mothurOut("Running command: unique.seqs(" + inputString + ")"); m->mothurOutEndLine();
m->mothurOut("\n/******************************************/\n");
m->mothurOut("Running command: unique.seqs(" + inputString + ")\n");
current->setMothurCalling(true);
Command* uniqueCommand = new DeconvoluteCommand(inputString);
......@@ -672,7 +675,7 @@ int PreClusterCommand::execute(){
util.renameFile(filenames["name"][0], newNamesFile);
}
if (m->getControl_pressed()) { for (int i = 0; i < outputNames.size(); i++) { util.mothurRemove(outputNames[i]); } return 0; }
m->mothurOut("It took " + toString(time(NULL) - start) + " secs to run pre.cluster."); m->mothurOutEndLine();
m->mothurOut("It took " + toString(time(NULL) - start) + " secs to run pre.cluster.\n");
}else {
if (processors != 1) { m->mothurOut("When using running without group information mothur can only use 1 processor, continuing."); m->mothurOutEndLine(); processors = 1; }
......@@ -682,11 +685,12 @@ int PreClusterCommand::execute(){
//reads fasta file and return number of seqs
long long numSeqs = 0; params->alignSeqs = readFASTA(ct, params, numSeqs); //fills alignSeqs and makes all seqs active
length = params->length;
if (m->getControl_pressed()) { for (int i = 0; i < outputNames.size(); i++) { util.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; }
if (numSeqs == 0) { m->mothurOut("Error reading fasta file...please correct.\n"); return 0; }
if (diffs > length) { m->mothurOut("Error: diffs is set to " + toString(diffs) + " which is greater than your sequence length of " + toString(length) + ".\n"); return 0; }
int count = process("", newMapFile, params);
outputNames.push_back(newMapFile); outputTypes["map"].push_back(newMapFile);
......@@ -698,7 +702,7 @@ int PreClusterCommand::execute(){
if (countfile != "") { newNamesFile = newCountFile; }
print(newFastaFile, newNamesFile, params);
for (int i = 0; i < params->alignSeqs.size(); i++) { delete params->alignSeqs[i]; } params->alignSeqs.clear();
m->mothurOut("It took " + toString(time(NULL) - start) + " secs to cluster " + toString(numSeqs) + " sequences."); m->mothurOutEndLine();
m->mothurOut("It took " + toString(time(NULL) - start) + " secs to cluster " + toString(numSeqs) + " sequences.\n");
}
if (m->getControl_pressed()) { for (int i = 0; i < outputNames.size(); i++) { util.mothurRemove(outputNames[i]); } return 0; }
......@@ -786,6 +790,8 @@ vector<seqPNode*> loadSeqs(map<string, string>& thisName, vector<Sequence>& this
if (topdown) { sort(alignSeqs.begin(), alignSeqs.end(), comparePriorityTopDown); }
else { sort(alignSeqs.begin(), alignSeqs.end(), comparePriorityDownTop); }
num = alignSeqs.size();
return alignSeqs;
}
catch(exception& e) {
......@@ -819,10 +825,11 @@ void printData(string group, preClusterData* params){
for (int i = 0; i < params->alignSeqs.size(); i++) {
if (params->alignSeqs[i]->numIdentical != 0) {
params->alignSeqs[i]->seq.printSequence(params->newFName);
params->newNName->write(group + '\t' + params->alignSeqs[i]->seq.getName() + '\t' + params->alignSeqs[i]->names + '\n');
params->newNName->write(params->alignSeqs[i]->seq.getName() + '\t' + params->alignSeqs[i]->names + '\n');
}
}
}
}
catch(exception& e) {
params->m->errorOut(e, "PreClusterCommand", "printData");
......@@ -862,7 +869,10 @@ long long driverGroups(preClusterData* params){
map<string, int> thisCount;
if (params->hasCount) { thisCount = cparser->getCountTable(params->groups[i]); }
params->alignSeqs = loadSeqs(thisNameMap, thisSeqs, thisCount, params->groups[i], numSeqs, params->hasName, params->hasCount, params->length, params->method, params->topdown);
long long num = 0;
params->alignSeqs = loadSeqs(thisNameMap, thisSeqs, thisCount, params->groups[i], num, params->hasName, params->hasCount, params->length, params->method, params->topdown);
numSeqs += num;
if (params->m->getControl_pressed()) { return 0; }
......@@ -879,7 +889,7 @@ long long driverGroups(preClusterData* params){
printData(params->groups[i], params);
for (int i = 0; i < params->alignSeqs.size(); i++) { delete params->alignSeqs[i]; } params->alignSeqs.clear();
params->m->mothurOut("It took " + toString(time(NULL) - start) + " secs to cluster " + toString(count) + " sequences.\n");
params->m->mothurOut("It took " + toString(time(NULL) - start) + " secs to cluster " + toString(num) + " sequences.\n");
}
if (params->hasCount) { delete cparser; }else { delete parser; }
......