]> git.donarmstrong.com Git - mothur.git/blobdiff - aligncommand.cpp
bug fixes
[mothur.git] / aligncommand.cpp
index 0f4c89a28ce7ca2b01eae1de815bebfb78ff6a77..877e7c76773ece0f459142e674382fb2747bb8fb 100644 (file)
@@ -90,6 +90,8 @@ AlignCommand::AlignCommand(string option)  {
                                
                                //go through files and make sure they are good, if not, then disregard them
                                for (int i = 0; i < candidateFileNames.size(); i++) {
+                                       //candidateFileNames[i] = m->getFullPathName(candidateFileNames[i]);
+                                       
                                        if (inputDir != "") {
                                                string path = m->hasPath(candidateFileNames[i]);
                                                //if the user has not given a path then, add inputdir. else leave path alone.
@@ -348,7 +350,6 @@ int AlignCommand::execute(){
 #else
 
                vector<unsigned long int> positions = m->divideFile(candidateFileNames[s], processors);
-                               
                for (int i = 0; i < (positions.size()-1); i++) {
                        lines.push_back(new linePair(positions[i], positions[(i+1)]));
                }       
@@ -487,7 +488,7 @@ int AlignCommand::driver(linePair* filePos, string alignFName, string reportFNam
                        if (m->control_pressed) {  return 0; }
                        
                        Sequence* candidateSeq = new Sequence(inFASTA);  m->gobble(inFASTA);
-       
+                       
                        int origNumBases = candidateSeq->getNumBases();
                        string originalUnaligned = candidateSeq->getUnaligned();
                        int numBasesNeeded = origNumBases * threshold;
@@ -564,8 +565,12 @@ int AlignCommand::driver(linePair* filePos, string alignFName, string reportFNam
                        }
                        delete candidateSeq;
                        
-                       unsigned long int pos = inFASTA.tellg();
-                       if ((pos == -1) || (pos >= filePos->end)) { break; }
+                       #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+                               unsigned long int pos = inFASTA.tellg();
+                               if ((pos == -1) || (pos >= filePos->end)) { break; }
+                       #else
+                               if (inFASTA.eof()) { break; }
+                       #endif
                        
                        //report progress
                        if((count) % 100 == 0){ m->mothurOut(toString(count)); m->mothurOutEndLine();           }