]> git.donarmstrong.com Git - mothur.git/blobdiff - unifracunweightedcommand.cpp
added otu.association command. added calcSpearman, calcKendall and calcPearson functi...
[mothur.git] / unifracunweightedcommand.cpp
index cc175e17fd74f0d808fc9efa11442f582333e73d..a404f79222ac83cf41d42c04ceb614df1e01dceb 100644 (file)
@@ -155,7 +155,7 @@ UnifracUnweightedCommand::UnifracUnweightedCommand(string option)  {
                        else { m->setGroupFile(groupfile); }
                        
                        namefile = validParameter.validFile(parameters, "name", true);
-                       if (namefile == "not open") { abort = true; }
+                       if (namefile == "not open") { namefile = ""; abort = true; }
                        else if (namefile == "not found") { namefile = ""; }
                        else { m->setNameFile(namefile); }
                        
@@ -171,7 +171,7 @@ UnifracUnweightedCommand::UnifracUnweightedCommand(string option)  {
                        }
                                
                        itersString = validParameter.validFile(parameters, "iters", false);                             if (itersString == "not found") { itersString = "1000"; }
-                       convert(itersString, iters); 
+                       m->mothurConvert(itersString, iters); 
                        
                        string temp = validParameter.validFile(parameters, "distance", false);                  
                        if (temp == "not found") { phylip = false; outputForm = ""; }
@@ -188,7 +188,7 @@ UnifracUnweightedCommand::UnifracUnweightedCommand(string option)  {
                        
                        temp = validParameter.validFile(parameters, "processors", false);       if (temp == "not found"){       temp = m->getProcessors();      }
                        m->setProcessors(temp);
-                       convert(temp, processors); 
+                       m->mothurConvert(temp, processors); 
                        
                        if (!random) {  iters = 0;  } //turn off random calcs
                        
@@ -198,6 +198,11 @@ UnifracUnweightedCommand::UnifracUnweightedCommand(string option)  {
                                m->splitAtDash(groups, Groups);
                                m->setGroups(Groups);
                        }
+                       
+                       if (namefile == "") {
+                               vector<string> files; files.push_back(treefile);
+                               parser.getNameFile(files);
+                       }
                }
                
        }
@@ -282,10 +287,11 @@ int UnifracUnweightedCommand::execute() {
                m->openOutputFile(sumFile, outSum);
                
                util = new SharedUtil();
-               vector<string> Groups = m->getGroups();
+               Groups = m->getGroups();
                vector<string> namesGroups = tmap->getNamesOfGroups();
                util->setGroups(Groups, namesGroups, allGroups, numGroups, "unweighted");       //sets the groups the user wants to analyze
                util->getCombos(groupComb, Groups, numComp);
+               m->setGroups(Groups);
                delete util;
        
                if (numGroups == 1) { numComp++; groupComb.push_back(allGroups); }