objects = {
/* Begin PBXBuildFile section */
+ 372E12700F26365B0095CF7E /* readotucommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 372E126F0F26365B0095CF7E /* readotucommand.cpp */; };
+ 372E12960F263D5A0095CF7E /* readdistcommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 372E12950F263D5A0095CF7E /* readdistcommand.cpp */; };
+ 372E12C10F2648250095CF7E /* readlistcommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 372E12C00F2648250095CF7E /* readlistcommand.cpp */; };
+ 372E12ED0F264D320095CF7E /* commandfactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 372E12EC0F264D320095CF7E /* commandfactory.cpp */; };
37D928550F21331F001D4494 /* ace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37D927B80F21331F001D4494 /* ace.cpp */; };
37D928560F21331F001D4494 /* averagelinkage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37D927BA0F21331F001D4494 /* averagelinkage.cpp */; };
37D928570F21331F001D4494 /* bootstrap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37D927BB0F21331F001D4494 /* bootstrap.cpp */; };
37D9285C0F21331F001D4494 /* collect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37D927C50F21331F001D4494 /* collect.cpp */; };
37D9285D0F21331F001D4494 /* collectcommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37D927C70F21331F001D4494 /* collectcommand.cpp */; };
37D9285E0F21331F001D4494 /* collectsharedcommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37D927CB0F21331F001D4494 /* collectsharedcommand.cpp */; };
- 37D9285F0F21331F001D4494 /* commandfactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37D927CE0F21331F001D4494 /* commandfactory.cpp */; };
37D928600F21331F001D4494 /* commandoptionparser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37D927D00F21331F001D4494 /* commandoptionparser.cpp */; };
37D928610F21331F001D4494 /* completelinkage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37D927D20F21331F001D4494 /* completelinkage.cpp */; };
37D928620F21331F001D4494 /* database.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37D927D30F21331F001D4494 /* database.cpp */; };
37D9287A0F21331F001D4494 /* rarefact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37D928050F21331F001D4494 /* rarefact.cpp */; };
37D9287B0F21331F001D4494 /* rarefactcommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37D928070F21331F001D4494 /* rarefactcommand.cpp */; };
37D9287C0F21331F001D4494 /* rarefactsharedcommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37D9280A0F21331F001D4494 /* rarefactsharedcommand.cpp */; };
- 37D9287D0F21331F001D4494 /* readdistcolumnfilecommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37D9280C0F21331F001D4494 /* readdistcolumnfilecommand.cpp */; };
- 37D9287E0F21331F001D4494 /* readdistphylipfilecommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37D9280E0F21331F001D4494 /* readdistphylipfilecommand.cpp */; };
- 37D9287F0F21331F001D4494 /* readlistfilecommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37D928100F21331F001D4494 /* readlistfilecommand.cpp */; };
37D928800F21331F001D4494 /* readmatrix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37D928120F21331F001D4494 /* readmatrix.cpp */; };
- 37D928810F21331F001D4494 /* readrabundfilecommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37D928140F21331F001D4494 /* readrabundfilecommand.cpp */; };
- 37D928820F21331F001D4494 /* readsabundfilecommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37D928160F21331F001D4494 /* readsabundfilecommand.cpp */; };
- 37D928830F21331F001D4494 /* readsharedfilecommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37D928180F21331F001D4494 /* readsharedfilecommand.cpp */; };
37D928840F21331F001D4494 /* sabundvector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37D9281A0F21331F001D4494 /* sabundvector.cpp */; };
37D928850F21331F001D4494 /* sequence.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37D9281C0F21331F001D4494 /* sequence.cpp */; };
37D928860F21331F001D4494 /* shannon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37D9281E0F21331F001D4494 /* shannon.cpp */; };
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
+ 372E126E0F26365B0095CF7E /* readotucommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = readotucommand.h; sourceTree = "<group>"; };
+ 372E126F0F26365B0095CF7E /* readotucommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = readotucommand.cpp; sourceTree = "<group>"; };
+ 372E12940F263D5A0095CF7E /* readdistcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = readdistcommand.h; sourceTree = "<group>"; };
+ 372E12950F263D5A0095CF7E /* readdistcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = readdistcommand.cpp; sourceTree = "<group>"; };
+ 372E12BF0F2648250095CF7E /* readlistcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = readlistcommand.h; sourceTree = "<group>"; };
+ 372E12C00F2648250095CF7E /* readlistcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = readlistcommand.cpp; sourceTree = "<group>"; };
+ 372E12EC0F264D320095CF7E /* commandfactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = commandfactory.cpp; sourceTree = "<group>"; };
37D927B80F21331F001D4494 /* ace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ace.cpp; sourceTree = "<group>"; };
37D927B90F21331F001D4494 /* ace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ace.h; sourceTree = "<group>"; };
37D927BA0F21331F001D4494 /* averagelinkage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = averagelinkage.cpp; sourceTree = "<group>"; };
37D927CB0F21331F001D4494 /* collectsharedcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = collectsharedcommand.cpp; sourceTree = "<group>"; };
37D927CC0F21331F001D4494 /* collectsharedcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = collectsharedcommand.h; sourceTree = "<group>"; };
37D927CD0F21331F001D4494 /* command.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = command.hpp; sourceTree = "<group>"; };
- 37D927CE0F21331F001D4494 /* commandfactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = commandfactory.cpp; sourceTree = "<group>"; };
37D927CF0F21331F001D4494 /* commandfactory.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = commandfactory.hpp; sourceTree = "<group>"; };
37D927D00F21331F001D4494 /* commandoptionparser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = commandoptionparser.cpp; sourceTree = "<group>"; };
37D927D10F21331F001D4494 /* commandoptionparser.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = commandoptionparser.hpp; sourceTree = "<group>"; };
37D928090F21331F001D4494 /* rarefactioncurvedata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rarefactioncurvedata.h; sourceTree = "<group>"; };
37D9280A0F21331F001D4494 /* rarefactsharedcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rarefactsharedcommand.cpp; sourceTree = "<group>"; };
37D9280B0F21331F001D4494 /* rarefactsharedcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rarefactsharedcommand.h; sourceTree = "<group>"; };
- 37D9280C0F21331F001D4494 /* readdistcolumnfilecommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = readdistcolumnfilecommand.cpp; sourceTree = "<group>"; };
- 37D9280D0F21331F001D4494 /* readdistcolumnfilecommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = readdistcolumnfilecommand.h; sourceTree = "<group>"; };
- 37D9280E0F21331F001D4494 /* readdistphylipfilecommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = readdistphylipfilecommand.cpp; sourceTree = "<group>"; };
- 37D9280F0F21331F001D4494 /* readdistphylipfilecommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = readdistphylipfilecommand.h; sourceTree = "<group>"; };
- 37D928100F21331F001D4494 /* readlistfilecommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = readlistfilecommand.cpp; sourceTree = "<group>"; };
- 37D928110F21331F001D4494 /* readlistfilecommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = readlistfilecommand.h; sourceTree = "<group>"; };
37D928120F21331F001D4494 /* readmatrix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = readmatrix.cpp; sourceTree = "<group>"; };
37D928130F21331F001D4494 /* readmatrix.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = readmatrix.hpp; sourceTree = "<group>"; };
- 37D928140F21331F001D4494 /* readrabundfilecommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = readrabundfilecommand.cpp; sourceTree = "<group>"; };
- 37D928150F21331F001D4494 /* readrabundfilecommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = readrabundfilecommand.h; sourceTree = "<group>"; };
- 37D928160F21331F001D4494 /* readsabundfilecommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = readsabundfilecommand.cpp; sourceTree = "<group>"; };
- 37D928170F21331F001D4494 /* readsabundfilecommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = readsabundfilecommand.h; sourceTree = "<group>"; };
- 37D928180F21331F001D4494 /* readsharedfilecommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = readsharedfilecommand.cpp; sourceTree = "<group>"; };
- 37D928190F21331F001D4494 /* readsharedfilecommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = readsharedfilecommand.h; sourceTree = "<group>"; };
37D9281A0F21331F001D4494 /* sabundvector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sabundvector.cpp; sourceTree = "<group>"; };
37D9281B0F21331F001D4494 /* sabundvector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sabundvector.hpp; sourceTree = "<group>"; };
37D9281C0F21331F001D4494 /* sequence.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sequence.cpp; sourceTree = "<group>"; };
37D927C90F21331F001D4494 /* collectdisplay.h */,
37D928AC0F213420001D4494 /* containers */,
37D927CA0F21331F001D4494 /* collectorscurvedata.h */,
- 37D927CE0F21331F001D4494 /* commandfactory.cpp */,
37D927CF0F21331F001D4494 /* commandfactory.hpp */,
+ 372E12EC0F264D320095CF7E /* commandfactory.cpp */,
37D927D00F21331F001D4494 /* commandoptionparser.cpp */,
37D927D10F21331F001D4494 /* commandoptionparser.hpp */,
37D927D20F21331F001D4494 /* completelinkage.cpp */,
37D928080F21331F001D4494 /* rarefactcommand.h */,
37D9280A0F21331F001D4494 /* rarefactsharedcommand.cpp */,
37D9280B0F21331F001D4494 /* rarefactsharedcommand.h */,
- 37D9280C0F21331F001D4494 /* readdistcolumnfilecommand.cpp */,
- 37D9280D0F21331F001D4494 /* readdistcolumnfilecommand.h */,
- 37D9280E0F21331F001D4494 /* readdistphylipfilecommand.cpp */,
- 37D9280F0F21331F001D4494 /* readdistphylipfilecommand.h */,
- 37D928100F21331F001D4494 /* readlistfilecommand.cpp */,
- 37D928110F21331F001D4494 /* readlistfilecommand.h */,
- 37D928140F21331F001D4494 /* readrabundfilecommand.cpp */,
- 37D928150F21331F001D4494 /* readrabundfilecommand.h */,
- 37D928160F21331F001D4494 /* readsabundfilecommand.cpp */,
- 37D928170F21331F001D4494 /* readsabundfilecommand.h */,
- 37D928180F21331F001D4494 /* readsharedfilecommand.cpp */,
- 37D928190F21331F001D4494 /* readsharedfilecommand.h */,
+ 372E12940F263D5A0095CF7E /* readdistcommand.h */,
+ 372E12950F263D5A0095CF7E /* readdistcommand.cpp */,
+ 372E126E0F26365B0095CF7E /* readotucommand.h */,
+ 372E126F0F26365B0095CF7E /* readotucommand.cpp */,
+ 372E12BF0F2648250095CF7E /* readlistcommand.h */,
+ 372E12C00F2648250095CF7E /* readlistcommand.cpp */,
37D928260F21331F001D4494 /* sharedcommand.cpp */,
37D928270F21331F001D4494 /* sharedcommand.h */,
37D928460F21331F001D4494 /* summarycommand.cpp */,
37D9285C0F21331F001D4494 /* collect.cpp in Sources */,
37D9285D0F21331F001D4494 /* collectcommand.cpp in Sources */,
37D9285E0F21331F001D4494 /* collectsharedcommand.cpp in Sources */,
- 37D9285F0F21331F001D4494 /* commandfactory.cpp in Sources */,
37D928600F21331F001D4494 /* commandoptionparser.cpp in Sources */,
37D928610F21331F001D4494 /* completelinkage.cpp in Sources */,
37D928620F21331F001D4494 /* database.cpp in Sources */,
37D9287A0F21331F001D4494 /* rarefact.cpp in Sources */,
37D9287B0F21331F001D4494 /* rarefactcommand.cpp in Sources */,
37D9287C0F21331F001D4494 /* rarefactsharedcommand.cpp in Sources */,
- 37D9287D0F21331F001D4494 /* readdistcolumnfilecommand.cpp in Sources */,
- 37D9287E0F21331F001D4494 /* readdistphylipfilecommand.cpp in Sources */,
- 37D9287F0F21331F001D4494 /* readlistfilecommand.cpp in Sources */,
37D928800F21331F001D4494 /* readmatrix.cpp in Sources */,
- 37D928810F21331F001D4494 /* readrabundfilecommand.cpp in Sources */,
- 37D928820F21331F001D4494 /* readsabundfilecommand.cpp in Sources */,
- 37D928830F21331F001D4494 /* readsharedfilecommand.cpp in Sources */,
37D928840F21331F001D4494 /* sabundvector.cpp in Sources */,
37D928850F21331F001D4494 /* sequence.cpp in Sources */,
37D928860F21331F001D4494 /* shannon.cpp in Sources */,
37D9289D0F21331F001D4494 /* validcalculator.cpp in Sources */,
37D9289E0F21331F001D4494 /* validcommands.cpp in Sources */,
37D9289F0F21331F001D4494 /* validparameter.cpp in Sources */,
+ 372E12700F26365B0095CF7E /* readotucommand.cpp in Sources */,
+ 372E12960F263D5A0095CF7E /* readdistcommand.cpp in Sources */,
+ 372E12C10F2648250095CF7E /* readlistcommand.cpp in Sources */,
+ 372E12ED0F264D320095CF7E /* commandfactory.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
}
//saves .list file so you can do the collect, rarefaction and summary commands without doing a read.list
- globaldata->setDistFile("");
+ if (globaldata->getFormat() == "phylip") { globaldata->setPhylipFile(""); }
+ else if (globaldata->getFormat() == "column") { globaldata->setColumnFile(""); }
+
globaldata->setListFile(fileroot+ tag + ".list");
globaldata->setNameFile("");
globaldata->setFormat("list");
*/
#include "command.hpp"
-#include "readdistphylipfilecommand.h"
-#include "readdistcolumnfilecommand.h"
-#include "readlistfilecommand.h"
-#include "readrabundfilecommand.h"
-#include "readsabundfilecommand.h"
-#include "readsharedfilecommand.h"
+#include "readdistcommand.h"
+#include "readotucommand.h"
+#include "readlistcommand.h"
#include "clustercommand.h"
#include "parselistcommand.h"
-#include "sharedcommand.h"
#include "collectcommand.h"
#include "collectsharedcommand.h"
#include "rarefactcommand.h"
try {
delete command; //delete the old command
- if(commandName == "read.phylip") { command = new ReadDistPhylipFileCommand(); }
- else if(commandName == "read.column") { command = new ReadDistColumnFileCommand(); }
+ if(commandName == "read.dist") { command = new ReadDistCommand(); }
+ else if(commandName == "read.otu") { command = new ReadOtuCommand(); }
else if(commandName == "read.list") { command = new ReadListFileCommand(); }
- else if(commandName == "read.rabund") { command = new ReadRAbundFileCommand(); }
- else if(commandName == "read.sabund") { command = new ReadSAbundFileCommand(); }
- else if(commandName == "read.shared") { command = new ReadSharedFileCommand(); }
else if(commandName == "cluster") { command = new ClusterCommand(); }
else if(commandName == "help") { command = new HelpCommand(); }
else if(commandName == "quit") { command = new QuitCommand(); }
else if(commandName == "collect.single") { command = new CollectCommand(); }
- else if(commandName == "shared") { command = new SharedCommand(); }
else if(commandName == "collect.shared") { command = new CollectSharedCommand(); }
else if(commandName == "rarefaction.single") { command = new RareFactCommand(); }
else if(commandName == "rarefaction.shared") { command = new RareFactSharedCommand(); }
else if(commandName == "summary.single") { command = new SummaryCommand(); }
else if(commandName == "summary.shared") { command = new SummarySharedCommand(); }
- else if(commandName == "parselist") { command = new ParseListCommand(); }
else { command = new NoCommand(); }
return command;
validCommand = new ValidCommands();
validParameter = new ValidParameters();
validCalculator = new ValidCalculators();
- distfile = globaldata->getDistFile();
+ columnfile = globaldata->getColumnFile();
+ phylipfile = globaldata->getPhylipFile();
listfile = globaldata->getListFile();
rabundfile = globaldata->getRabundFile();
sabundfile = globaldata->getSabundFile();
//is it a valid parameter
if (validParameter->isValidParameter(parameter) != true) { return false; }
- if (parameter == "distfile" ) { distfile = value; }
+ if (parameter == "phylipfile" ) { phylipfile = value; }
+ if (parameter == "columnfile" ) { columnfile = value; }
if (parameter == "listfile" ) { listfile = value; }
if (parameter == "rabundfile" ) { rabundfile = value; }
if (parameter == "sabundfile" ) { sabundfile = value; }
//is it a valid parameter
if (validParameter->isValidParameter(parameter) != true) { return false; }
- if (parameter == "distfile" ) { distfile = value; }
+ if (parameter == "phylipfile" ) { phylipfile = value; }
+ if (parameter == "columnfile" ) { columnfile = value; }
if (parameter == "listfile" ) { listfile = value; }
if (parameter == "rabundfile" ) { rabundfile = value; }
if (parameter == "sabundfile" ) { sabundfile = value; }
//make sure the user does not use both the line and label parameters
if ((line != "") && (label != "")) { cout << "You may use either the line or label parameters, but not both." << endl; return false; }
+
- //validate files
- if (commandName == "parselist") {
- validateParseFiles(commandName);
- }
- if ((commandName == "read.phylip") || (commandName == "read.column")) {
+ if (commandName == "read.dist") {
validateReadFiles();
validateReadDist();
- }else if ((commandName == "read.list") || (commandName == "read.rabund") || (commandName == "read.sabund")){
- validateReadFiles();
- validateReadPhil(commandName);
- }else if (commandName == "read.shared") {
+ }else if (commandName == "read.otu") {
validateReadFiles();
- validateParseFiles(commandName); //checks the listfile and groupfile parameters
+ validateReadPhil();
+ }else if (commandName == "read.list") {
+ validateParseFiles(); //checks the listfile and groupfile parameters
}
//are you trying to cluster before you have read something
ifstream filehandle;
int ableToOpen;
- //are we reading a distfile
- if (distfile != "") {
- ableToOpen = openInputFile(distfile, filehandle);
+ //are we reading a phylipfile
+ if (phylipfile != "") {
+ ableToOpen = openInputFile(phylipfile, filehandle);
+ filehandle.close();
+ //unable to open
+ if (ableToOpen == 1) { errorFree = false; }
+ else { globaldata->inputFileName = phylipfile; }
+ //are we reading a phylipfile
+ }else if (columnfile != "") {
+ ableToOpen = openInputFile(columnfile, filehandle);
filehandle.close();
//unable to open
if (ableToOpen == 1) { errorFree = false; }
- else { globaldata->inputFileName = distfile; }
+ else { globaldata->inputFileName = columnfile; }
//are we reading a listfile
}else if (listfile!= "") {
ableToOpen = openInputFile(listfile, filehandle);
ifstream filehandle;
int ableToOpen;
- if (distfile == "") { cout << "When executing a read.phylip or read.column you must enter a distfile." << endl; errorFree = false; }
+ if ((phylipfile == "") && (columnfile == "")) { cout << "When executing a read.dist you must enter a phylipfile or a columnfile." << endl; errorFree = false; }
+ else if ((phylipfile != "") && (columnfile != "")) { cout << "When executing a read.dist you must enter ONLY ONE of the following: phylipfile or columnfile." << endl; errorFree = false; }
- if (commandName == "read.column") {
+ if (columnfile != "") {
if (namefile == "") {
cout << "You need to provide a namefile name if you are going to use the column format." << endl;
errorFree = false;
/******************************************************/
//This function checks to make sure the user entered appropriate
// format parameters on a parselistcommand
-void ErrorCheck::validateParseFiles(string command) {
+void ErrorCheck::validateParseFiles() {
try {
ifstream filehandle;
int ableToOpen;
//checks for valid files
- if (command == "read.shared" ) {
- if (listfile == "") { cout << "When executing a read.shared you must enter a listfile and a groupfile." << endl; errorFree = false; }
- else if (groupfile == "") { cout << "When executing a read.shared you must enter a listfile and a groupfile." << endl; errorFree = false; }
- }else if (command == "parselist" ) {
- if (listfile == "") { cout << "When executing a parselist you must enter a listfile and a groupfile." << endl; errorFree = false; }
- else if (groupfile == "") { cout << "When executing a parselist you must enter a listfile and a groupfile." << endl; errorFree = false; }
- }
-
+
+ if (listfile == "") { cout << "When executing a read.list you must enter a listfile and a groupfile." << endl; errorFree = false; }
+ else if (groupfile == "") { cout << "When executing a read.list you must enter a listfile and a groupfile." << endl; errorFree = false; }
+
//checks parameters on the read command
if (listfile != "") {
ableToOpen = openInputFile(listfile, filehandle);
/******************************************************/
//This function checks to make sure the user entered appropriate
// format parameters on a distfile read
-void ErrorCheck::validateReadPhil(string command) {
+void ErrorCheck::validateReadPhil() {
try {
ifstream filehandle;
int ableToOpen;
- //checks for valid files
- if (command == "read.list" ) {
- if (listfile == "") { cout << "When executing a read.list you must enter a listfile." << endl; errorFree = false; }
- }else if (command == "read.sabund" ) {
- if (sabundfile == "") { cout << "When executing a read.sabund you must enter a sabundfile." << endl; errorFree = false; }
- }else if (command == "read.rabund" ) {
- if (rabundfile == "") { cout << "When executing a read.rabund you must enter a rabundfile." << endl; errorFree = false; }
+ //checks to make sure only one file type is given
+ if (listfile != "") {
+ if ((rabundfile != "") || (sabundfile != "")) {
+ cout << "When executing a read.otu you must enter ONLY ONE of the following: listfile, rabundfile or sabundfile." << endl; errorFree = false; }
+ }else if (rabundfile != "") {
+ if ((listfile != "") || (sabundfile != "")) {
+ cout << "When executing a read.otu you must enter ONLY ONE of the following: listfile, rabundfile or sabundfile." << endl; errorFree = false; }
+ }else if (sabundfile != "") {
+ if ((listfile != "") || (rabundfile != "")) {
+ cout << "When executing a read.otu you must enter ONLY ONE of the following: listfile, rabundfile or sabundfile." << endl; errorFree = false; }
+ }else if ((listfile == "") && (rabundfile == "") && (sabundfile == "")) {
+ cout << "When executing a read.otu you must enter one of the following: listfile, rabundfile or sabundfile." << endl; errorFree = false;
}
//checks parameters on the read command
void ErrorCheck::clear() {
//option definitions should go here...
- distfile = "";
+ phylipfile = "";
+ columnfile = "";
listfile = "";
rabundfile = "";
sabundfile = "";
void splitAtDash(string&, set<string>&);
void validateReadFiles();
void validateReadDist();
- void validateReadPhil(string);
- void validateParseFiles(string);
+ void validateReadPhil();
+ void validateParseFiles();
void clear();
- string distfile, listfile, rabundfile, sabundfile, namefile, groupfile, orderfile, cutoff, format;
+ string phylipfile, columnfile, listfile, rabundfile, sabundfile, namefile, groupfile, orderfile, cutoff, format;
string precision, method, fileroot, label, line, iters, jumble, freq, single, rarefaction, shared, summary;
string commandName, optionText;
bool errorFree;
splitAtComma(value, optionText);
splitAtEquals(key, value);
- if (key == "distfile" ) { distfile = value; inputFileName = value; fileroot = value;}
- if (key == "listfile" ) { listfile = value; inputFileName = value; fileroot = value;}
- if (key == "rabundfile" ) { rabundfile = value; inputFileName = value; fileroot = value;}
- if (key == "sabundfile" ) { sabundfile = value; inputFileName = value; fileroot = value;}
+ if (key == "phylipfile" ) { phylipfile = value; inputFileName = value; fileroot = value; format = "phylip";}
+ if (key == "columnfile" ) { columnfile = value; inputFileName = value; fileroot = value; format = "column";}
+ if (key == "listfile" ) { listfile = value; inputFileName = value; fileroot = value; format = "list"; }
+ if (key == "rabundfile" ) { rabundfile = value; inputFileName = value; fileroot = value; format = "rabund"; }
+ if (key == "sabundfile" ) { sabundfile = value; inputFileName = value; fileroot = value; format = "sabund"; }
if (key == "namefile" ) { namefile = value; }
if (key == "orderfile" ) { orderfile = value; }
if (key == "groupfile" ) { groupfile = value; }
//saves the last parameter
value = optionText;
splitAtEquals(key, value);
- if (key == "distfile" ) { distfile = value; inputFileName = value; fileroot = value; }
- if (key == "listfile" ) { listfile = value; inputFileName = value; fileroot = value; }
- if (key == "rabundfile" ) { rabundfile = value; inputFileName = value; fileroot = value; }
- if (key == "sabundfile" ) { sabundfile = value; inputFileName = value; fileroot = value; }
+ if (key == "phylipfile" ) { phylipfile = value; inputFileName = value; fileroot = value; format = "phylip"; }
+ if (key == "columnfile" ) { columnfile = value; inputFileName = value; fileroot = value; format = "column"; }
+ if (key == "listfile" ) { listfile = value; inputFileName = value; fileroot = value; format = "list"; }
+ if (key == "rabundfile" ) { rabundfile = value; inputFileName = value; fileroot = value; format = "rabund"; }
+ if (key == "sabundfile" ) { sabundfile = value; inputFileName = value; fileroot = value; format = "sabund"; }
if (key == "namefile" ) { namefile = value; }
if (key == "orderfile" ) { orderfile = value; }
if (key == "groupfile" ) { groupfile = value; }
/******************************************************/
void GlobalData::setReadFormat(string command){
try {
- if (command == "read.phylip") {
+ if (command == "read.dist") {
clear();
- format = "phylip";
- }else if (command == "read.column") {
+ }else if (command == "read.otu") {
clear();
- format = "column";
- }else if (command == "read.list") {
- clear();
- format = "list";
- }else if (command == "read.rabund") {
- clear();
- format = "rabund";
- }else if (command == "read.sabund") {
- clear();
- format = "sabund";
}else if (command == "read.shared") {
clear();
format = "shared";
/******************************************************/
// These functions give you the option parameters of the commands
-string GlobalData::getDistFile() { return distfile; }
+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; }
void GlobalData::setListFile(string file) { listfile = file; inputFileName = file;}
void GlobalData::setRabundFile(string file) { rabundfile = file; inputFileName = file;}
void GlobalData::setSabundFile(string file) { sabundfile = file; inputFileName = file;}
-void GlobalData::setDistFile(string file) { distfile = 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::setNameFile(string file) { namefile = file; }
void GlobalData::setFormat(string Format) { format = Format; }
void GlobalData::clear() {
//option definitions should go here...
- distfile = "";
- listfile = "";///users/westcott/desktop/s.list
+ phylipfile = "";
+ columnfile = "";
+ listfile = "";
rabundfile = "";
sabundfile = "";
namefile = "";
- groupfile = ""; ///users/westcott/desktop/s.names
+ groupfile = "";
orderfile = "";
cutoff = "10.00";
format = "";
set<int> lines; //hold lines to be used
set<string> labels; //holds labels to be used
- string getDistFile();
+ string getPhylipFile();
+ string getColumnFile();
string getListFile();
string getRabundFile();
string getSabundFile();
string getJumble();
string getFreq();
void setListFile(string);
- void setDistFile(string);
+ void setPhylipFile(string);
+ void setColumnFile(string);
void setNameFile(string);
void setRabundFile(string);
void setSabundFile(string);
void splitAtDash(string&, set<string>&);
private:
- string distfile, listfile, rabundfile, sabundfile, namefile, groupfile, orderfile, line, label;
+ string phylipfile, columnfile, listfile, rabundfile, sabundfile, namefile, groupfile, orderfile, line, label;
string cutoff, format, precision, method, fileroot, iters, jumble, freq, single, rarefaction, shared, summary, sharedsummary, sharedrarefaction;
static GlobalData* _uniqueInstance;
GlobalData( const GlobalData& ); // Disable copy constructor
globaldata = GlobalData::getInstance();
- if (globaldata->helpRequest == "read.phylip") {
- cout << "The read.phylip command parameter options are distfile, namefile, cutoff and precision" << "\n";
- cout << "The read.phylip command should be in the following format: " << "\n";
- cout << "read.phylip(distfile=yourDistFile, namefile=yourNameFile, cutoff=yourCutoff, precision=yourPrecision) " << "\n";
- cout << "The distfile parameter is required. If you do not provide a cutoff value 10.00 is assumed. If you do not provide a precision value then 100 is assumed." << "\n";
- cout << "Note: No spaces between parameter labels (i.e. distfile), '=' and parameters (i.e.yourDistfile)." << "\n" << "\n";
- }else if (globaldata->helpRequest == "read.column") {
- cout << "The read.column command parameter options are distfile, namefile, cutoff and precision" << "\n";
- cout << "The read.column command should be in the following format: " << "\n";
- cout << "read.column(distfile=yourDistFile, namefile=yourNameFile, cutoff=yourCutoff, precision=yourPrecision) " << "\n";
- cout << "The distfile and namefile parameters are required. If you do not provide a cutoff value 10.00 is assumed. If you do not provide a precision value then 100 is assumed." << "\n";
+ if (globaldata->helpRequest == "read.dist") {
+ cout << "The read.dist command parameter options are phylipfile or columnfile, namefile, cutoff and precision" << "\n";
+ cout << "The read.dist command should be in the following format: " << "\n";
+ cout << "read.dist(phylipfile=yourDistFile, namefile=yourNameFile, cutoff=yourCutoff, precision=yourPrecision) " << "\n";
+ cout << "The phylipfile or columnfile parameter is required, but only one may be used. If you use a columnfile the namefile is required. " << "\n";
+ cout << "If you do not provide a cutoff value 10.00 is assumed. If you do not provide a precision value then 100 is assumed." << "\n";
cout << "Note: No spaces between parameter labels (i.e. distfile), '=' and parameters (i.e.yourDistfile)." << "\n" << "\n";
+ }else if (globaldata->helpRequest == "read.otu") {
+ cout << "The read.otu command parameter options are listfile, rabundfile, sabundfile or orderfile." << "\n";
+ cout << "The read.otu command should be in the following format: " << "\n";
+ cout << "read.otu(listfile=yourListFile, orderfile=yourOrderFile) " << "\n";
+ cout << "The read.otu requires one of hte following parameters: listfile, rabundfile or sabundfile. Only one may be used at a time." << "\n";
+ cout << "Note: No spaces between parameter labels (i.e. listfile), '=' and parameters (i.e.yourListfile)." << "\n" << "\n";
}else if (globaldata->helpRequest == "read.list") {
- cout << "The read.list command parameter options are listfile and orderfile." << "\n";
+ cout << "The read.list command parameter options are listfile and groupfile." << "\n";
cout << "The read.list command should be in the following format: " << "\n";
- cout << "read.list(listfile=yourListFile, orderfile=yourOrderFile) " << "\n";
- cout << "The listfile parameter is required." << "\n";
- cout << "Note: No spaces between parameter labels (i.e. listfile), '=' and parameters (i.e.yourListfile)." << "\n" << "\n";
- }else if (globaldata->helpRequest == "read.rabund") {
- cout << "The read.rabund command parameter options are rabundfile and orderfile." << "\n";
- cout << "The read.rabund command should be in the following format: " << "\n";
- cout << "read.rabund(rabundfile=yourRAbundFile, orderfile=yourOrderFile) " << "\n";
- cout << "The rabundfile parameter is required." << "\n";
- cout << "Note: No spaces between parameter labels (i.e. rabundfile), '=' and parameters (i.e.yourRAbundfile)." << "\n" << "\n";
- }else if (globaldata->helpRequest == "read.sabund") {
- cout << "The read.sabund command parameter options are sabundfile and orderfile." << "\n";
- cout << "The read.sabund command should be in the following format: " << "\n";
- cout << "read.sabund(sabundfile=yourSAbundFile, orderfile=yourOrderFile) " << "\n";
- cout << "The sabundfile parameter is required." << "\n";
- cout << "Note: No spaces between parameter labels (i.e. sabundfile), '=' and parameters (i.e.yourSAbundfile)." << "\n" << "\n";
- }else if (globaldata->helpRequest == "read.shared") {
- cout << "The read.shared command parameter options are listfile and groupfile." << "\n";
- cout << "The read.shared command should be in the following format: " << "\n";
- cout << "read.shared(listfile=yourListFile, groupfile=yourGroupFile) " << "\n";
+ cout << "read.list(listfile=yourListFile, groupfile=yourGroupFile) " << "\n";
cout << "The listfile parameter and groupfile paramaters are required." << "\n";
+ cout << "The read.list command parses a list file and separates it into groups." << "\n";
+ cout << "It outputs a .shared file containing the otu information for each group as well as a .list file for each group." << "\n";
cout << "Note: No spaces between parameter labels (i.e. listfile), '=' and parameters (i.e.yourListfile)." << "\n" << "\n";
}else if (globaldata->helpRequest == "cluster") {
cout << "The cluster command can only be executed after a successful read.phylip or read.column command." << "\n";
cout << "The default value for jumble is 0 (meaning don’t jumble, if it’s set to 1 then it will jumble) and sharedsummary is sharedChao-sharedAce-sharedJabund-sharedSorensonAbund-sharedJclass-sharedSorClass-sharedJest-sharedSorEst-SharedThetaYC-SharedThetaN" << "\n";
cout << "The label and line parameters are used to analyze specific lines in your input." << "\n";
cout << "Note: No spaces between parameter labels (i.e. listfile), '=' and parameters (i.e.yourListfile)." << "\n" << "\n";
- }else if (globaldata->helpRequest == "shared") {
- cout << "The shared command can only be executed after a successful read.shared command." << "\n";
- cout << "The shared command parses a list file and separates it into groups." << "\n";
- cout << "It outputs a shared file containing the otu information for each group. There are no shared command parameters." << "\n";
- cout << "The shared command should be in the following format: shared()." << "\n";
- cout << "Example shared()." << "\n";
- }else if (globaldata->helpRequest == "parselist") {
- cout << "The parselist command parses a list file and separates it into groups." << "\n";
- cout << "It outputs a list file for each group." << "\n";
- cout << "The parselist command parameter options are listfile and groupfile." << "\n";
- cout << "The parselist command should be in the following format: " << "\n";
- cout << "parselist(listfile=yourListFile, groupfile=yourGroupFile) " << "\n";
- cout << "The listfile parameter and groupfile paramater are required." << "\n";
- cout << "Note: No spaces between parameter labels (i.e. listfile), '=' and parameters (i.e.yourListfile)." << "\n" << "\n";
}else if (globaldata->helpRequest == "quit") {
cout << "The quit command will terminate Dotur and should be in the following format: " << "\n";
cout << "quit()" << "\n" << "\n";
}else if (globaldata->helpRequest == "") {
- cout << "Valid commands are read.phylip(), read.column(), read.list(), read.rabund(), read.sabund(), cluster(), collect.single(), rarefaction.single(), summary.single(), collect.shared(), rarefaction.shared(), summary.shared(), shared(), pareselist(), quit(), help()." << "\n";
+ cout << "Valid commands are read.dist(), read.list(), read.otu(), cluster(), collect.single(), rarefaction.single(), summary.single(), collect.shared(), rarefaction.shared(), summary.shared(), quit(), help()." << "\n";
cout << "For more information about a specific command type 'help(commandName)' i.e. 'help(read.phylip)'" << endl;
}else {
cout << "not a valid command" << endl;
}
//set fileroot
- if(globaldata->getFileRoot() != ""){
- fileroot = globaldata->getFileRoot();
- }
- else{
- fileroot = getRootName(globaldata->getDistFile());
- }
+ fileroot = getRootName(globaldata->getListFile());
//open output list files
for (i=0; i<groupMap->getNumGroups(); i++) {//opens an output file for each group
}
list = input->getListVector();
}
+
+ //set groupmap for .shared commands
+ globaldata->gGroupmap = groupMap;
+
return 0;
}
catch(exception& e) {
ParseListCommand::~ParseListCommand(){
delete list;
- delete groupMap;
delete input;
delete read;
}
+++ /dev/null
-#ifndef READDISTCOLUMNFILECOMMAND_H
-#define READDISTCOLUMNFILECOMMAND_H
-/*
- * readdistcolumnfilecommand.h
- * Dotur
- *
- * Created by Sarah Westcott on 1/2/09.
- * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
- *
- */
-
-#include <Carbon/Carbon.h>
-#include <iostream>
-#include <fstream>
-#include "command.hpp"
-#include "readmatrix.hpp"
-
-/* The read.column command is used to read a distance matrix file in column format.
-The read.column command parameter options are distfile, namefile, cutoff and precision.
-The read.column command should be in the following format: read.column (distfile=yourDistFile,
-namefile=yourNameFile, cutoff=yourCutoff, precision=yourPrecision). The distfile and namefile parameters are required.
-If you do not provide a cutoff value 10.00 is assumed. If you do not provide a precision value then 100 is assumed. */
-
-class NameAssignment;
-class GlobalData;
-
-
-class ReadDistColumnFileCommand : public Command {
-public:
- ReadDistColumnFileCommand();
- ~ReadDistColumnFileCommand();
- int execute();
-
-private:
- GlobalData* globaldata;
- double cutoff;
- int precision;
- ReadMatrix* read;
- string filename, format, method;
- NameAssignment* nameMap;
-};
-
-#endif
\ No newline at end of file
--- /dev/null
+/*
+ * readdistcommand.cpp
+ * Mothur
+ *
+ * Created by Sarah Westcott on 1/20/09.
+ * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
+ *
+ */
+
+#include "readdistcommand.h"
+
+ReadDistCommand::ReadDistCommand(){
+ try {
+ globaldata = GlobalData::getInstance();
+
+ filename = globaldata->inputFileName;
+ format = globaldata->getFormat();
+
+ if (format == "column") { read = new ReadColumnMatrix(filename); }
+ else if (format == "phylip") { read = new ReadPhylipMatrix(filename); }
+
+ if(globaldata->getPrecision() != ""){
+ convert(globaldata->getPrecision(), precision);
+ }
+
+ if(globaldata->getCutOff() != ""){
+ convert(globaldata->getCutOff(), cutoff);
+ cutoff += (5 / (precision * 10.0));
+ }
+ read->setCutoff(cutoff);
+
+ if(globaldata->getNameFile() != ""){
+ nameMap = new NameAssignment(globaldata->getNameFile());
+ nameMap->readMap(1,2);
+ }
+ else{
+ nameMap = NULL;
+ }
+
+ }
+ catch(exception& e) {
+ cout << "Standard Error: " << e.what() << " has occurred in the ReadDistCommand class Function ReadDistCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ exit(1);
+ }
+ catch(...) {
+ cout << "An unknown error has occurred in the ReadDistCommand class function ReadDistCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ exit(1);
+ }
+}
+
+//**********************************************************************************************************************
+ReadDistCommand::~ReadDistCommand(){
+ delete read;
+ delete nameMap;
+}
+
+//**********************************************************************************************************************
+int ReadDistCommand::execute(){
+ try {
+ read->read(nameMap);
+ globaldata->setListVector(read->getListVector());
+ globaldata->setSparseMatrix(read->getMatrix());
+ return 0;
+ }
+ catch(exception& e) {
+ cout << "Standard Error: " << e.what() << " has occurred in the ReadDistCommand class Function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ exit(1);
+ }
+ catch(...) {
+ cout << "An unknown error has occurred in the ReadDistCommand class function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ exit(1);
+ }
+}
\ No newline at end of file
--- /dev/null
+#ifndef READDISTCOMMAND_H
+#define READDISTCOMMAND_H
+/*
+ * readdistcommand.h
+ * Mothur
+ *
+ * Created by Sarah Westcott on 1/20/09.
+ * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
+ *
+ */
+
+#include <Carbon/Carbon.h>
+#include <iostream>
+#include <fstream>
+#include "command.hpp"
+#include "readmatrix.hpp"
+
+/* The read.dist command is used to read a distance matrix file.
+The read.dist command parameter options are phylipfile, columnfile, namefile, cutoff and precision.
+The read.dist command should be in the following format: read.dist(phylipfile=yourDistFile,
+namefile=yourNameFile, cutoff=yourCutoff, precision=yourPrecision). The phylipfile or columnfile are required and if you use a columnfile the namefile is required.
+If you do not provide a cutoff value 10.00 is assumed. If you do not provide a precision value then 100 is assumed. */
+
+class NameAssignment;
+class GlobalData;
+
+
+class ReadDistCommand : public Command {
+public:
+ ReadDistCommand();
+ ~ReadDistCommand();
+ int execute();
+
+private:
+ GlobalData* globaldata;
+ double cutoff;
+ int precision;
+ ReadMatrix* read;
+ string filename, format, method;
+ NameAssignment* nameMap;
+};
+
+#endif
\ No newline at end of file
+++ /dev/null
-/*
- * readdistphylipfilecommand.cpp
- * Dotur
- *
- * Created by Sarah Westcott on 1/2/09.
- * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
- *
- */
-
-#include "readdistphylipfilecommand.h"
-
-//**********************************************************************************************************************
-
-ReadDistPhylipFileCommand::ReadDistPhylipFileCommand(){
- try {
- globaldata = GlobalData::getInstance();
-
- filename = globaldata->inputFileName;
-
- format = globaldata->getFormat();
- read = new ReadPhylipMatrix(filename);
-
- if(globaldata->getPrecision() != ""){
- convert(globaldata->getPrecision(), precision);
- }
-
- if(globaldata->getCutOff() != ""){
- convert(globaldata->getCutOff(), cutoff);
- cutoff += (5 / (precision * 10.0));
- }
- read->setCutoff(cutoff);
-
- if(globaldata->getNameFile() != ""){
- nameMap = new NameAssignment(globaldata->getNameFile());
- nameMap->readMap(1,2);
- }
- else{
- nameMap = NULL;
- }
- }
- catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the ReadDistPhylipFileCommand class Function ReadDistPhylipFileCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
- catch(...) {
- cout << "An unknown error has occurred in the ReadDistPhylipFileCommand class function ReadDistPhylipFileCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
-}
-
-//**********************************************************************************************************************
-
-ReadDistPhylipFileCommand::~ReadDistPhylipFileCommand(){
- delete read;
- delete nameMap;
-}
-
-//**********************************************************************************************************************
-
-int ReadDistPhylipFileCommand::execute(){
- try {
- read->read(nameMap);
- globaldata->setListVector(read->getListVector());
- globaldata->setSparseMatrix(read->getMatrix());
- return 0;
- }
- catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the ReadDistPhylipFileCommand class Function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
- catch(...) {
- cout << "An unknown error has occurred in the ReadDistPhylipFileCommand class function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
-}
+++ /dev/null
-#ifndef READDISTPHYLIPFILECOMMAND_H
-#define READDISTPHYLIPFILECOMMAND_H
-/*
- * readdistphylipfilecommand.h
- * Dotur
- *
- * Created by Sarah Westcott on 1/2/09.
- * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
- *
- */
-
-#include <Carbon/Carbon.h>
-
-#include <iostream>
-#include <fstream>
-#include "command.hpp"
-#include "readmatrix.hpp"
-
-/* The read.phylip command is used to read a distance matrix file in phylip format.
-The read.phylip command parameter options are distfile, namefile, cutoff and precision.
-The read.phylip command should be in the following format: read.phylip(distfile=yourDistFile,
-namefile=yourNameFile, cutoff=yourCutoff, precision=yourPrecision). The distfile parameter is required.
-If you do not provide a cutoff value 10.00 is assumed. If you do not provide a precision value then 100 is assumed. */
-
-
-class NameAssignment;
-class GlobalData;
-
-
-class ReadDistPhylipFileCommand : public Command {
-public:
- ReadDistPhylipFileCommand();
- ~ReadDistPhylipFileCommand();
- int execute();
-
-private:
- GlobalData* globaldata;
- double cutoff;
- int precision;
- ReadMatrix* read;
- string filename, format, method;
- NameAssignment* nameMap;
-};
-
-#endif
\ No newline at end of file
--- /dev/null
+/*
+ * readlistcommand.h
+ * Mothur
+ *
+ * Created by Sarah Westcott on 1/20/09.
+ * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
+ *
+ */
+
+#ifndef READLISTFILECOMMAND_H
+#define READLISTFILECOMMAND_H
+/*
+ * readlistcommand.h
+ * Mothur
+ *
+ * Created by Sarah Westcott on 1/20/09.
+ * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
+ *
+ */
+
+#include <Carbon/Carbon.h>
+#include <iostream>
+#include <fstream>
+#include "command.hpp"
+#include "readmatrix.hpp"
+#include "inputdata.h"
+#include "groupmap.h"
+#include "sharedcommand.h"
+#include "parselistcommand.h"
+
+
+/* The read.list command parameter options are listfile and groupfile.
+The read.list command should be in the following format:
+read.shared(listfile=yourListFile, groupfile=yourGroupFile).
+The listfile parameter and groupfile paramaters are required. */
+
+
+class GlobalData;
+
+class ReadListFileCommand : public Command {
+public:
+ ReadListFileCommand();
+ ~ReadListFileCommand();
+ int execute();
+
+private:
+ GlobalData* globaldata;
+ Command* shared;
+ Command* parselist;
+ GroupMap* groupMap;
+ ReadMatrix* read;
+ InputData* input;
+ string filename;
+};
+
+#endif
\ No newline at end of file
+++ /dev/null
-#ifndef READLISTFILECOMMAND_H
-#define READLISTFILECOMMAND_H
-/*
- * readlistfilecommand.h
- * Dotur
- *
- * Created by Sarah Westcott on 1/2/09.
- * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
- *
- */
-
-#include <Carbon/Carbon.h>
-#include <iostream>
-#include <fstream>
-#include "command.hpp"
-#include "readmatrix.hpp"
-#include "inputdata.h"
-
-/* The read.list command parameter options are listfile and orderfile.
-The read.list command should be in the following format:
-read.list(listfile=yourListFile, orderfile=yourOrderFile). The listfile parameter is required. */
-
-class GlobalData;
-
-class ReadListFileCommand : public Command {
-public:
- ReadListFileCommand();
- ~ReadListFileCommand();
- int execute();
-
-private:
- GlobalData* globaldata;
- ReadMatrix* read;
- InputData* input;
- string filename;
-};
-
-#endif
\ No newline at end of file
--- /dev/null
+/*
+ * readotu.cpp
+ * Mothur
+ *
+ * Created by Sarah Westcott on 1/20/09.
+ * Copyright 2009 Schloss Lab UMASS AMherst. All rights reserved.
+ *
+ */
+
+#include "readotucommand.h"
+
+//**********************************************************************************************************************
+ReadOtuCommand::ReadOtuCommand(){
+ try {
+ globaldata = GlobalData::getInstance();
+ filename = globaldata->inputFileName;
+ read = new ReadPhilFile(filename);
+ }
+ catch(exception& e) {
+ cout << "Standard Error: " << e.what() << " has occurred in the ReadOtuCommand class Function ReadOtuCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ exit(1);
+ }
+ catch(...) {
+ cout << "An unknown error has occurred in the ReadOtuCommand class function ReadOtuCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ exit(1);
+ }
+}
+
+//**********************************************************************************************************************
+
+ReadOtuCommand::~ReadOtuCommand(){
+ delete read;
+}
+
+//**********************************************************************************************************************
+
+int ReadOtuCommand::execute(){
+ try {
+ read->read(&*globaldata);
+ return 0;
+ }
+ catch(exception& e) {
+ cout << "Standard Error: " << e.what() << " has occurred in the ReadOtuCommand class Function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ exit(1);
+ }
+ catch(...) {
+ cout << "An unknown error has occurred in the ReadOtuCommand class function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
\ No newline at end of file
--- /dev/null
+#ifndef READOTUCOMMAND_H
+#define READOTUCOMMAND_H
+/*
+ * readotu.h
+ * Mothur
+ *
+ * Created by Sarah Westcott on 1/20/09.
+ * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
+ *
+ */
+
+#include <Carbon/Carbon.h>
+#include <iostream>
+#include <fstream>
+#include "command.hpp"
+#include "readmatrix.hpp"
+#include "inputdata.h"
+
+/* The read.otu command parameter options are listfile, sabundfile, rabundfile and orderfile.
+The read.otu command should be in the following format:
+read.otu(listfile=yourListFile, orderfile=yourOrderFile). The listfile, sabundfile or rabundfile are required, but only one may be used. */
+
+class GlobalData;
+
+class ReadOtuCommand : public Command {
+public:
+ ReadOtuCommand();
+ ~ReadOtuCommand();
+ int execute();
+
+private:
+ GlobalData* globaldata;
+ ReadMatrix* read;
+ InputData* input;
+ string filename;
+};
+
+#endif
\ No newline at end of file
+++ /dev/null
-/*
- * readrabundfilecommand.cpp
- * Dotur
- *
- * Created by Sarah Westcott on 1/2/09.
- * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
- *
- */
-
-#include "readrabundfilecommand.h"
-
-//**********************************************************************************************************************
-ReadRAbundFileCommand::ReadRAbundFileCommand(){
- try {
- globaldata = GlobalData::getInstance();
- filename = globaldata->inputFileName;
- read = new ReadPhilFile(filename);
- }
- catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the ReadRAbundFileCommand class Function ReadRAbundFileCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
- catch(...) {
- cout << "An unknown error has occurred in the ReadRAbundFileCommand class function ReadRAbundFileCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
-}
-
-//**********************************************************************************************************************
-
-ReadRAbundFileCommand::~ReadRAbundFileCommand(){
- delete read;
-}
-
-//**********************************************************************************************************************
-
-int ReadRAbundFileCommand::execute(){
- try {
- read->read(&*globaldata);
- return 0;
- }
- catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the ReadRAbundFileCommand class Function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
- catch(...) {
- cout << "An unknown error has occurred in the ReadRAbundFileCommand class function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
-}
-//**********************************************************************************************************************
+++ /dev/null
-/*
- * readsabundfilecommand.cpp
- * Dotur
- *
- * Created by Sarah Westcott on 1/2/09.
- * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
- *
- */
-
-#include "readsabundfilecommand.h"
-
-//**********************************************************************************************************************
-ReadSAbundFileCommand::ReadSAbundFileCommand(){
- try {
- globaldata = GlobalData::getInstance();
- filename = globaldata->inputFileName;
- read = new ReadPhilFile(filename);
- }
- catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the ReadSAbundFileCommand class Function ReadSAbundFileCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
- catch(...) {
- cout << "An unknown error has occurred in the ReadSAbundFileCommand class function ReadSAbundFileCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
-}
-
-//**********************************************************************************************************************
-
-ReadSAbundFileCommand::~ReadSAbundFileCommand(){
- delete read;
-}
-
-//**********************************************************************************************************************
-
-int ReadSAbundFileCommand::execute(){
- try {
- read->read(&*globaldata);
- return 0;
- }
- catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the ReadSAbundFileCommand class Function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
- catch(...) {
- cout << "An unknown error has occurred in the ReadSAbundFileCommand class function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
-}
-//**********************************************************************************************************************
+++ /dev/null
-#ifndef READSABUNDFILECOMMAND_H
-#define READSABUNDFILECOMMAND_H
-/*
- * readsabundfilecommand.h
- * Dotur
- *
- * Created by Sarah Westcott on 1/2/09.
- * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
- *
- */
-
-#include <Carbon/Carbon.h>
-#include <iostream>
-#include <fstream>
-#include "command.hpp"
-#include "readmatrix.hpp"
-#include "inputdata.h"
-
-/* The read.sabund command parameter options are sabundfile and orderfile.
-The read.sabund command should be in the following format:
-read.sabund(sabundfile=yourSabundFile, orderfile=yourOrderFile). The sabundfile parameter is required.*/
-
-class GlobalData;
-
-class ReadSAbundFileCommand : public Command {
-public:
- ReadSAbundFileCommand();
- ~ReadSAbundFileCommand();
- int execute();
-
-private:
- GlobalData* globaldata;
- ReadMatrix* read;
- InputData* input;
- string filename;
-};
-
-#endif
\ No newline at end of file
ValidCommands::ValidCommands() {
try {
- commands["read.phylip"] = "read.phylip";
- commands["read.column"] = "read.column";
+ commands["read.dist"] = "read.dist";
+ commands["read.otu"] = "read.otu";
commands["read.list"] = "read.list";
- commands["read.rabund"] = "read.rabund";
- commands["read.sabund"] = "read.sabund";
- commands["read.shared"] = "read.shared";
commands["cluster"] = "cluster";
commands["help"] = "help";
commands["quit"] = "quit";
commands["collect.single"] = "collect.single";
- commands["shared"] = "shared";
commands["collect.shared"] = "collect.shared";
commands["rarefaction.single"] = "rarefaction.single";
commands["rarefaction.shared"] = "rarefaction.shared";
commands["summary.single"] = "summary.single";
commands["summary.shared"] = "summary.shared";
- commands["parselist"] = "parselist";
-
+
}
catch(exception& e) {
cout << "Standard Error: " << e.what() << " has occurred in the ValidCommands class Function ValidCommands. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
if ((commands.find(command)) != (commands.end())) {
return true;
}else{
- cout << command << " is not a valid command in Mothur. Valid commands are read.phylip(), read.column(), read.list(), read.rabund(), read.sabund(), read.shared(), cluster(), collect.single(), collect.shared(), parselist(), shared(), rarefaction.single(), rarefaction.shared(), summary.single(), summary.shared(), quit(), help()." << endl;
+ cout << command << " is not a valid command in Mothur. Valid commands are read.dist(), read.list(), cluster(), collect.single(), collect.shared(), rarefaction.single(), rarefaction.shared(), summary.single(), summary.shared(), quit(), help()." << endl;
return false;
}
ValidParameters::ValidParameters() {
try {
- parameters["distfile"] = "distfile";
+ parameters["phylipfile"] = "phylipfile";
+ parameters["columnfile"] = "columnfile";
parameters["listfile"] = "listfile";
parameters["rabundfile"] = "rabundfile";
parameters["sabundfile"] = "sabundfile";