globaldata = GlobalData::getInstance();
abort = false;
allLines = 1;
- lines.clear();
labels.clear();
//allow user to run help
else {
//valid paramters for this command
- string AlignArray[] = {"fasta","line","label","name", "group"};
+ string AlignArray[] = {"fasta","label","name", "group"};
vector<string> myArray (AlignArray, AlignArray+(sizeof(AlignArray)/sizeof(string)));
OptionParser parser(option);
//check for optional parameter and set defaults
// ...at some point should added some additional type checking...
- line = validParameter.validFile(parameters, "line", false);
- if (line == "not found") { line = ""; }
- else {
- if(line != "all") { splitAtDash(line, lines); allLines = 0; }
- else { allLines = 1; }
- }
label = validParameter.validFile(parameters, "label", false);
if (label == "not found") { label = ""; }
else { allLines = 1; }
}
- //make sure user did not use both the line and label parameters
- if ((line != "") && (label != "")) { mothurOut("You cannot use both the line and label parameters at the same time. "); mothurOutEndLine(); abort = true; }
- //if the user has not specified any line or labels use the ones from read.otu
- else if ((line == "") && (label == "")) {
+ //if the user has not specified any labels use the ones from read.otu
+ if (label == "") {
allLines = globaldata->allLines;
labels = globaldata->labels;
- lines = globaldata->lines;
}
namesfile = validParameter.validFile(parameters, "name", true);
void BinSeqCommand::help(){
try {
mothurOut("The bin.seqs command can only be executed after a successful read.otu command of a listfile.\n");
- mothurOut("The bin.seqs command parameters are fasta, name, line, label and group. The fasta parameter is required, and you may not use line and label at the same time.\n");
- mothurOut("The line and label allow you to select what distance levels you would like a output files created for, and are separated by dashes.\n");
- mothurOut("The bin.seqs command should be in the following format: bin.seqs(fasta=yourFastaFile, name=yourNamesFile, group=yourGroupFile, line=yourLines, label=yourLabels).\n");
- mothurOut("Example bin.seqs(fasta=amazon.fasta, group=amazon.groups, line=1-3-5, name=amazon.names).\n");
- mothurOut("The default value for line and label are all lines in your inputfile.\n");
+ mothurOut("The bin.seqs command parameters are fasta, name, label and group. The fasta parameter is required.\n");
+ mothurOut("The label parameter allows you to select what distance levels you would like a output files created for, and are separated by dashes.\n");
+ mothurOut("The bin.seqs command should be in the following format: bin.seqs(fasta=yourFastaFile, name=yourNamesFile, group=yourGroupFile, label=yourLabels).\n");
+ mothurOut("Example bin.seqs(fasta=amazon.fasta, group=amazon.groups, name=amazon.names).\n");
+ mothurOut("The default value for label is all lines in your inputfile.\n");
mothurOut("The bin.seqs command outputs a .fasta file for each distance you specify appending the OTU number to each name.\n");
mothurOut("If you provide a groupfile, then it also appends the sequences group to the name.\n");
mothurOut("Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFastaFile).\n\n");
try {
if (abort == true) { return 0; }
- int count = 1;
int error = 0;
//read fastafile
//if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
set<string> processedLabels;
set<string> userLabels = labels;
- set<int> userLines = lines;
- while((list != NULL) && ((allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
+ while((list != NULL) && ((allLines == 1) || (userLabels.size() != 0))) {
- if(allLines == 1 || lines.count(count) == 1 || labels.count(list->getLabel()) == 1){
+ if(allLines == 1 || labels.count(list->getLabel()) == 1){
error = process(list);
if (error == 1) { return 0; }
processedLabels.insert(list->getLabel());
userLabels.erase(list->getLabel());
- userLines.erase(count);
}
if ((anyLabelsToProcess(list->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLabel) != 1)) {
processedLabels.insert(list->getLabel());
userLabels.erase(list->getLabel());
-
}
lastLabel = list->getLabel();
delete list;
list = input->getListVector();
- count++;
}
}
}
- //run last line if you need to
+ //run last label if you need to
if (needToRun == true) {
if (list != NULL) { delete list; }
list = input->getListVector(lastLabel);
FastaMap* fasta;
GroupMap* groupMap;
bool abort, allLines;
- set<int> lines; //hold lines to be used
set<string> labels; //holds labels to be used
- string filename, fastafile, namesfile, groupfile, line, label;
+ string filename, fastafile, namesfile, groupfile, label;
ofstream out;
ifstream in, inNames;
globaldata = GlobalData::getInstance();
abort = false;
allLines = 1;
- lines.clear();
labels.clear();
Groups.clear();
Estimators.clear();
else {
//valid paramters for this command
- string Array[] = {"line","label","calc","groups","iters"};
+ string Array[] = {"label","calc","groups","iters"};
vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
OptionParser parser(option);
//check for optional parameter and set defaults
// ...at some point should added some additional type checking...
- line = validParameter.validFile(parameters, "line", false);
- if (line == "not found") { line = ""; }
- else {
- if(line != "all") { splitAtDash(line, lines); allLines = 0; }
- else { allLines = 1; }
- }
-
label = validParameter.validFile(parameters, "label", false);
if (label == "not found") { label = ""; }
else {
else { allLines = 1; }
}
- //make sure user did not use both the line and label parameters
- if ((line != "") && (label != "")) { mothurOut("You cannot use both the line and label parameters at the same time. "); mothurOutEndLine(); abort = true; }
- //if the user has not specified any line or labels use the ones from read.otu
- else if((line == "") && (label == "")) {
+ //if the user has not specified any labels use the ones from read.otu
+ if(label == "") {
allLines = globaldata->allLines;
labels = globaldata->labels;
- lines = globaldata->lines;
}
groups = validParameter.validFile(parameters, "groups", false);
void BootSharedCommand::help(){
try {
mothurOut("The bootstrap.shared command can only be executed after a successful read.otu command.\n");
- mothurOut("The bootstrap.shared command parameters are groups, calc, iters, line and label. You may not use line and label at the same time.\n");
+ mothurOut("The bootstrap.shared command parameters are groups, calc, iters and label.\n");
mothurOut("The groups parameter allows you to specify which of the groups in your groupfile you would like included used.\n");
- mothurOut("The group names are separated by dashes. The line and label allow you to select what distance levels you would like trees created for, and are also separated by dashes.\n");
- mothurOut("The bootstrap.shared command should be in the following format: bootstrap.shared(groups=yourGroups, calc=yourCalcs, line=yourLines, label=yourLabels, iters=yourIters).\n");
- mothurOut("Example bootstrap.shared(groups=A-B-C, line=1-3-5, calc=jabund-sorabund, iters=100).\n");
+ mothurOut("The group names are separated by dashes. The label parameter allows you to select what distance levels you would like trees created for, and is also separated by dashes.\n");
+ mothurOut("The bootstrap.shared command should be in the following format: bootstrap.shared(groups=yourGroups, calc=yourCalcs, label=yourLabels, iters=yourIters).\n");
+ mothurOut("Example bootstrap.shared(groups=A-B-C, calc=jabund-sorabund, iters=100).\n");
mothurOut("The default value for groups is all the groups in your groupfile.\n");
mothurOut("The default value for calc is jclass-thetayc. The default for iters is 1000.\n");
}
if (abort == true) { return 0; }
- int count = 1;
util = new SharedUtil();
//read first line
//if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
set<string> processedLabels;
set<string> userLabels = labels;
- set<int> userLines = lines;
//set users groups
util->setGroups(globaldata->Groups, globaldata->gGroupmap->namesOfGroups, "treegroup");
tmap->makeSim(globaldata->gGroupmap);
globaldata->gTreemap = tmap;
- while((order != NULL) && ((allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
+ while((order != NULL) && ((allLines == 1) || (userLabels.size() != 0))) {
- if(allLines == 1 || lines.count(count) == 1 || labels.count(order->getLabel()) == 1){
+ if(allLines == 1 || labels.count(order->getLabel()) == 1){
mothurOut(order->getLabel()); mothurOutEndLine();
process(order);
processedLabels.insert(order->getLabel());
userLabels.erase(order->getLabel());
- userLines.erase(count);
}
- //you have a label the user want that is smaller than this line and the last line has not already been processed
+ //you have a label the user want that is smaller than this label and the last label has not already been processed
if ((anyLabelsToProcess(order->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLabel) != 1)) {
delete order;
//get next line to process
delete order;
order = input->getSharedOrderVector();
- count++;
}
//output error messages about any remaining user labels
}
-
-
//reset groups parameter
globaldata->Groups.clear();
vector<SharedRAbundVector*> lookup;
bool abort, allLines;
- set<int> lines; //hold lines to be used
set<string> labels; //holds labels to be used
- string outputFile, calc, groups, line, label;
+ string outputFile, calc, groups, label;
int numGroups, iters;
vector<string> Estimators, Groups; //holds estimators to be used
totalNumSeq = i+1;
}
- //calculate last line if you haven't already
+ //calculate last label if you haven't already
if(numSeqs % increment != 0){
//how many comparisons to make i.e. for group a, b, c = ab, ac, bc.
int n = 1;
globaldata = GlobalData::getInstance();
abort = false;
allLines = 1;
- lines.clear();
labels.clear();
Estimators.clear();
else {
//valid paramters for this command
- string Array[] = {"freq","line","label","calc","abund","size"};
+ string Array[] = {"freq","label","calc","abund","size"};
vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
OptionParser parser(option);
//check for optional parameter and set defaults
// ...at some point should added some additional type checking...
- line = validParameter.validFile(parameters, "line", false);
- if (line == "not found") { line = ""; }
- else {
- if(line != "all") { splitAtDash(line, lines); allLines = 0; }
- else { allLines = 1; }
- }
-
label = validParameter.validFile(parameters, "label", false);
if (label == "not found") { label = ""; }
else {
else { allLines = 1; }
}
- //make sure user did not use both the line and label parameters
- if ((line != "") && (label != "")) { mothurOut("You cannot use both the line and label parameters at the same time. "); mothurOutEndLine(); abort = true; }
- //if the user has not specified any line or labels use the ones from read.otu
- else if((line == "") && (label == "")) {
+ //if the user has not specified any labels use the ones from read.otu
+ if (label == "") {
allLines = globaldata->allLines;
labels = globaldata->labels;
- lines = globaldata->lines;
}
calc = validParameter.validFile(parameters, "calc", false);
try {
mothurOut("The collect.single command can only be executed after a successful read.otu command. WITH ONE EXECEPTION. \n");
mothurOut("The collect.single command can be executed after a successful cluster command. It will use the .list file from the output of the cluster.\n");
- mothurOut("The collect.single command parameters are label, line, freq, calc and abund. No parameters are required, but you may not use \n");
- mothurOut("both the line and label parameters at the same time. The collect.single command should be in the following format: \n");
- mothurOut("collect.single(label=yourLabel, line=yourLines, iters=yourIters, freq=yourFreq, calc=yourEstimators).\n");
- mothurOut("Example collect(label=unique-.01-.03, line=0-5-10, iters=10000, freq=10, calc=sobs-chao-ace-jack).\n");
+ mothurOut("The collect.single command parameters are label, freq, calc and abund. No parameters are required. \n");
+ mothurOut("The collect.single command should be in the following format: \n");
+ mothurOut("collect.single(label=yourLabel, iters=yourIters, freq=yourFreq, calc=yourEstimators).\n");
+ mothurOut("Example collect(label=unique-.01-.03, iters=10000, freq=10, calc=sobs-chao-ace-jack).\n");
mothurOut("The default values for freq is 100, and calc are sobs-chao-ace-jack-shannon-npshannon-simpson.\n");
validCalculator->printCalc("single", cout);
- mothurOut("The label and line parameters are used to analyze specific lines in your input.\n");
+ mothurOut("The label parameter is used to analyze specific labels in your input.\n");
mothurOut("Note: No spaces between parameter labels (i.e. freq), '=' and parameters (i.e.yourFreq).\n\n");
}
catch(exception& e) {
try {
if (abort == true) { return 0; }
-
- int count = 1;
//if the users entered no valid calculators don't execute command
if (cDisplays.size() == 0) { return 0; }
//if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
set<string> processedLabels;
set<string> userLabels = labels;
- set<int> userLines = lines;
- while((order != NULL) && ((allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
+ while((order != NULL) && ((allLines == 1) || (userLabels.size() != 0))) {
- if(allLines == 1 || lines.count(count) == 1 || labels.count(order->getLabel()) == 1){
+ if(allLines == 1 || labels.count(order->getLabel()) == 1){
cCurve = new Collect(order, cDisplays);
cCurve->getCurve(freq);
mothurOut(order->getLabel()); mothurOutEndLine();
processedLabels.insert(order->getLabel());
userLabels.erase(order->getLabel());
- userLines.erase(count);
- //you have a label the user want that is smaller than this line and the last line has not already been processed
- }
+ }
+ //you have a label the user want that is smaller than this label and the last label has not already been processed
if ((anyLabelsToProcess(order->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLabel) != 1)) {
delete order;
delete order;
order = (input->getOrderVector());
- count++;
}
//output error messages about any remaining user labels
}
}
- //run last line if you need to
+ //run last label if you need to
if (needToRun == true) {
if (order != NULL) { delete order; }
order = (input->getOrderVector(lastLabel));
The collect command generates a collector's curve from the given file.
The collect command can only be executed after a successful read.list, read.sabund or read.rabund command, with one exception.
The collect command can be executed after a successful cluster command. It will use the .list file from the output of the cluster.
- The collect command outputs a file for each estimator you choose to use. The collect command parameters are label, line, freq, single, abund.
- No parameters are required, but you may not use both the line and label parameters at the same time.
- The collect command should be in the following format: collect(label=yourLabel, line=yourLines, freq=yourFreq, single=yourEstimators, abund=yourAbund).
- example collect(label=unique-.01-.03, line=0,5,10, freq=10, single=collect-chao-ace-jack).
+ The collect command outputs a file for each estimator you choose to use. The collect command parameters are label, freq, single, abund.
+ No parameters are required.
+ The collect command should be in the following format: collect(label=yourLabel, freq=yourFreq, single=yourEstimators, abund=yourAbund).
+ example collect(label=unique-.01-.03, freq=10, single=collect-chao-ace-jack).
The default values for freq is 100, for abund is 10, and single are collect-chao-ace-jack-bootstrap-shannon-npshannon-simpson.
The valid single estimators are: collect-chao-ace-jack-bootstrap-shannon-npshannon-simpson.
- The label and line parameters are used to analyze specific lines in your input. */
+ The label parameter is used to analyze specific labels in your input. */
int freq, abund, size;
bool abort, allLines;
- set<int> lines; //hold lines to be used
set<string> labels; //holds labels to be used
- string line, label, calc;
+ string label, calc;
vector<string> Estimators;
globaldata = GlobalData::getInstance();
abort = false;
allLines = 1;
- lines.clear();
labels.clear();
Estimators.clear();
Groups.clear();
else {
//valid paramters for this command
- string Array[] = {"freq","line","label","calc","groups"};
+ string Array[] = {"freq","label","calc","groups"};
vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
OptionParser parser(option);
//check for optional parameter and set defaults
- // ...at some point should added some additional type checking...
- line = validParameter.validFile(parameters, "line", false);
- if (line == "not found") { line = ""; }
- else {
- if(line != "all") { splitAtDash(line, lines); allLines = 0; }
- else { allLines = 1; }
- }
-
+ // ...at some point should added some additional type checking..
label = validParameter.validFile(parameters, "label", false);
if (label == "not found") { label = ""; }
else {
else { allLines = 1; }
}
- //make sure user did not use both the line and label parameters
- if ((line != "") && (label != "")) { mothurOut("You cannot use both the line and label parameters at the same time. "); mothurOutEndLine(); abort = true; }
- //if the user has not specified any line or labels use the ones from read.otu
- else if((line == "") && (label == "")) {
+ //if the user has not specified any labels use the ones from read.otu
+ if(label == "") {
allLines = globaldata->allLines;
labels = globaldata->labels;
- lines = globaldata->lines;
}
calc = validParameter.validFile(parameters, "calc", false);
void CollectSharedCommand::help(){
try {
mothurOut("The collect.shared command can only be executed after a successful read.otu command.\n");
- mothurOut("The collect.shared command parameters are label, line, freq, calc and groups. No parameters are required, but you may not use \n");
- mothurOut("both the line and label parameters at the same time. The collect.shared command should be in the following format: \n");
- mothurOut("collect.shared(label=yourLabel, line=yourLines, freq=yourFreq, calc=yourEstimators, groups=yourGroups).\n");
- mothurOut("Example collect.shared(label=unique-.01-.03, line=0-5-10, freq=10, groups=B-C, calc=sharedchao-sharedace-jabund-sorensonabund-jclass-sorclass-jest-sorest-thetayc-thetan).\n");
+ mothurOut("The collect.shared command parameters are label, freq, calc and groups. No parameters are required \n");
+ mothurOut("The collect.shared command should be in the following format: \n");
+ mothurOut("collect.shared(label=yourLabel, freq=yourFreq, calc=yourEstimators, groups=yourGroups).\n");
+ mothurOut("Example collect.shared(label=unique-.01-.03, freq=10, groups=B-C, calc=sharedchao-sharedace-jabund-sorensonabund-jclass-sorclass-jest-sorest-thetayc-thetan).\n");
mothurOut("The default values for freq is 100 and calc are sharedsobs-sharedchao-sharedace-jabund-sorensonabund-jclass-sorclass-jest-sorest-thetayc-thetan.\n");
mothurOut("The default value for groups is all the groups in your groupfile.\n");
validCalculator->printCalc("shared", cout);
- mothurOut("The label and line parameters are used to analyze specific lines in your input.\n");
+ mothurOut("The label parameter is used to analyze specific labels in your input.\n");
mothurOut("The groups parameter allows you to specify which of the groups in your groupfile you would like analyzed. You must enter at least 2 valid groups.\n");
mothurOut("Note: No spaces between parameter labels (i.e. list), '=' and parameters (i.e.yourListfile).\n\n");
if (abort == true) { return 0; }
- int count = 1;
-
//if the users entered no valid calculators don't execute command
if (cDisplays.size() == 0) { return 0; }
//if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
set<string> processedLabels;
set<string> userLabels = labels;
- set<int> userLines = lines;
//set users groups
util->setGroups(globaldata->Groups, globaldata->gGroupmap->namesOfGroups, "collect");
util->updateGroupIndex(globaldata->Groups, globaldata->gGroupmap->groupIndex);
- while((order != NULL) && ((allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
+ while((order != NULL) && ((allLines == 1) || (userLabels.size() != 0))) {
- if(allLines == 1 || lines.count(count) == 1 || labels.count(order->getLabel()) == 1){
+ if(allLines == 1 || labels.count(order->getLabel()) == 1){
//create collectors curve
cCurve = new Collect(order, cDisplays);
mothurOut(order->getLabel()); mothurOutEndLine();
processedLabels.insert(order->getLabel());
userLabels.erase(order->getLabel());
- userLines.erase(count);
}
- //you have a label the user want that is smaller than this line and the last line has not already been processed
+ //you have a label the user want that is smaller than this label and the last label has not already been processed
if ((anyLabelsToProcess(order->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLabel) != 1)) {
delete order;
order = input->getSharedOrderVector(lastLabel);
//get next line to process
delete order;
order = input->getSharedOrderVector();
- count++;
}
//output error messages about any remaining user labels
}
}
- //run last line if you need to
+ //run last label if you need to
if (needToRun == true) {
if (order != NULL) { delete order; }
order = input->getSharedOrderVector(lastLabel);
#include "validcalculator.h"
#include "sharedutilities.h"
-/* The collect.shared() command:
- The collect command generates a collector's curve from the given file representing several groups.
- The collect.shared command can only be executed after a successful read.shared command.
- It outputs a file for each estimator you choose to use. The collect.shared command parameters are label, line, freq and shared.
- No parameters are required, but you may not use both the line and label parameters at the same time.
- The collect.shared command should be in the following format: collect.shared(label=yourLabel, line=yourLines,
- freq=yourFreq, shared=yourEstimators). Example collect.shared(label=unique-.01-.03, line=0,5,10, freq=10,
- shared=sharedChao-sharedAce-sharedJabund). The default value for
- freq is 100 and shared are sharedChao-sharedAce-sharedJabund-sharedSorensonAbund-sharedJclass-sharedSorClass-sharedJest-sharedSorEst-SharedThetaYC-SharedThetaN.
- The valid shared estimators are: sharedChao-sharedAce-sharedJabund-sharedSorensonAbund-sharedJclass-sharedSorClass-sharedJest-sharedSorEst-SharedThetaYC-SharedThetaN.
- The label and line parameters are used to analyze specific lines in your input. */
-
-
class GlobalData;
class CollectSharedCommand : public Command {
string format;
bool abort, allLines;
- set<int> lines; //hold lines to be used
set<string> labels; //holds labels to be used
- string line, label, calc, groups;
+ string label, calc, groups;
vector<string> Estimators, Groups;
globaldata = GlobalData::getInstance();
abort = false;
allLines = 1;
- lines.clear();
labels.clear();
//allow user to run help
help(); abort = true;
} else {
//valid paramters for this command
- string Array[] = {"fasta","list","line","label","name", "group"};
+ string Array[] = {"fasta","list","label","name", "group"};
vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
OptionParser parser(option);
//check for optional parameter and set defaults
// ...at some point should added some additional type checking...
- line = validParameter.validFile(parameters, "line", false);
- if (line == "not found") { line = ""; }
- else {
- if(line != "all") { splitAtDash(line, lines); allLines = 0; }
- else { allLines = 1; }
- }
-
label = validParameter.validFile(parameters, "label", false);
if (label == "not found") { label = ""; }
else {
else { allLines = 1; }
}
- //make sure user did not use both the line and label parameters
- if ((line != "") && (label != "")) { mothurOut("You cannot use both the line and label parameters at the same time. "); mothurOutEndLine(); abort = true; }
- //if the user has not specified any line or labels use the ones from read.otu
- else if ((line == "") && (label == "")) {
+ //if the user has not specified any labels use the ones from read.otu
+ if (label == "") {
allLines = globaldata->allLines;
labels = globaldata->labels;
- lines = globaldata->lines;
}
namesfile = validParameter.validFile(parameters, "name", true);
void GetOTURepCommand::help(){
try {
mothurOut("The get.oturep command can only be executed after a successful read.dist command.\n");
- mothurOut("The get.oturep command parameters are list, fasta, name, group, line and label. The fasta and list parameters are required, and you may not use line and label at the same time.\n");
- mothurOut("The line and label allow you to select what distance levels you would like a output files created for, and are separated by dashes.\n");
- mothurOut("The get.oturep command should be in the following format: get.oturep(fasta=yourFastaFile, list=yourListFile, name=yourNamesFile, group=yourGroupFile, line=yourLines, label=yourLabels).\n");
- mothurOut("Example get.oturep(fasta=amazon.fasta, list=amazon.fn.list, group=amazon.groups, line=1-3-5, name=amazon.names).\n");
- mothurOut("The default value for line and label are all lines in your inputfile.\n");
+ mothurOut("The get.oturep command parameters are list, fasta, name, group and label. The fasta and list parameters are required.\n");
+ mothurOut("The label parameter allows you to select what distance levels you would like a output files created for, and is separated by dashes.\n");
+ mothurOut("The get.oturep command should be in the following format: get.oturep(fasta=yourFastaFile, list=yourListFile, name=yourNamesFile, group=yourGroupFile, label=yourLabels).\n");
+ mothurOut("Example get.oturep(fasta=amazon.fasta, list=amazon.fn.list, group=amazon.groups, name=amazon.names).\n");
+ mothurOut("The default value for label is all labels in your inputfile.\n");
mothurOut("The get.oturep command outputs a .fastarep file for each distance you specify, selecting one OTU representative for each bin.\n");
mothurOut("If you provide a groupfile, then it also appends the names of the groups present in that bin.\n");
mothurOut("Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFastaFile).\n\n");
if (abort == true) { return 0; }
- int count = 1;
int error;
//read fastafile
//if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
set<string> processedLabels;
set<string> userLabels = labels;
- set<int> userLines = lines;
-
- while((list != NULL) && ((allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
+ while((list != NULL) && ((allLines == 1) || (userLabels.size() != 0))) {
- if (allLines == 1 || lines.count(count) == 1 || labels.count(list->getLabel()) == 1){
+ if (allLines == 1 || labels.count(list->getLabel()) == 1){
mothurOut(list->getLabel() + "\t" + toString(list->size())); mothurOutEndLine();
error = process(list);
if (error == 1) { return 0; } //there is an error in hte input files, abort command
processedLabels.insert(list->getLabel());
userLabels.erase(list->getLabel());
- userLines.erase(count);
}
if ((anyLabelsToProcess(list->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLabel) != 1)) {
delete list;
list = input->getListVector();
- count++;
}
//output error messages about any remaining user labels
}
}
- //run last line if you need to
+ //run last label if you need to
if (needToRun == true) {
if (list != NULL) { delete list; }
list = input->getListVector(lastLabel);
group = group.substr(0, group.length()-1);
}
- // if only 1 sequence in bin or processing the "unique" line, then
+ // if only 1 sequence in bin or processing the "unique" label, then
// the first sequence of the OTU is the representative one
if ((names.size() == 1) || (list->getLabel() == "unique")) {
return names[0];
InputData* input;
FastaMap* fasta;
GroupMap* groupMap;
- string filename, fastafile, listfile, namesfile, groupfile, line, label;
+ string filename, fastafile, listfile, namesfile, groupfile, label;
ofstream out;
ifstream in, inNames;
bool groupError;
bool abort, allLines;
- set<int> lines; //hold lines to be used
set<string> labels; //holds labels to be used
map<string, int> nameToIndex; //maps sequence name to index in sparsematrix
globaldata = GlobalData::getInstance();
abort = false;
allLines = 1;
- lines.clear();
labels.clear();
//allow user to run help
else {
//valid paramters for this command
- string Array[] = {"line","label","sorted"};
+ string Array[] = {"label","sorted"};
vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
OptionParser parser(option);
temp = validParameter.validFile(parameters, "sorted", false); if (temp == "not found") { temp = "T"; }
sorted = isTrue(temp);
- line = validParameter.validFile(parameters, "line", false);
- if (line == "not found") { line = ""; }
- else {
- if(line != "all") { splitAtDash(line, lines); allLines = 0; }
- else { allLines = 1; }
- }
-
label = validParameter.validFile(parameters, "label", false);
if (label == "not found") { label = ""; }
else {
else { allLines = 1; }
}
- //make sure user did not use both the line and label parameters
- if ((line != "") && (label != "")) { mothurOut("You cannot use both the line and label parameters at the same time. "); mothurOutEndLine(); abort = true; }
- //if the user has not specified any line or labels use the ones from read.otu
- else if((line == "") && (label == "")) {
+ //if the user has not specified any labels use the ones from read.otu
+ if(label == "") {
allLines = globaldata->allLines;
labels = globaldata->labels;
- lines = globaldata->lines;
}
if (abort == false) {
void GetRAbundCommand::help(){
try {
mothurOut("The get.rabund command can only be executed after a successful read.otu of a listfile.\n");
- mothurOut("The get.rabund command parameters are line, label and sorted. No parameters are required, and you may not use line and label at the same time.\n");
- mothurOut("The line and label allow you to select what distance levels you would like included in your .rabund file, and are separated by dashes.\n");
+ mothurOut("The get.rabund command parameters are label and sorted. No parameters are required.\n");
+ mothurOut("The label parameter allows you to select what distance levels you would like included in your .rabund file, and are separated by dashes.\n");
mothurOut("The sorted parameters allows you to print the rabund results sorted by abundance or not. The default is sorted.\n");
- mothurOut("The get.rabund command should be in the following format: get.rabund(line=yourLines, label=yourLabels, sorted=yourSorted).\n");
- mothurOut("Example get.rabund(line=1-3-5, sorted=F).\n");
- mothurOut("The default value for line and label are all lines in your inputfile.\n");
+ mothurOut("The get.rabund command should be in the following format: get.rabund(label=yourLabels, sorted=yourSorted).\n");
+ mothurOut("Example get.rabund(sorted=F).\n");
+ mothurOut("The default value for label is all labels in your inputfile.\n");
mothurOut("The get.rabund command outputs a .rabund file containing the lines you selected.\n");
- mothurOut("Note: No spaces between parameter labels (i.e. line), '=' and parameters (i.e.yourLines).\n\n");
+ mothurOut("Note: No spaces between parameter labels (i.e. label), '=' and parameters (i.e.yourLabels).\n\n");
}
catch(exception& e) {
errorOut(e, "GetRAbundCommand", "help");
if (abort == true) { return 0; }
- int count = 1;
-
//read first line
read = new ReadOTUFile(globaldata->inputFileName);
read->read(&*globaldata);
//if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
set<string> processedLabels;
set<string> userLabels = labels;
- set<int> userLines = lines;
-
- while((list != NULL) && ((allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
+ while((list != NULL) && ((allLines == 1) || (userLabels.size() != 0))) {
- if(allLines == 1 || lines.count(count) == 1 || labels.count(list->getLabel()) == 1){
+ if(allLines == 1 || labels.count(list->getLabel()) == 1){
mothurOut(list->getLabel()); mothurOutEndLine();
rabund = new RAbundVector();
*rabund = (list->getRAbundVector());
processedLabels.insert(list->getLabel());
userLabels.erase(list->getLabel());
- userLines.erase(count);
}
if ((anyLabelsToProcess(list->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLabel) != 1)) {
delete list;
list = input->getListVector();
- count++;
}
//output error messages about any remaining user labels
}
}
- //run last line if you need to
+ //run last label if you need to
if (needToRun == true) {
if (list != NULL) { delete list; }
list = input->getListVector(lastLabel);
RAbundVector* rabund;
bool abort, allLines, sorted;
- set<int> lines; //hold lines to be used
set<string> labels; //holds labels to be used
- string line, label;
+ string label;
};
globaldata = GlobalData::getInstance();
abort = false;
allLines = 1;
- lines.clear();
labels.clear();
//allow user to run help
else {
//valid paramters for this command
- string Array[] = {"line","label"};
+ string Array[] = {"label"};
vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
OptionParser parser(option);
//check for optional parameter and set defaults
// ...at some point should added some additional type checking...
- line = validParameter.validFile(parameters, "line", false);
- if (line == "not found") { line = ""; }
- else {
- if(line != "all") { splitAtDash(line, lines); allLines = 0; }
- else { allLines = 1; }
- }
-
label = validParameter.validFile(parameters, "label", false);
if (label == "not found") { label = ""; }
else {
else { allLines = 1; }
}
- //make sure user did not use both the line and label parameters
- if ((line != "") && (label != "")) { mothurOut("You cannot use both the line and label parameters at the same time. "); mothurOutEndLine(); abort = true; }
- //if the user has not specified any line or labels use the ones from read.otu
- else if((line == "") && (label == "")) {
+ //if the user has not specified any labels use the ones from read.otu
+ if(label == "") {
allLines = globaldata->allLines;
labels = globaldata->labels;
- lines = globaldata->lines;
}
if (abort == false) {
void GetSAbundCommand::help(){
try {
mothurOut("The get.sabund command can only be executed after a successful read.otu of a listfile or rabundfile.\n");
- mothurOut("The get.sabund command parameters are line and label. No parameters are required, and you may not use line and label at the same time.\n");
- mothurOut("The line and label allow you to select what distance levels you would like included in your .sabund file, and are separated by dashes.\n");
- mothurOut("The get.sabund command should be in the following format: get.sabund(line=yourLines, label=yourLabels).\n");
- mothurOut("Example get.sabund(line=1-3-5).\n");
- mothurOut("The default value for line and label are all lines in your inputfile.\n");
- mothurOut("The get.sabund command outputs a .sabund file containing the lines you selected.\n");
- mothurOut("Note: No spaces between parameter labels (i.e. line), '=' and parameters (i.e.yourLines).\n\n");
+ mothurOut("The get.sabund command parameters is label. No parameters are required.\n");
+ mothurOut("The label parameter allows you to select what distance levels you would like included in your .sabund file, and are separated by dashes.\n");
+ mothurOut("The get.sabund command should be in the following format: get.sabund(label=yourLabels).\n");
+ mothurOut("Example get.sabund().\n");
+ mothurOut("The default value for label is all labels in your inputfile.\n");
+ mothurOut("The get.sabund command outputs a .sabund file containing the labels you selected.\n");
+ mothurOut("Note: No spaces between parameter labels (i.e. label), '=' and parameters (i.e.yourLabel).\n\n");
}
catch(exception& e) {
errorOut(e, "GetSAbundCommand", "help");
if (abort == true) { return 0; }
- int count = 1;
-
//using order vector so you don't have to distinguish between the list and rabund files
read = new ReadOTUFile(globaldata->inputFileName);
read->read(&*globaldata);
//if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
set<string> processedLabels;
set<string> userLabels = labels;
- set<int> userLines = lines;
-
- while((order != NULL) && ((allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
+ while((order != NULL) && ((allLines == 1) || (userLabels.size() != 0))) {
- if(allLines == 1 || lines.count(count) == 1 || labels.count(order->getLabel()) == 1){
+ if(allLines == 1 || labels.count(order->getLabel()) == 1){
mothurOut(order->getLabel()); mothurOutEndLine();
sabund = new SAbundVector();
*sabund = (order->getSAbundVector());
processedLabels.insert(order->getLabel());
userLabels.erase(order->getLabel());
- userLines.erase(count);
}
if ((anyLabelsToProcess(order->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLabel) != 1)) {
delete order;
order = (input->getOrderVector());
- count++;
}
//output error messages about any remaining user labels
}
}
- //run last line if you need to
+ //run last label if you need to
if (needToRun == true) {
if (order != NULL) { delete order; }
order = (input->getOrderVector(lastLabel));
SAbundVector* sabund;
bool abort, allLines;
- set<int> lines; //hold lines to be used
set<string> labels; //holds labels to be used
- string line, label;
+ string label;
};
gTree.clear();
Treenames.clear();
- labels.clear(); lines.clear(); Groups.clear();
+ labels.clear(); Groups.clear();
allLines = 1;
runParse = true;
}
string inputFileName, argv;
bool allLines, runParse, jumble;
vector<string> Estimators, Groups; //holds estimators to be used
- set<int> lines; //hold lines to be used
set<string> labels; //holds labels to be used
vector<string> Treenames;
globaldata = GlobalData::getInstance();
abort = false;
allLines = 1;
- lines.clear();
labels.clear();
//allow user to run help
else {
//valid paramters for this command
- string AlignArray[] = {"groups","line","label","sorted","scale"};
+ string AlignArray[] = {"groups","label","sorted","scale"};
vector<string> myArray (AlignArray, AlignArray+(sizeof(AlignArray)/sizeof(string)));
OptionParser parser(option);
//check for optional parameter and set defaults
// ...at some point should added some additional type checking...
- line = validParameter.validFile(parameters, "line", false);
- if (line == "not found") { line = ""; }
- else {
- if(line != "all") { splitAtDash(line, lines); allLines = 0; }
- else { allLines = 1; }
- }
-
label = validParameter.validFile(parameters, "label", false);
if (label == "not found") { label = ""; }
else {
else { allLines = 1; }
}
- //make sure user did not use both the line and label parameters
- if ((line != "") && (label != "")) { mothurOut("You cannot use both the line and label parameters at the same time. "); mothurOutEndLine(); abort = true; }
- //if the user has not specified any line or labels use the ones from read.otu
- else if ((line == "") && (label == "")) {
+ //if the user has not specified any labels use the ones from read.otu
+ if (label == "") {
allLines = globaldata->allLines;
labels = globaldata->labels;
- lines = globaldata->lines;
}
groups = validParameter.validFile(parameters, "groups", false);
void HeatMapCommand::help(){
try {
mothurOut("The heatmap.bin command can only be executed after a successful read.otu command.\n");
- mothurOut("The heatmap.bin command parameters are groups, sorted, scale, line and label. No parameters are required, but you may not use line and label at the same time.\n");
+ mothurOut("The heatmap.bin command parameters are groups, sorted, scale label. No parameters are required.\n");
mothurOut("The groups parameter allows you to specify which of the groups in your groupfile you would like included in your heatmap.\n");
mothurOut("The sorted parameter allows you to choose to see the file with the shared otus at the top or the otus in the order they appear in your input file. \n");
mothurOut("The scale parameter allows you to choose the range of color your bin information will be displayed with.\n");
- mothurOut("The group names are separated by dashes. The line and label allow you to select what distance levels you would like a heatmap created for, and are also separated by dashes.\n");
- mothurOut("The heatmap.bin command should be in the following format: heatmap.bin(groups=yourGroups, sorted=yourSorted, line=yourLines, label=yourLabels).\n");
- mothurOut("Example heatmap.bin(groups=A-B-C, line=1-3-5, sorted=F, scale=log10).\n");
- mothurOut("The default value for groups is all the groups in your groupfile, and all lines in your inputfile will be used.\n");
+ mothurOut("The group names are separated by dashes. The label parameter allows you to select what distance levels you would like a heatmap created for, and are also separated by dashes.\n");
+ mothurOut("The heatmap.bin command should be in the following format: heatmap.bin(groups=yourGroups, sorted=yourSorted, label=yourLabels).\n");
+ mothurOut("Example heatmap.bin(groups=A-B-C, sorted=F, scale=log10).\n");
+ mothurOut("The default value for groups is all the groups in your groupfile, and all labels in your inputfile will be used.\n");
mothurOut("The default value for sorted is T meaning you want the shared otus on top, you may change it to F meaning the exact representation of your input file.\n");
mothurOut("The default value for scale is log10; your other options are log2 and linear.\n");
- mothurOut("The heatmap.bin command outputs a .svg file for each line or label you specify.\n");
+ mothurOut("The heatmap.bin command outputs a .svg file for each label you specify.\n");
mothurOut("Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n\n");
}
if (abort == true) { return 0; }
- int count = 1;
string lastLabel;
if (format == "sharedfile") {
//if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
set<string> processedLabels;
set<string> userLabels = labels;
- set<int> userLines = lines;
if ((format != "list") && (format != "rabund") && (format != "sabund")) {
//as long as you are not at the end of the file or done wih the lines you want
- while((lookup[0] != NULL) && ((allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
+ while((lookup[0] != NULL) && ((allLines == 1) || (userLabels.size() != 0))) {
- if(allLines == 1 || lines.count(count) == 1 || labels.count(lookup[0]->getLabel()) == 1){
+ if(allLines == 1 || labels.count(lookup[0]->getLabel()) == 1){
mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
heatmap->getPic(lookup);
processedLabels.insert(lookup[0]->getLabel());
userLabels.erase(lookup[0]->getLabel());
- userLines.erase(count);
}
if ((anyLabelsToProcess(lookup[0]->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLabel) != 1)) {
//get next line to process
lookup = input->getSharedRAbundVectors();
- count++;
}
//output error messages about any remaining user labels
}
}
- //run last line if you need to
+ //run last label if you need to
if (needToRun == true) {
for (int i = 0; i < lookup.size(); i++) { if (lookup[i] != NULL) { delete lookup[i]; } }
lookup = input->getSharedRAbundVectors(lastLabel);
}else{
- while((rabund != NULL) && ((allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
+ while((rabund != NULL) && ((allLines == 1) || (userLabels.size() != 0))) {
- if(allLines == 1 || lines.count(count) == 1 || labels.count(rabund->getLabel()) == 1){
+ if(allLines == 1 || labels.count(rabund->getLabel()) == 1){
mothurOut(rabund->getLabel()); mothurOutEndLine();
heatmap->getPic(rabund);
processedLabels.insert(rabund->getLabel());
userLabels.erase(rabund->getLabel());
- userLines.erase(count);
}
if ((anyLabelsToProcess(rabund->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLabel) != 1)) {
lastLabel = rabund->getLabel();
delete rabund;
rabund = input->getRAbundVector();
- count++;
}
//output error messages about any remaining user labels
}
}
- //run last line if you need to
+ //run last label if you need to
if (needToRun == true) {
if (rabund != NULL) { delete rabund; }
HeatMap* heatmap;
bool abort, allLines;
- set<int> lines; //hold lines to be used
set<string> labels; //holds labels to be used
- string format, groups, sorted, scale, line, label;
+ string format, groups, sorted, scale, label;
vector<string> Groups;
globaldata = GlobalData::getInstance();
abort = false;
allLines = 1;
- lines.clear();
labels.clear();
Groups.clear();
Estimators.clear();
else {
//valid paramters for this command
- string AlignArray[] = {"groups","line","label", "calc"};
+ string AlignArray[] = {"groups","label", "calc"};
vector<string> myArray (AlignArray, AlignArray+(sizeof(AlignArray)/sizeof(string)));
OptionParser parser(option);
//check for optional parameter and set defaults
// ...at some point should added some additional type checking...
- line = validParameter.validFile(parameters, "line", false);
- if (line == "not found") { line = ""; }
- else {
- if(line != "all") { splitAtDash(line, lines); allLines = 0; }
- else { allLines = 1; }
- }
-
label = validParameter.validFile(parameters, "label", false);
if (label == "not found") { label = ""; }
else {
else { allLines = 1; }
}
- //make sure user did not use both the line and label parameters
- if ((line != "") && (label != "")) { mothurOut("You cannot use both the line and label parameters at the same time. "); mothurOutEndLine(); abort = true; }
- //if the user has not specified any line or labels use the ones from read.otu
- else if ((line == "") && (label == "")) {
+ //if the user has not specified any labels use the ones from read.otu
+ if (label == "") {
allLines = globaldata->allLines;
labels = globaldata->labels;
- lines = globaldata->lines;
}
calc = validParameter.validFile(parameters, "calc", false);
void HeatMapSimCommand::help(){
try {
mothurOut("The heatmap.sim command can only be executed after a successful read.otu command.\n");
- mothurOut("The heatmap.sim command parameters are groups, calc, line and label. No parameters are required, but you may not use line and label at the same time.\n");
+ mothurOut("The heatmap.sim command parameters are groups, calc and label. No parameters are required.\n");
mothurOut("The groups parameter allows you to specify which of the groups in your groupfile you would like included in your heatmap.\n");
- mothurOut("The group names are separated by dashes. The line and label allow you to select what distance levels you would like a heatmap created for, and are also separated by dashes.\n");
- mothurOut("The heatmap.sim command should be in the following format: heatmap.sim(groups=yourGroups, calc=yourCalc, line=yourLines, label=yourLabels).\n");
- mothurOut("Example heatmap.sim(groups=A-B-C, line=1-3-5, calc=jabund).\n");
- mothurOut("The default value for groups is all the groups in your groupfile, and all lines in your inputfile will be used.\n");
+ mothurOut("The group names are separated by dashes. The label parameter allows you to select what distance levels you would like a heatmap created for, and is also separated by dashes.\n");
+ mothurOut("The heatmap.sim command should be in the following format: heatmap.sim(groups=yourGroups, calc=yourCalc, label=yourLabels).\n");
+ mothurOut("Example heatmap.sim(groups=A-B-C, calc=jabund).\n");
+ mothurOut("The default value for groups is all the groups in your groupfile, and all labels in your inputfile will be used.\n");
validCalculator->printCalc("heat", cout);
mothurOut("The default value for calc is jclass-thetayc.\n");
- mothurOut("The heatmap.sim command outputs a .svg file for each calculator you choose at each line or label you specify.\n");
+ mothurOut("The heatmap.sim command outputs a .svg file for each calculator you choose at each label you specify.\n");
mothurOut("Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n\n");
}
if (abort == true) { return 0; }
- int count = 1;
-
//if the users entered no valid calculators don't execute command
if (heatCalculators.size() == 0) { mothurOut("No valid calculators."); mothurOutEndLine(); return 0; }
//if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
set<string> processedLabels;
set<string> userLabels = labels;
- set<int> userLines = lines;
-
//as long as you are not at the end of the file or done wih the lines you want
- while((lookup[0] != NULL) && ((allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
+ while((lookup[0] != NULL) && ((allLines == 1) || (userLabels.size() != 0))) {
- if(allLines == 1 || lines.count(count) == 1 || labels.count(lookup[0]->getLabel()) == 1){
+ if(allLines == 1 || labels.count(lookup[0]->getLabel()) == 1){
mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
heatmap->getPic(lookup, heatCalculators);
processedLabels.insert(lookup[0]->getLabel());
userLabels.erase(lookup[0]->getLabel());
- userLines.erase(count);
}
if ((anyLabelsToProcess(lookup[0]->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLabel) != 1)) {
//get next line to process
for (int i = 0; i < lookup.size(); i++) { delete lookup[i]; }
lookup = input->getSharedRAbundVectors();
- count++;
}
//output error messages about any remaining user labels
}
}
- //run last line if you need to
+ //run last label if you need to
if (needToRun == true) {
for (int i = 0; i < lookup.size(); i++) { if (lookup[i] != NULL) { delete lookup[i]; } }
lookup = input->getSharedRAbundVectors(lastLabel);
map<string, string> parameters;
map<string, string>::iterator it;
bool abort, allLines;
- set<int> lines; //hold lines to be used
set<string> labels; //holds labels to be used
- string format, groups, line, label, calc;
+ string format, groups, label, calc;
vector<string> Estimators, Groups;
globaldata = GlobalData::getInstance();
abort = false;
allLines = 1;
- lines.clear();
labels.clear();
Groups.clear();
Estimators.clear();
else {
//valid paramters for this command
- string Array[] = {"line","label","calc","groups"};
+ string Array[] = {"label","calc","groups"};
vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
OptionParser parser(option);
//check for optional parameter and set defaults
// ...at some point should added some additional type checking...
- line = validParameter.validFile(parameters, "line", false);
- if (line == "not found") { line = ""; }
- else {
- if(line != "all") { splitAtDash(line, lines); allLines = 0; }
- else { allLines = 1; }
- }
-
label = validParameter.validFile(parameters, "label", false);
if (label == "not found") { label = ""; }
else {
else { allLines = 1; }
}
- //make sure user did not use both the line and label parameters
- if ((line != "") && (label != "")) { mothurOut("You cannot use both the line and label parameters at the same time. "); mothurOutEndLine(); abort = true; }
- //if the user has not specified any line or labels use the ones from read.otu
- else if((line == "") && (label == "")) {
+ //if the user has not specified any labels use the ones from read.otu
+ if (label == "") {
allLines = globaldata->allLines;
labels = globaldata->labels;
- lines = globaldata->lines;
}
groups = validParameter.validFile(parameters, "groups", false);
void MatrixOutputCommand::help(){
try {
mothurOut("The dist.shared command can only be executed after a successful read.otu command.\n");
- mothurOut("The dist.shared command parameters are groups, calc, line and label. The calc parameter is required, and you may not use line and label at the same time.\n");
+ mothurOut("The dist.shared command parameters are groups, calc and label. No parameters are required.\n");
mothurOut("The groups parameter allows you to specify which of the groups in your groupfile you would like included used.\n");
- mothurOut("The group names are separated by dashes. The line and label allow you to select what distance levels you would like distance matrices created for, and are also separated by dashes.\n");
- mothurOut("The dist.shared command should be in the following format: dist.shared(groups=yourGroups, calc=yourCalcs, line=yourLines, label=yourLabels).\n");
- mothurOut("Example dist.shared(groups=A-B-C, line=1-3-5, calc=jabund-sorabund).\n");
+ mothurOut("The group names are separated by dashes. The label parameter allows you to select what distance levels you would like distance matrices created for, and is also separated by dashes.\n");
+ mothurOut("The dist.shared command should be in the following format: dist.shared(groups=yourGroups, calc=yourCalcs, label=yourLabels).\n");
+ mothurOut("Example dist.shared(groups=A-B-C, calc=jabund-sorabund).\n");
mothurOut("The default value for groups is all the groups in your groupfile.\n");
mothurOut("The default value for calc is jclass and thetayc.\n");
validCalculator->printCalc("matrix", cout);
try {
if (abort == true) { return 0; }
-
- int count = 1;
-
+
//if the users entered no valid calculators don't execute command
if (matrixCalculators.size() == 0) { mothurOut("No valid calculators."); mothurOutEndLine(); return 0; }
//if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
set<string> processedLabels;
set<string> userLabels = labels;
- set<int> userLines = lines;
-
+
if (lookup.size() < 2) { mothurOut("You have not provided enough valid groups. I cannot run the command."); mothurOutEndLine(); return 0;}
numGroups = lookup.size();
//as long as you are not at the end of the file or done wih the lines you want
- while((lookup[0] != NULL) && ((allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
+ while((lookup[0] != NULL) && ((allLines == 1) || (userLabels.size() != 0))) {
- if(allLines == 1 || lines.count(count) == 1 || labels.count(lookup[0]->getLabel()) == 1){
+ if(allLines == 1 || labels.count(lookup[0]->getLabel()) == 1){
mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
process(lookup);
processedLabels.insert(lookup[0]->getLabel());
userLabels.erase(lookup[0]->getLabel());
- userLines.erase(count);
}
if ((anyLabelsToProcess(lookup[0]->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLabel) != 1)) {
userLabels.erase(lookup[0]->getLabel());
}
-
lastLabel = lookup[0]->getLabel();
//get next line to process
for (int i = 0; i < lookup.size(); i++) { delete lookup[i]; }
lookup = input->getSharedRAbundVectors();
- count++;
}
//output error messages about any remaining user labels
}
}
- //run last line if you need to
+ //run last label if you need to
if (needToRun == true) {
for (int i = 0; i < lookup.size(); i++) { if (lookup[i] != NULL) { delete lookup[i]; } }
lookup = input->getSharedRAbundVectors(lastLabel);
// aka. dist.shared()
/* This command create a tree file for each similarity calculator at distance level, using various calculators to find the similiarity between groups.
- The user can select the lines or labels they wish to use as well as the groups they would like included.
+ The user can select the labels they wish to use as well as the groups they would like included.
They can also use as many or as few calculators as they wish. */
class GlobalData;
ofstream out;
bool abort, allLines;
- set<int> lines; //hold lines to be used
set<string> labels; //holds labels to be used
- string outputFile, calc, groups, line, label;
+ string outputFile, calc, groups, label;
vector<string> Estimators, Groups; //holds estimators to be used
globaldata = GlobalData::getInstance();
abort = false;
allLines = 1;
- lines.clear();
labels.clear();
Estimators.clear();
else {
//valid paramters for this command
- string Array[] = {"iters","freq","line","label","calc","abund"};
+ string Array[] = {"iters","freq","label","calc","abund"};
vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
OptionParser parser(option);
//check for optional parameter and set defaults
// ...at some point should added some additional type checking...
- line = validParameter.validFile(parameters, "line", false);
- if (line == "not found") { line = ""; }
- else {
- if(line != "all") { splitAtDash(line, lines); allLines = 0; }
- else { allLines = 1; }
- }
-
label = validParameter.validFile(parameters, "label", false);
if (label == "not found") { label = ""; }
else {
else { allLines = 1; }
}
- //make sure user did not use both the line and label parameters
- if ((line != "") && (label != "")) { mothurOut("You cannot use both the line and label parameters at the same time. "); mothurOutEndLine(); abort = true; }
- //if the user has not specified any line or labels use the ones from read.otu
- else if((line == "") && (label == "")) {
+ //if the user has not specified any labels use the ones from read.otu
+ if(label == "") {
allLines = globaldata->allLines;
labels = globaldata->labels;
- lines = globaldata->lines;
}
calc = validParameter.validFile(parameters, "calc", false);
try {
mothurOut("The rarefaction.single command can only be executed after a successful read.otu WTIH ONE EXECEPTION.\n");
mothurOut("The rarefaction.single command can be executed after a successful cluster command. It will use the .list file from the output of the cluster.\n");
- mothurOut("The rarefaction.single command parameters are label, line, iters, freq, calc and abund. No parameters are required, but you may not use \n");
- mothurOut("both the line and label parameters at the same time. The rarefaction.single command should be in the following format: \n");
- mothurOut("rarefaction.single(label=yourLabel, line=yourLines, iters=yourIters, freq=yourFreq, calc=yourEstimators).\n");
- mothurOut("Example rarefaction.single(label=unique-.01-.03, line=0-5-10, iters=10000, freq=10, calc=sobs-rchao-race-rjack-rbootstrap-rshannon-rnpshannon-rsimpson).\n");
+ mothurOut("The rarefaction.single command parameters are label, iters, freq, calc and abund. No parameters are required. \n");
+ mothurOut("The rarefaction.single command should be in the following format: \n");
+ mothurOut("rarefaction.single(label=yourLabel, iters=yourIters, freq=yourFreq, calc=yourEstimators).\n");
+ mothurOut("Example rarefaction.single(label=unique-.01-.03, iters=10000, freq=10, calc=sobs-rchao-race-rjack-rbootstrap-rshannon-rnpshannon-rsimpson).\n");
mothurOut("The default values for iters is 1000, freq is 100, and calc is rarefaction which calculates the rarefaction curve for the observed richness.\n");
validCalculator->printCalc("rarefaction", cout);
- mothurOut("The label and line parameters are used to analyze specific lines in your input.\n");
+ mothurOut("The label parameter is used to analyze specific labels in your input.\n");
mothurOut("Note: No spaces between parameter labels (i.e. freq), '=' and parameters (i.e.yourFreq).\n\n");
}
catch(exception& e) {
if (abort == true) { return 0; }
- int count = 1;
-
//if the users entered no valid calculators don't execute command
if (rDisplays.size() == 0) { return 0; }
//if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
set<string> processedLabels;
set<string> userLabels = labels;
- set<int> userLines = lines;
//as long as you are not at the end of the file or done wih the lines you want
- while((order != NULL) && ((allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
+ while((order != NULL) && ((allLines == 1) || (userLabels.size() != 0))) {
- if(allLines == 1 || lines.count(count) == 1 || labels.count(order->getLabel()) == 1){
+ if(allLines == 1 || labels.count(order->getLabel()) == 1){
rCurve = new Rarefact(order, rDisplays);
rCurve->getCurve(freq, nIters);
mothurOut(order->getLabel()); mothurOutEndLine();
processedLabels.insert(order->getLabel());
userLabels.erase(order->getLabel());
- userLines.erase(count);
}
if ((anyLabelsToProcess(order->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLabel) != 1)) {
delete order;
order = (input->getOrderVector());
- count++;
}
//output error messages about any remaining user labels
}
}
- //run last line if you need to
+ //run last label if you need to
if (needToRun == true) {
if (order != NULL) { delete order; }
order = (input->getOrderVector(lastLabel));
#include "validcalculator.h"
-/*The rarefaction() command:
- The rarefaction command generates a rarefaction curve from a given file.
- The rarefaction command can only be executed after a successful read.list, read.sabund or read.rabund command, with one exception.
- The rarefaction command can be executed after a successful cluster command. It will use the .list file from the output of the cluster.
- The rarefaction command outputs a file for each estimator you choose to use. It is recommended to only use rarefaction estimator.
- The rarefaction command parameters are label, line, iters, freq, rarefaction. No parameters are required,
- but you may not use both the line and label parameters at the same time. The rarefaction command should be in the following format:
- rarefaction(label=yourLabel, line=yourLines, iters=yourIters, freq=yourFreq, rarefaction=yourEstimators).
- Example rarefaction(label=unique-.01-.03, line=0,5,10, iters=10000, freq=10, rarefaction=rarefaction-rchao-race-rjack-rbootstrap-rshannon-rnpshannon-rsimpson).
- The default values for iters is 1000, freq is 100, and rarefaction is rarefaction which calculates the rarefaction curve for the observed richness.
- The valid rarefaction estimators are: rarefaction-rchao-race-rjack-rbootstrap-rshannon-rnpshannon-rsimpson.
- Rarefaction is the only recommended estimator. The label and line parameters are used to analyze specific lines in your input. */
-
-
class GlobalData;
class RareFactCommand : public Command {
int freq, nIters, abund;
bool abort, allLines;
- set<int> lines; //hold lines to be used
set<string> labels; //holds labels to be used
- string line, label, calc;
+ string label, calc;
vector<string> Estimators;
};
abort = false;
allLines = 1;
- lines.clear();
labels.clear();
Estimators.clear();
Groups.clear();
else {
//valid paramters for this command
- string Array[] = {"iters","line","label","calc","groups", "jumble"};
+ string Array[] = {"iters","label","calc","groups", "jumble"};
vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
OptionParser parser(option);
//check for optional parameter and set defaults
// ...at some point should added some additional type checking...
- line = validParameter.validFile(parameters, "line", false);
- if (line == "not found") { line = ""; }
- else {
- if(line != "all") { splitAtDash(line, lines); allLines = 0; }
- else { allLines = 1; }
- }
-
label = validParameter.validFile(parameters, "label", false);
if (label == "not found") { label = ""; }
else {
else { allLines = 1; }
}
- //make sure user did not use both the line and label parameters
- if ((line != "") && (label != "")) { mothurOut("You cannot use both the line and label parameters at the same time. "); mothurOutEndLine(); abort = true; }
- //if the user has not specified any line or labels use the ones from read.otu
- else if((line == "") && (label == "")) {
+ //if the user has not specified any labels use the ones from read.otu
+ if(label == "") {
allLines = globaldata->allLines;
labels = globaldata->labels;
- lines = globaldata->lines;
}
calc = validParameter.validFile(parameters, "calc", false);
void RareFactSharedCommand::help(){
try {
mothurOut("The rarefaction.shared command can only be executed after a successful read.otu command.\n");
- mothurOut("The rarefaction.shared command parameters are label, line, iters, groups, jumble and calc. No parameters are required, but you may not use \n");
- mothurOut("both the line and label parameters at the same time. The rarefaction command should be in the following format: \n");
- mothurOut("rarefaction.shared(label=yourLabel, line=yourLines, iters=yourIters, calc=yourEstimators, jumble=yourJumble, groups=yourGroups).\n");
- mothurOut("Example rarefaction.shared(label=unique-.01-.03, line=0-5-10, iters=10000, groups=B-C, jumble=T, calc=sharedobserved).\n");
+ mothurOut("The rarefaction.shared command parameters are label, iters, groups, jumble and calc. No parameters are required.\n");
+ mothurOut("The rarefaction command should be in the following format: \n");
+ mothurOut("rarefaction.shared(label=yourLabel, iters=yourIters, calc=yourEstimators, jumble=yourJumble, groups=yourGroups).\n");
+ mothurOut("Example rarefaction.shared(label=unique-0.01-0.03, iters=10000, groups=B-C, jumble=T, calc=sharedobserved).\n");
mothurOut("The default values for iters is 1000, freq is 100, and calc is sharedobserved which calculates the shared rarefaction curve for the observed richness.\n");
mothurOut("The default value for groups is all the groups in your groupfile, and jumble is true.\n");
validCalculator->printCalc("sharedrarefaction", cout);
- mothurOut("The label and line parameters are used to analyze specific lines in your input.\n");
+ mothurOut("The label parameter is used to analyze specific labels in your input.\n");
mothurOut("The groups parameter allows you to specify which of the groups in your groupfile you would like analyzed. You must enter at least 2 valid groups.\n");
mothurOut("Note: No spaces between parameter labels (i.e. freq), '=' and parameters (i.e.yourFreq).\n\n");
}
if (abort == true) { return 0; }
- int count = 1;
-
//if the users entered no valid calculators don't execute command
if (rDisplays.size() == 0) { return 0; }
//if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
set<string> processedLabels;
set<string> userLabels = labels;
- set<int> userLines = lines;
//as long as you are not at the end of the file or done wih the lines you want
- while((lookup[0] != NULL) && ((allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
+ while((lookup[0] != NULL) && ((allLines == 1) || (userLabels.size() != 0))) {
- if(allLines == 1 || lines.count(count) == 1 || labels.count(lookup[0]->getLabel()) == 1){
+ if(allLines == 1 || labels.count(lookup[0]->getLabel()) == 1){
rCurve = new Rarefact(lookup, rDisplays);
rCurve->getSharedCurve(freq, nIters);
mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
processedLabels.insert(lookup[0]->getLabel());
userLabels.erase(lookup[0]->getLabel());
- userLines.erase(count);
}
if ((anyLabelsToProcess(lookup[0]->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLabel) != 1)) {
//get next line to process
for (int i = 0; i < lookup.size(); i++) { delete lookup[i]; }
lookup = input->getSharedRAbundVectors();
- count++;
}
//output error messages about any remaining user labels
}
}
- //run last line if you need to
+ //run last label if you need to
if (needToRun == true) {
for (int i = 0; i < lookup.size(); i++) { if (lookup[i] != NULL) { delete lookup[i]; } }
lookup = input->getSharedRAbundVectors(lastLabel);
#include "readotu.h"
#include "validcalculator.h"
-/* The rarefaction.shared() command:
- The rarefaction command generates a rarefaction curve from a given file representing several groups.
- The rarefaction.shared command can only be executed after a successful read.shared command. It outputs a file for each estimator you choose to use.
- The rarefaction.shared command parameters are label, line, iters and sharedrarefaction.
- No parameters are required, but you may not use both the line and label parameters at the same time.
- The rarefaction command should be in the following format: rarefaction.shared(label=yourLabel, line=yourLines, iters=yourIters,
- sharedrarefaction=yourEstimators). Example rarefaction.shared(label=unique-.01-.03, line=0,5,10, iters=10000,
- sharedrarefaction =sharedobserved). The default values for
- iters is 1000 and sharedrarefaction is sharedobserved which calculates the shared rarefaction curve for the observed richness.
- The valid sharedrarefaction estimator is sharedobserved. The label and line parameters are used to analyze specific lines in your input. */
-
-
class GlobalData;
class RareFactSharedCommand : public Command {
string format;
bool abort, allLines, jumble;
- set<int> lines; //hold lines to be used
set<string> labels; //holds labels to be used
- string line, label, calc, groups;
+ string label, calc, groups;
vector<string> Estimators, Groups;
else {
//valid paramters for this command
- string Array[] = {"list","order","shared", "line", "label","group","sabund", "rabund"};
+ string Array[] = {"list","order","shared", "label","group","sabund", "rabund"};
vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
OptionParser parser(option);
//check for optional parameter and set defaults
// ...at some point should added some additional type checking...
- line = validParameter.validFile(parameters, "line", false);
- if (line == "not found") { line = ""; }
- else {
- if(line != "all") { splitAtDash(line, lines); allLines = 0; }
- else { allLines = 1; }
- globaldata->lines = lines;
- }
-
label = validParameter.validFile(parameters, "label", false);
if (label == "not found") { label = ""; }
else {
globaldata->allLines = allLines;
- //make sure user did not use both the line and label parameters
- if ((line != "") && (label != "")) { mothurOut("You cannot use both the line and label parameters at the same time. "); mothurOutEndLine(); abort = true; }
-
orderfile = validParameter.validFile(parameters, "order", true);
if (orderfile == "not open") { abort = true; }
else if (orderfile == "not found") { orderfile = ""; }
try {
mothurOut("The read.otu command must be run before you execute a collect.single, rarefaction.single, summary.single, \n");
mothurOut("collect.shared, rarefaction.shared or summary.shared command. Mothur will generate a .list, .rabund and .sabund upon completion of the cluster command \n");
- mothurOut("or you may use your own. The read.otu command parameter options are list, rabund, sabund, shared, group, order, line and label.\n");
+ mothurOut("or you may use your own. The read.otu command parameter options are list, rabund, sabund, shared, group, order and label.\n");
mothurOut("The read.otu command can be used in two ways. The first is to read a list, rabund or sabund and run the collect.single, rarefaction.single or summary.single.\n");
mothurOut("For this use the read.otu command should be in the following format: read.otu(list=yourListFile, order=yourOrderFile, label=yourLabels).\n");
mothurOut("The list, rabund or sabund parameter is required, but you may only use one of them.\n");
- mothurOut("The line and label parameters are optional but you may not use both the line and label parameters at the same time.\n");
- mothurOut("The label and line parameters are used to read specific lines in your input.\n");
+ mothurOut("The label parameter is used to read specific labels in your input.\n");
mothurOut("The second way to use the read.otu command is to read a list and a group, or a shared so you can use the collect.shared, rarefaction.shared or summary.shared commands.\n");
- mothurOut("In this case the read.otu command should be in the following format: read.otu(list=yourListFile, group=yourGroupFile, line=yourLines) or read.otu(shared=yourSharedFile). \n");
+ mothurOut("In this case the read.otu command should be in the following format: read.otu(list=yourListFile, group=yourGroupFile) or read.otu(shared=yourSharedFile). \n");
mothurOut("The list parameter and group paramaters or the shared paremeter is required. When using the command the second way with a list and group file read.otu command parses the .list file\n");
- mothurOut("and separates it into groups. It outputs a .shared file containing the OTU information for each group. The read.otu command also outputs a .list file for each group. \n");
+ mothurOut("and separates it into groups. It outputs a .shared file containing the OTU information for each group. The read.otu command also outputs a .rabund file for each group. \n");
mothurOut("Note: No spaces between parameter labels (i.e. list), '=' and parameters (i.e.yourListfile).\n\n");
}
#include "groupmap.h"
#include "sharedcommand.h"
-/* The read.otu must be run before you execute a collect.single, rarefaction.single, summary.single,
-collect.shared, rarefaction.shared or summary.shared command. Mothur will generate a .list, .rabund and .sabund
-upon completion of the cluster command or you may use your own. The read.otu command parameter options are
-listfile, rabundfile, sabundfile, groupfile and orderfile. The reaad.otu command can be used in two ways.
-The first is to read a listfile, rabundfile or sabundfile and run the collect.single, rarefaction.single or summary.single.
-For this use the read.otu command should be in the following format: read.otu(listfile=yourListFile, orderfile=yourOrderFile).
-The listfile, rabundfile or sabundfile parameter is required, but you may only use one of them.
-The second way to use the read.otu command is to read a listfile and a groupfile so you can use the collect.shared,
-rarefaction.shared or summary.shared commands. In this case the read.otu command should be in the following format:
-read.otu(listfile=yourListFile, groupfile=yourGroupFile). The listfile parameter and groupfile paramaters are required.
-When using the command the second way read.otu command parses the .list file and separates it into groups.
-It outputs a .shared file containing the OTU information for each group. The read.otu command also outputs a .list file for each group. */
-
class GlobalData;
class ReadOtuCommand : public Command {
private:
GlobalData* globaldata;
- //ReadOTUFile* read;
InputData* input;
Command* shared;
GroupMap* groupMap;
- string filename, listfile, orderfile, sharedfile, line, label, groupfile, sabundfile, rabundfile, format;
+ string filename, listfile, orderfile, sharedfile, label, groupfile, sabundfile, rabundfile, format;
bool abort, allLines;
- set<int> lines; //hold lines to be used
set<string> labels; //holds labels to be used
};
try {
//lookup.clear();
- int count = 1;
string errorOff = "no error";
//read in listfile
//if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
set<string> processedLabels;
set<string> userLabels = globaldata->labels;
- set<int> userLines = globaldata->lines;
- while((SharedList != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
+ while((SharedList != NULL) && ((globaldata->allLines == 1) || (userLabels.size() != 0))) {
- if(globaldata->allLines == 1 || globaldata->lines.count(count) == 1 || globaldata->labels.count(SharedList->getLabel()) == 1){
+ if(globaldata->allLines == 1 || globaldata->labels.count(SharedList->getLabel()) == 1){
lookup = SharedList->getSharedRAbundVector();
mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
processedLabels.insert(SharedList->getLabel());
userLabels.erase(SharedList->getLabel());
- userLines.erase(count);
}
if ((anyLabelsToProcess(SharedList->getLabel(), userLabels, errorOff) == true) && (processedLabels.count(lastLabel) != 1)) {
delete SharedList;
SharedList = input->getSharedListVector(); //get new list vector to process
-
- count++;
}
//output error messages about any remaining user labels
}
}
- //run last line if you need to
+ //run last label if you need to
if (needToRun == true) {
if (SharedList != NULL) { delete SharedList; }
SharedList = input->getSharedListVector(lastLabel); //get new list vector to process
globaldata = GlobalData::getInstance();
abort = false;
allLines = 1;
- lines.clear();
labels.clear();
Estimators.clear();
else {
//valid paramters for this command
- string Array[] = {"line","label","calc","abund","size"};
+ string Array[] = {"label","calc","abund","size"};
vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
OptionParser parser(option);
//check for optional parameter and set defaults
// ...at some point should added some additional type checking...
- line = validParameter.validFile(parameters, "line", false);
- if (line == "not found") { line = ""; }
- else {
- if(line != "all") { splitAtDash(line, lines); allLines = 0; }
- else { allLines = 1; }
- }
-
label = validParameter.validFile(parameters, "label", false);
if (label == "not found") { label = ""; }
else {
else { allLines = 1; }
}
- //make sure user did not use both the line and label parameters
- if ((line != "") && (label != "")) { mothurOut("You cannot use both the line and label parameters at the same time. "); mothurOutEndLine(); abort = true; }
- //if the user has not specified any line or labels use the ones from read.otu
- else if((line == "") && (label == "")) {
+ //if the user has not specified any labels use the ones from read.otu
+ if(label == "") {
allLines = globaldata->allLines;
labels = globaldata->labels;
- lines = globaldata->lines;
}
calc = validParameter.validFile(parameters, "calc", false);
try {
mothurOut("The summary.single command can only be executed after a successful read.otu WTIH ONE EXECEPTION.\n");
mothurOut("The summary.single command can be executed after a successful cluster command. It will use the .list file from the output of the cluster.\n");
- mothurOut("The summary.single command parameters are label, line, calc, abund. No parameters are required, but you may not use \n");
- mothurOut("both the line and label parameters at the same time. The summary.single command should be in the following format: \n");
- mothurOut("summary.single(label=yourLabel, line=yourLines, calc=yourEstimators).\n");
- mothurOut("Example summary.single(label=unique-.01-.03, line=0,5,10, calc=sobs-chao-ace-jack-bootstrap-shannon-npshannon-simpson).\n");
+ mothurOut("The summary.single command parameters are label, calc, abund. No parameters are required.\n");
+ mothurOut("The summary.single command should be in the following format: \n");
+ mothurOut("summary.single(label=yourLabel, calc=yourEstimators).\n");
+ mothurOut("Example summary.single(label=unique-.01-.03, calc=sobs-chao-ace-jack-bootstrap-shannon-npshannon-simpson).\n");
validCalculator->printCalc("summary", cout);
mothurOut("The default value calc is sobs-chao-ace-jack-shannon-npshannon-simpson\n");
- mothurOut("The label and line parameters are used to analyze specific lines in your input.\n");
- mothurOut("Note: No spaces between parameter labels (i.e. line), '=' and parameters (i.e.yourLines).\n\n");
+ mothurOut("The label parameter is used to analyze specific labels in your input.\n");
+ mothurOut("Note: No spaces between parameter labels (i.e. label), '=' and parameters (i.e.yourLabels).\n\n");
}
catch(exception& e) {
errorOut(e, "SummaryCommand", "help");
if (abort == true) { return 0; }
- int count = 1;
-
//if the users entered no valid calculators don't execute command
if (sumCalculators.size() == 0) { return 0; }
//if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
set<string> processedLabels;
set<string> userLabels = labels;
- set<int> userLines = lines;
-
- while((sabund != NULL) && ((allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
- if(allLines == 1 || lines.count(count) == 1 || labels.count(sabund->getLabel()) == 1){
+ while((sabund != NULL) && ((allLines == 1) || (userLabels.size() != 0))) {
+
+ if(allLines == 1 || labels.count(sabund->getLabel()) == 1){
mothurOut(sabund->getLabel()); mothurOutEndLine();
processedLabels.insert(sabund->getLabel());
userLabels.erase(sabund->getLabel());
- userLines.erase(count);
-
-
+
outputFileHandle << sabund->getLabel();
for(int i=0;i<sumCalculators.size();i++){
vector<double> data = sumCalculators[i]->getValues(sabund);
delete sabund;
sabund = input->getSAbundVector();
- count++;
}
//output error messages about any remaining user labels
}
}
- //run last line if you need to
+ //run last label if you need to
if (needToRun == true) {
if (sabund != NULL) { delete sabund; }
sabund = input->getSAbundVector(lastLabel);
#include "readotu.h"
#include "validcalculator.h"
-/* The summary() command:
- The summary command can only be executed after a successful read.list, read.sabund or read.rabund command, with one exception.
- The summary command can be executed after a successful cluster command. It will use the .list file from the output of the cluster.
- The summary command outputs a file for each estimator you choose to use. The summary command parameters are label, line, summary.
- No parameters are required, but you may not use both the line and label parameters at the same time.
- The summary command should be in the following format: summary(label=yourLabel, line=yourLines, summary=yourEstimators).
- Example summary(label=unique-.01-.03, line=0,5,10, summary=collect-chao-ace-jack-bootstrap-shannon-npshannon-simpson).
- The default value for summary is collect-chao-ace-jack-bootstrap-shannon-npshannon-simpson.
- The valid summary estimators are: collect-chao-ace-jack-bootstrap-shannon-npshannon-simpson.
- The label and line parameters are used to analyze specific lines in your input. */
-
-
class GlobalData;
class SummaryCommand : public Command {
int abund, size;
bool abort, allLines;
- set<int> lines; //hold lines to be used
set<string> labels; //holds labels to be used
- string line, label, calc;
+ string label, calc;
vector<string> Estimators;
};
globaldata = GlobalData::getInstance();
abort = false;
allLines = 1;
- lines.clear();
labels.clear();
Estimators.clear();
else {
//valid paramters for this command
- string Array[] = {"line","label","calc","groups"};
+ string Array[] = {"label","calc","groups"};
vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
OptionParser parser(option);
//check for optional parameter and set defaults
// ...at some point should added some additional type checking...
- line = validParameter.validFile(parameters, "line", false);
- if (line == "not found") { line = ""; }
- else {
- if(line != "all") { splitAtDash(line, lines); allLines = 0; }
- else { allLines = 1; }
- }
-
label = validParameter.validFile(parameters, "label", false);
if (label == "not found") { label = ""; }
else {
else { allLines = 1; }
}
- //make sure user did not use both the line and label parameters
- if ((line != "") && (label != "")) { mothurOut("You cannot use both the line and label parameters at the same time. "); mothurOutEndLine(); abort = true; }
- //if the user has not specified any line or labels use the ones from read.otu
- else if((line == "") && (label == "")) {
+ //if the user has not specified any labels use the ones from read.otu
+ if(label == "") {
allLines = globaldata->allLines;
labels = globaldata->labels;
- lines = globaldata->lines;
}
calc = validParameter.validFile(parameters, "calc", false);
void SummarySharedCommand::help(){
try {
mothurOut("The summary.shared command can only be executed after a successful read.otu command.\n");
- mothurOut("The summary.shared command parameters are label, line and calc. No parameters are required, but you may not use \n");
- mothurOut("both the line and label parameters at the same time. The summary.shared command should be in the following format: \n");
- mothurOut("summary.shared(label=yourLabel, line=yourLines, calc=yourEstimators, groups=yourGroups).\n");
- mothurOut("Example summary.shared(label=unique-.01-.03, line=0,5,10, groups=B-C, calc=sharedchao-sharedace-jabund-sorensonabund-jclass-sorclass-jest-sorest-thetayc-thetan).\n");
+ mothurOut("The summary.shared command parameters are label and calc. No parameters are required.\n");
+ mothurOut("The summary.shared command should be in the following format: \n");
+ mothurOut("summary.shared(label=yourLabel, calc=yourEstimators, groups=yourGroups).\n");
+ mothurOut("Example summary.shared(label=unique-.01-.03, groups=B-C, calc=sharedchao-sharedace-jabund-sorensonabund-jclass-sorclass-jest-sorest-thetayc-thetan).\n");
validCalculator->printCalc("sharedsummary", cout);
mothurOut("The default value for calc is sharedsobs-sharedchao-sharedace-jabund-sorensonabund-jclass-sorclass-jest-sorest-thetayc-thetan\n");
mothurOut("The default value for groups is all the groups in your groupfile.\n");
- mothurOut("The label and line parameters are used to analyze specific lines in your input.\n");
+ mothurOut("The label parameter is used to analyze specific labels in your input.\n");
mothurOut("The groups parameter allows you to specify which of the groups in your groupfile you would like analyzed. You must enter at least 2 valid groups.\n");
- mothurOut("Note: No spaces between parameter labels (i.e. line), '=' and parameters (i.e.yourLines).\n\n");
+ mothurOut("Note: No spaces between parameter labels (i.e. label), '=' and parameters (i.e.yourLabel).\n\n");
}
catch(exception& e) {
errorOut(e, "SummarySharedCommand", "help");
try {
if (abort == true) { return 0; }
-
- int count = 1;
//if the users entered no valid calculators don't execute command
if (sumCalculators.size() == 0) { return 0; }
//if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
set<string> processedLabels;
set<string> userLabels = labels;
- set<int> userLines = lines;
-
+
//as long as you are not at the end of the file or done wih the lines you want
- while((lookup[0] != NULL) && ((allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
+ while((lookup[0] != NULL) && ((allLines == 1) || (userLabels.size() != 0))) {
- if(allLines == 1 || lines.count(count) == 1 || labels.count(lookup[0]->getLabel()) == 1){
+ if(allLines == 1 || labels.count(lookup[0]->getLabel()) == 1){
mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
process(lookup);
processedLabels.insert(lookup[0]->getLabel());
userLabels.erase(lookup[0]->getLabel());
- userLines.erase(count);
}
if ((anyLabelsToProcess(lookup[0]->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLabel) != 1)) {
//prevent memory leak
for (int i = 0; i < lookup.size(); i++) { delete lookup[i]; }
lookup = input->getSharedRAbundVectors();
- count++;
}
//output error messages about any remaining user labels
}
}
- //run last line if you need to
+ //run last label if you need to
if (needToRun == true) {
for (int i = 0; i < lookup.size(); i++) { if (lookup[i] != NULL) { delete lookup[i]; } }
lookup = input->getSharedRAbundVectors(lastLabel);
#include "readotu.h"
#include "validcalculator.h"
-
-/*The summary.shared() command
- The summary.shared command can only be executed after a successful read.shared command.
- It outputs a file for each estimator you choose to use. The summary.shared command parameters are label,
- line and sharedsummary. No parameters are required, but you may not use both the line and label parameters at the same time.
- The summary.shared command should be in the following format: summary.shared(label=yourLabel,
- line=yourLines, sharedsummary=yourEstimators).
- Example summary.shared(label=unique-.01-.03, line=0,5,10, sharedsummary=sharedChao-sharedAce-sharedJabund
- -sharedSorensonAbund-sharedJclass-sharedSorClass-sharedJest-sharedSorEst-SharedThetaYC-SharedThetaN).
- The default value for sharedsummary is sharedChao-sharedAce-sharedJabund-sharedSorensonAbund-sharedJclass-sharedSorClass-sharedJest-sharedSorEst-SharedThetaYC-SharedThetaN.
- The valid sharedsummary estimators are: sharedChao-sharedAce-sharedJabund-sharedSorensonAbund-sharedJclass-sharedSorClass
- -sharedJest-sharedSorEst-SharedThetaYC-SharedThetaN. The label and line parameters are used to analyze specific lines in your input. */
-
-
class GlobalData;
-
class SummarySharedCommand : public Command {
public:
map<string, string> parameters;
map<string, string>::iterator it;
bool abort, allLines, mult;
- set<int> lines; //hold lines to be used
set<string> labels; //holds labels to be used
- string line, label, calc, groups;
+ string label, calc, groups;
vector<string> Estimators, Groups;
vector<SharedRAbundVector*> lookup;
string outputFileName, format, outAllFileName;
globaldata = GlobalData::getInstance();
abort = false;
allLines = 1;
- lines.clear();
labels.clear();
Groups.clear();
Estimators.clear();
else {
//valid paramters for this command
- string Array[] = {"line","label","calc","groups", "phylip", "column", "name", "precision","cutoff"};
+ string Array[] = {"label","calc","groups", "phylip", "column", "name", "precision","cutoff"};
vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
OptionParser parser(option);
//check for optional parameter and set defaults
// ...at some point should added some additional type checking...
- line = validParameter.validFile(parameters, "line", false);
- if (line == "not found") { line = ""; }
- else {
- if(line != "all") { splitAtDash(line, lines); allLines = 0; }
- else { allLines = 1; }
- }
-
label = validParameter.validFile(parameters, "label", false);
if (label == "not found") { label = ""; }
else {
else { allLines = 1; }
}
- //make sure user did not use both the line and label parameters
- if ((line != "") && (label != "")) { mothurOut("You cannot use both the line and label parameters at the same time. "); mothurOutEndLine(); abort = true; }
- //if the user has not specified any line or labels use the ones from read.otu
- else if((line == "") && (label == "")) {
+ //if the user has not specified any labels use the ones from read.otu
+ if(label == "") {
allLines = globaldata->allLines;
labels = globaldata->labels;
- lines = globaldata->lines;
}
groups = validParameter.validFile(parameters, "groups", false);
try {
mothurOut("The tree.shared command creates a .tre to represent the similiarity between groups or sequences.\n");
mothurOut("The tree.shared command can only be executed after a successful read.otu command or by providing a distance file.\n");
- mothurOut("The tree.shared command parameters are groups, calc, phylip, column, name, cutoff, precision, line and label. You may not use line and label at the same time.\n");
+ mothurOut("The tree.shared command parameters are groups, calc, phylip, column, name, cutoff, precision and label.\n");
mothurOut("The groups parameter allows you to specify which of the groups in your groupfile you would like included used.\n");
- mothurOut("The group names are separated by dashes. The line and label allow you to select what distance levels you would like trees created for, and are also separated by dashes.\n");
+ mothurOut("The group names are separated by dashes. The label allow you to select what distance levels you would like trees created for, and are also separated by dashes.\n");
mothurOut("The phylip or column parameter are required if you do not run the read.otu command first, and only one may be used. If you use a column file the name filename is required. \n");
mothurOut("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");
- mothurOut("The tree.shared command should be in the following format: tree.shared(groups=yourGroups, calc=yourCalcs, line=yourLines, label=yourLabels).\n");
- mothurOut("Example tree.shared(groups=A-B-C, line=1-3-5, calc=jabund-sorabund).\n");
+ mothurOut("The tree.shared command should be in the following format: tree.shared(groups=yourGroups, calc=yourCalcs, label=yourLabels).\n");
+ mothurOut("Example tree.shared(groups=A-B-C, calc=jabund-sorabund).\n");
mothurOut("The default value for groups is all the groups in your groupfile.\n");
mothurOut("The default value for calc is jclass-thetayc.\n");
mothurOut("The tree.shared command outputs a .tre file for each calculator you specify at each distance you choose.\n");
/***********************************************************/
void TreeGroupCommand::makeSimsShared() {
try {
- int count = 1;
//clear globaldatas old tree names if any
globaldata->Treenames.clear();
set<string> processedLabels;
set<string> userLabels = labels;
- set<int> userLines = lines;
-
+
//as long as you are not at the end of the file or done wih the lines you want
- while((lookup[0] != NULL) && ((allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
+ while((lookup[0] != NULL) && ((allLines == 1) || (userLabels.size() != 0))) {
- if(allLines == 1 || lines.count(count) == 1 || labels.count(lookup[0]->getLabel()) == 1){
+ if(allLines == 1 || labels.count(lookup[0]->getLabel()) == 1){
mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
process(lookup);
processedLabels.insert(lookup[0]->getLabel());
userLabels.erase(lookup[0]->getLabel());
- userLines.erase(count);
}
if ((anyLabelsToProcess(lookup[0]->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLabel) != 1)) {
//get next line to process
for (int i = 0; i < lookup.size(); i++) { delete lookup[i]; }
lookup = input->getSharedRAbundVectors();
- count++;
}
//output error messages about any remaining user labels
}
}
- //run last line if you need to
+ //run last label if you need to
if (needToRun == true) {
for (int i = 0; i < lookup.size(); i++) { if (lookup[i] != NULL) { delete lookup[i]; } }
lookup = input->getSharedRAbundVectors(lastLabel);
float precision, cutoff;
bool abort, allLines;
- set<int> lines; //hold lines to be used
set<string> labels; //holds labels to be used
- string phylipfile, columnfile, namefile, calc, groups, line, label;
+ string phylipfile, columnfile, namefile, calc, groups, label;
vector<string> Estimators, Groups; //holds estimators to be used
//if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
globaldata = GlobalData::getInstance();
abort = false;
allLines = 1;
- lines.clear();
labels.clear();
//allow user to run help
else {
//valid paramters for this command
- string AlignArray[] = {"groups","line","label","calc", "abund"};
+ string AlignArray[] = {"groups","label","calc", "abund"};
vector<string> myArray (AlignArray, AlignArray+(sizeof(AlignArray)/sizeof(string)));
OptionParser parser(option);
//check for optional parameter and set defaults
// ...at some point should added some additional type checking...
- line = validParameter.validFile(parameters, "line", false);
- if (line == "not found") { line = ""; }
- else {
- if(line != "all") { splitAtDash(line, lines); allLines = 0; }
- else { allLines = 1; }
- }
-
label = validParameter.validFile(parameters, "label", false);
if (label == "not found") { label = ""; }
else {
else { allLines = 1; }
}
- //make sure user did not use both the line and label parameters
- if ((line != "") && (label != "")) { mothurOut("You cannot use both the line and label parameters at the same time. "); mothurOutEndLine(); abort = true; }
- //if the user has not specified any line or labels use the ones from read.otu
- else if ((line == "") && (label == "")) {
+ //if the user has not specified any labels use the ones from read.otu
+ if (label == "") {
allLines = globaldata->allLines;
labels = globaldata->labels;
- lines = globaldata->lines;
}
groups = validParameter.validFile(parameters, "groups", false);
void VennCommand::help(){
try {
mothurOut("The venn command can only be executed after a successful read.otu command.\n");
- mothurOut("The venn command parameters are groups, calc, abund, line and label. No parameters are required, but you may not use line and label at the same time.\n");
+ mothurOut("The venn command parameters are groups, calc, abund and label. No parameters are required.\n");
mothurOut("The groups parameter allows you to specify which of the groups in your groupfile you would like included in your venn diagram, you may only use a maximum of 4 groups.\n");
- mothurOut("The group names are separated by dashes. The line and label allow you to select what distance levels you would like a venn diagram created for, and are also separated by dashes.\n");
- mothurOut("The venn command should be in the following format: venn(groups=yourGroups, calc=yourCalcs, line=yourLines, label=yourLabels, abund=yourAbund).\n");
- mothurOut("Example venn(groups=A-B-C, line=1-3-5, calc=sharedsobs-sharedchao, abund=20).\n");
- mothurOut("The default value for groups is all the groups in your groupfile up to 4, and all lines in your inputfile will be used.\n");
+ mothurOut("The group names are separated by dashes. The label allows you to select what distance levels you would like a venn diagram created for, and are also separated by dashes.\n");
+ mothurOut("The venn command should be in the following format: venn(groups=yourGroups, calc=yourCalcs, label=yourLabels, abund=yourAbund).\n");
+ mothurOut("Example venn(groups=A-B-C, calc=sharedsobs-sharedchao, abund=20).\n");
+ mothurOut("The default value for groups is all the groups in your groupfile up to 4, and all labels in your inputfile will be used.\n");
mothurOut("The default value for calc is sobs if you have only read a list file or if you have selected only one group, and sharedsobs if you have multiple groups.\n");
mothurOut("The default available estimators for calc are sobs, chao and ace if you have only read a list file, and sharedsobs, sharedchao and sharedace if you have read a list and group file or a shared file.\n");
mothurOut("The only estmiator available four 4 groups is sharedsobs.\n");
if (abort == true) { return 0; }
- int count = 1;
string lastLabel;
//if the users entered no valid calculators don't execute command
//if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
set<string> processedLabels;
set<string> userLabels = labels;
- set<int> userLines = lines;
if (format != "list") {
//as long as you are not at the end of the file or done wih the lines you want
- while((lookup[0] != NULL) && ((allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
+ while((lookup[0] != NULL) && ((allLines == 1) || (userLabels.size() != 0))) {
- if(allLines == 1 || lines.count(count) == 1 || labels.count(lookup[0]->getLabel()) == 1){
+ if(allLines == 1 || labels.count(lookup[0]->getLabel()) == 1){
mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
processedLabels.insert(lookup[0]->getLabel());
userLabels.erase(lookup[0]->getLabel());
- userLines.erase(count);
if (lookup.size() > 4) {
mothurOut("Error: Too many groups chosen. You may use up to 4 groups with the venn command. I will use the first four groups in your groupfile."); mothurOutEndLine();
//get next line to process
for (int i = 0; i < lookup.size(); i++) { delete lookup[i]; }
lookup = input->getSharedRAbundVectors();
- count++;
}
//output error messages about any remaining user labels
}
}
- //run last line if you need to
+ //run last label if you need to
if (needToRun == true) {
for (int i = 0; i < lookup.size(); i++) { if (lookup[i] != NULL) { delete lookup[i]; } }
lookup = input->getSharedRAbundVectors(lastLabel);
}else{
- while((sabund != NULL) && ((allLines == 1) || (userLabels.size() != 0) || (userLines.size() != 0))) {
+ while((sabund != NULL) && ((allLines == 1) || (userLabels.size() != 0))) {
- if(allLines == 1 || lines.count(count) == 1 || labels.count(sabund->getLabel()) == 1){
+ if(allLines == 1 || labels.count(sabund->getLabel()) == 1){
mothurOut(sabund->getLabel()); mothurOutEndLine();
venn->getPic(sabund, vennCalculators);
processedLabels.insert(sabund->getLabel());
userLabels.erase(sabund->getLabel());
- userLines.erase(count);
}
if ((anyLabelsToProcess(sabund->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLabel) != 1)) {
delete sabund;
sabund = input->getSAbundVector();
- count++;
}
//output error messages about any remaining user labels
}
}
- //run last line if you need to
+ //run last label if you need to
if (needToRun == true) {
if (sabund != NULL) { delete sabund; }
sabund = input->getSAbundVector(lastLabel);
int abund;
bool abort, allLines;
- set<int> lines; //hold lines to be used
set<string> labels; //holds labels to be used
- string format, groups, calc, line, label;
+ string format, groups, calc, label;
vector<string> Estimators, Groups;