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 */,
*/
#include "catchallcommand.h"
-#include "globaldata.hpp"
//**********************************************************************************************************************
vector<string> CatchAllCommand::setParameters(){
*/
#include "command.hpp"
-#include "globaldata.hpp"
/*
Evans, J., L. Sheneman, and J.A. Foster (2006) Relaxed Neighbor-Joining:
//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;
temp->setGroup(m->Groups[i]);
lookup.push_back(temp);
}
-
+
SharedCollectorsCurveData* ccd = new SharedCollectorsCurveData();
//initialize labels for output
//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()) {
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;
}
pair = false;
ccd->updateSharedData(lookup, totalNumSeq, m->Groups.size(), pair);
}
-
+
//resets output files
for(int i=0;i<displays.size();i++){
displays[i]->reset();
//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;
}
n++;
}
-
+
if ((estimate->getMultiple() == true) && all) {
numGroupComb++;
groupData.resize((numGroupComb*data.size()), 0);
*/
-#include "globaldata.hpp"
#include "commandoptionparser.hpp"
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++) {
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
}
}
- 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;
}
+++ /dev/null
-
-/*
-#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);
- }
-}
-/*******************************************************/
-
-/*******************************************************/
-
-
+++ /dev/null
-#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
//**********************************************************************************************************************
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);
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()); }
#include "mothur.h"
#include "engine.hpp"
-#include "globaldata.hpp"
#include "mothurout.h"
/**************************************************************************************************/
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");
if (!m->gui) {
outNewLog << endl << endl << "*********************************************************************************" << endl << endl;
+ }else {
+ outNewLog << endl;
}
outNewLog.close();
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 {
void setProcessors(string p) { processors = p; }
void printCurrentFiles();
+ bool hasCurrentFiles();
void clearCurrentFiles();
private:
#include "mothur.h"
#include "nameassignment.hpp"
#include "listvector.hpp"
-#include "globaldata.hpp"
/******************************************************/
+++ /dev/null
-/*
- * 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;
-}
-
-/***********************************************************************/
-
+++ /dev/null
-#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
*/
#include "command.hpp"
-#include "readotu.h"
#include "inputdata.h"
#include "groupmap.h"
#include "sharedcommand.h"
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; }
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;
if (f.eof() != true) { f >> nextLabel; }
}
-
- m->saveNextLabel = nextLabel;
+ m->saveNextLabel = nextLabel;
}
catch(exception& e) {
}
}
-/**************************************************************************************
+/**************************************************************************************/
void SharedUtil::updateGroupIndex(vector<string>& userGroups, map<string, int>& index) {
try {
index.clear();
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: