X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=subsample.cpp;h=2eb1d497494849e316b58103f84a2c95a475a832;hp=a6b1b2d58da2daa5cc53d17d4bbb814b56921ffd;hb=499f4ac6e321f9f03d4c3aa25c3b6880892c8b83;hpb=a9dbc22713bfc056a797361dd757b1a5c98e1c01 diff --git a/subsample.cpp b/subsample.cpp index a6b1b2d..2eb1d49 100644 --- a/subsample.cpp +++ b/subsample.cpp @@ -24,7 +24,7 @@ Tree* SubSample::getSample(Tree* T, CountTable* ct, CountTable* newCt, int size) for (int i = 0; i < Groups.size(); i++) { if (m->inUsersGroups(Groups[i], m->getGroups())) { if (m->control_pressed) { break; } - cout << Groups[i] << endl; + int thisSize = ct->getGroupCount(Groups[i]); if (thisSize >= size) { @@ -108,7 +108,7 @@ vector SubSample::getSample(vector& thislookup, int try { //save mothurOut's binLabels to restore for next label - vector saveBinLabels = m->currentBinLabels; + vector saveBinLabels = m->currentSharedBinLabels; int numBins = thislookup[0]->getNumBins(); for (int i = 0; i < thislookup.size(); i++) { @@ -136,7 +136,7 @@ vector SubSample::getSample(vector& thislookup, int for (int j = 0; j < size; j++) { - if (m->control_pressed) { return m->currentBinLabels; } + if (m->control_pressed) { return m->currentSharedBinLabels; } int bin = order.get(j); @@ -149,11 +149,11 @@ vector SubSample::getSample(vector& thislookup, int //subsampling may have created some otus with no sequences in them eliminateZeroOTUS(thislookup); - if (m->control_pressed) { return m->currentBinLabels; } + if (m->control_pressed) { return m->currentSharedBinLabels; } //save mothurOut's binLabels to restore for next label - vector subsampleBinLabels = m->currentBinLabels; - m->currentBinLabels = saveBinLabels; + vector subsampleBinLabels = m->currentSharedBinLabels; + m->currentSharedBinLabels = saveBinLabels; return subsampleBinLabels; @@ -200,7 +200,7 @@ int SubSample::eliminateZeroOTUS(vector& thislookup) { for (int h = 0; h < diff; h++) { binLabel += "0"; } } binLabel += sbinNumber; - if (i < m->currentBinLabels.size()) { binLabel = m->currentBinLabels[i]; } + if (i < m->currentSharedBinLabels.size()) { binLabel = m->currentSharedBinLabels[i]; } newBinLabels.push_back(binLabel); } @@ -210,7 +210,7 @@ int SubSample::eliminateZeroOTUS(vector& thislookup) { thislookup.clear(); thislookup = newLookup; - m->currentBinLabels = newBinLabels; + m->currentSharedBinLabels = newBinLabels; return 0;