]> git.donarmstrong.com Git - mothur.git/commitdiff
added flag to count table read so that commands that don't require the group info...
authorSarahsWork <sarahswork@imac.westcotts.net>
Mon, 22 Apr 2013 13:47:08 +0000 (09:47 -0400)
committerSarahsWork <sarahswork@imac.westcotts.net>
Mon, 22 Apr 2013 13:47:08 +0000 (09:47 -0400)
51 files changed:
binsequencecommand.cpp
chimeraperseuscommand.cpp
chimeraperseuscommand.h
chimeraslayercommand.cpp
chimerauchimecommand.cpp
chimerauchimecommand.h
classifyotucommand.cpp
classifyseqscommand.cpp
clustercommand.cpp
clusterdoturcommand.cpp
clusterfragmentscommand.cpp
clustersplitcommand.cpp
consensusseqscommand.cpp
countgroupscommand.cpp
countseqscommand.cpp
countseqscommand.h
counttable.cpp
counttable.h
deconvolutecommand.cpp
getgroupscommand.cpp
getlineagecommand.cpp
getoturepcommand.cpp
getrabundcommand.cpp
getsabundcommand.cpp
getseqscommand.cpp
heatmapsimcommand.cpp
listseqscommand.cpp
mgclustercommand.cpp
parselistscommand.cpp
prcseqscommand.cpp
preclustercommand.cpp
primerdesigncommand.cpp
removegroupscommand.cpp
removelineagecommand.cpp
removerarecommand.cpp
removeseqscommand.cpp
screenseqscommand.cpp
secondarystructurecommand.cpp
seqerrorcommand.cpp
seqsummarycommand.cpp
sequencecountparser.cpp
sharedcommand.cpp
sharedlistvector.cpp
splitabundcommand.cpp
splitgroupscommand.cpp
subsamplecommand.cpp
summaryqualcommand.cpp
summarytaxcommand.cpp
treegroupscommand.cpp
treereader.cpp
trimseqscommand.cpp

index 7798a4d74f749eed04d4554c796776a58697b98b..be167d9b9cbb92a8ffea832b8c2eccfb4ed6bf3d 100644 (file)
@@ -249,7 +249,7 @@ int BinSeqCommand::execute(){
                
                //if user gave a namesfile then use it
                if (namesfile != "") {  readNamesFile();  }
-        if (countfile != "") {  ct.readTable(countfile);  }
+        if (countfile != "") {  ct.readTable(countfile, true);  }
                
                input = new InputData(listfile, "list");
                list = input->getListVector();
index fd94fcab7e289590da462eef7f03fc7069ab551f..cea481bd22062b7461a06705d08ba4d1c1930451 100644 (file)
@@ -516,7 +516,7 @@ int ChimeraPerseusCommand::execute(){
             
             if (hasCount) {
                 CountTable* ct = new CountTable();
-                ct->readTable(nameFile);
+                ct->readTable(nameFile, true);
                 
                 if (ct->hasGroupInfo()) {
                     cparser = new SequenceCountParser(fastaFileNames[s], *ct);
@@ -534,7 +534,7 @@ int ChimeraPerseusCommand::execute(){
                     
                     if(processors == 1)        {       numSeqs = driverGroups(outputFileName, accnosFileName, newCountFile, 0, groups.size(), groups);
                         if (dups) {
-                            CountTable c; c.readTable(nameFile);
+                            CountTable c; c.readTable(nameFile, true);
                             if (!m->isBlank(newCountFile)) {
                                 ifstream in2;
                                 m->openInputFile(newCountFile, in2);
@@ -559,7 +559,7 @@ int ChimeraPerseusCommand::execute(){
                         numChimeras = deconvoluteResults(uniqueNames, outputFileName, accnosFileName);
                     }else {
                         set<string> doNotRemove;
-                        CountTable c; c.readTable(newCountFile);
+                        CountTable c; c.readTable(newCountFile, true);
                         vector<string> namesInTable = c.getNamesOfSeqs();
                         for (int i = 0; i < namesInTable.size(); i++) {
                             int temp = c.getNumSeqs(namesInTable[i]);
@@ -1070,7 +1070,7 @@ int ChimeraPerseusCommand::createProcessesGroups(string outputFName, string accn
                int num = 0;
                
         CountTable newCount;
-        if (hasCount && dups) { newCount.readTable(name); }
+        if (hasCount && dups) { newCount.readTable(name, true); }
         
                //sanity check
                if (groups.size() < processors) { processors = groups.size(); }
index 99a66f8838e4ccbbe10fe72ef66135be7dfda869..b6d4fc9323f659abe52cd70a1e3598a84d9db936 100644 (file)
@@ -130,7 +130,7 @@ static DWORD WINAPI MyPerseusThreadFunction(LPVOID lpParam){
         SequenceCountParser* cparser;
                if (pDataArray->hasCount) {
             CountTable* ct = new CountTable();
-            ct->readTable(pDataArray->namefile);
+            ct->readTable(pDataArray->namefile, true);
             cparser = new SequenceCountParser(pDataArray->fastafile, *ct);
             delete ct;
         }else {
index e7003c4d88bfe40266dffcf0770e3037cb39f38f..f01bd3ee9d9bb3611b52b38819f98300da9cff39 100644 (file)
@@ -759,7 +759,7 @@ int ChimeraSlayerCommand::execute(){
                                if (processors == 1) {
                     numSeqs = driverGroups(outputFileName, accnosFileName, trimFastaFileName, fileToPriority, fileGroup, newCountFile);
                     if (hasCount && dups) {
-                        CountTable c; c.readTable(nameFileNames[s]);
+                        CountTable c; c.readTable(nameFileNames[s], true);
                         if (!m->isBlank(newCountFile)) {
                             ifstream in2;
                             m->openInputFile(newCountFile, in2);
@@ -791,7 +791,7 @@ int ChimeraSlayerCommand::execute(){
                     }else {
                         if (hasCount) {
                             set<string> doNotRemove;
-                            CountTable c; c.readTable(newCountFile);
+                            CountTable c; c.readTable(newCountFile, true);
                             vector<string> namesInTable = c.getNamesOfSeqs();
                             for (int i = 0; i < namesInTable.size(); i++) {
                                 int temp = c.getNumSeqs(namesInTable[i]);
@@ -1551,7 +1551,7 @@ int ChimeraSlayerCommand::createProcessesGroups(string outputFName, string accno
                if (fileToPriority.size() < processors) { processors = fileToPriority.size(); }
         
         CountTable newCount;
-        if (hasCount && dups) { newCount.readTable(countFile); }
+        if (hasCount && dups) { newCount.readTable(countFile, true); }
                
                int groupsPerProcessor = fileToPriority.size() / processors;
                int remainder = fileToPriority.size() % processors;
@@ -2161,7 +2161,7 @@ map<string, int> ChimeraSlayerCommand::sortFastaFile(string fastaFile, string na
         int error;
         if (hasCount) { 
             CountTable ct;
-            ct.readTable(nameFile);
+            ct.readTable(nameFile, true);
             
             for(map<string, string>::iterator it = seqs.begin(); it != seqs.end(); it++) {
                 int num = ct.getNumSeqs(it->first);
index 3d23a7693818f329ff6ac53cca560998c8a9fc95..422792a68525b495008694360c393e26ba358c09 100644 (file)
@@ -674,7 +674,7 @@ int ChimeraUchimeCommand::execute(){
                 int error;
                 if (hasCount) {
                     CountTable ct;
-                    ct.readTable(nameFile);
+                    ct.readTable(nameFile, true);
                     for(map<string, string>::iterator it = seqs.begin(); it != seqs.end(); it++) {
                         int num = ct.getNumSeqs(it->first);
                         if (num == 0) { error = 1; }
@@ -725,7 +725,7 @@ int ChimeraUchimeCommand::execute(){
                                if(processors == 1)     {       totalSeqs = driverGroups(outputFileName, newFasta, accnosFileName, alnsFileName, newCountFile, 0, groups.size(), groups);
                     
                     if (hasCount && dups) {
-                        CountTable c; c.readTable(nameFile);
+                        CountTable c; c.readTable(nameFile, true);
                         if (!m->isBlank(newCountFile)) {
                             ifstream in2;
                             m->openInputFile(newCountFile, in2);
@@ -755,7 +755,7 @@ int ChimeraUchimeCommand::execute(){
                     
                     if (hasCount) {
                         set<string> doNotRemove;
-                        CountTable c; c.readTable(newCountFile);
+                        CountTable c; c.readTable(newCountFile, true);
                         vector<string> namesInTable = c.getNamesOfSeqs();
                         for (int i = 0; i < namesInTable.size(); i++) {
                             int temp = c.getNumSeqs(namesInTable[i]);
@@ -1795,7 +1795,7 @@ int ChimeraUchimeCommand::createProcessesGroups(string outputFName, string filen
                int num = 0;
         
         CountTable newCount;
-        if (hasCount && dups) { newCount.readTable(nameFile); }
+        if (hasCount && dups) { newCount.readTable(nameFile, true); }
                
                //sanity check
                if (groups.size() < processors) { processors = groups.size(); }
index 2237493801aa836dcb84e77e3957a480f30dcc2b..fadc4a4d401dcf5da93d0d32c56ed9ec8a7ef99a 100644 (file)
@@ -175,7 +175,7 @@ static DWORD WINAPI MyUchimeThreadFunction(LPVOID lpParam){
         SequenceCountParser* cparser;
                if (pDataArray->hasCount) {
             CountTable* ct = new CountTable();
-            ct->readTable(pDataArray->namefile);
+            ct->readTable(pDataArray->namefile, true);
             cparser = new SequenceCountParser(pDataArray->fastafile, *ct);
             delete ct;
         }else {
index d0ddc691236e59cdd0fcb6a2578249375fd8ad0e..170c234ac245e6c32e3174ad80145fbcc359f2f2 100644 (file)
@@ -293,7 +293,7 @@ int ClassifyOtuCommand::execute(){
                if (namefile != "")     {       m->readNames(namefile, nameMap, true);  }
         if (groupfile != "")    {   groupMap = new GroupMap(groupfile);  groupMap->readMap();  groups = groupMap->getNamesOfGroups(); }
         else { groupMap = NULL;  }
-        if (countfile != "") {  ct = new CountTable(); ct->readTable(countfile);  if (ct->hasGroupInfo()) { groups = ct->getNamesOfGroups(); } }
+        if (countfile != "") {  ct = new CountTable(); ct->readTable(countfile, true);  if (ct->hasGroupInfo()) { groups = ct->getNamesOfGroups(); } }
         else {  ct = NULL;    }
         
                //read taxonomy file and save in map for easy access in building bin trees
index edbd4c466bfa500bcaa72b1f8266f3dd40185ae9..b311821b3e8d293daac13107eb9e6771be360bf0 100644 (file)
@@ -812,7 +812,7 @@ int ClassifySeqsCommand::execute(){
                 PhyloSummary* taxaSum;
                 if (hasCount) { 
                     ct = new CountTable();
-                    ct->readTable(countfileNames[s]);
+                    ct->readTable(countfileNames[s], true);
                     taxaSum = new PhyloSummary(taxonomyFileName, ct);
                     taxaSum->summarize(tempTaxonomyFile);
                 }else {
index e4e20622cae08b3578e8e8871616c1cd874da0aa..2ac2eaa6bd2466df296e407e7e67f9c8a095edc3 100644 (file)
@@ -305,7 +305,7 @@ int ClusterCommand::execute(){
             read->read(nameMap);
                }else if (countfile != "") {
             ct = new CountTable();
-            ct->readTable(countfile);
+            ct->readTable(countfile, false);
             read->read(ct);
         }else { read->read(nameMap); }
                
index 91eb923ae38d8b9a52ebb8a00a4ea4fb0cf951a7..08a5938b85b3b40f7a53619766d1a9a3e004a9a5 100644 (file)
@@ -226,7 +226,7 @@ int ClusterDoturCommand::execute(){
             delete nameMap;
                }else if (countfile != "") {
             ct = new CountTable();
-            ct->readTable(countfile);
+            ct->readTable(countfile, false);
             cluster->readPhylipFile(phylipfile, ct);
             delete ct;
         }else {
index 1b8cc71706710a3c80d53f6ff2fd877d07d98103..f17c11e7384330c4b9eb4d5af86f734fc0d0f21f 100644 (file)
@@ -181,7 +181,7 @@ ClusterFragmentsCommand::ClusterFragmentsCommand(string option) {
             countfile = validParameter.validFile(parameters, "count", true);
                        if (countfile == "not open") { abort = true; countfile = ""; }  
                        else if (countfile == "not found") { countfile = ""; }
-                       else { ct.readTable(countfile); m->setCountTableFile(countfile); }
+                       else { ct.readTable(countfile, false); m->setCountTableFile(countfile); }
                        
             if ((countfile != "") && (namefile != "")) { m->mothurOut("When executing a cluster.fragments command you must enter ONLY ONE of the following: count or name."); m->mothurOutEndLine(); abort = true; }
                        
index 37e42d2fb167591825a26e6599c6986ee78e4f78..74867ebdeb0ec271d07d727b7cf9c8d19aa13284 100644 (file)
@@ -1168,7 +1168,7 @@ string ClusterSplitCommand::clusterClassicFile(string thisDistFile, string thisN
             cluster->readPhylipFile(thisDistFile, nameMap);
                }else if (countfile != "") {
             ct = new CountTable();
-            ct->readTable(thisNamefile);
+            ct->readTable(thisNamefile, false);
             cluster->readPhylipFile(thisDistFile, ct);
         }
         tag = cluster->getTag();
@@ -1296,7 +1296,7 @@ string ClusterSplitCommand::clusterFile(string thisDistFile, string thisNamefile
             read->read(nameMap);
                }else if (countfile != "") {
             ct = new CountTable();
-            ct->readTable(thisNamefile);
+            ct->readTable(thisNamefile, false);
             read->read(ct);
         }else { read->read(nameMap); }
                
index 1b1e7d20d37603610945f6dadbf6dd32399ed8d5..3d671f98420e0fa7cf844aac647bd43feea959e8 100644 (file)
@@ -226,7 +226,7 @@ int ConsensusSeqsCommand::execute(){
                if (m->control_pressed) { return 0; }
                
                if (namefile != "") { readNames(); }
-        if (countfile != "") { ct.readTable(countfile);  }
+        if (countfile != "") { ct.readTable(countfile, true);  }
                
                if (m->control_pressed) { return 0; }
                
index 6da077485c5fcd7641d759ceb6820dc9652033a7..83c2d315d0b8f781caa02c04c4fed5e1cb6b6a0d 100644 (file)
@@ -261,7 +261,7 @@ int CountGroupsCommand::execute(){
             m->openOutputFile(outputFileName, out);
             
                        CountTable ct;
-                       ct.readTable(countfile);
+                       ct.readTable(countfile, true);
             
                        //make sure groups are valid
                        //takes care of user setting groupNames that are invalid or setting groups=all
index dfa012eeff0f0f49c778c00b2098348a489f1855..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";
index b4170a8867897b96e13f7483f6053b960f7629b4..6ba36b1a0264e20efe7bd251bc8d505cdf30cb87 100644 (file)
@@ -37,6 +37,7 @@ private:
        string namefile, groupfile, outputDir, groups;
        bool abort, large;
        vector<string> Groups, outputNames;
+    int processors;
     
     int processSmall(string);
     int processLarge(string);
index 48b52d98e76e6da585c862682c3906bdf4ad0f67..6eca8ee2a4b5354da54412b9eb6986b6ba244657 100644 (file)
@@ -211,7 +211,7 @@ int CountTable::createTable(string namefile, string groupfile, bool createGroup)
        }
 }
 /************************************************************/
-int CountTable::readTable(string file) {
+int CountTable::readTable(string file, bool readGroups) {
     try {
         filename = file;
         ifstream in;
@@ -227,7 +227,7 @@ int CountTable::readTable(string file) {
         indexNameMap.clear();
         counts.clear();
         map<int, string> originalGroupIndexes;
-        if (columnHeaders.size() > 2) { hasGroups = true; numGroups = columnHeaders.size() - 2;  }
+        if ((columnHeaders.size() > 2) && readGroups) { hasGroups = true; numGroups = columnHeaders.size() - 2;  }
         for (int i = 2; i < columnHeaders.size(); i++) {  groups.push_back(columnHeaders[i]);  originalGroupIndexes[i-2] = columnHeaders[i]; totalGroups.push_back(0); }
         //sort groups to keep consistent with how we store the groups in groupmap
         sort(groups.begin(), groups.end());
@@ -248,7 +248,13 @@ int CountTable::readTable(string file) {
             
             //if group info, then read it
             vector<int> groupCounts; groupCounts.resize(numGroups, 0);
-            for (int i = 0; i < numGroups; i++) {  int thisIndex = indexGroupMap[originalGroupIndexes[i]]; in >> groupCounts[thisIndex]; m->gobble(in); totalGroups[thisIndex] += groupCounts[thisIndex];  }
+            if (columnHeaders.size() > 2) { //file contains groups
+                if (readGroups) { //user wants to save them
+                    for (int i = 0; i < numGroups; i++) {  int thisIndex = indexGroupMap[originalGroupIndexes[i]]; in >> groupCounts[thisIndex]; m->gobble(in); totalGroups[thisIndex] += groupCounts[thisIndex];  }
+                }else { //read and discard
+                    m->getline(in); m->gobble(in);
+                }
+            }
             
             map<string, int>::iterator it = indexNameMap.find(name);
             if (it == indexNameMap.end()) {
index 34c941bece659b832afd9f2ff8866a16d37c14f1..51d0b4544bc73c7e832826bad702028f0143a549 100644 (file)
@@ -50,7 +50,7 @@ class CountTable {
         //reads and creates smart enough to eliminate groups with zero counts 
         int createTable(set<string>&, map<string, string>&, set<string>&); //seqNames, seqName->group, groupNames 
         int createTable(string, string, bool); //namefile, groupfile, createGroup
-        int readTable(string); 
+        int readTable(string, bool);
     
         int printTable(string);
         int printHeaders(ofstream&);
index 09e077b57ca8800d3663f6dd5c3515102aaa1129..8b73425fc5c2aefb2d7e3b4a87caf4fa8be44c40 100644 (file)
@@ -209,7 +209,7 @@ int DeconvoluteCommand::execute() {
         }
         CountTable ct;
         if (countfile != "")  {  
-            ct.readTable(countfile);
+            ct.readTable(countfile, false);
             if (countfile == outCountFile){
                 //prepare filenames and open files
                 map<string, string> mvariables;
index e4f7450b4291e1ca281ebe806dd476fac86019b9..45e0a783e393ba828d8bd74c3884fa45779a92f2 100644 (file)
@@ -370,7 +370,7 @@ int GetGroupsCommand::execute(){
                 m->mothurOut("\n[NOTE]: The count file should contain only unique names, so mothur assumes your fasta, list and taxonomy files also contain only uniques.\n\n");
             }
             CountTable ct;
-            ct.readTable(countfile);
+            ct.readTable(countfile, true);
             if (!ct.hasGroupInfo()) { m->mothurOut("[ERROR]: your count file does not contain group info, aborting.\n"); return 0; }
                 
             vector<string> gNamesOfGroups = ct.getNamesOfGroups();
index 438aa3808441e60b9fb4fa22d4e9313a58956b2a..b895cc4fc62bfb49346c96df7a0d6371dd2b4a50 100644 (file)
@@ -444,7 +444,7 @@ int GetLineageCommand::readCount(){
         //check for groups that have been eliminated
         CountTable ct;
         if (ct.testGroups(outputFileName)) {
-            ct.readTable(outputFileName);
+            ct.readTable(outputFileName, true);
             ct.printTable(outputFileName);
         }
 
index a041b38aadac3c3cc28bf7313eeb4e8bde6e4535..dbd19a8bfc7d5a266b131e74b18f3f2980c40aba 100644 (file)
@@ -261,7 +261,7 @@ GetOTURepCommand::GetOTURepCommand(string option)  {
                        else if (countfile == "not open") { abort = true; countfile =  ""; }    
                        else {   
                 m->setCountTableFile(countfile); 
-                ct.readTable(countfile);
+                ct.readTable(countfile, true);
                 if (ct.hasGroupInfo()) { hasGroups = true; }
             }
             
@@ -1106,7 +1106,7 @@ int GetOTURepCommand::processFastaNames(string filename, string label, FastaMap*
         
         CountTable thisCt;
         if (countfile != "") {
-            thisCt.readTable(countfile);
+            thisCt.readTable(countfile, true);
             if (tempGroup != "noGroup") { out2 << "Representative_Sequence\ttotal\t" << tempGroup << endl; }
         }
     
@@ -1253,7 +1253,7 @@ int GetOTURepCommand::processNames(string filename, string label) {
         
         CountTable thisCt;
         if (countfile != "") {
-            thisCt.readTable(countfile);
+            thisCt.readTable(countfile, true);
             if (tempGroup != "noGroup") { out2 << "Representative_Sequence\ttotal\t" << tempGroup << endl; }
         }
         
index 4870a627663da88857f157e0cfd2912545a7aa61..da1bfae2c07f5cb719961dce93324ff8135fbfc4 100644 (file)
@@ -319,7 +319,7 @@ int GetRAbundCommand::execute(){
 int GetRAbundCommand::processList(ofstream& out){
        try {
         CountTable ct;
-        ct.readTable(countfile);
+        ct.readTable(countfile, false);
         
         InputData input(inputfile, format);
         ListVector* list = input.getListVector();
index d3fb5298c5d1191c0f90b4787b6b2ed349de5f61..f4838cf8a72a75708085b3917b8828939e43f683 100644 (file)
@@ -307,7 +307,7 @@ int GetSAbundCommand::execute(){
 int GetSAbundCommand::processList(ofstream& out){
        try {
         CountTable ct;
-        ct.readTable(countfile);
+        ct.readTable(countfile, false);
         
         InputData input(inputfile, format);
         ListVector* list = input.getListVector();
index 287f5a6acdc08a9c40b6e2e12b159a2f83fc9636..142023e7a40881c1c6397a761ba350132490b75c 100644 (file)
@@ -587,7 +587,7 @@ int GetSeqsCommand::readCount(){
         //check for groups that have been eliminated
         CountTable ct;
         if (ct.testGroups(outputFileName)) {
-            ct.readTable(outputFileName);
+            ct.readTable(outputFileName, true);
             ct.printTable(outputFileName);
         }
                
index 98739b68291fd42d83d1190a46313886126f02bf..01a60aea3b01ad2ce95584c33280e7dde4d8147f 100644 (file)
@@ -543,7 +543,7 @@ int HeatMapSimCommand::runCommandDist() {
                 }
              }else if (countfile != "") {
                 nameMap = NULL;
-                ct.readTable(countfile);
+                ct.readTable(countfile, true);
                 names = ct.getNamesOfSeqs();
             }
                        
index d10dfb4935c390d0353976eeb5c182340519ebfb..cf884705cb26f341ef08713b118af32fd49c5bdf 100644 (file)
@@ -415,7 +415,7 @@ int ListSeqsCommand::readGroup(){
 int ListSeqsCommand::readCount(){
        try {
                CountTable ct;
-               ct.readTable(countfile);
+               ct.readTable(countfile, false);
         
         if (m->control_pressed) { return 0; }
         
index 24c4f27777d21ed88b6f3b41411394502802404e..e76dd4860b03826db116323af7e42528a591c526 100644 (file)
@@ -247,7 +247,7 @@ int MGClusterCommand::execute(){
         if(countfile != "") {
             //map<string, int> nameMapCounts = m->readNames(namefile);
             ct = new CountTable();
-            ct->readTable(countfile);
+            ct->readTable(countfile, false);
             rabund = new RAbundVector();
             createRabund(ct, list, rabund);
         }else {
index 3ed65c67f700b98d3c99a12a9dc6018ff4cfdd76..5a568f3511d38f56601362d860a9643e702c9a1b 100644 (file)
@@ -169,7 +169,7 @@ ParseListCommand::ParseListCommand(string option)  {
                        else if (countfile == "not open") { abort = true; countfile =  ""; }    
                        else {   
                 m->setCountTableFile(countfile); 
-                ct.readTable(countfile);
+                ct.readTable(countfile, true);
                 if (!ct.hasGroupInfo()) { 
                     abort = true;
                     m->mothurOut("[ERROR]: The parse.list command requires group info to be present in your countfile, quitting."); m->mothurOutEndLine();
index 8db6c24ff05ce4a5a23bc11a9021b208f5e65d55..f2ca9db29d7a94ce0d22606d4ad114e11001fd4f 100644 (file)
@@ -1088,7 +1088,7 @@ int PcrSeqsCommand::readCount(set<string> badSeqNames){
         //check for groups that have been eliminated
         CountTable ct;
         if (ct.testGroups(goodCountFile)) {
-            ct.readTable(goodCountFile);
+            ct.readTable(goodCountFile, true);
             ct.printTable(goodCountFile);
         }
                
index bbf8df27ac5ee691f091f150638b781f85486a11..24d22845c5a4fc33d109888e5f2007d25134672e 100644 (file)
@@ -192,7 +192,7 @@ PreClusterCommand::PreClusterCommand(string option) {
                        else if (countfile == "not open") { abort = true; countfile =  ""; }    
                        else {   
                 m->setCountTableFile(countfile); 
-                ct.readTable(countfile);
+                ct.readTable(countfile, true);
                 if (ct.hasGroupInfo()) { bygroup = true; }
                 else { bygroup = false;  }
             }
index 59369b3cf7411bdc0383d2a0be0676c3caee4c61..195adf4f716b29bd7c12a2f3529603e4baec6b4d 100644 (file)
@@ -1088,7 +1088,7 @@ map<string, int> PrimerDesignCommand::readCount(unsigned long int& numSeqs){
         map<string, int> nameMap;
         
         CountTable ct;
-        ct.readTable(countfile);
+        ct.readTable(countfile, false);
         vector<string> namesOfSeqs = ct.getNamesOfSeqs();
         numSeqs = ct.getNumUniqueSeqs();
         
index 4f4b1580582b953c3b8318acc68345cc8d45ae48..1e5fe11de39f34b30f59249895bcf393506e32f9 100644 (file)
@@ -369,7 +369,7 @@ int RemoveGroupsCommand::execute(){
                 m->mothurOut("\n[NOTE]: The count file should contain only unique names, so mothur assumes your fasta, list and taxonomy files also contain only uniques.\n\n");
             }
             CountTable ct;
-            ct.readTable(countfile);
+            ct.readTable(countfile, true);
             if (!ct.hasGroupInfo()) { m->mothurOut("[ERROR]: your count file does not contain group info, aborting.\n"); return 0; }
             
             vector<string> gNamesOfGroups = ct.getNamesOfGroups();
index 5b6fc252c4ae8c78619d0f3ad76afbb9792cbddd..1496f8a69b74896f610889bbf87771f9237d89da 100644 (file)
@@ -599,7 +599,7 @@ int RemoveLineageCommand::readCount(){
         //check for groups that have been eliminated
         CountTable ct;
         if (ct.testGroups(outputFileName)) {
-            ct.readTable(outputFileName);
+            ct.readTable(outputFileName, true);
             ct.printTable(outputFileName);
         }
                
index cf6674e5a7cbfd65c9e17e4a22cd24678502239f..a551681fb6721e4b3670fe912e1b6bfe909dd388 100644 (file)
@@ -411,7 +411,7 @@ int RemoveRareCommand::processList(){
                        util.setGroups(Groups, namesGroups);
                        m->openOutputFile(outputGroupFileName, outGroup);
                }else if (countfile != "") {
-            ct.readTable(countfile);
+            ct.readTable(countfile, true);
             if (ct.hasGroupInfo()) {
                 vector<string> namesGroups = ct.getNamesOfGroups();
                 SharedUtil util;
index c7af108325390221bd0313e4ad2a733dfd2e90d3..b1bc4fd508576c04126206b4e178798c088cb91d 100644 (file)
@@ -557,7 +557,7 @@ int RemoveSeqsCommand::readCount(){
         //check for groups that have been eliminated
         CountTable ct;
         if (ct.testGroups(outputFileName)) {
-            ct.readTable(outputFileName);
+            ct.readTable(outputFileName, true);
             ct.printTable(outputFileName);
         }
 
index d2fbe935356a2f0752efa683a893a5892e1b2eb2..051aa99434f6bb21a8d3b3b54cb2cc671eab98d2 100644 (file)
@@ -683,7 +683,7 @@ int ScreenSeqsCommand::screenReports(map<string, string>& badSeqNames){
             if (namefile != "") { nameMap = m->readNames(namefile); }
             else if (countfile != "") {
                 CountTable ct;
-                ct.readTable(countfile);
+                ct.readTable(countfile, true);
                 nameMap = ct.getNameMap();
             }
             getSummary(positions); 
@@ -714,7 +714,7 @@ int ScreenSeqsCommand::screenReports(map<string, string>& badSeqNames){
             if (namefile != "") { nameMap = m->readNames(namefile); }
             else if (countfile != "") {
                 CountTable ct;
-                ct.readTable(countfile);
+                ct.readTable(countfile, true);
                 nameMap = ct.getNameMap();
             }
             getSummaryReport();
@@ -1019,7 +1019,7 @@ int ScreenSeqsCommand::screenFasta(map<string, string>& badSeqNames){
                        if (namefile != "") { nameMap = m->readNames(namefile); }
             else if (countfile != "") {
                 CountTable ct;
-                ct.readTable(countfile);
+                ct.readTable(countfile, true);
                 nameMap = ct.getNameMap();
             }
                        getSummary(positions); 
@@ -2206,7 +2206,7 @@ int ScreenSeqsCommand::screenCountFile(map<string, string> badSeqNames){
         //check for groups that have been eliminated
         CountTable ct;
         if (ct.testGroups(goodCountFile)) {
-            ct.readTable(goodCountFile);
+            ct.readTable(goodCountFile, true);
             ct.printTable(goodCountFile);
         }
                
index c1cdb6b90c910c2e58c5d016a6c2293f7d7aa8ce..3354665852ce1b5a95b9ecc7cc673d5083b25d8b 100644 (file)
@@ -200,7 +200,7 @@ int AlignCheckCommand::execute(){
                if (namefile != "") { nameMap = m->readNames(namefile); }
         else if (countfile != "") {
             CountTable ct;
-            ct.readTable(countfile);
+            ct.readTable(countfile, false);
             nameMap = ct.getNameMap();
         }
                
index 203a71ede5544a3d1c5e2eba73072fa825445aac..54d3dcc5c9b6c93f267478e6491126b3aedff772 100644 (file)
@@ -358,7 +358,7 @@ int SeqErrorCommand::execute(){
                if(namesFileName != "")     {   weights = getWeights();         }
         else if (countfile != "")   {
             CountTable ct;
-            ct.readTable(countfile);
+            ct.readTable(countfile, false);
             weights = ct.getNameMap();
         }
                
index 6d8336cb40217a9547791e69765230dff0dabe62..27bb8d95190fb66ea03510cf266d2d53824d988c 100644 (file)
@@ -203,7 +203,7 @@ int SeqSummaryCommand::execute(){
                if (namefile != "") { nameMap = m->readNames(namefile); }
         else if (countfile != "") {
             CountTable ct;
-            ct.readTable(countfile);
+            ct.readTable(countfile, false);
             nameMap = ct.getNameMap();
         }
                
index 1300c0f1023fdd24d53c7bb9033be1d5c1c3e5d6..37eb4e7f5256617bd3917428616a897ee14706e4 100644 (file)
@@ -16,7 +16,7 @@ SequenceCountParser::SequenceCountParser(string countfile, string fastafile) {
                
                //read count file
                CountTable countTable;
-               countTable.readTable(countfile);
+               countTable.readTable(countfile, true);
                
                //initialize maps
                namesOfGroups = countTable.getNamesOfGroups();
index 91ca1a15cc7b3d6bad67331e129b57c6819e34b4..8d5d89c3a96843b5fd1c8aafa112f25c3b216e1f 100644 (file)
@@ -766,7 +766,7 @@ int SharedCommand::createSharedFromListGroup(string filename) {
             m->setAllGroups(allGroups);
         }else{
             countTable = new CountTable();
-            countTable->readTable(countfile);
+            countTable->readTable(countfile, true);
         }
         
         if (m->control_pressed) { return 0; }
index 223ca073fa2c5c9c083d5d20bc024fe82f724b68..0ee2f795cea302bd98a31285b278479f13ef17f3 100644 (file)
@@ -32,7 +32,7 @@ SharedListVector::SharedListVector(ifstream& f) : DataVector(), maxRank(0), numB
             groupmap->readMap(); 
         }else {
             countTable = new CountTable();
-            countTable->readTable(m->getCountTableFile());
+            countTable->readTable(m->getCountTableFile(), true);
         }
 
                int hold;
index 2d37e8d459857f7f0161ba87111df0403ff9c827..580493b60a1e4d449a71b8689635e8ced4dea397 100644 (file)
@@ -212,7 +212,7 @@ SplitAbundCommand::SplitAbundCommand(string option)  {
                        else if (countfile == "not found") { countfile = "";  } 
                        else {
                 m->setCountTableFile(countfile); 
-                ct.readTable(countfile);
+                ct.readTable(countfile, true);
             }
             
             if ((namefile != "") && (countfile != "")) {
index 238eda55e04a3df6e43a2fae8cee5736c4f6febc..c15ba3a4d588b3eedcaca7713c6d5acb8610aee2 100644 (file)
@@ -320,7 +320,7 @@ int SplitGroupCommand::runCount(){
        try {
         
         CountTable ct;
-        ct.readTable(countfile);
+        ct.readTable(countfile, true);
         if (!ct.hasGroupInfo()) { m->mothurOut("[ERROR]: your count file does not contain group info, cannot split by group.\n"); m->control_pressed = true; }
         
         if (m->control_pressed) { return 0; }
index 4128191598d22e8e7280f403dca79494e61da948..fe79fbbae883a409187730e1899fde8b05493193 100644 (file)
@@ -273,7 +273,7 @@ SubSampleCommand::SubSampleCommand(string option) {
                        else if (countfile == "not found") { countfile = "";  } 
                        else {
                 m->setCountTableFile(countfile); 
-                ct.readTable(countfile);
+                ct.readTable(countfile, true);
             }
             
             if ((namefile != "") && (countfile != "")) {
index 0f6f719ef568446af70438eb08579a81c7c6f3f6..e1e626ea273a650840dd849442e43762e9a100cf 100644 (file)
@@ -196,7 +196,7 @@ int SummaryQualCommand::execute(){
                if (namefile != "") { nameMap = m->readNames(namefile); }
                else if (countfile != "") {
             CountTable ct;
-            ct.readTable(countfile);
+            ct.readTable(countfile, false);
             nameMap = ct.getNameMap();
         }
         
index c76f175b047ef9ee46eff28911c1a21cd6310a97..e244863c65de54c6c5133d3901a1dc1bc973c6ac 100644 (file)
@@ -223,7 +223,7 @@ int SummaryTaxCommand::execute(){
             groupMap->readMap();
         }else if (countfile != "") {
             ct = new CountTable();
-            ct->readTable(countfile);
+            ct->readTable(countfile, true);
         }
                
         PhyloSummary* taxaSum;
index b793dc885ef9213f290f118be55066a0e2837086..0119741988c010e0d3b3d3df1bbc4c052f5bba8f 100644 (file)
@@ -458,7 +458,7 @@ int TreeGroupCommand::execute(){
                 readMatrix->read(nameMap);
             }else if (countfile != "") {
                 ct = new CountTable();
-                ct->readTable(countfile);
+                ct->readTable(countfile, true);
                 readMatrix->read(ct);
             }else {
                 readMatrix->read(nameMap);
index 0e25f12a39b2a5341ad2ba3bf7255bb8b6aa7edc..8427b562501086e8a9bf13b6e036474348412b0e 100644 (file)
@@ -15,7 +15,7 @@ TreeReader::TreeReader(string tf, string cf) : treefile(tf), countfile(cf)  {
     try {
         m = MothurOut::getInstance();
         ct = new CountTable();
-        ct->readTable(cf);
+        ct->readTable(cf, true);
         
         //if no groupinfo in count file we need to add it
         if (!ct->hasGroupInfo()) {
index 5a5d445cb8624386e90d4c714c1f460f1be0d509..81b9111b17dd8bba332ad8a8267cc12bf16e235a 100644 (file)
@@ -422,7 +422,7 @@ int TrimSeqsCommand::execute(){
                
                if (countfile != "") {
             CountTable ct;
-            ct.readTable(countfile);
+            ct.readTable(countfile, true);
             nameCount = ct.getNameMap();
                        outputNames.push_back(trimCountFile);
                        outputNames.push_back(scrapCountFile);
@@ -540,7 +540,7 @@ int TrimSeqsCommand::execute(){
             
             if (countfile != "") { //create countfile with group info included
                 CountTable* ct = new CountTable();
-                ct->readTable(trimCountFile);
+                ct->readTable(trimCountFile, true);
                 map<string, int> justTrimmedNames = ct->getNameMap();
                 delete ct;