X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=pcoacommand.cpp;h=3cd844a36d5a5c253786b4eb29745388b042d2d4;hb=943d3038553f82378567d3b651969146716e5862;hp=fbcb7e08779d14f28277d8b5e8d0a8ce3b088174;hpb=e6c4a7223199d800d496356604eb34dfe273673d;p=mothur.git diff --git a/pcoacommand.cpp b/pcoacommand.cpp index fbcb7e0..3cd844a 100644 --- a/pcoacommand.cpp +++ b/pcoacommand.cpp @@ -26,8 +26,7 @@ vector PCOACommand::getValidParameters(){ //********************************************************************************************************************** PCOACommand::PCOACommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["pcoa"] = tempOutNames; outputTypes["loadings"] = tempOutNames; @@ -64,10 +63,10 @@ vector PCOACommand::getRequiredFiles(){ PCOACommand::PCOACommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //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 @@ -149,7 +148,7 @@ PCOACommand::~PCOACommand(){} int PCOACommand::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); @@ -170,12 +169,12 @@ int PCOACommand::execute(){ vector d; vector e; vector > G = D; - vector > copy_G; + //vector > copy_G; m->mothurOut("\nProcessing...\n\n"); for(int count=0;count<2;count++){ - recenter(offset, D, G); if (m->control_pressed) { return 0; } + linearCalc.recenter(offset, D, G); if (m->control_pressed) { return 0; } linearCalc.tred2(G, d, e); if (m->control_pressed) { return 0; } linearCalc.qtli(d, e, G); if (m->control_pressed) { return 0; } offset = d[d.size()-1]; @@ -198,7 +197,7 @@ int PCOACommand::execute(){ double corr = linearCalc.calcPearson(EuclidDists, D); //G is the pcoa file, D is the users distance matrix - m->mothurOut("Pearson's coefficient using " + toString(i) + " axis: " + toString(corr)); m->mothurOutEndLine(); + m->mothurOut("Rsq " + toString(i) + " axis: " + toString(corr * corr)); m->mothurOutEndLine(); if (m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } return 0; } } @@ -231,40 +230,6 @@ void PCOACommand::get_comment(istream& f, char begin, char end){ } /*********************************************************************************************************************************/ -void PCOACommand::recenter(double offset, vector > D, vector >& G){ - try { - int rank = D.size(); - - vector > A(rank); - vector > C(rank); - for(int i=0;ierrorOut(e, "PCOACommand", "recenter"); - exit(1); - } - -} - -/*********************************************************************************************************************************/ - void PCOACommand::output(string fnameRoot, vector name_list, vector >& G, vector d) { try { int rank = name_list.size();