X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=metastatscommand.cpp;h=de9e373194b30bc97a2afbeceb49b5303aa66de3;hb=ffa535cf04326227080b02594616971a2c3a5195;hp=204d83e10df302ba17d3303c0bdb0a81f54536be;hpb=4283eb0248ca6e7e3e3344647f16166da0e14147;p=mothur.git diff --git a/metastatscommand.cpp b/metastatscommand.cpp index 204d83e..de9e373 100644 --- a/metastatscommand.cpp +++ b/metastatscommand.cpp @@ -9,6 +9,7 @@ #include "metastatscommand.h" #include "sharedutilities.h" +#include "sharedrabundfloatvector.h" //********************************************************************************************************************** @@ -213,7 +214,7 @@ MetaStatsCommand::MetaStatsCommand(string option) { int MetaStatsCommand::execute(){ try { - if (abort == true) { if (calledHelp) { return 0; } return 2; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } //just used to convert files to test metastats online /****************************************************/ @@ -221,7 +222,6 @@ int MetaStatsCommand::execute(){ convertSharedToInput = false; if (convertInputToShared) { convertToShared(sharedfile); return 0; } /****************************************************/ - designMap = new GroupMap(designfile); designMap->readDesignMap(); @@ -574,9 +574,11 @@ int MetaStatsCommand::convertToShared(string filename) { string header = m->getline(in); m->gobble(in); vector groups = m->splitWhiteSpace(header); - vector newLookup; + vector newLookup; + cout << groups.size() << endl; for (int i = 0; i < groups.size(); i++) { - SharedRAbundVector* temp = new SharedRAbundVector(); + cout << "creating group " << groups[i] << endl; + SharedRAbundFloatVector* temp = new SharedRAbundFloatVector(); temp->setLabel("0.03"); temp->setGroup(groups[i]); newLookup.push_back(temp); @@ -589,9 +591,9 @@ int MetaStatsCommand::convertToShared(string filename) { string otuname; in >> otuname; m->gobble(in); otuCount++; - + cout << otuname << endl; for (int i = 0; i < groups.size(); i++) { - int temp; + double temp; in >> temp; m->gobble(in); newLookup[i]->push_back(temp, groups[i]); } @@ -646,7 +648,7 @@ int MetaStatsCommand::convertToInput(vector& subset, string out << subset[subset.size()-1]->getGroup() << endl; for (int i = 0; i < subset[0]->getNumBins(); i++) { - out << m->currentBinLabels[i] << '\t'; + out << m->currentSharedBinLabels[i] << '\t'; for (int j = 0; j < subset.size()-1; j++) { out << subset[j]->getAbundance(i) << '\t'; } @@ -654,6 +656,8 @@ int MetaStatsCommand::convertToInput(vector& subset, string } out.close(); + cout << thisfilename+".matrix" << endl; + return 0; } catch(exception& e) {