From ccae9eef0b44f2d63fdf4a707d0d40243aa1b990 Mon Sep 17 00:00:00 2001 From: Sarah Westcott Date: Wed, 11 Jul 2012 15:09:35 -0400 Subject: [PATCH] working on mgcluster count file change --- mgclustercommand.cpp | 10 +++++----- mgclustercommand.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mgclustercommand.cpp b/mgclustercommand.cpp index cffb80f..6ef968c 100644 --- a/mgclustercommand.cpp +++ b/mgclustercommand.cpp @@ -172,7 +172,7 @@ MGClusterCommand::MGClusterCommand(string option) { else if (countfile == "not found") { countfile = ""; } else { m->setCountTableFile(countfile); } - if (countfile != "" && namefile != "") { m->mothurOut("Cannot have both a name file and count file. Please use one or the other."); m->mothurOutEndLine(); abort = true; } + if (countfile != "" && namefile != "") { m->mothurOut("[ERROR]: Cannot have both a name file and count file. Please use one or the other."); m->mothurOutEndLine(); abort = true; } if ((blastfile == "")) { m->mothurOut("When executing a mgcluster command you must provide a blastfile."); m->mothurOutEndLine(); abort = true; } @@ -249,8 +249,8 @@ int MGClusterCommand::execute(){ //map nameMapCounts = m->readNames(namefile); ct = new CountTable(); ct->readTable(countfile); - createRabund(ct, list); - rabund = &rav; + rabund = new RAbundVector(); + createRabund(ct, list, rabund); }else { rabund = new RAbundVector(list->getRAbundVector()); } @@ -724,7 +724,7 @@ void MGClusterCommand::sortHclusterFiles(string unsortedDist, string unsortedOve //********************************************************************************************************************** -void MGClusterCommand::createRabund(CountTable* ct, ListVector* list){ +void MGClusterCommand::createRabund(CountTable*& ct, ListVector*& list, RAbundVector*& rabund){ try { //vector names = ct.getNamesOfSeqs(); @@ -739,7 +739,7 @@ void MGClusterCommand::createRabund(CountTable* ct, ListVector* list){ for (int j = 0; j < binNames.size(); j++) { total += ct->getNumSeqs(binNames[j]); } - rav.push_back(total); + rabund->push_back(total); } diff --git a/mgclustercommand.h b/mgclustercommand.h index 0626b86..6c75d6c 100644 --- a/mgclustercommand.h +++ b/mgclustercommand.h @@ -64,7 +64,7 @@ private: ListVector* mergeOPFs(map, float); void sortHclusterFiles(string, string); vector getSeqs(ifstream&); - void createRabund(CountTable*, ListVector*); + void createRabund(CountTable*&, ListVector*&, RAbundVector*&); }; -- 2.39.2