]> git.donarmstrong.com Git - mothur.git/blobdiff - countseqscommand.cpp
added flag to count table read so that commands that don't require the group info...
[mothur.git] / countseqscommand.cpp
index 3bafbcd71752b48e675e0d85fcf037cc896056dc..e97810effcb6f3c2dd05a34f30518aea8f13a97b 100644 (file)
@@ -17,6 +17,7 @@ vector<string> CountSeqsCommand::setParameters(){
        try {
                CommandParameter pname("name", "InputTypes", "", "", "none", "none", "none","count",false,true,true); parameters.push_back(pname);
                CommandParameter pgroup("group", "InputTypes", "", "", "none", "none", "none","",false,false,true); parameters.push_back(pgroup);
+        CommandParameter pprocessors("processors", "Number", "", "1", "", "", "","",false,false,true); parameters.push_back(pprocessors);
         CommandParameter plarge("large", "Boolean", "", "F", "", "", "","",false,false); parameters.push_back(plarge);
                CommandParameter pgroups("groups", "String", "", "", "", "", "","",false,false); parameters.push_back(pgroups);
                CommandParameter pinputdir("inputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(pinputdir);
@@ -39,6 +40,7 @@ string CountSeqsCommand::getHelpString(){
                helpString += "The groups parameter allows you to indicate which groups you want to include in the counts, by default all groups in your groupfile are used.\n";
         helpString += "The large parameter indicates the name and group files are too large to fit in RAM.\n";
                helpString += "When you use the groups parameter and a sequence does not represent any sequences from the groups you specify it is not included in the .count.summary file.\n";
+        helpString += "The processors parameter allows you to specify the number of processors to use. The default is 1.\n";
                helpString += "The count.seqs command should be in the following format: count.seqs(name=yourNameFile).\n";
                helpString += "Example count.seqs(name=amazon.names) or make.table(name=amazon.names).\n";
                helpString += "Note: No spaces between parameter labels (i.e. name), '=' and parameters (i.e.yourNameFile).\n";
@@ -236,7 +238,11 @@ int CountSeqsCommand::processSmall(string outputFileName){
                        
                        string firstCol, secondCol;
                        in >> firstCol; m->gobble(in); in >> secondCol; m->gobble(in);
-                       
+            //cout << firstCol << '\t' << secondCol << endl;
+            m->checkName(firstCol);
+            m->checkName(secondCol);
+                       //cout << firstCol << '\t' << secondCol << endl;
+           
                        vector<string> names;
                        m->splitAtChar(secondCol, names, ',');
                        
@@ -435,6 +441,8 @@ map<int, string> CountSeqsCommand::processNameFile(string name) {
                 else  { secondCol = pieces[i]; pairDone = true; columnOne=true; }
                 
                 if (pairDone) { 
+                    m->checkName(firstCol);
+                    m->checkName(secondCol);
                     //parse names into vector
                     vector<string> theseNames;
                     m->splitAtComma(secondCol, theseNames);
@@ -456,6 +464,8 @@ map<int, string> CountSeqsCommand::processNameFile(string name) {
                 else  { secondCol = pieces[i]; pairDone = true; columnOne=true; }
                 
                 if (pairDone) { 
+                    m->checkName(firstCol);
+                    m->checkName(secondCol);
                     //parse names into vector
                     vector<string> theseNames;
                     m->splitAtComma(secondCol, theseNames);
@@ -507,6 +517,7 @@ map<int, string> CountSeqsCommand::getGroupNames(string filename, set<string>& n
                 else  { secondCol = pieces[i]; pairDone = true; columnOne=true; }
                 
                 if (pairDone) { 
+                    m->checkName(firstCol);
                     it = groupIndex.find(secondCol);
                     if (it == groupIndex.end()) { //add group, assigning the group and number so we can use vectors above
                         groupIndex[secondCol] = count;
@@ -529,6 +540,7 @@ map<int, string> CountSeqsCommand::getGroupNames(string filename, set<string>& n
                 else  { secondCol = pieces[i]; pairDone = true; columnOne=true; }
                 
                 if (pairDone) { 
+                    m->checkName(firstCol);
                     it = groupIndex.find(secondCol);
                     if (it == groupIndex.end()) { //add group, assigning the group and number so we can use vectors above
                         groupIndex[secondCol] = count;