]> git.donarmstrong.com Git - mothur.git/blobdiff - seqerrorcommand.cpp
changed int to pid_t type in fork(). roughed in get.mimarkscommand.
[mothur.git] / seqerrorcommand.cpp
index 54d3dcc5c9b6c93f267478e6491126b3aedff772..f7edb21f8f6586686de459800472bf9a27582467 100644 (file)
@@ -358,7 +358,7 @@ int SeqErrorCommand::execute(){
                if(namesFileName != "")     {   weights = getWeights();         }
         else if (countfile != "")   {
             CountTable ct;
-            ct.readTable(countfile, false);
+            ct.readTable(countfile, false, false);
             weights = ct.getNameMap();
         }
                
@@ -462,18 +462,18 @@ int SeqErrorCommand::createProcesses(string filename, string qFileName, string r
                
                //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){
                                
-                               num = driver(filename, qFileName, rFileName, summaryFileName + toString(getpid()) + ".temp", errorOutputFileName+ toString(getpid()) + ".temp", chimeraOutputFileName + toString(getpid()) + ".temp", lines[process], qLines[process], rLines[process]);
+                               num = driver(filename, qFileName, rFileName, summaryFileName + m->mothurGetpid(process) + ".temp", errorOutputFileName+ m->mothurGetpid(process) + ".temp", chimeraOutputFileName + m->mothurGetpid(process) + ".temp", lines[process], qLines[process], rLines[process]);
                                
                                //pass groupCounts to parent
                                ofstream out;
-                               string tempFile = filename + toString(getpid()) + ".info.temp";
+                               string tempFile = filename + m->mothurGetpid(process) + ".info.temp";
                                m->openOutputFile(tempFile, out);
                                
                                //output totalBases and totalMatches
@@ -1412,9 +1412,7 @@ int SeqErrorCommand::setLines(string filename, string qfilename, string rfilenam
                                        string sname = "";  nameStream >> sname;
                                        sname = sname.substr(1);
                     
-                    for (int i = 0; i < sname.length(); i++) {
-                        if (sname[i] == ':') { sname[i] = '_'; m->changedSeqNames = true; }
-                    }
+                    m->checkName(sname);
                                        
                                        map<string, int>::iterator it = firstSeqNames.find(sname);
                                        
@@ -1475,9 +1473,7 @@ int SeqErrorCommand::setLines(string filename, string qfilename, string rfilenam
                     istringstream nameStream(input);
                     string sname = "";  nameStream >> sname;
                     
-                    for (int i = 0; i < sname.length(); i++) {
-                        if (sname[i] == ':') { sname[i] = '_'; m->changedSeqNames = true; }
-                    }
+                    m->checkName(sname);
                     
                     map<string, int>::iterator it = firstSeqNamesReport.find(sname);