//create and initialize vector of sharedvectors, one for each group
for (int i = 0; i < Groups.size(); i++) {
SharedRAbundVector* temp = new SharedRAbundVector(order->getNumBins());
//create and initialize vector of sharedvectors, one for each group
for (int i = 0; i < Groups.size(); i++) {
SharedRAbundVector* temp = new SharedRAbundVector(order->getNumBins());
- cout << "Standard Error: " << e.what() << " has occurred in the SharedUtil class Function getSharedVectors. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
- catch(...) {
- cout << "An unknown error has occurred in the SharedUtil class function getSharedVectors. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ m->errorOut(e, "SharedUtil", "getSharedVectors");
- cout << "Standard Error: " << e.what() << " has occurred in the SharedUtil class Function getSharedVectorswithReplacement. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
- catch(...) {
- cout << "An unknown error has occurred in the SharedUtil class function getSharedVectorswithReplacement. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ m->errorOut(e, "SharedUtil", "getSharedVectorswithReplacement");
//need to have mode because different commands require different number of valid groups
void SharedUtil::setGroups(vector<string>& userGroups, vector<string>& allGroups) {
try {
//need to have mode because different commands require different number of valid groups
void SharedUtil::setGroups(vector<string>& userGroups, vector<string>& allGroups) {
try {
if (userGroups.size() != 0) {
if (userGroups[0] != "all") {
//check that groups are valid
for (int i = 0; i < userGroups.size(); i++) {
if (isValidGroup(userGroups[i], allGroups) != true) {
if (userGroups.size() != 0) {
if (userGroups[0] != "all") {
//check that groups are valid
for (int i = 0; i < userGroups.size(); i++) {
if (isValidGroup(userGroups[i], allGroups) != true) {
}
/**************************************************************************************************/
//need to have mode because different commands require different number of valid groups
void SharedUtil::setGroups(vector<string>& userGroups, vector<string>& allGroups, string mode) {
try {
}
/**************************************************************************************************/
//need to have mode because different commands require different number of valid groups
void SharedUtil::setGroups(vector<string>& userGroups, vector<string>& allGroups, string mode) {
try {
if (userGroups.size() != 0) {
if (userGroups[0] != "all") {
//check that groups are valid
for (int i = 0; i < userGroups.size(); i++) {
if (isValidGroup(userGroups[i], allGroups) != true) {
if (userGroups.size() != 0) {
if (userGroups[0] != "all") {
//check that groups are valid
for (int i = 0; i < userGroups.size(); i++) {
if (isValidGroup(userGroups[i], allGroups) != true) {
if ((mode == "collect") || (mode == "rarefact") || (mode == "summary") || (mode == "treegroup")) {
//if the user only entered invalid groups
if ((userGroups.size() == 0) || (userGroups.size() == 1)) {
if ((mode == "collect") || (mode == "rarefact") || (mode == "summary") || (mode == "treegroup")) {
//if the user only entered invalid groups
if ((userGroups.size() == 0) || (userGroups.size() == 1)) {
- cout << "Standard Error: " << e.what() << " has occurred in the SharedUtil class Function setGroups. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
- catch(...) {
- cout << "An unknown error has occurred in the SharedUtil class function setGroups. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ m->errorOut(e, "SharedUtil", "setGroups");
//for parsimony and unifrac commands you set pairwise groups as well as an allgroups in calc
void SharedUtil::setGroups(vector<string>& userGroups, vector<string>& allGroups, string& label, int& numGroups, string mode){ //globaldata->Groups, your tree or group map, allgroups, mode
try {
//for parsimony and unifrac commands you set pairwise groups as well as an allgroups in calc
void SharedUtil::setGroups(vector<string>& userGroups, vector<string>& allGroups, string& label, int& numGroups, string mode){ //globaldata->Groups, your tree or group map, allgroups, mode
try {
//if the user has not entered specific groups to analyze then do them all
if (userGroups.size() != 0) {
if (userGroups[0] != "all") {
//check that groups are valid
for (int i = 0; i < userGroups.size(); i++) {
if (isValidGroup(userGroups[i], allGroups) != true) {
//if the user has not entered specific groups to analyze then do them all
if (userGroups.size() != 0) {
if (userGroups[0] != "all") {
//check that groups are valid
for (int i = 0; i < userGroups.size(); i++) {
if (isValidGroup(userGroups[i], allGroups) != true) {
}
//rip extra - off allgroups
label = label.substr(0, label.length()-1);
}
//rip extra - off allgroups
label = label.substr(0, label.length()-1);
}else if ((mode == "unweighted") || (mode == "parsimony")) {
//if the user only entered invalid groups
if ((userGroups.size() == 0) && (numGroups == 0)) {
}else if ((mode == "unweighted") || (mode == "parsimony")) {
//if the user only entered invalid groups
if ((userGroups.size() == 0) && (numGroups == 0)) {
for (int i = 0; i < allGroups.size(); i++) {
if (allGroups[i] != "xxx") {
userGroups.push_back(allGroups[i]);
for (int i = 0; i < allGroups.size(); i++) {
if (allGroups[i] != "xxx") {
userGroups.push_back(allGroups[i]);
- cout << "Standard Error: " << e.what() << " has occurred in the SharedUtil class Function setGroups. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
- catch(...) {
- cout << "An unknown error has occurred in the SharedUtil class function setGroups. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ m->errorOut(e, "SharedUtil", "setGroups");
exit(1);
}
}
/**************************************************************************************/
void SharedUtil::getCombos(vector<string>& groupComb, vector<string> userGroups, int& numComp) { //groupcomb, globaldata->Groups, numcomb
try {
exit(1);
}
}
/**************************************************************************************/
void SharedUtil::getCombos(vector<string>& groupComb, vector<string> userGroups, int& numComp) { //groupcomb, globaldata->Groups, numcomb
try {
//calculate number of comparisons i.e. with groups A,B,C = AB, AC, BC = 3;
numComp = 0;
for (int i=0; i< userGroups.size(); i++) {
numComp += i;
//calculate number of comparisons i.e. with groups A,B,C = AB, AC, BC = 3;
numComp = 0;
for (int i=0; i< userGroups.size(); i++) {
numComp += i;
- for (int l = i+1; l < userGroups.size(); l++) {
- //set group comparison labels
- groupComb.push_back(userGroups[i] + "-" + userGroups[l]);
+ for (int l = 0; l < i; l++) {
+ if (userGroups[i] > userGroups[l]) {
+ //set group comparison labels
+ groupComb.push_back(userGroups[l] + "-" + userGroups[i]);
+ }else{
+ groupComb.push_back(userGroups[i] + "-" + userGroups[l]);
+ }
- cout << "Standard Error: " << e.what() << " has occurred in the SharedUtil class Function getCombos. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
- catch(...) {
- cout << "An unknown error has occurred in the SharedUtil class function getCombos. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ m->errorOut(e, "SharedUtil", "getCombos");
- cout << "Standard Error: " << e.what() << " has occurred in the SharedUtil class Function isValidGroup. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
- catch(...) {
- cout << "An unknown error has occurred in the SharedUtil class function isValidGroup. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ m->errorOut(e, "SharedUtil", "isValidGroup");
- cout << "Standard Error: " << e.what() << " has occurred in the SharedUtil class Function updateGroupIndex. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
- catch(...) {
- cout << "An unknown error has occurred in the SharedUtil class function updateGroupIndex. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+ m->errorOut(e, "SharedUtil", "updateGroupIndex");