]> git.donarmstrong.com Git - mothur.git/commitdiff
1.23.0
authorwestcott <westcott>
Mon, 9 Jan 2012 16:38:48 +0000 (16:38 +0000)
committerwestcott <westcott>
Mon, 9 Jan 2012 16:38:48 +0000 (16:38 +0000)
makefile
seqnoise.cpp

index c7dc1fdd1a6aeae18a6db7857a473e2be6fca966..e2e66c152650226dda8bde8f43d93a5e660c2895 100644 (file)
--- a/makefile
+++ b/makefile
@@ -15,8 +15,8 @@ USEREADLINE ?= yes
 CYGWIN_BUILD ?= no
 USECOMPRESSION ?= no
 MOTHUR_FILES="\"Enter_your_default_path_here\""
-RELEASE_DATE = "\"12/7/2011\""
-VERSION = "\"1.22.0\""
+RELEASE_DATE = "\"1/9/2012\""
+VERSION = "\"1.23.0\""
 FORTAN_COMPILER = gfortran
 
 # Optimize to level 3:
@@ -24,10 +24,10 @@ CXXFLAGS += -O3
 
 ifeq  ($(strip $(64BIT_VERSION)),yes)
        #if you are using centos uncomment the following lines
-       CXX = g++44
+       #CXX = g++44
        
        #if you are a mac user use the following line
-#      TARGET_ARCH += -arch x86_64
+       TARGET_ARCH += -arch x86_64
        
        #if you using cygwin to build Windows the following line
        #CXX = x86_64-w64-mingw32-g++
@@ -35,7 +35,7 @@ ifeq  ($(strip $(64BIT_VERSION)),yes)
        #TARGET_ARCH += -m64 -static
 
        #if you are a linux user use the following line
-       CXXFLAGS += -mtune=native -march=native -m64
+       #CXXFLAGS += -mtune=native -march=native -m64
        
         CXXFLAGS += -DBIT_VERSION
 endif
index 578daafffe4273fae5564781d1407ddc0bd869aa..9ee80106b4346391c66d8fc75650b3f71e337062 100644 (file)
@@ -140,6 +140,8 @@ int seqNoise::getListData(string listFileName, double cutOff, vector<int>& 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<int>& 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<int>& 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;i<numOTUs;i++){
+                               
+                               if (m->control_pressed) { return 0; }
+                               
+                               string otu;
+                               iss >> otu;
+                               
+                               int count = 0;
+                               
+                               string number = "";
+                               
+                               for(int j=0;j<otu.size();j++){
+                                       if(otu[j] != ','){
+                                               number += otu[j];
+                                       }
+                                       else{
+                                               int index = atoi(number.c_str());
+                                               otuData[index] = i;
+                                               count++;
+                                               number = "";
+                                       }
+                               }
+                               
+                               int index = atoi(number.c_str());
+                               otuData[index] = i;
+                               count++;
+                               
+                               otuFreq[i] = count;
+                       }
+                       
+                       otuBySeqLookUp.resize(numOTUs);
+                       
+                       int numSeqs = otuData.size();
+                       
+                       for(int i=0;i<numSeqs;i++){
+                               if (m->control_pressed) { return 0; }
+                               otuBySeqLookUp[otuData[i]].push_back(i);
+                       }
+                       for(int i=0;i<numOTUs;i++){
+                               if (m->control_pressed) { return 0; }
+                               for(int j=otuBySeqLookUp[i].size();j<numSeqs;j++){
+                                       otuBySeqLookUp[i].push_back(0);
+                               }
+                       }
+                       
+               }
+               
                return 0;
        }
        catch(exception& e) {