]> git.donarmstrong.com Git - mothur.git/commitdiff
1.18.1
authorwestcott <westcott>
Fri, 15 Apr 2011 15:25:08 +0000 (15:25 +0000)
committerwestcott <westcott>
Fri, 15 Apr 2011 15:25:08 +0000 (15:25 +0000)
25 files changed:
Mothur.xcodeproj/project.pbxproj
catchallcommand.cpp
clearcutcommand.h
clustercommand.cpp
collect.cpp
collectdisplay.h
commandoptionparser.cpp
decalc.cpp
engine.cpp
getcurrentcommand.cpp
globaldata.cpp [deleted file]
globaldata.hpp [deleted file]
heatmapsimcommand.cpp
helpcommand.h
mothur.cpp
mothurout.cpp
mothurout.h
readcluster.h
readotu.cpp [deleted file]
readotu.h [deleted file]
readotucommand.h
sharedjest.cpp
sharedrabundvector.cpp
sharedutilities.cpp
sharedutilities.h

index dbe9347e33ebe48637d991f4b31bff75091dfc98..6bc5e178281bbdc2a993986280a9a366864c07eb 100644 (file)
                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 */; };
                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 */; };
                A7E9B70912D37EC400DA6239 /* getseqscommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getseqscommand.h; sourceTree = "<group>"; };
                A7E9B70A12D37EC400DA6239 /* getsharedotucommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = getsharedotucommand.cpp; sourceTree = "<group>"; };
                A7E9B70B12D37EC400DA6239 /* getsharedotucommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getsharedotucommand.h; sourceTree = "<group>"; };
-               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 = "<group>"; };
                A7E9B70F12D37EC400DA6239 /* goodscoverage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = goodscoverage.h; sourceTree = "<group>"; };
                A7E9B71012D37EC400DA6239 /* gotohoverlap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = gotohoverlap.cpp; sourceTree = SOURCE_ROOT; };
                A7E9B7B612D37EC400DA6239 /* readdistcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = readdistcommand.cpp; sourceTree = "<group>"; };
                A7E9B7B712D37EC400DA6239 /* readdistcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = readdistcommand.h; sourceTree = "<group>"; };
                A7E9B7B812D37EC400DA6239 /* readmatrix.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = readmatrix.hpp; sourceTree = "<group>"; };
-               A7E9B7B912D37EC400DA6239 /* readotu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = readotu.cpp; sourceTree = "<group>"; };
-               A7E9B7BA12D37EC400DA6239 /* readotu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = readotu.h; sourceTree = "<group>"; };
                A7E9B7BB12D37EC400DA6239 /* readotucommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = readotucommand.cpp; sourceTree = "<group>"; };
                A7E9B7BC12D37EC400DA6239 /* readotucommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = readotucommand.h; sourceTree = "<group>"; };
                A7E9B7BD12D37EC400DA6239 /* readphylip.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = readphylip.cpp; sourceTree = "<group>"; };
                                A7E9B6DB12D37EC400DA6239 /* engine.hpp */,
                                A7E9B6E012D37EC400DA6239 /* fileoutput.cpp */,
                                A7E9B6E112D37EC400DA6239 /* fileoutput.h */,
-                               A7E9B70C12D37EC400DA6239 /* globaldata.cpp */,
-                               A7E9B70D12D37EC400DA6239 /* globaldata.hpp */,
                                A7E9B71112D37EC400DA6239 /* gotohoverlap.hpp */,
                                A7E9B71012D37EC400DA6239 /* gotohoverlap.cpp */,
                                A7E9B71812D37EC400DA6239 /* hcluster.cpp */,
                                A7E9B7B412D37EC400DA6239 /* readcolumn.cpp */,
                                A7E9B7B512D37EC400DA6239 /* readcolumn.h */,
                                A7E9B7B812D37EC400DA6239 /* readmatrix.hpp */,
-                               A7E9B7BA12D37EC400DA6239 /* readotu.h */,
-                               A7E9B7B912D37EC400DA6239 /* readotu.cpp */,
                                A7E9B7BD12D37EC400DA6239 /* readphylip.cpp */,
                                A7E9B7BE12D37EC400DA6239 /* readphylip.h */,
                                A7E9B7BF12D37EC400DA6239 /* readtree.cpp */,
                                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 */,
                                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 */,
index 3effaf4eaafe09659252e6f93fa81f31dcc4e1db..1e89cdcca0d5230867356d37f8c6404a98639da6 100644 (file)
@@ -8,7 +8,6 @@
  */
 
 #include "catchallcommand.h"
-#include "globaldata.hpp"
 
 //**********************************************************************************************************************
 vector<string> CatchAllCommand::setParameters(){       
index af456566b241a5592b710c01d7d0486090c80705..89fa1ab81b8c36f552439da56af1f3706bfe19db 100644 (file)
@@ -11,7 +11,6 @@
  */
 
 #include "command.hpp"
-#include "globaldata.hpp"
 
 /* 
   Evans, J., L. Sheneman, and J.A. Foster (2006) Relaxed Neighbor-Joining: 
index cdcc6ca9745d8bdf3509c3505ef5c15dc61fd991..25ab61b9f7068f7d5a36df3bd2e4596fd0905078 100644 (file)
@@ -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;
index 8db4a28c5d33661741916e0d7560be470fd97ab2..78fd05c0c9470117b9750096cbdf8a8a5a6a15f3 100644 (file)
@@ -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;i<displays.size();i++){
                         displays[i]->reset();
index cf507f16a7d3ce960b3393ed1c751312c08b2094..f7c8a4888f68949fe5a5a6c8b38dcc0ad375992d 100644 (file)
@@ -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);
index c5e000be7542716f46e24cbd20d2a81c0184e9a6..e356afe5c74972e5298ddfa87a0672c97c4facfe 100644 (file)
@@ -8,7 +8,6 @@
  */
 
 
-#include "globaldata.hpp"
 #include "commandoptionparser.hpp"
 
 
index 0b9f466a55e3e42175260468713d34702d8d2831..2e577d2275edbd3212dfc064307d7c144c9ab469 100644 (file)
@@ -825,7 +825,9 @@ vector<Sequence*> DeCalculator::findClosest(Sequence* querySeq, vector<Sequence*
                        i++;
                }
 
-               if (numWanted > 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++) {
index f128c4684040346110d519c56f45c9506e953866..d595be332eed785c27037710396d1a7dd46c845e 100644 (file)
@@ -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
index 2f67123a88c9795c362fac6cc4a428fc8e961d46..9289ba6da677a6e91f989a3b15c5f407d32ce3f8 100644 (file)
@@ -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 (file)
index a0b80ec..0000000
+++ /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 (file)
index 59bbac5..0000000
+++ /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<Tree*> 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<string>  Estimators;//, Groups; //holds estimators to be used
-       //set<string> labels; //holds labels to be used
-       vector<string> Treenames;
-       map<string, string> 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
index dd8fa4c7ecf647f4cc3ab9b8657cb7c3f019d1ac..0d3bc33e2e406e1a811598fee620a92f3cedc3e2 100644 (file)
 //**********************************************************************************************************************
 vector<string> 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);
index 4794a67a8ca3dc8ed542534070910385d549bd15..46393c020c0a0074525b3df80eb7dade0f8cfa3b 100644 (file)
@@ -23,8 +23,8 @@ public:
        
        vector<string> 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()); }  
index 45be11d8adbb0a74fa5412298e803991f1877fd9..67ede87039d783c71a40a0317d3a1ccbffdc7b97 100644 (file)
@@ -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();
                                
index 7309c174c83027437e67026869f53161101e11bc..8fde2fd105d2b100715cc244a6d9a16bbd9eb353 100644 (file)
@@ -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 {
index 57d3f7647dabf43dd30f2caeefa9ae2bd09a0d30..8138f28e46115b8d527270a80d904e68ebbc322a 100644 (file)
@@ -141,6 +141,7 @@ class MothurOut {
                void setProcessors(string p)            { processors = p;                                                       }
                
                void printCurrentFiles();
+               bool hasCurrentFiles();
                void clearCurrentFiles();
                
        private:
index eaf6b2dbb2bb422b67d6ffe55b3a1c854f7196d4..a838dace17f35547421c03b0dfc8dcc6efdc2317 100644 (file)
@@ -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 (file)
index 5cb52bb..0000000
+++ /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 (file)
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
index d1dc5b7fc73726b09d9dce49a71015c0f70d70da..6b3d1e0ed3ec709181f78ee8428db2ff273c88d1 100644 (file)
@@ -10,7 +10,6 @@
  */
 
 #include "command.hpp"
-#include "readotu.h"
 #include "inputdata.h"
 #include "groupmap.h"
 #include "sharedcommand.h"
index 9c53448e0edb44478bd47c6cebd6fea68ea2d0b9..504dd7d605d7d06193c4596841975b0a8f801086 100644 (file)
@@ -38,7 +38,7 @@ EstOutput Jest::getValues(vector<SharedRAbundVector*> 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; }
index 1440ee1135dfac48dfef52a7d47df39c56264eaa..b41c5fafa40255b1535526f79c2ce1c5dc637a43 100644 (file)
@@ -60,7 +60,7 @@ SharedRAbundVector::SharedRAbundVector(string id, vector<individual> 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) {
index 15f16a6f1942921ca41098dd502750d68c75ce3e..f43bb8107f3ec05ef462bcbb491283706c6a9730 100644 (file)
@@ -305,7 +305,7 @@ bool SharedUtil::isValidGroup(string groupname, vector<string> groups) {
        }
 }
 
-/**************************************************************************************
+/**************************************************************************************/
 void SharedUtil::updateGroupIndex(vector<string>& userGroups, map<string, int>& index) {
        try {
                index.clear();
index 9892173ff293590223ae285304402a55981bdac8..df7e8d3091d811285f15cb49402053ec09a4f535 100644 (file)
@@ -28,7 +28,7 @@ class SharedUtil {
                void setGroups(vector<string>&, vector<string>&, string);  //globaldata->Groups, your tree or group map, mode
                void setGroups(vector<string>&, vector<string>&, string&, int&, string);  //globaldata->Groups, your tree or group map, allgroups, numGroups, mode
                void getCombos(vector<string>&, vector<string>, int&); //groupcomb, globaldata->Groups, numcomb
-               //void updateGroupIndex(vector<string>&, map<string, int>&); //globaldata->Groups, groupmap->groupIndex
+               void updateGroupIndex(vector<string>&, map<string, int>&); //globaldata->Groups, groupmap->groupIndex
                bool isValidGroup(string, vector<string>);
                
        private: