]> git.donarmstrong.com Git - mothur.git/blobdiff - filterseqscommand.cpp
update .gitignore
[mothur.git] / filterseqscommand.cpp
index 8b68988884acb408d0e72c5c3fa407a7b9f241b6..6041c95d59952fbaf1c856055181d4e145c3a9c0 100644 (file)
@@ -653,18 +653,18 @@ int FilterSeqsCommand::createProcessesRunFilter(string F, string filename, strin
                
                //loop through and create all the processes you want
                while (process != processors) {
-                       int pid = fork();
+                       pid_t pid = fork();
                        
                        if (pid > 0) {
                                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){
-                               string filteredFasta = filename + toString(getpid()) + ".temp";
+                               string filteredFasta = filename + m->mothurGetpid(process) + ".temp";
                                num = driverRunFilter(F, filteredFasta, filename, lines[process]);
                                
                                //pass numSeqs to parent
                                ofstream out;
-                               string tempFile = filename +  toString(getpid()) + ".num.temp";
+                               string tempFile = filename +  m->mothurGetpid(process) + ".num.temp";
                                m->openOutputFile(tempFile, out);
                                out << num << endl;
                                out.close();
@@ -990,7 +990,8 @@ int FilterSeqsCommand::driverCreateFilter(Filters& F, string filename, linePair*
                                        
                        Sequence seq(in); m->gobble(in);
                        if (seq.getName() != "") {
-                                       if (seq.getAligned().length() != alignmentLength) { m->mothurOut("Sequences are not all the same length, please correct."); m->mothurOutEndLine(); m->control_pressed = true;  }
+                    if (m->debug) { m->mothurOut("[DEBUG]: " + seq.getName() + " length = " + toString(seq.getAligned().length())); m->mothurOutEndLine();}
+                                       if (seq.getAligned().length() != alignmentLength) { m->mothurOut("[ERROR]: Sequences are not all the same length, please correct."); m->mothurOutEndLine(); m->control_pressed = true;  }
                                        
                                        if(trump != '*')                        {       F.doTrump(seq);         }
                                        if(m->isTrue(vertical) || soft != 0)    {       F.getFreqs(seq);        }
@@ -1078,7 +1079,7 @@ int FilterSeqsCommand::createProcessesCreateFilter(Filters& F, string filename)
                                
                //loop through and create all the processes you want
                while (process != processors) {
-                       int pid = fork();
+                       pid_t pid = fork();
                        
                        if (pid > 0) {
                                processIDS.push_back(pid);  //create map from line number to pid so you can append files in correct order later
@@ -1094,7 +1095,7 @@ int FilterSeqsCommand::createProcessesCreateFilter(Filters& F, string filename)
                                num = driverCreateFilter(F, filename, lines[process]);
                                
                                //write out filter counts to file
-                               filename += toString(getpid()) + "filterValues.temp";
+                               filename += m->mothurGetpid(process) + "filterValues.temp";
                                ofstream out;
                                m->openOutputFile(filename, out);