]> git.donarmstrong.com Git - mothur.git/commitdiff
fixed bug wit unifrac files
authorwestcott <westcott>
Fri, 6 Mar 2009 15:29:54 +0000 (15:29 +0000)
committerwestcott <westcott>
Fri, 6 Mar 2009 15:29:54 +0000 (15:29 +0000)
fullmatrix.cpp
fullmatrix.h
parsimonycommand.cpp
unifracunweightedcommand.cpp

index 75cb0dfc8a441f510ffbda66b29345d05a6f161f..6ff9334604c0fd0b622b55d971e7eeb69c946e63 100644 (file)
 #include "fullmatrix.h"
 
 
-/**************************************************************************
-FullMatrix::FullMatrix(ifstream& in) {
-
-}
-~FullMatrix::FullMatrix(){}
+/**************************************************************************/
+//This constructor reads a distance matrix file and stores the data in the matrix.
+FullMatrix::FullMatrix(ifstream& f) {
+       try{
+               f >> numSeqs;
+               
        
-       int FullMatrix::getNumSeqs(){}
-*/
\ No newline at end of file
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the FullMatrix class Function FullMatrix. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the FullMatrix class function FullMatrix. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+}
+/**************************************************************************/   
+int FullMatrix::getNumSeqs(){ return numSeqs; }
+/**************************************************************************/
\ No newline at end of file
index 4fe11451ea7bc612e1b50397bd82328bbe2195c3..389816abd70d40ce47ec324ce5d830bee77feff9 100644 (file)
@@ -17,7 +17,7 @@ class FullMatrix {
 public:
        FullMatrix(){};
        FullMatrix(ifstream&);
-       ~FullMatrix();
+       ~FullMatrix(){};
        
        int getNumSeqs();
        
index ee2125e99168553cb0e45de137d46211bdfc6421..633ddad982df6be8931b463dfe6d6c2e1b0cd8ef 100644 (file)
@@ -340,6 +340,7 @@ void ParsimonyCommand::setGroups() {
                                        allGroups = allGroups.substr(0, allGroups.length()-1);
                                }
                        }else{//user has enter "all" and wants the default groups
+                               globaldata->Groups.clear();
                                for (int i = 0; i < tmap->namesOfGroups.size(); i++) {
                                        globaldata->Groups.push_back(tmap->namesOfGroups[i]);
                                        numGroups++;
index bebd43b7d5ed7c4d24a82a4d0a8f96e15aed908f..6e217c8a71d37f22c3401a2dccc10aa23000fb26 100644 (file)
@@ -220,6 +220,7 @@ void UnifracUnweightedCommand::setGroups() {
                                        allGroups = allGroups.substr(0, allGroups.length()-1);
                                }
                        }else{//user has enter "all" and wants the default groups
+                               globaldata->Groups.clear();
                                for (int i = 0; i < tmap->namesOfGroups.size(); i++) {
                                        globaldata->Groups.push_back(tmap->namesOfGroups[i]);
                                        numGroups++;