From 5589a967aab6b83d826508f4c37a789fb6a2a26e Mon Sep 17 00:00:00 2001 From: westcott Date: Fri, 6 Mar 2009 15:29:54 +0000 Subject: [PATCH] fixed bug wit unifrac files --- fullmatrix.cpp | 26 +++++++++++++++++++------- fullmatrix.h | 2 +- parsimonycommand.cpp | 1 + unifracunweightedcommand.cpp | 1 + 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/fullmatrix.cpp b/fullmatrix.cpp index 75cb0df..6ff9334 100644 --- a/fullmatrix.cpp +++ b/fullmatrix.cpp @@ -10,11 +10,23 @@ #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 diff --git a/fullmatrix.h b/fullmatrix.h index 4fe1145..389816a 100644 --- a/fullmatrix.h +++ b/fullmatrix.h @@ -17,7 +17,7 @@ class FullMatrix { public: FullMatrix(){}; FullMatrix(ifstream&); - ~FullMatrix(); + ~FullMatrix(){}; int getNumSeqs(); diff --git a/parsimonycommand.cpp b/parsimonycommand.cpp index ee2125e..633ddad 100644 --- a/parsimonycommand.cpp +++ b/parsimonycommand.cpp @@ -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++; diff --git a/unifracunweightedcommand.cpp b/unifracunweightedcommand.cpp index bebd43b..6e217c8 100644 --- a/unifracunweightedcommand.cpp +++ b/unifracunweightedcommand.cpp @@ -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++; -- 2.39.5