*
*/
-using namespace std;
-#include <map>
-#include <exception>
#include "sabundvector.hpp"
#include "rabundvector.hpp"
#include "ordervector.hpp"
-#include "datavector.hpp"
-#include "utilities.hpp"
#include "listvector.hpp"
/***********************************************************************/
-ListVector::ListVector() : DataVector(), maxRank(0), numBins(0), numSeqs(0){};
+ListVector::ListVector() : DataVector(), maxRank(0), numBins(0), numSeqs(0){}
/***********************************************************************/
-ListVector::ListVector(int n): DataVector(), data(n, "") , maxRank(0), numBins(0), numSeqs(0){};
+ListVector::ListVector(int n): DataVector(), data(n, "") , maxRank(0), numBins(0), numSeqs(0){}
/***********************************************************************/
}
}
catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the ListVector class Function ListVector. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
- catch(...) {
- cout << "An unknown error has occurred in the ListVector class function ListVector. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ m->errorOut(e, "ListVector", "ListVector");
exit(1);
}
}
f >> inputData;
set(i, inputData);
}
+
+ gobble(f);
}
catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the ListVector class Function ListVector. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
- catch(...) {
- cout << "An unknown error has occurred in the ListVector class function ListVector. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ m->errorOut(e, "ListVector", "ListVector");
exit(1);
}
}
numSeqs += (nNames_new - nNames_old);
}
catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the ListVector class Function set. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
- catch(...) {
- cout << "An unknown error has occurred in the ListVector class function set. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ m->errorOut(e, "ListVector", "set");
exit(1);
}
}
numSeqs += nNames;
}
catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the ListVector class Function push_back. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
- catch(...) {
- cout << "An unknown error has occurred in the ListVector class function push_back. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ m->errorOut(e, "ListVector", "push_back");
exit(1);
}
}
output << endl;
}
catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the ListVector class Function print. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
- catch(...) {
- cout << "An unknown error has occurred in the ListVector class function print. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ m->errorOut(e, "ListVector", "print");
exit(1);
}
}
return rav;
}
catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the ListVector class Function getRAbundVector. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
- catch(...) {
- cout << "An unknown error has occurred in the ListVector class function getRAbundVector. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ m->errorOut(e, "ListVector", "getRAbundVector");
exit(1);
}
}
return sav;
}
catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the ListVector class Function getSAbundVector. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
- catch(...) {
- cout << "An unknown error has occurred in the ListVector class function getSAbundVector. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ m->errorOut(e, "ListVector", "getSAbundVector");
exit(1);
}
}
-/***********************************************************************/
-SharedOrderVector* ListVector::getSharedOrderVector(){
- globaldata = GlobalData::getInstance();
- string groupName, names, name;
- groupmap = globaldata->gGroupmap;
- SharedOrderVector* order;
- order = new SharedOrderVector();
- order->setLabel(label);
-
- for(int i=0;i<numBins;i++){
- int binSize = getNumNames(get(i)); //find number of individual in given bin
- names = get(i);
- while (names.find_first_of(',') != -1) {
- name = names.substr(0,names.find_first_of(','));
- names = names.substr(names.find_first_of(',')+1, names.length());
- groupName = groupmap->getGroup(name);
- order->push_back(i, binSize, groupName); //i represents what bin you are in
- }
- //get last name
- groupName = groupmap->getGroup(names);
- order->push_back(i, binSize, groupName);
- }
- random_shuffle(order->begin(), order->end());
- return order;
-}
-
/***********************************************************************/
OrderVector ListVector::getOrderVector(map<string,int>* orderMap = NULL){
}
else{
if(orderMap->count(seqName) == 0){
- cerr << seqName << " not found, check *.names file\n";
+ m->mothurOut(seqName + " not found, check *.names file\n");
exit(1);
}
}
if(orderMap->count(seqName) == 0){
- cerr << seqName << " not found, check *.names file\n";
+ m->mothurOut(seqName + " not found, check *.names file\n");
exit(1);
}
ov.set((*orderMap)[seqName], i);
}
}
catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the ListVector class Function getOrderVector. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
- catch(...) {
- cout << "An unknown error has occurred in the ListVector class function getOrderVector. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ m->errorOut(e, "ListVector", "getOrderVector");
exit(1);
}
}