#include "sharedsobscollectsummary.h"
#include "sharedchao1.h"
#include "sharedace.h"
+#include "nseqs.h"
//**********************************************************************************************************************
else {
//valid paramters for this command
- string AlignArray[] = {"groups","label","calc", "abund","outputdir","inputdir"};
+ string AlignArray[] = {"groups","label","calc", "abund","nseqs","outputdir","inputdir"};
vector<string> myArray (AlignArray, AlignArray+(sizeof(AlignArray)/sizeof(string)));
OptionParser parser(option);
//if the user changes the output directory command factory will send this info to us in the output parameter
outputDir = validParameter.validFile(parameters, "outputdir", false); if (outputDir == "not found"){
outputDir = "";
- outputDir += hasPath(globaldata->inputFileName); //if user entered a file with a path then preserve it
+ outputDir += m->hasPath(globaldata->inputFileName); //if user entered a file with a path then preserve it
}
//check for optional parameter and set defaults
label = validParameter.validFile(parameters, "label", false);
if (label == "not found") { label = ""; }
else {
- if(label != "all") { splitAtDash(label, labels); allLines = 0; }
+ if(label != "all") { m->splitAtDash(label, labels); allLines = 0; }
else { allLines = 1; }
}
groups = validParameter.validFile(parameters, "groups", false);
if (groups == "not found") { groups = ""; }
else {
- splitAtDash(groups, Groups);
+ m->splitAtDash(groups, Groups);
globaldata->Groups = Groups;
}
else { calc = "sharedsobs"; }
}
}
- splitAtDash(calc, Estimators);
+ m->splitAtDash(calc, Estimators);
string temp;
temp = validParameter.validFile(parameters, "abund", false); if (temp == "not found") { temp = "10"; }
convert(temp, abund);
+
+ temp = validParameter.validFile(parameters, "nseqs", false); if (temp == "not found"){ temp = "f"; }
+ nseqs = m->isTrue(temp);
+
if (abort == false) {
validCalculator = new ValidCalculators();
//if the users entered no valid calculators don't execute command
if (vennCalculators.size() == 0) { m->mothurOut("No valid calculators given, please correct."); m->mothurOutEndLine(); abort = true; }
- else { venn = new Venn(outputDir); }
+ else { venn = new Venn(outputDir, nseqs); }
}
}
void VennCommand::help(){
try {
m->mothurOut("The venn command can only be executed after a successful read.otu command.\n");
- m->mothurOut("The venn command parameters are groups, calc, abund and label. No parameters are required.\n");
+ m->mothurOut("The venn command parameters are groups, calc, abund, nseqs and label. No parameters are required.\n");
m->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");
m->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");
m->mothurOut("The venn command should be in the following format: venn(groups=yourGroups, calc=yourCalcs, label=yourLabels, abund=yourAbund).\n");
m->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");
m->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");
m->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");
- m->mothurOut("The only estmiator available four 4 groups is sharedsobs.\n");
+ m->mothurOut("The nseqs parameter will output the number of sequences represented by the otus in the picture, default=F.\n");
+ m->mothurOut("The only estimators available four 4 groups are sharedsobs and sharedchao.\n");
m->mothurOut("The venn command outputs a .svg file for each calculator you specify at each distance you choose.\n");
m->mothurOut("Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n\n");
}
for(int i = 0; i < outfilenames.size(); i++) { if (outfilenames[i] != "control" ) { outputNames.push_back(outfilenames[i]); } }
}
- if ((anyLabelsToProcess(lookup[0]->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLabel) != 1)) {
+ if ((m->anyLabelsToProcess(lookup[0]->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLabel) != 1)) {
string saveLabel = lookup[0]->getLabel();
for (int i = 0; i < lookup.size(); i++) { delete lookup[i]; }
userLabels.erase(sabund->getLabel());
}
- if ((anyLabelsToProcess(sabund->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLabel) != 1)) {
+ if ((m->anyLabelsToProcess(sabund->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLabel) != 1)) {
string saveLabel = sabund->getLabel();
delete sabund;