]> git.donarmstrong.com Git - mothur.git/blobdiff - pcacommand.cpp
added cutoff change to hcluster
[mothur.git] / pcacommand.cpp
index 6e2cce79736a9f01edbaa44bd31e145921850a30..8dee743e07bd4fb546d907e41fd7ab97f6f71664 100644 (file)
@@ -70,6 +70,7 @@ PCACommand::PCACommand(string option)  {
                
                //allow user to run help
                if(option == "help") { help(); abort = true; calledHelp = true; }
+               else if(option == "citation") { citation(); abort = true; calledHelp = true;}
                
                else {
                        vector<string> myArray = setParameters();
@@ -116,12 +117,12 @@ PCACommand::PCACommand(string option)  {
                        sharedfile = validParameter.validFile(parameters, "shared", true);
                        if (sharedfile == "not open") { sharedfile = ""; abort = true; }        
                        else if (sharedfile == "not found") { sharedfile = ""; }
-                       else {  mode = "sharedfile"; inputFile = sharedfile; }
+                       else {  mode = "sharedfile"; inputFile = sharedfile; m->setSharedFile(sharedfile); }
                        
                        relabundfile = validParameter.validFile(parameters, "relabund", true);
                        if (relabundfile == "not open") { relabundfile = ""; abort = true; }    
                        else if (relabundfile == "not found") { relabundfile = ""; }
-                       else {  mode = "relabund"; inputFile = relabundfile; }
+                       else {  mode = "relabund"; inputFile = relabundfile; m->setRelAbundFile(relabundfile); }
                        
                        
                        if ((sharedfile == "") && (relabundfile == "")) { 
@@ -318,7 +319,6 @@ int PCACommand::process(vector<SharedRAbundFloatVector*>& lookupFloat){
                vector< vector<double> > matrix(numSamples);
                vector<double> colMeans(numOTUs);
                
-                               
                //fill matrix with shared relative abundances, re-center
                for (int i = 0; i < lookupFloat.size(); i++) {
                        matrix[i].resize(numOTUs, 0);
@@ -426,7 +426,7 @@ void PCACommand::output(string fnameRoot, vector<string> name_list, vector<vecto
                }
                pcaData << endl;
                
-               for(int i=0;i<numEigenValues;i++){
+               for(int i=0;i<name_list.size();i++){
                        pcaData << name_list[i] << '\t';
                        for(int j=0;j<numEigenValues;j++){
                                pcaData << G[i][j] << '\t';