]> git.donarmstrong.com Git - mothur.git/commitdiff
mods to shhh.seqs command
authorpschloss <pschloss>
Tue, 15 Feb 2011 11:41:28 +0000 (11:41 +0000)
committerpschloss <pschloss>
Tue, 15 Feb 2011 11:41:28 +0000 (11:41 +0000)
shhhercommand.cpp
shhhercommand.h

index 6a19618b503d13157a1fdea8ae5a234c019fe9af..39a27d593abd1a3da6d9f93ab89e79b893c72089 100644 (file)
@@ -289,7 +289,9 @@ int ShhherCommand::execute(){
                        
                        for(int i=0;i<numFiles;i++){
                                flowFileName = flowFileVector[i];
-                       
+
+                               
+                               
                                m->mothurOut("\n>>>>>\tProcessing " + flowFileName + " (file " + toString(i+1) + " of " + toString(numFiles) + ")\t<<<<<\n");
                                m->mothurOut("Reading flowgrams...\n");
                                
@@ -761,6 +763,11 @@ void ShhherCommand::getFlowData(){
                m->openInputFile(flowFileName, flowFile);
                
                string seqName;
+               seqNameVector.clear();
+               lengths.clear();
+               flowDataIntI.clear();
+               nameMap.clear();
+               
                
                int currentNumFlowCells;
                
@@ -943,7 +950,7 @@ void ShhherCommand::getUniques(){
                uniqueFlowDataIntI.resize(numFlowCells * numUniques);
                uniqueLengths.resize(numUniques);       
                
-               flowDataPrI.assign(numSeqs * numFlowCells, 0);
+               flowDataPrI.resize(numSeqs * numFlowCells, 0);
                for(int i=0;i<flowDataPrI.size();i++)   {       flowDataPrI[i] = getProbIntensity(flowDataIntI[i]);             }
        }
        catch(exception& e) {
@@ -1205,6 +1212,10 @@ void ShhherCommand::getOTUData(string listFileName){
                nSeqsPerOTU.assign(numOTUs, 0);
                aaP.resize(numOTUs);
                
+               seqNumber.clear();
+               aaI.clear();
+               seqIndex.clear();
+               
                string singleOTU = "";
                
                for(int i=0;i<numOTUs;i++){
@@ -1673,9 +1684,9 @@ void ShhherCommand::calcNewDistancesChildMPI(int startSeq, int stopSeq, vector<i
        try{
                vector<double> newTau(numOTUs,0);
                vector<double> norms(numSeqs, 0);
-               otuIndex.resize(0);
-               seqIndex.resize(0);
-               singleTau.resize(0);
+               otuIndex.clear();
+               seqIndex.clear();
+               singleTau.clear();
                
                
                
index 9e50824b05f9c70a151a903b8119ba09c447b963..acceb7fdba0aa19c3e5f8b032d11d5ad872dca5c 100644 (file)
@@ -40,19 +40,20 @@ private:
        
        vector<int> nSeqsBreaks;
        vector<int> nOTUsBreaks;
-       vector<double> flowDataPrI;
-       vector<short> flowDataIntI;
-       vector<int> lengths;
-       vector<string> seqNameVector;
        vector<double> singleLookUp;
        vector<double> jointLookUp;
+       
+       vector<string> seqNameVector;
+       vector<int> lengths;
+       vector<short> flowDataIntI;
+       vector<double> flowDataPrI;
        map<string, int> nameMap;
        vector<int> otuData;
        vector<int> cumNumSeqs;
        vector<int> nSeqsPerOTU;
        vector<vector<int> > aaP;       //tMaster->aanP:        each row is a different otu / each col contains the sequence indices
-       vector<int> seqNumber;          //tMaster->anP:         the sequence id number sorted by OTU
        vector<vector<int> > aaI;       //tMaster->aanI:        that are in each otu - can't differentiate between aaP and aaI 
+       vector<int> seqNumber;          //tMaster->anP:         the sequence id number sorted by OTU
        vector<int> seqIndex;           //tMaster->anI;         the index that corresponds to seqNumber
        vector<double> dist;            //adDist - distance of sequences to centroids
        vector<short> change;           //did the centroid sequence change? 0 = no; 1 = yes
@@ -61,9 +62,9 @@ private:
        vector<double> singleTau;       //tMaster->adTau:       1-D Tau vector (1xnumSeqs)
        vector<short> uniqueFlowgrams;
        vector<int> uniqueCount;
-       vector<int> uniqueLengths;
        vector<int> mapSeqToUnique;
        vector<int> mapUniqueToSeq;
+       vector<int> uniqueLengths;
        
        int numSeqs, numUniques, numOTUs, numFlowCells;