X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=seqnoise.cpp;h=8e7a4395fbf20009d135502fde3774b2592a9440;hb=541bab1dac00688b4c3a8c4a95ab464412663c50;hp=578daafffe4273fae5564781d1407ddc0bd869aa;hpb=e0dc0bcef2a0f7e1f63abb531dbb1ad533da98ca;p=mothur.git diff --git a/seqnoise.cpp b/seqnoise.cpp index 578daaf..8e7a439 100644 --- a/seqnoise.cpp +++ b/seqnoise.cpp @@ -140,6 +140,8 @@ int seqNoise::getListData(string listFileName, double cutOff, vector& otuDa m->openInputFile(listFileName, listFile); double threshold; int numOTUs; + string line = ""; + bool adjustCutoff = true; if(listFile.peek() == 'u'){ m->getline(listFile); } @@ -147,9 +149,10 @@ int seqNoise::getListData(string listFileName, double cutOff, vector& otuDa listFile >> threshold; if(threshold < cutOff){ - m->getline(listFile); + line = m->getline(listFile); m->gobble(listFile); } else{ + adjustCutoff = false; listFile >> numOTUs; otuFreq.resize(numOTUs, 0); @@ -201,6 +204,63 @@ int seqNoise::getListData(string listFileName, double cutOff, vector& otuDa break; } } + + listFile.close(); + + //the listfile does not contain a threshold greater than the cutoff so use highest value + if (adjustCutoff) { + istringstream iss (line,istringstream::in); + + iss >> numOTUs; + otuFreq.resize(numOTUs, 0); + + for(int i=0;icontrol_pressed) { return 0; } + + string otu; + iss >> otu; + + int count = 0; + + string number = ""; + + for(int j=0;jcontrol_pressed) { return 0; } + otuBySeqLookUp[otuData[i]].push_back(i); + } + for(int i=0;icontrol_pressed) { return 0; } + for(int j=otuBySeqLookUp[i].size();j