]> git.donarmstrong.com Git - mothur.git/commitdiff
changes while testing 1.26
authorSarah Westcott <mothur.westcott@gmail.com>
Tue, 3 Jul 2012 15:40:16 +0000 (11:40 -0400)
committerSarah Westcott <mothur.westcott@gmail.com>
Tue, 3 Jul 2012 15:40:16 +0000 (11:40 -0400)
Mothur.xcodeproj/project.pbxproj
counttable.cpp
counttable.h
getcoremicrobiomecommand.cpp
getotulabelscommand.cpp
makecontigscommand.cpp
makefile
removeotulabelscommand.cpp
shhhercommand.cpp

index b6d221f3ba93e62c67ca7c2fe3f239bf5813758e..13f12e072b616b5337cd5bece8f3c68c44ca6a3d 100644 (file)
                                GCC_OPTIMIZATION_LEVEL = 0;
                                GCC_PREPROCESSOR_DEFINITIONS = (
                                        "MOTHUR_FILES=\"\\\"../release\\\"\"",
-                                       "VERSION=\"\\\"1.25.0\\\"\"",
-                                       "RELEASE_DATE=\"\\\"5/01/2012\\\"\"",
+                                       "VERSION=\"\\\"1.26.0\\\"\"",
+                                       "RELEASE_DATE=\"\\\"7/9/2012\\\"\"",
                                );
                                "GCC_VERSION[arch=*]" = "";
                                GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
                                GCC_MODEL_TUNING = "";
                                GCC_OPTIMIZATION_LEVEL = 0;
                                GCC_PREPROCESSOR_DEFINITIONS = (
-                                       "VERSION=\"\\\"1.25.0\\\"\"",
-                                       "RELEASE_DATE=\"\\\"4/30/2012\\\"\"",
+                                       "VERSION=\"\\\"1.26.0\\\"\"",
+                                       "RELEASE_DATE=\"\\\"7/9/2012\\\"\"",
                                );
                                GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
                                GCC_WARN_ABOUT_RETURN_TYPE = YES;
index c4e2732e8554cd81a934af7f2ee3bfcff7705db6..7f08509897f0765823b4e2e7b65f837809821c45 100644 (file)
@@ -173,5 +173,37 @@ vector<string> CountTable::getNamesOfSeqs() {
        }
 }
 /************************************************************/
+//returns names of seqs
+int CountTable::mergeCounts(string seq1, string seq2) {
+    try {
+        map<string, int>::iterator it = indexNameMap.find(seq1);
+        if (it == indexNameMap.end()) {
+            m->mothurOut("[ERROR]: " + seq1 + " is not in your count table. Please correct.\n"); m->control_pressed = true;
+        }else { 
+            map<string, int>::iterator it2 = indexNameMap.find(seq2);
+            if (it2 == indexNameMap.end()) {
+                m->mothurOut("[ERROR]: " + seq2 + " is not in your count table. Please correct.\n"); m->control_pressed = true;
+            }else { 
+                //merge data
+                for (int i = 0; i < groups.size(); i++) {
+                    counts[it->second][i] += counts[it2->second][i];
+                    counts[it2->second][i] = 0;
+                }
+                totals[it->second] += totals[it2->second];
+                totals[it2->second] = 0;
+                uniques--;
+                indexNameMap.erase(it2); 
+            }
+        }
+        
+        return 0;
+    }
+       catch(exception& e) {
+               m->errorOut(e, "CountTable", "getNamesOfSeqs");
+               exit(1);
+       }
+}
+
+/************************************************************/
 
 
index 8c970199babf9d45f3a624d3456d39732fc3e5e2..ffc08167682bf8aa9f1a4a42267a90d666376250 100644 (file)
@@ -59,6 +59,7 @@ class CountTable {
         int getNumUniqueSeqs() { return uniques; } //return number of unique/representative seqs
         int getGroupIndex(string); //returns index in getGroupCounts vector of specific group
         vector<string> getNamesOfSeqs();
+        int mergeCounts(string, string); //combines counts for 2 seqs, saving under the first name passed in.
     
     private:
         string filename;
index 63af3abb3a595cff133a2caac91dea1aa1e420c1..3cc77be4ab73ad4f8d17635aa5b2ace242b22ec8 100644 (file)
@@ -308,7 +308,7 @@ int GetCoreMicroBiomeCommand::execute(){
 int GetCoreMicroBiomeCommand::createTable(vector<SharedRAbundFloatVector*>& lookup){
        try {
         
-        string outputFileName = outputDir + m->getRootName(m->getSimpleName(inputFileName)) + lookup[0]->getLabel() + getOutputFileNameTag("coremicrobiome");
+        string outputFileName = outputDir + m->getRootName(m->getSimpleName(inputFileName)) + lookup[0]->getLabel() + "." + getOutputFileNameTag("coremicrobiome");
         outputNames.push_back(outputFileName);  outputTypes["coremicrobiome"].push_back(outputFileName);
                ofstream out;
                m->openOutputFile(outputFileName, out);
index a281f9f8a23f98d36f7a4b303bdf7804d945c4c7..7dc0b414f40e3db4b3daa0469589ba30dc5fe781 100644 (file)
@@ -33,9 +33,9 @@ string GetOtuLabelsCommand::getHelpString(){
                string helpString = "";
                helpString += "The get.otulabels command can be used to select specific otus with the output from classify.otu, otu.association, or corr.axes.\n";
                helpString += "The get.otulabels parameters are: constaxonomy, otucorr, corraxes, and accnos.\n";
-               helpString += "The constaxonomy parameter is input the results of the classify.otu command.\n";
-        helpString += "The otucorr parameter is input the results of the otu.association command.\n";
-        helpString += "The corraxes parameter is input the results of the corr.axes command.\n";
+               helpString += "The constaxonomy parameter is used to input the results of the classify.otu command.\n";
+        helpString += "The otucorr parameter is used to input the results of the otu.association command.\n";
+        helpString += "The corraxes parameter is used to input the results of the corr.axes command.\n";
                helpString += "The get.otulabels commmand should be in the following format: \n";
                helpString += "get.otulabels(accnos=yourListOfOTULabels, corraxes=yourCorrAxesFile)\n";
                return helpString;
index ed2f05d5559584101fc77c55c09b2af3d078729d..691d706ab00efa8823412753b72f08e5198873b1 100644 (file)
@@ -38,8 +38,8 @@ string MakeContigsCommand::getHelpString(){
                string helpString = "";
                helpString += "The make.contigs command reads a forward fastq file and a reverse fastq file and outputs new fasta and quality files.\n";
                helpString += "The make.contigs command parameters are ffastq, rfastq, align, match, mismatch, gapopen, gapextend and processors.\n";
-               helpString += "The ffastq and rfastq parameter is required.\n";
-               helpString += "The align parameter allows you to specify the alignment method to use.  Your options are: gotoh, needleman, blast and noalign. The default is needleman.\n";
+               helpString += "The ffastq and rfastq parameters are required.\n";
+               helpString += "The align parameter allows you to specify the alignment method to use.  Your options are: gotoh and needleman. The default is needleman.\n";
                helpString += "The match parameter allows you to specify the bonus for having the same base. The default is 1.0.\n";
                helpString += "The mistmatch parameter allows you to specify the penalty for having different bases.  The default is -1.0.\n";
                helpString += "The gapopen parameter allows you to specify the penalty for opening a gap in an alignment. The default is -2.0.\n";
@@ -212,7 +212,7 @@ int MakeContigsCommand::execute(){
         
         string outFastaFile = outputDir + m->getRootName(m->getSimpleName(ffastqfile)) + getOutputFileNameTag("fasta");
         string outQualFile = outputDir + m->getRootName(m->getSimpleName(ffastqfile)) + getOutputFileNameTag("qfile");
-        string outMisMatchFile = outputDir + m->getRootName(m->getSimpleName(ffastqfile)) + getOutputFileNameTag("mismatches");
+        string outMisMatchFile = outputDir + m->getRootName(m->getSimpleName(ffastqfile)) + getOutputFileNameTag("mismatch");
         outputNames.push_back(outFastaFile); outputTypes["fasta"].push_back(outFastaFile);
         outputNames.push_back(outQualFile); outputTypes["qfile"].push_back(outQualFile);
         outputNames.push_back(outMisMatchFile); outputTypes["mismatch"].push_back(outMisMatchFile);
index 6f8a42343be48654dc77ef2e021caf601a02ff2e..32ede6e5fa70a2ab42f4aa6ebcc0382b32dc8d76 100644 (file)
--- a/makefile
+++ b/makefile
@@ -15,8 +15,8 @@ USEREADLINE ?= yes
 CYGWIN_BUILD ?= no
 USECOMPRESSION ?= no
 MOTHUR_FILES="\"Enter_your_default_path_here\""
-RELEASE_DATE = "\"5/14/2012\""
-VERSION = "\"1.25.1\""
+RELEASE_DATE = "\"7/9/2012\""
+VERSION = "\"1.26.0\""
 FORTAN_COMPILER = gfortran
 FORTRAN_FLAGS = 
 
index 01d8529dded5e9c7e17bd02724158156566dece7..a05e08154b10c6c0123a5f3f93847db520ee7959 100644 (file)
@@ -148,7 +148,7 @@ RemoveOtuLabelsCommand::RemoveOtuLabelsCommand(string option)  {
             }
             
             vector<string> tempOutNames;
-            outputTypes["contaxonomy"] = tempOutNames; 
+            outputTypes["constaxonomy"] = tempOutNames; 
             outputTypes["otucorr"] = tempOutNames;
             outputTypes["corraxes"] = tempOutNames;
             
index 97629b600031c06c063f405175dd9fa369ae7c93..115e930969323ba4655e0b5ba5c2a8e1166a1397 100644 (file)
@@ -1839,14 +1839,17 @@ void ShhherCommand::writeGroups(){
     try {
         string thisOutputDir = outputDir;
         if (outputDir == "") {  thisOutputDir += m->hasPath(flowFileName);  }
-        string fileRoot = thisOutputDir + m->getRootName(m->getSimpleName(flowFileName));
-        string groupFileName = fileRoot + getOutputFileNameTag("group");
+        string fileRoot = m->getRootName(m->getSimpleName(flowFileName));
+        int pos = fileRoot.find_first_of('.');
+        string fileGroup = fileRoot;
+        if (pos != string::npos) {  fileGroup = fileRoot.substr(pos+1, (fileRoot.length()-1-(pos+1)));  }
+        string groupFileName = thisOutputDir + fileRoot + getOutputFileNameTag("group");
         ofstream groupFile;
         m->openOutputFile(groupFileName, groupFile);
         
         for(int i=0;i<numSeqs;i++){
             if (m->control_pressed) { break; }
-            groupFile << seqNameVector[i] << '\t' << fileRoot << endl;
+            groupFile << seqNameVector[i] << '\t' << fileGroup << endl;
         }
         groupFile.close();
         outputNames.push_back(groupFileName);
@@ -2319,15 +2322,18 @@ int ShhherCommand::driver(vector<string> filenames, string thisCompositeFASTAFil
                 string fastaFileName = thisOutputDir + m->getRootName(m->getSimpleName(flowFileName)) + getOutputFileNameTag("fasta");
                 string nameFileName = thisOutputDir + m->getRootName(m->getSimpleName(flowFileName)) + getOutputFileNameTag("name");
                 string otuCountsFileName = thisOutputDir + m->getRootName(m->getSimpleName(flowFileName)) + getOutputFileNameTag("counts");
-                string fileRoot = thisOutputDir + m->getRootName(m->getSimpleName(flowFileName));
-                string groupFileName = fileRoot + getOutputFileNameTag("group");
+                string fileRoot = m->getRootName(m->getSimpleName(flowFileName));
+                int pos = fileRoot.find_first_of('.');
+                string fileGroup = fileRoot;
+                if (pos != string::npos) {  fileGroup = fileRoot.substr(pos+1, (fileRoot.length()-1-(pos+1)));  }
+                string groupFileName = thisOutputDir + fileRoot + getOutputFileNameTag("group");
 
                 
                 writeQualities(numOTUs, numFlowCells, qualityFileName, otuCounts, nSeqsPerOTU, seqNumber, singleTau, flowDataIntI, uniqueFlowgrams, cumNumSeqs, mapUniqueToSeq, seqNameVector, centroids, aaI); if (m->control_pressed) { break; }
                 writeSequences(thisCompositeFASTAFileName, numOTUs, numFlowCells, fastaFileName, otuCounts, uniqueFlowgrams, seqNameVector, aaI, centroids);if (m->control_pressed) { break; }
                 writeNames(thisCompositeNamesFileName, numOTUs, nameFileName, otuCounts, seqNameVector, aaI, nSeqsPerOTU);                             if (m->control_pressed) { break; }
                 writeClusters(otuCountsFileName, numOTUs, numFlowCells,otuCounts, centroids, uniqueFlowgrams, seqNameVector, aaI, nSeqsPerOTU, lengths, flowDataIntI);                 if (m->control_pressed) { break; }
-                writeGroups(groupFileName, fileRoot, numSeqs, seqNameVector);                                          if (m->control_pressed) { break; }
+                writeGroups(groupFileName, fileGroup, numSeqs, seqNameVector);                                         if (m->control_pressed) { break; }
                 
                 if (large) {
                     if (g > 0) {