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);
//**********************************************************************************************************************
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");
}
}
- ofstream pcaData((fnameRoot+".pca").c_str(), ios::trunc);
+ ofstream pcaData((fnameRoot+".pca.axes").c_str(), ios::trunc);
pcaData.setf(ios::fixed, ios::floatfield);
pcaData.setf(ios::showpoint);
- outputNames.push_back(fnameRoot+".pca");
- outputTypes["pca"].push_back(fnameRoot+".pca");
+ outputNames.push_back(fnameRoot+".pca.axes");
+ outputTypes["pca"].push_back(fnameRoot+".pca.axes");
ofstream pcaLoadings((fnameRoot+".pca.loadings").c_str(), ios::trunc);
pcaLoadings.setf(ios::fixed, ios::floatfield);