]> git.donarmstrong.com Git - mothur.git/commitdiff
filter.seqs bug change
authorwestcott <westcott>
Mon, 23 Aug 2010 16:11:13 +0000 (16:11 +0000)
committerwestcott <westcott>
Mon, 23 Aug 2010 16:11:13 +0000 (16:11 +0000)
Mothur.xcodeproj/project.pbxproj
aligncommand.cpp
filterseqscommand.cpp
mothur.h

index 71436b740ed32cdcbb984847f71ca81ea44da0ae..ebe8a90115bbc86641664e6922ba39a23e92de25 100644 (file)
                                A7DA2022113FECD400BF472F /* clustercommand.h */,
                                A71D924311AEB42400D00CBC /* clustersplitcommand.h */,
                                A71D924211AEB42400D00CBC /* clustersplitcommand.cpp */,
-                               A7DA2025113FECD400BF472F /* collectcommand.cpp */,
                                A7DA2026113FECD400BF472F /* collectcommand.h */,
+                               A7DA2025113FECD400BF472F /* collectcommand.cpp */,
                                A7DA2029113FECD400BF472F /* collectsharedcommand.cpp */,
                                A7DA202A113FECD400BF472F /* collectsharedcommand.h */,
                                A7DA2031113FECD400BF472F /* consensuscommand.cpp */,
index ed6b45d229c233c99540adb43bb924bb6352ae75..613f9b7d6f13b04dec679a162ba71faf25326c65 100644 (file)
@@ -347,7 +347,7 @@ int AlignCommand::execute(){
                                
 #else
                vector<unsigned long int> positions = divideFile(candidateFileNames[s], processors);
-                               
+                                                       
                for (int i = 0; i < (positions.size()-1); i++) {
                        lines.push_back(new linePair(positions[i], positions[(i+1)]));
                }       
index e91d32b1e781ec580900ea5053425950d220f090..2c61465449410bd3ec974924f1f0ce2e97739835 100644 (file)
@@ -866,6 +866,13 @@ int FilterSeqsCommand::createProcessesCreateFilter(Filters& F, string filename)
                                processIDS.push_back(pid);  //create map from line number to pid so you can append files in correct order later
                                process++;
                        }else if (pid == 0){
+                               //reset child's filter counts to 0;
+                               F.a.clear(); F.a.resize(alignmentLength, 0);
+                               F.t.clear(); F.t.resize(alignmentLength, 0);
+                               F.g.clear(); F.g.resize(alignmentLength, 0);
+                               F.c.clear(); F.c.resize(alignmentLength, 0);
+                               F.gap.clear(); F.gap.resize(alignmentLength, 0);
+                               
                                num = driverCreateFilter(F, filename, lines[process]);
                                
                                //write out filter counts to file
index 2622e2515e87ed9914f4491b716dc03c501d5411..d5086b3909ece580bbb552454ced3a742b790dcd 100644 (file)
--- a/mothur.h
+++ b/mothur.h
@@ -1163,7 +1163,7 @@ inline vector<unsigned long int> divideFile(string filename, int& proc) {
                //for each process seekg to closest file break and search for next '>' char. make that the filebreak
                for (int i = 0; i < proc; i++) {
                        unsigned long int spot = (i+1) * chunkSize;
-                       
+                                       
                        ifstream in;
                        openInputFile(filename, in);
                        in.seekg(spot);
@@ -1174,9 +1174,10 @@ inline vector<unsigned long int> divideFile(string filename, int& proc) {
                           char c = in.get();
                           if (c == '>') {   in.putback(c); newSpot = in.tellg(); break;  }
                        }
-                       
+                               
                        //there was not another sequence before the end of the file
-                       if (newSpot == spot) {  break;  }
+                       unsigned long int sanityPos = in.tellg();
+                       if (sanityPos == -1) {  break;  }
                        else {   filePos.push_back(newSpot);  }
                        
                        in.close();