From 82bf18e3ef0a52345519f91a682e64cc385b56bb Mon Sep 17 00:00:00 2001 From: westcott Date: Fri, 15 Apr 2011 15:25:08 +0000 Subject: [PATCH] 1.18.1 --- Mothur.xcodeproj/project.pbxproj | 12 --- catchallcommand.cpp | 1 - clearcutcommand.h | 1 - clustercommand.cpp | 4 +- collect.cpp | 10 +- collectdisplay.h | 9 +- commandoptionparser.cpp | 1 - decalc.cpp | 4 +- engine.cpp | 10 +- getcurrentcommand.cpp | 6 +- globaldata.cpp | 173 ------------------------------- globaldata.hpp | 105 ------------------- heatmapsimcommand.cpp | 6 +- helpcommand.h | 4 +- mothur.cpp | 5 +- mothurout.cpp | 34 ++++++ mothurout.h | 1 + readcluster.h | 1 - readotu.cpp | 86 --------------- readotu.h | 47 --------- readotucommand.h | 1 - sharedjest.cpp | 2 +- sharedrabundvector.cpp | 5 +- sharedutilities.cpp | 2 +- sharedutilities.h | 2 +- 25 files changed, 75 insertions(+), 457 deletions(-) delete mode 100644 globaldata.cpp delete mode 100644 globaldata.hpp delete mode 100644 readotu.cpp delete mode 100644 readotu.h diff --git a/Mothur.xcodeproj/project.pbxproj b/Mothur.xcodeproj/project.pbxproj index dbe9347..6bc5e17 100644 --- a/Mothur.xcodeproj/project.pbxproj +++ b/Mothur.xcodeproj/project.pbxproj @@ -107,7 +107,6 @@ A7E9B8D712D37EC400DA6239 /* getsabundcommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7E9B70612D37EC400DA6239 /* getsabundcommand.cpp */; }; A7E9B8D812D37EC400DA6239 /* getseqscommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7E9B70812D37EC400DA6239 /* getseqscommand.cpp */; }; A7E9B8D912D37EC400DA6239 /* getsharedotucommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7E9B70A12D37EC400DA6239 /* getsharedotucommand.cpp */; }; - A7E9B8DA12D37EC400DA6239 /* globaldata.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7E9B70C12D37EC400DA6239 /* globaldata.cpp */; }; A7E9B8DB12D37EC400DA6239 /* goodscoverage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7E9B70E12D37EC400DA6239 /* goodscoverage.cpp */; }; A7E9B8DC12D37EC400DA6239 /* gotohoverlap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7E9B71012D37EC400DA6239 /* gotohoverlap.cpp */; }; A7E9B8DD12D37EC400DA6239 /* gower.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7E9B71212D37EC400DA6239 /* gower.cpp */; }; @@ -190,7 +189,6 @@ A7E9B92A12D37EC400DA6239 /* readcluster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7E9B7B212D37EC400DA6239 /* readcluster.cpp */; }; A7E9B92B12D37EC400DA6239 /* readcolumn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7E9B7B412D37EC400DA6239 /* readcolumn.cpp */; }; A7E9B92C12D37EC400DA6239 /* readdistcommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7E9B7B612D37EC400DA6239 /* readdistcommand.cpp */; }; - A7E9B92D12D37EC400DA6239 /* readotu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7E9B7B912D37EC400DA6239 /* readotu.cpp */; }; A7E9B92E12D37EC400DA6239 /* readotucommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7E9B7BB12D37EC400DA6239 /* readotucommand.cpp */; }; A7E9B92F12D37EC400DA6239 /* readphylip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7E9B7BD12D37EC400DA6239 /* readphylip.cpp */; }; A7E9B93012D37EC400DA6239 /* readtree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7E9B7BF12D37EC400DA6239 /* readtree.cpp */; }; @@ -522,8 +520,6 @@ A7E9B70912D37EC400DA6239 /* getseqscommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getseqscommand.h; sourceTree = ""; }; A7E9B70A12D37EC400DA6239 /* getsharedotucommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = getsharedotucommand.cpp; sourceTree = ""; }; A7E9B70B12D37EC400DA6239 /* getsharedotucommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getsharedotucommand.h; sourceTree = ""; }; - A7E9B70C12D37EC400DA6239 /* globaldata.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = globaldata.cpp; sourceTree = SOURCE_ROOT; }; - A7E9B70D12D37EC400DA6239 /* globaldata.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = globaldata.hpp; sourceTree = SOURCE_ROOT; }; A7E9B70E12D37EC400DA6239 /* goodscoverage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = goodscoverage.cpp; sourceTree = ""; }; A7E9B70F12D37EC400DA6239 /* goodscoverage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = goodscoverage.h; sourceTree = ""; }; A7E9B71012D37EC400DA6239 /* gotohoverlap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = gotohoverlap.cpp; sourceTree = SOURCE_ROOT; }; @@ -695,8 +691,6 @@ A7E9B7B612D37EC400DA6239 /* readdistcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = readdistcommand.cpp; sourceTree = ""; }; A7E9B7B712D37EC400DA6239 /* readdistcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = readdistcommand.h; sourceTree = ""; }; A7E9B7B812D37EC400DA6239 /* readmatrix.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = readmatrix.hpp; sourceTree = ""; }; - A7E9B7B912D37EC400DA6239 /* readotu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = readotu.cpp; sourceTree = ""; }; - A7E9B7BA12D37EC400DA6239 /* readotu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = readotu.h; sourceTree = ""; }; A7E9B7BB12D37EC400DA6239 /* readotucommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = readotucommand.cpp; sourceTree = ""; }; A7E9B7BC12D37EC400DA6239 /* readotucommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = readotucommand.h; sourceTree = ""; }; A7E9B7BD12D37EC400DA6239 /* readphylip.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = readphylip.cpp; sourceTree = ""; }; @@ -964,8 +958,6 @@ A7E9B6DB12D37EC400DA6239 /* engine.hpp */, A7E9B6E012D37EC400DA6239 /* fileoutput.cpp */, A7E9B6E112D37EC400DA6239 /* fileoutput.h */, - A7E9B70C12D37EC400DA6239 /* globaldata.cpp */, - A7E9B70D12D37EC400DA6239 /* globaldata.hpp */, A7E9B71112D37EC400DA6239 /* gotohoverlap.hpp */, A7E9B71012D37EC400DA6239 /* gotohoverlap.cpp */, A7E9B71812D37EC400DA6239 /* hcluster.cpp */, @@ -1579,8 +1571,6 @@ A7E9B7B412D37EC400DA6239 /* readcolumn.cpp */, A7E9B7B512D37EC400DA6239 /* readcolumn.h */, A7E9B7B812D37EC400DA6239 /* readmatrix.hpp */, - A7E9B7BA12D37EC400DA6239 /* readotu.h */, - A7E9B7B912D37EC400DA6239 /* readotu.cpp */, A7E9B7BD12D37EC400DA6239 /* readphylip.cpp */, A7E9B7BE12D37EC400DA6239 /* readphylip.h */, A7E9B7BF12D37EC400DA6239 /* readtree.cpp */, @@ -1751,7 +1741,6 @@ A7E9B8D712D37EC400DA6239 /* getsabundcommand.cpp in Sources */, A7E9B8D812D37EC400DA6239 /* getseqscommand.cpp in Sources */, A7E9B8D912D37EC400DA6239 /* getsharedotucommand.cpp in Sources */, - A7E9B8DA12D37EC400DA6239 /* globaldata.cpp in Sources */, A7E9B8DB12D37EC400DA6239 /* goodscoverage.cpp in Sources */, A7E9B8DC12D37EC400DA6239 /* gotohoverlap.cpp in Sources */, A7E9B8DD12D37EC400DA6239 /* gower.cpp in Sources */, @@ -1834,7 +1823,6 @@ A7E9B92A12D37EC400DA6239 /* readcluster.cpp in Sources */, A7E9B92B12D37EC400DA6239 /* readcolumn.cpp in Sources */, A7E9B92C12D37EC400DA6239 /* readdistcommand.cpp in Sources */, - A7E9B92D12D37EC400DA6239 /* readotu.cpp in Sources */, A7E9B92E12D37EC400DA6239 /* readotucommand.cpp in Sources */, A7E9B92F12D37EC400DA6239 /* readphylip.cpp in Sources */, A7E9B93012D37EC400DA6239 /* readtree.cpp in Sources */, diff --git a/catchallcommand.cpp b/catchallcommand.cpp index 3effaf4..1e89cdc 100644 --- a/catchallcommand.cpp +++ b/catchallcommand.cpp @@ -8,7 +8,6 @@ */ #include "catchallcommand.h" -#include "globaldata.hpp" //********************************************************************************************************************** vector CatchAllCommand::setParameters(){ diff --git a/clearcutcommand.h b/clearcutcommand.h index af45656..89fa1ab 100644 --- a/clearcutcommand.h +++ b/clearcutcommand.h @@ -11,7 +11,6 @@ */ #include "command.hpp" -#include "globaldata.hpp" /* Evans, J., L. Sheneman, and J.A. Foster (2006) Relaxed Neighbor-Joining: diff --git a/clustercommand.cpp b/clustercommand.cpp index cdcc6ca..25ab61b 100644 --- a/clustercommand.cpp +++ b/clustercommand.cpp @@ -149,10 +149,10 @@ ClusterCommand::ClusterCommand(string option) { //is there are current file available for either of these? //give priority to column, then phylip columnfile = m->getColumnFile(); - if (columnfile != "") { m->mothurOut("Using " + columnfile + " as input file for the column parameter."); m->mothurOutEndLine(); } + if (columnfile != "") { distfile = columnfile; format = "column"; m->mothurOut("Using " + columnfile + " as input file for the column parameter."); m->mothurOutEndLine(); } else { phylipfile = m->getPhylipFile(); - if (phylipfile != "") { m->mothurOut("Using " + phylipfile + " as input file for the phylip parameter."); m->mothurOutEndLine(); } + if (phylipfile != "") { distfile = phylipfile; format = "phylip"; m->mothurOut("Using " + phylipfile + " as input file for the phylip parameter."); m->mothurOutEndLine(); } else { m->mothurOut("No valid current files. You must provide a phylip or column file before you can use the cluster command."); m->mothurOutEndLine(); abort = true; diff --git a/collect.cpp b/collect.cpp index 8db4a28..78fd05c 100644 --- a/collect.cpp +++ b/collect.cpp @@ -80,7 +80,7 @@ try { temp->setGroup(m->Groups[i]); lookup.push_back(temp); } - + SharedCollectorsCurveData* ccd = new SharedCollectorsCurveData(); //initialize labels for output @@ -114,7 +114,7 @@ try { //get first sample individual chosen = sharedorder->get(i); int abundance; - + //set info for sharedvector in chosens group for (int j = 0; j < lookup.size(); j++) { if (chosen.group == lookup[j]->getGroup()) { @@ -141,14 +141,16 @@ try { for (int w = 0; w < lookup.size(); w++) { if ((w != k) && (w != l)) { subset.push_back(lookup[w]); } } - + ccd->updateSharedData(subset, i+1, m->Groups.size(), pair); } n++; } + //if this is a calculator that can do multiples then do them pair = false; ccd->updateSharedData(lookup, i+1, m->Groups.size(), pair); + } totalNumSeq = i+1; } @@ -177,7 +179,7 @@ try { pair = false; ccd->updateSharedData(lookup, totalNumSeq, m->Groups.size(), pair); } - + //resets output files for(int i=0;ireset(); diff --git a/collectdisplay.h b/collectdisplay.h index cf507f1..f7c8a48 100644 --- a/collectdisplay.h +++ b/collectdisplay.h @@ -30,8 +30,11 @@ public: //figure out what groups are being compared in getValues //because we randomizes the order we need to put the results in the correct column in the output file int group1Index, group2Index, pos; - group1Index = shared[0]->getGroupIndex(); - group2Index = shared[1]->getGroupIndex(); + + for (int i = 0; i < m->Groups.size(); i++) { + if (shared[0]->getGroup() == m->Groups[i]) { group1Index = i; } + if (shared[1]->getGroup() == m->Groups[i]) { group2Index = i; } + } numGroupComb = 0; int n = 1; @@ -46,7 +49,7 @@ public: } n++; } - + if ((estimate->getMultiple() == true) && all) { numGroupComb++; groupData.resize((numGroupComb*data.size()), 0); diff --git a/commandoptionparser.cpp b/commandoptionparser.cpp index c5e000b..e356afe 100644 --- a/commandoptionparser.cpp +++ b/commandoptionparser.cpp @@ -8,7 +8,6 @@ */ -#include "globaldata.hpp" #include "commandoptionparser.hpp" diff --git a/decalc.cpp b/decalc.cpp index 0b9f466..2e577d2 100644 --- a/decalc.cpp +++ b/decalc.cpp @@ -825,7 +825,9 @@ vector DeCalculator::findClosest(Sequence* querySeq, vector dists.size()) { m->mothurOut("numwanted is larger than the number of template sequences, adjusting numwanted."); m->mothurOutEndLine(); numWanted = dists.size(); } + if (numWanted > dists.size()) { + //m->mothurOut("numwanted is larger than the number of template sequences, adjusting numwanted."); m->mothurOutEndLine(); + numWanted = dists.size(); } //cout << numWanted << endl; for (int i = 0; i < numWanted; i++) { diff --git a/engine.cpp b/engine.cpp index f128c46..d595be3 100644 --- a/engine.cpp +++ b/engine.cpp @@ -469,10 +469,12 @@ bool ScriptEngine::getInput(){ if (input == "") { input = "quit()"; } - if ((!mout->gui) || (input != "quit()")) { - mout->mothurOutEndLine(); - mout->mothurOut("mothur > " + input); - mout->mothurOutEndLine(); + if (mout->gui) { + if ((input.find("quit") != string::npos) || (input.find("set.logfile") != string::npos)) {} + else if ((input.find("get.current") != string::npos) && (!mout->hasCurrentFiles())) {} + else { mout->mothurOutEndLine(); mout->mothurOut("mothur > " + input); mout->mothurOutEndLine(); } + }else{ + mout->mothurOutEndLine(); mout->mothurOut("mothur > " + input); mout->mothurOutEndLine(); } #ifdef USE_MPI diff --git a/getcurrentcommand.cpp b/getcurrentcommand.cpp index 2f67123..9289ba6 100644 --- a/getcurrentcommand.cpp +++ b/getcurrentcommand.cpp @@ -143,8 +143,10 @@ int GetCurrentCommand::execute(){ } } - m->mothurOutEndLine(); m->mothurOut("Current files saved by mothur:"); m->mothurOutEndLine(); - m->printCurrentFiles(); + if (m->hasCurrentFiles()) { + m->mothurOutEndLine(); m->mothurOut("Current files saved by mothur:"); m->mothurOutEndLine(); + m->printCurrentFiles(); + } return 0; } diff --git a/globaldata.cpp b/globaldata.cpp deleted file mode 100644 index a0b80ec..0000000 --- a/globaldata.cpp +++ /dev/null @@ -1,173 +0,0 @@ - -/* -#include "globaldata.hpp" -#include "sharedlistvector.h" -#include "inputdata.h" -#include "fullmatrix.h" - -/*******************************************************/ - -/****************************************************** -GlobalData* GlobalData::getInstance() { - if( _uniqueInstance == 0) { - _uniqueInstance = new GlobalData(); - } - return _uniqueInstance; -} -/*******************************************************/ - -/****************************************************** -// These functions give you the option parameters of the commands -string GlobalData::getPhylipFile() { return phylipfile; } -string GlobalData::getColumnFile() { return columnfile; } -string GlobalData::getListFile() { return listfile; } -string GlobalData::getRabundFile() { return rabundfile; } -string GlobalData::getSabundFile() { return sabundfile; } -string GlobalData::getNameFile() { return namefile; } -string GlobalData::getGroupFile() { return groupfile; } -string GlobalData::getOrderFile() { return orderfile; } -string GlobalData::getOrderGroupFile() { return ordergroup; } -string GlobalData::getTreeFile() { return treefile; } -string GlobalData::getSharedFile() { return sharedfile; } -string GlobalData::getRelAbundFile() { return relAbundfile; } -string GlobalData::getFormat() { return format; } - -void GlobalData::setListFile(string file) { listfile = file; inputFileName = file; } -void GlobalData::setTreeFile(string file) { treefile = file; inputFileName = file; } -void GlobalData::setRabundFile(string file) { rabundfile = file; inputFileName = file; } -void GlobalData::setSabundFile(string file) { sabundfile = file; inputFileName = file; } -void GlobalData::setPhylipFile(string file) { phylipfile = file; inputFileName = file; } -void GlobalData::setColumnFile(string file) { columnfile = file; inputFileName = file; } -void GlobalData::setGroupFile(string file) { groupfile = file; } -void GlobalData::setSharedFile(string file) { sharedfile = file; inputFileName = file; } -void GlobalData::setRelAbundFile(string file) { relAbundfile = file; inputFileName = file; } -void GlobalData::setNameFile(string file) { namefile = file; } -void GlobalData::setOrderFile(string file) { orderfile = file; } -void GlobalData::setOrderGroupFile(string file) { ordergroup = file; } -void GlobalData::setFormat(string Format) { format = Format; } - - -/*******************************************************/ - -/****************************************************** -GlobalData::GlobalData() { - m = MothurOut::getInstance(); - //option definitions should go here... - clear(); - gListVector = NULL; - gSparseMatrix = NULL; - ginput = NULL; - gorder = NULL; - glist = NULL; - gSharedList = NULL; - sabund = NULL; - rabund = NULL; - gGroupmap = NULL; - gMatrix = NULL; - gTreemap = NULL; - gSequenceDB = NULL; - nameMap = NULL; - saveNextLabel = ""; -} -/*******************************************************/ - -/****************************************************** -void GlobalData::clear() { - //option definitions should go here... - phylipfile = ""; //do we need this? - columnfile = ""; //do we need this? - listfile = ""; - rabundfile = ""; - sabundfile = ""; - namefile = ""; //do we need this? - groupfile = ""; //do we need this? - orderfile = ""; - ordergroup = ""; -// fastafile = ""; //do we need this? - treefile = ""; - sharedfile = ""; - relAbundfile = ""; - format = ""; - saveNextLabel = ""; -} - - -/*******************************************************/ - -/****************************************************** -void GlobalData::newRead() { - try{ - //remove old file names - clear(); - - //free memory - if (gGroupmap != NULL) { delete gGroupmap; gGroupmap = NULL; } - - if (gListVector != NULL) { delete gListVector; gListVector = NULL;} - - if (gSparseMatrix != NULL) { delete gSparseMatrix; gSparseMatrix = NULL; } - - if (ginput != NULL) { delete ginput; ginput = NULL;} - - if (gorder != NULL) { delete gorder; gorder = NULL; } - - if (glist != NULL) { delete glist; glist = NULL;} - - if (gSharedList != NULL) { delete gSharedList; gSharedList = NULL; } - - if (sabund != NULL) { delete sabund; sabund = NULL;} - - if (rabund != NULL) { delete rabund; rabund = NULL; } - - if (gMatrix != NULL) { delete gMatrix; gMatrix = NULL;} - - if (gTreemap != NULL) { delete gTreemap; gTreemap = NULL; } - - if (gSequenceDB != NULL) { delete gSequenceDB; gSequenceDB = NULL;} - - if (nameMap != NULL) { delete nameMap; nameMap = NULL; } - - - gTree.clear(); - Treenames.clear(); - labels.clear(); Groups.clear(); - allLines = 1; - runParse = true; - names.clear(); - } - catch(exception& e) { - m->errorOut(e, "GlobalData", "newRead"); - exit(1); - } -} - -//******************************************************/ - -/***************************************************** -GlobalData::~GlobalData() { - _uniqueInstance = 0; - try { - if (gGroupmap != NULL) { delete gGroupmap; gGroupmap = NULL; } - if (gListVector != NULL) { delete gListVector; gListVector = NULL;} - if (gSparseMatrix != NULL) { delete gSparseMatrix; gSparseMatrix = NULL; } - if (ginput != NULL) { delete ginput; ginput = NULL;} - if (gorder != NULL) { delete gorder; gorder = NULL; } - if (glist != NULL) { delete glist; glist = NULL;} - if (gSharedList != NULL) { delete gSharedList; gSharedList = NULL; } - if (sabund != NULL) { delete sabund; sabund = NULL;} - if (rabund != NULL) { delete rabund; rabund = NULL; } - if (gMatrix != NULL) { delete gMatrix; gMatrix = NULL;} - if (gTreemap != NULL) { delete gTreemap; gTreemap = NULL; } - if (gSequenceDB != NULL) { delete gSequenceDB; gSequenceDB = NULL;} - if (nameMap != NULL) { delete nameMap; nameMap = NULL; } - } - catch(exception& e) { - m->errorOut(e, "GlobalData", "~GlobalData"); - exit(1); - } -} -/*******************************************************/ - -/*******************************************************/ - - diff --git a/globaldata.hpp b/globaldata.hpp deleted file mode 100644 index 59bbac5..0000000 --- a/globaldata.hpp +++ /dev/null @@ -1,105 +0,0 @@ -#ifndef GLOBALDATA_HPP -#define GLOBALDATA_HPP -/* -#include "mothur.h" -#include "groupmap.h" -#include "treemap.h" -#include "rabundvector.hpp" -#include "sabundvector.hpp" -#include "listvector.hpp" -#include "tree.h" -#include "sparsematrix.hpp" -#include "sequencedb.h" -#include "nameassignment.hpp" - - -class ListVector; -class SharedListVector; -class SparseMatrix; -class FullMatrix; -class Tree; -class OrderVector; -class InputData; -class GroupMap; -class TreeMap; -class SAbundVector; -class RAbundVector; -class SequenceDB; - -class GlobalData { -public: - static GlobalData* getInstance(); - /*ListVector* gListVector; - //SparseMatrix* gSparseMatrix; - InputData* ginput; - OrderVector* gorder; - ListVector* glist; - vector gTree; - SharedListVector* gSharedList; - SAbundVector* sabund; - RAbundVector* rabund; - //GroupMap* gGroupmap; - FullMatrix* gMatrix; - TreeMap* gTreemap; - SequenceDB* gSequenceDB; - NameAssignment* nameMap; - string argv; //inputFileName, - bool runParse, jumble, sim; //allLines, - vector Estimators;//, Groups; //holds estimators to be used - //set labels; //holds labels to be used - vector Treenames; - map names; - string saveNextLabel; - - - /*string getPhylipFile(); - string getColumnFile(); - string getListFile(); - string getRabundFile(); - string getSabundFile(); - string getNameFile(); //do we need this? - string getGroupFile(); //do we need this? - string getOrderFile(); - string getOrderGroupFile(); - string getTreeFile(); - string getSharedFile(); - string getRelAbundFile(); - string getFormat(); //do we need this? - - - void setListFile(string); - void setTreeFile(string); - void setGroupFile(string); //do we need this? - void setPhylipFile(string); - void setColumnFile(string); - void setNameFile(string); //do we need this? - void setRabundFile(string); - void setSabundFile(string); - void setSharedFile(string); - void setRelAbundFile(string); - void setOrderFile(string file); - void setOrderGroupFile(string file); - void setFormat(string); //do we need this?*/ - - - - //void clear(); - //void clearLabels(); - //void clearAbund(); - - //void newRead(); - /* -private: - MothurOut* m; - //string phylipfile, columnfile, listfile, rabundfile, sabundfile, namefile, groupfile, orderfile, treefile, sharedfile, format, distfile, ordergroup, relAbundfile; - - static GlobalData* _uniqueInstance; - GlobalData( const GlobalData& ); // Disable copy constructor - void operator=( const GlobalData& ); // Disable assignment operator - GlobalData(); - ~GlobalData(); - - -};*/ - -#endif diff --git a/heatmapsimcommand.cpp b/heatmapsimcommand.cpp index dd8fa4c..0d3bc33 100644 --- a/heatmapsimcommand.cpp +++ b/heatmapsimcommand.cpp @@ -23,10 +23,10 @@ //********************************************************************************************************************** vector HeatMapSimCommand::setParameters(){ try { - CommandParameter pshared("shared", "InputTypes", "", "", "LRSS", "LRSS", "none",false,false); parameters.push_back(pshared); - CommandParameter pphylip("phylip", "InputTypes", "", "", "PhylipColumn", "PhylipColumn", "none",false,false); parameters.push_back(pphylip); + CommandParameter pshared("shared", "InputTypes", "", "", "PhylipColumnShared", "PhylipColumnShared", "none",false,false); parameters.push_back(pshared); + CommandParameter pphylip("phylip", "InputTypes", "", "", "PhylipColumnShared", "PhylipColumnShared", "none",false,false); parameters.push_back(pphylip); CommandParameter pname("name", "InputTypes", "", "", "none", "none", "ColumnName",false,false); parameters.push_back(pname); - CommandParameter pcolumn("column", "InputTypes", "", "", "PhylipColumn", "PhylipColumn", "ColumnName",false,false); parameters.push_back(pcolumn); + CommandParameter pcolumn("column", "InputTypes", "", "", "PhylipColumnShared", "PhylipColumnShared", "ColumnName",false,false); parameters.push_back(pcolumn); CommandParameter pgroups("groups", "String", "", "", "", "", "",false,false); parameters.push_back(pgroups); CommandParameter plabel("label", "String", "", "", "", "", "",false,false); parameters.push_back(plabel); CommandParameter pcalc("calc", "Multiple", "jabund-sorabund-jclass-sorclass-jest-sorest-thetayc-thetan-morisitahorn-braycurtis", "jest-thetayc", "", "", "",true,false); parameters.push_back(pcalc); diff --git a/helpcommand.h b/helpcommand.h index 4794a67..46393c0 100644 --- a/helpcommand.h +++ b/helpcommand.h @@ -23,8 +23,8 @@ public: vector setParameters() { return outputNames; } //dummy, doesn't really do anything string getCommandName() { return "help"; } - string getCommandCategory() { return "General"; } - string getHelpString() { return "For more information about a specific command type 'commandName(help)' i.e. 'read.dist(help)'"; } + string getCommandCategory() { return "Hidden"; } + string getHelpString() { return "For more information about a specific command type 'commandName(help)' i.e. 'cluster(help)'"; } int execute(); void help() { m->mothurOut(getHelpString()); } diff --git a/mothur.cpp b/mothur.cpp index 45be11d..67ede87 100644 --- a/mothur.cpp +++ b/mothur.cpp @@ -9,7 +9,6 @@ #include "mothur.h" #include "engine.hpp" -#include "globaldata.hpp" #include "mothurout.h" /**************************************************************************************************/ @@ -168,7 +167,7 @@ int main(int argc, char *argv[]){ if(argc>1){ input = argv[1]; - m->mothurOut("input = " + input); m->mothurOutEndLine(); + //m->mothurOut("input = " + input); m->mothurOutEndLine(); if (input[0] == '#') { m->mothurOutJustToLog("Script Mode"); @@ -215,6 +214,8 @@ int main(int argc, char *argv[]){ if (!m->gui) { outNewLog << endl << endl << "*********************************************************************************" << endl << endl; + }else { + outNewLog << endl; } outNewLog.close(); diff --git a/mothurout.cpp b/mothurout.cpp index 7309c17..8fde2fd 100644 --- a/mothurout.cpp +++ b/mothurout.cpp @@ -46,6 +46,40 @@ void MothurOut::printCurrentFiles() { exit(1); } } +/*********************************************************************************************/ +bool MothurOut::hasCurrentFiles() { + try { + bool hasCurrent = false; + + if (accnosfile != "") { return true; } + if (columnfile != "") { return true; } + if (designfile != "") { return true; } + if (fastafile != "") { return true; } + if (groupfile != "") { return true; } + if (listfile != "") { return true; } + if (namefile != "") { return true; } + if (oligosfile != "") { return true; } + if (orderfile != "") { return true; } + if (ordergroupfile != "") { return true; } + if (phylipfile != "") { return true; } + if (qualfile != "") { return true; } + if (rabundfile != "") { return true; } + if (relabundfile != "") { return true; } + if (sabundfile != "") { return true; } + if (sfffile != "") { return true; } + if (sharedfile != "") { return true; } + if (taxonomyfile != "") { return true; } + if (treefile != "") { return true; } + + return hasCurrent; + + } + catch(exception& e) { + errorOut(e, "MothurOut", "hasCurrentFiles"); + exit(1); + } +} + /*********************************************************************************************/ void MothurOut::clearCurrentFiles() { try { diff --git a/mothurout.h b/mothurout.h index 57d3f76..8138f28 100644 --- a/mothurout.h +++ b/mothurout.h @@ -141,6 +141,7 @@ class MothurOut { void setProcessors(string p) { processors = p; } void printCurrentFiles(); + bool hasCurrentFiles(); void clearCurrentFiles(); private: diff --git a/readcluster.h b/readcluster.h index eaf6b2d..a838dac 100644 --- a/readcluster.h +++ b/readcluster.h @@ -13,7 +13,6 @@ #include "mothur.h" #include "nameassignment.hpp" #include "listvector.hpp" -#include "globaldata.hpp" /******************************************************/ diff --git a/readotu.cpp b/readotu.cpp deleted file mode 100644 index 5cb52bb..0000000 --- a/readotu.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/* - * readotu.cpp - * Mothur - * - * Created by Sarah Westcott on 4/21/09. - * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved. - * - */ - -#include "readotu.h" - -/*********************************************************************** - -ReadOTUFile::ReadOTUFile(string pf): philFile(pf){ - m = MothurOut::getInstance(); - //m->openInputFile(philFile, fileHandle); -} - -/*********************************************************************** -//This function reads the list, rabund or sabund files to be used by collect and rarefact command. -void ReadOTUFile::read(GlobalData* globaldata){ - try { - - if (globaldata->getOrderFile() == "") { - //you have two inputs because in the next if statement if you only have one then it moves ahead in the same file. - //So when you run the collect or summary commands you miss a line. - input = new InputData(philFile, globaldata->getFormat()); //format tells you whether philFile is list, rabund, sabund. - inputList = new InputData(philFile, globaldata->getFormat()); //format tells you whether philFile is list, rabund, sabund. - inputSabund = new InputData(philFile, globaldata->getFormat()); //format tells you whether philFile is list, rabund, sabund or shared. - inputRabund = new InputData(philFile, globaldata->getFormat()); - }else {//there is an orderfile - input = new InputData(philFile, globaldata->getOrderFile(), globaldata->getFormat()); - } - - //memory leak prevention - //if (globaldata->ginput != NULL) { delete globaldata->ginput; } - globaldata->ginput = input; //saving to be used by collector and rarefact commands. - - if ((globaldata->getFormat() == "list") || (globaldata->getFormat() == "rabund") || (globaldata->getFormat() == "sabund")) {//you are reading a list, rabund or sabund file for collect, rarefaction or summary. - -//cout << input << '\t' << globaldata << endl; - order = input->getOrderVector(); - //memory leak prevention - - //if (globaldata->gorder != NULL) { delete globaldata->gorder; } - globaldata->gorder = order; //saving to be used by collect and rarefact commands. - sabund = inputSabund->getSAbundVector(); - //if (globaldata->sabund != NULL) { delete globaldata->sabund; } - globaldata->sabund = sabund; //saving to be used by summary command. - delete inputSabund; - - rabund = inputRabund->getRAbundVector(); - //if (globaldata->rabund != NULL) { delete globaldata->rabund; } - globaldata->rabund = rabund; //saving to be used by heatmap.bin command. - delete inputRabund; - - list = inputList->getListVector(); - //if (globaldata->gListVector != NULL) { delete globaldata->gListVector; } - globaldata->gListVector = list; - delete inputList; - - }else if (globaldata->getFormat() == "shared") { - SharedList = input->getSharedListVector(); //you are reading for collect.shared, rarefaction.shared, summary.shared, parselist command, or shared commands. - //memory leak prevention - //if (globaldata->gSharedList != NULL) { delete globaldata->gSharedList; } - globaldata->gSharedList = SharedList; - delete inputSabund; - delete inputRabund; - delete inputList; - } - } - catch(exception& e) { - m->errorOut(e, "ReadOTUFile", "read"); - exit(1); - } -} - -/*********************************************************************** - -ReadOTUFile::~ReadOTUFile(){ -// delete input; -// delete order; -} - -/***********************************************************************/ - diff --git a/readotu.h b/readotu.h deleted file mode 100644 index c2dcb99..0000000 --- a/readotu.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef READOTU_H -#define READOTU_H -/* - * readotu.h - * Mothur - * - * Created by Sarah Westcott on 4/21/09. - * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved. - * - */ - -/* - -#include "rabundvector.hpp" -#include "listvector.hpp" -#include "sharedlistvector.h" -#include "inputdata.h" -#include "globaldata.hpp" -#include "sabundvector.hpp" -#include "groupmap.h" - - -class ReadOTUFile { - -public: - ReadOTUFile(string); - ~ReadOTUFile(); - void read(GlobalData* globaldata); -private: - //ifstream fileHandle; - string philFile; - InputData* input; - InputData* inputSabund; - InputData* inputRabund; - InputData* inputList; - ListVector* list; - SharedListVector* SharedList; - OrderVector* order; - SAbundVector* sabund; - RAbundVector* rabund; - GlobalData* globaldata; - MothurOut* m; - // InputData* getInput() { return input; } -}; - -*/ -#endif diff --git a/readotucommand.h b/readotucommand.h index d1dc5b7..6b3d1e0 100644 --- a/readotucommand.h +++ b/readotucommand.h @@ -10,7 +10,6 @@ */ #include "command.hpp" -#include "readotu.h" #include "inputdata.h" #include "groupmap.h" #include "sharedcommand.h" diff --git a/sharedjest.cpp b/sharedjest.cpp index 9c53448..504dd7d 100644 --- a/sharedjest.cpp +++ b/sharedjest.cpp @@ -38,7 +38,7 @@ EstOutput Jest::getValues(vector shared) { S12 = sharedChao->getValues(shared); S1 = chaoS1->getValues(chaoS1Sabund); S2 = chaoS2->getValues(chaoS2Sabund); - + data[0] = S12[0] / (float)(S1[0] + S2[0] - S12[0]); if (isnan(data[0]) || isinf(data[0])) { data[0] = 0; } diff --git a/sharedrabundvector.cpp b/sharedrabundvector.cpp index 1440ee1..b41c5fa 100644 --- a/sharedrabundvector.cpp +++ b/sharedrabundvector.cpp @@ -60,7 +60,7 @@ SharedRAbundVector::SharedRAbundVector(string id, vector rav) : Data SharedRAbundVector::SharedRAbundVector(ifstream& f) : DataVector(), maxRank(0), numBins(0), numSeqs(0) { try { m->namesOfGroups.clear(); - + int num, inputData, count; count = 0; string holdLabel, nextLabel, groupN; @@ -122,8 +122,7 @@ SharedRAbundVector::SharedRAbundVector(ifstream& f) : DataVector(), maxRank(0), if (f.eof() != true) { f >> nextLabel; } } - - m->saveNextLabel = nextLabel; + m->saveNextLabel = nextLabel; } catch(exception& e) { diff --git a/sharedutilities.cpp b/sharedutilities.cpp index 15f16a6..f43bb81 100644 --- a/sharedutilities.cpp +++ b/sharedutilities.cpp @@ -305,7 +305,7 @@ bool SharedUtil::isValidGroup(string groupname, vector groups) { } } -/************************************************************************************** +/**************************************************************************************/ void SharedUtil::updateGroupIndex(vector& userGroups, map& index) { try { index.clear(); diff --git a/sharedutilities.h b/sharedutilities.h index 9892173..df7e8d3 100644 --- a/sharedutilities.h +++ b/sharedutilities.h @@ -28,7 +28,7 @@ class SharedUtil { void setGroups(vector&, vector&, string); //globaldata->Groups, your tree or group map, mode void setGroups(vector&, vector&, string&, int&, string); //globaldata->Groups, your tree or group map, allgroups, numGroups, mode void getCombos(vector&, vector, int&); //groupcomb, globaldata->Groups, numcomb - //void updateGroupIndex(vector&, map&); //globaldata->Groups, groupmap->groupIndex + void updateGroupIndex(vector&, map&); //globaldata->Groups, groupmap->groupIndex bool isValidGroup(string, vector); private: -- 2.39.2