From 7aa301dfa67cfcb5b00c6b4e38a7ad56eb8337db Mon Sep 17 00:00:00 2001 From: Sarah Westcott Date: Fri, 11 Jan 2013 08:16:14 -0500 Subject: [PATCH] fixed bug in pre.cluster with output file name change and other bugs while testing 1.29.0 --- classifyotucommand.cpp | 3 ++- command.hpp | 10 +++++++++- indicatorcommand.cpp | 2 +- matrixoutputcommand.cpp | 2 +- phylotypecommand.h | 1 - preclustercommand.h | 1 - venncommand.cpp | 3 ++- 7 files changed, 15 insertions(+), 7 deletions(-) diff --git a/classifyotucommand.cpp b/classifyotucommand.cpp index 47b1841..d0ddc69 100644 --- a/classifyotucommand.cpp +++ b/classifyotucommand.cpp @@ -42,7 +42,7 @@ vector ClassifyOtuCommand::setParameters(){ string ClassifyOtuCommand::getHelpString(){ try { string helpString = ""; - helpString += "The classify.otu command parameters are list, taxonomy, reftaxonomy, name, group, count, cutoff, label, basis and probs. The taxonomy and list parameters are required unless you have a valid current file.\n"; + helpString += "The classify.otu command parameters are list, taxonomy, reftaxonomy, name, group, count, persample, cutoff, label, basis and probs. The taxonomy and list parameters are required unless you have a valid current file.\n"; helpString += "The reftaxonomy parameter allows you give the name of the reference taxonomy file used when you classified your sequences. Providing it will keep the rankIDs in the summary file static.\n"; helpString += "The name parameter allows you add a names file with your taxonomy file.\n"; helpString += "The group parameter allows you provide a group file to use in creating the summary file breakdown.\n"; @@ -53,6 +53,7 @@ string ClassifyOtuCommand::getHelpString(){ helpString += "Now for basis=otu could give Clostridiales 3 7 6 1 2, where 7 is the number of otus that classified to Clostridiales.\n"; helpString += "6 is the number of otus containing sequences from groupA, 1 is the number of otus containing sequences from groupB, and 2 is the number of otus containing sequences from groupC.\n"; helpString += "The label parameter allows you to select what distance levels you would like a output files created for, and is separated by dashes.\n"; + helpString += "The persample parameter allows you to find a consensus taxonomy for each group. Default=f\n"; helpString += "The default value for label is all labels in your inputfile.\n"; helpString += "The cutoff parameter allows you to specify a consensus confidence threshold for your taxonomy. The default is 51, meaning 51%. Cutoff cannot be below 51.\n"; helpString += "The probs parameter shuts off the outputting of the consensus confidence results. The default is true, meaning you want the confidence to be shown.\n"; diff --git a/command.hpp b/command.hpp index 7ed03f1..48dcf28 100644 --- a/command.hpp +++ b/command.hpp @@ -50,14 +50,22 @@ class Command { //find pattern to use based on number of variables passed in string pattern = ""; bool foundPattern = false; + vector numVariablesPerPattern; for (int i = 0; i < patterns.size(); i++) { int numVariables = 0; for (int j = 0; j < patterns[i].length(); j++) { if (patterns[i][j] == '[') { numVariables++; } } + numVariablesPerPattern.push_back(numVariables); if (numVariables == variableParts.size()) { pattern = patterns[i]; foundPattern = true; break; } } - if (!foundPattern) { m->mothurOut("[ERROR]: Not enough variable pieces for " + type + ".\n"); m->control_pressed = true; } + //if you didn't find an exact match do we have something that might work + if (!foundPattern) { + for (int i = 0; i < numVariablesPerPattern.size(); i++) { + if (numVariablesPerPattern[i] < variableParts.size()) { pattern = patterns[i]; foundPattern = true; break; } + } + if (!foundPattern) { m->mothurOut("[ERROR]: Not enough variable pieces for " + type + ".\n"); m->control_pressed = true; } + } if (pattern != "") { int numVariables = 0; diff --git a/indicatorcommand.cpp b/indicatorcommand.cpp index b92c58b..8b9a88c 100644 --- a/indicatorcommand.cpp +++ b/indicatorcommand.cpp @@ -291,8 +291,8 @@ int IndicatorCommand::execute(){ for (int i = 0; i < m->Treenames.size(); i++) { nameMap.insert(m->Treenames[i]); //sanity check - is this a group that is not in the sharedfile? + if (i == 0) { gps.insert("Group1"); } if (designfile == "") { - if (i == 0) { gps.insert("Group1"); } if (!(m->inUsersGroups(m->Treenames[i], m->getAllGroups()))) { m->mothurOut("[ERROR]: " + m->Treenames[i] + " is not a group in your shared or relabund file."); m->mothurOutEndLine(); mismatch = true; diff --git a/matrixoutputcommand.cpp b/matrixoutputcommand.cpp index b7e1dae..d2c29bd 100644 --- a/matrixoutputcommand.cpp +++ b/matrixoutputcommand.cpp @@ -796,7 +796,7 @@ int MatrixOutputCommand::process(vector thisLookup){ outAve.close(); variables["[tag2]"] = "std"; - distFileName = outputDir + getOutputFileName("phylip",variables); + distFileName = getOutputFileName("phylip",variables); outputNames.push_back(distFileName); outputTypes["phylip"].push_back(distFileName); ofstream outSTD; m->openOutputFile(distFileName, outSTD); diff --git a/phylotypecommand.h b/phylotypecommand.h index 7fe10af..534dc8e 100644 --- a/phylotypecommand.h +++ b/phylotypecommand.h @@ -42,7 +42,6 @@ private: int cutoff; map namemap; vector outputNames; - map > outputTypes; map currentNodes; map parentNodes; diff --git a/preclustercommand.h b/preclustercommand.h index 0bd56c8..56bf1f3 100644 --- a/preclustercommand.h +++ b/preclustercommand.h @@ -79,7 +79,6 @@ private: map::iterator itSize; // map active; //maps sequence name to whether it has already been merged or not. vector outputNames; - map > outputTypes; int readFASTA(); void readNameFile(); diff --git a/venncommand.cpp b/venncommand.cpp index 70c35f7..98796b3 100644 --- a/venncommand.cpp +++ b/venncommand.cpp @@ -46,7 +46,7 @@ vector VennCommand::setParameters(){ string VennCommand::getHelpString(){ try { string helpString = ""; - helpString += "The venn command parameters are list, shared, groups, calc, abund, nseqs, permute, fontsize and label. shared, relabund, list, rabund or sabund is required unless you have a valid current file.\n"; + helpString += "The venn command parameters are list, shared, groups, calc, abund, nseqs, permute, sharedotus, fontsize and label. shared, relabund, list, rabund or sabund is required unless you have a valid current file.\n"; helpString += "The groups parameter allows you to specify which of the groups in your groupfile you would like included in your venn diagram, you may only use a maximum of 4 groups.\n"; helpString += "The group names are separated by dashes. The label allows you to select what distance levels you would like a venn diagram created for, and are also separated by dashes.\n"; helpString += "The fontsize parameter allows you to adjust the font size of the picture created, default=24.\n"; @@ -58,6 +58,7 @@ string VennCommand::getHelpString(){ helpString += "The nseqs parameter will output the number of sequences represented by the otus in the picture, default=F.\n"; helpString += "If you have more than 4 groups, the permute parameter will find all possible combos of 4 of your groups and create pictures for them, default=F.\n"; helpString += "The only estimators available four 4 groups are sharedsobs and sharedchao.\n"; + helpString += "The sharedotus parameter can be used with the sharedsobs calculator to get the names of the OTUs in each section of the venn diagram. Default=t.\n"; helpString += "The venn command outputs a .svg file for each calculator you specify at each distance you choose.\n"; helpString += "Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n"; return helpString; -- 2.39.2