]> git.donarmstrong.com Git - mothur.git/commitdiff
fixed bug with get.oturep and fixed problem with errorcheckor that did not allow...
authorwestcott <westcott>
Tue, 21 Apr 2009 15:14:13 +0000 (15:14 +0000)
committerwestcott <westcott>
Tue, 21 Apr 2009 15:14:13 +0000 (15:14 +0000)
errorchecking.cpp
getoturepcommand.cpp

index 4eef3b041aaf724e87efb980c6115c9cc78036ce..aa223a20379d1fd590908fbb5aa92c7a38cbf03b 100644 (file)
@@ -23,21 +23,21 @@ ErrorCheck::ErrorCheck() {
 /******************************************************/
 
 void ErrorCheck::refresh() {
-       columnfile = globaldata->getColumnFile();
-       phylipfile = globaldata->getPhylipFile();
-       listfile = globaldata->getListFile();
-       rabundfile = globaldata->getRabundFile();
-       sabundfile = globaldata->getSabundFile();
-       namefile = globaldata->getNameFile();
-       groupfile = globaldata->getGroupFile();
-       orderfile = globaldata->getOrderFile();
-       fastafile = globaldata->getFastaFile();
-       treefile = globaldata->getTreeFile();
-       cutoff = globaldata->getCutOff();
-       format = globaldata->getFormat();
-       method = globaldata->getMethod();
-       randomtree = globaldata->getRandomTree();
-       sharedfile = globaldata->getSharedFile();
+       //columnfile = globaldata->getColumnFile();
+       //phylipfile = globaldata->getPhylipFile();
+       //listfile = globaldata->getListFile();
+       //rabundfile = globaldata->getRabundFile();
+       //sabundfile = globaldata->getSabundFile();
+       //namefile = globaldata->getNameFile();
+       //groupfile = globaldata->getGroupFile();
+       //orderfile = globaldata->getOrderFile();
+       //fastafile = globaldata->getFastaFile();
+       //treefile = globaldata->getTreeFile();
+       //cutoff = globaldata->getCutOff();
+       //format = globaldata->getFormat();
+       //method = globaldata->getMethod();
+       //randomtree = globaldata->getRandomTree();
+       //sharedfile = globaldata->getSharedFile();
 }
 
 /*******************************************************/
@@ -85,8 +85,6 @@ bool ErrorCheck::checkInput(string input) {
                                
                                //is it a valid parameter
                                if (validParameter->isValidParameter(parameter, commandName, value) != true) { return false; }
-
-
                                
                                if (parameter == "phylip" )             { phylipfile = value; }
                                if (parameter == "column" )             { columnfile = value; }
index 064455f49e28538c95858ba574dc9ef3b0cc9289..6daad979d741f56290ac7e40979de956a705e1ee 100644 (file)
@@ -20,11 +20,19 @@ GetOTURepCommand::GetOTURepCommand(){
                if(globaldata->gListVector != NULL)             {       
                        listOfNames = new ListVector(*globaldata->gListVector); 
                        
+                       vector<string> names;
+                       string binnames;
                        //map names to rows in sparsematrix
                        for (int i = 0; i < listOfNames->size(); i++) {
-                               nameToIndex[listOfNames->get(i)] = i;
+                               names.clear();
+                               binnames = listOfNames->get(i);
+                               splitAtComma(binnames, names);
+                               
+                               for (int j = 0; j < names.size(); j++) {
+                                       nameToIndex[names[j]] = i;
+                               }
                        }
-               }else { cout << "error" << endl; }
+               }else { cout << "error, no listvector." << endl; }
 
                
                fastafile = globaldata->getFastaFile();
@@ -176,7 +184,7 @@ string GetOTURepCommand::FindRep(int bin) {
                string minName;
                
                binnames = list->get(bin);
-               
+       
                //parse names into vector
                splitAtComma(binnames, names);
                
@@ -186,6 +194,7 @@ string GetOTURepCommand::FindRep(int bin) {
                        //fill binMap
                        for (int i = 0; i < names.size(); i++) {
                                for (it3 = nameToIndex.begin(); it3 != nameToIndex.end(); it3++) {
+
                                        if (it3->first == names[i]) {  
                                                binMap[it3->second] = it3->first;