From: Sarah Westcott Date: Tue, 3 Jul 2012 15:40:16 +0000 (-0400) Subject: changes while testing 1.26 X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=commitdiff_plain;h=1f3d51cfdbe3e28c780501b7ed82d64fe27dba98 changes while testing 1.26 --- diff --git a/Mothur.xcodeproj/project.pbxproj b/Mothur.xcodeproj/project.pbxproj index b6d221f..13f12e0 100644 --- a/Mothur.xcodeproj/project.pbxproj +++ b/Mothur.xcodeproj/project.pbxproj @@ -2232,8 +2232,8 @@ 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; @@ -2268,8 +2268,8 @@ 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; diff --git a/counttable.cpp b/counttable.cpp index c4e2732..7f08509 100644 --- a/counttable.cpp +++ b/counttable.cpp @@ -173,5 +173,37 @@ vector CountTable::getNamesOfSeqs() { } } /************************************************************/ +//returns names of seqs +int CountTable::mergeCounts(string seq1, string seq2) { + try { + map::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::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); + } +} + +/************************************************************/ diff --git a/counttable.h b/counttable.h index 8c97019..ffc0816 100644 --- a/counttable.h +++ b/counttable.h @@ -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 getNamesOfSeqs(); + int mergeCounts(string, string); //combines counts for 2 seqs, saving under the first name passed in. private: string filename; diff --git a/getcoremicrobiomecommand.cpp b/getcoremicrobiomecommand.cpp index 63af3ab..3cc77be 100644 --- a/getcoremicrobiomecommand.cpp +++ b/getcoremicrobiomecommand.cpp @@ -308,7 +308,7 @@ int GetCoreMicroBiomeCommand::execute(){ int GetCoreMicroBiomeCommand::createTable(vector& 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); diff --git a/getotulabelscommand.cpp b/getotulabelscommand.cpp index a281f9f..7dc0b41 100644 --- a/getotulabelscommand.cpp +++ b/getotulabelscommand.cpp @@ -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; diff --git a/makecontigscommand.cpp b/makecontigscommand.cpp index ed2f05d..691d706 100644 --- a/makecontigscommand.cpp +++ b/makecontigscommand.cpp @@ -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); diff --git a/makefile b/makefile index 6f8a423..32ede6e 100644 --- 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 = diff --git a/removeotulabelscommand.cpp b/removeotulabelscommand.cpp index 01d8529..a05e081 100644 --- a/removeotulabelscommand.cpp +++ b/removeotulabelscommand.cpp @@ -148,7 +148,7 @@ RemoveOtuLabelsCommand::RemoveOtuLabelsCommand(string option) { } vector tempOutNames; - outputTypes["contaxonomy"] = tempOutNames; + outputTypes["constaxonomy"] = tempOutNames; outputTypes["otucorr"] = tempOutNames; outputTypes["corraxes"] = tempOutNames; diff --git a/shhhercommand.cpp b/shhhercommand.cpp index 97629b6..115e930 100644 --- a/shhhercommand.cpp +++ b/shhhercommand.cpp @@ -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;icontrol_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 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) {