]> git.donarmstrong.com Git - mothur.git/blobdiff - treegroupscommand.cpp
working on current change
[mothur.git] / treegroupscommand.cpp
index b5849d3a0d23f49951161ab3c0bde4abd9af86d1..902b9a253b0aa7e5515b74adf464b7fe17a65e2c 100644 (file)
@@ -179,21 +179,22 @@ TreeGroupCommand::TreeGroupCommand(string option)  {
                        phylipfile = validParameter.validFile(parameters, "phylip", true);
                        if (phylipfile == "not open") { phylipfile = ""; abort = true; }
                        else if (phylipfile == "not found") { phylipfile = ""; }        
-                       else {  inputfile = phylipfile;  format = "phylip";     }
+                       else {  inputfile = phylipfile;  format = "phylip"; m->setPhylipFile(phylipfile);       }
                        
                        columnfile = validParameter.validFile(parameters, "column", true);
                        if (columnfile == "not open") { columnfile = ""; abort = true; }        
                        else if (columnfile == "not found") { columnfile = ""; }
-                       else {  inputfile = columnfile; format = "column";      }
+                       else {  inputfile = columnfile; format = "column";      m->setColumnFile(columnfile); }
                        
                        sharedfile = validParameter.validFile(parameters, "shared", true);
                        if (sharedfile == "not open") { sharedfile = ""; abort = true; }        
                        else if (sharedfile == "not found") { sharedfile = ""; }
-                       else {  inputfile = sharedfile; format = "sharedfile";  }
+                       else {  inputfile = sharedfile; format = "sharedfile";  m->setSharedFile(sharedfile); }
                        
                        namefile = validParameter.validFile(parameters, "name", true);
                        if (namefile == "not open") { abort = true; }   
                        else if (namefile == "not found") { namefile = ""; }
+                       else { m->setNameFile(namefile); }
                        
                        if ((phylipfile == "") && (columnfile == "") && (sharedfile == "")) { 
                                //is there are current file available for either of these?
@@ -248,6 +249,11 @@ TreeGroupCommand::TreeGroupCommand(string option)  {
                                 if (calc == "default")  {  calc = "jclass-thetayc";  }
                        }
                        m->splitAtDash(calc, Estimators);
+                       if (m->inUsersGroups("citation", Estimators)) { 
+                               ValidCalculators validCalc; validCalc.printCitations(Estimators); 
+                               //remove citation from list of calcs
+                               for (int i = 0; i < Estimators.size(); i++) { if (Estimators[i] == "citation") {  Estimators.erase(Estimators.begin()+i); break; } }
+                       }
 
                        string temp;
                        temp = validParameter.validFile(parameters, "precision", false);                        if (temp == "not found") { temp = "100"; }
@@ -753,8 +759,8 @@ int TreeGroupCommand::process(vector<SharedRAbundVector*> thisLookup) {
                                                                if (m->control_pressed) { return 1; }
                                                                
                                                                //save values in similarity matrix
-                                                               simMatrix[k][l] = data[0];
-                                                               simMatrix[l][k] = data[0];
+                                                               simMatrix[k][l] = -(data[0]-1.0);
+                                                               simMatrix[l][k] = -(data[0]-1.0);
                                                        }
                                                }
                                        }