X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=pcacommand.cpp;h=2e8f132eefa8a491f1b5e23a2d9650da22ee1c84;hb=74d3aaf0f85080ea3cfb1f1871e706bab9f48392;hp=89e1cb71f282aa2f2606b84ae3aba03da5c74f6b;hpb=e6c4a7223199d800d496356604eb34dfe273673d;p=mothur.git diff --git a/pcacommand.cpp b/pcacommand.cpp index 89e1cb7..2e8f132 100644 --- a/pcacommand.cpp +++ b/pcacommand.cpp @@ -25,8 +25,7 @@ vector PCACommand::getValidParameters(){ //********************************************************************************************************************** PCACommand::PCACommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["pca"] = tempOutNames; outputTypes["loadings"] = tempOutNames; @@ -63,12 +62,12 @@ vector PCACommand::getRequiredFiles(){ PCACommand::PCACommand(string option) { try { - abort = false; + abort = false; calledHelp = false; globaldata = GlobalData::getInstance(); //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -111,7 +110,7 @@ PCACommand::PCACommand(string option) { metric = m->isTrue(temp); label = validParameter.validFile(parameters, "label", false); - if (label == "not found") { label = ""; m->mothurOut("You did not provide a label, I will use the first label in your inputfile."); m->mothurOutEndLine(); } + if (label == "not found") { label = ""; labels = globaldata->labels; if(labels.size() == 0) { m->mothurOut("You did not provide a label, I will use the first label in your inputfile."); m->mothurOutEndLine(); } } else { m->splitAtDash(label, labels); } groups = validParameter.validFile(parameters, "groups", false); @@ -130,9 +129,9 @@ PCACommand::PCACommand(string option) { //********************************************************************************************************************** void PCACommand::help(){ try { - m->mothurOut("The pca command can only be run after a successful read.otu command."); m->mothurOutEndLine(); + m->mothurOut("The pca command can only be run after a successful read.otu command of a shared or relabund file."); m->mothurOutEndLine(); m->mothurOut("The pca command parameters are label, groups and metric. No parameters are required."); m->mothurOutEndLine(); - m->mothurOut("The label parameter is used to analyze specific labels in your input. Default is the first label in your shared or relabund file. Multpile labels may be separated by dashes.\n"); + m->mothurOut("The label parameter is used to analyze specific labels in your input. Default is the first label in your shared or relabund file. Multiple labels may be separated by dashes.\n"); m->mothurOut("The groups parameter allows you to specify which groups you would like analyzed. Groupnames are separated by dashes.\n"); m->mothurOut("The metric parameter allows indicate you if would like the pearson correlation coefficient calculated. Default=True"); m->mothurOutEndLine(); m->mothurOut("Example pca(groups=yourGroups).\n"); @@ -150,7 +149,7 @@ PCACommand::~PCACommand(){} int PCACommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } cout.setf(ios::fixed, ios::floatfield); cout.setf(ios::showpoint);