]> git.donarmstrong.com Git - mothur.git/commitdiff
fixed bug in pre.cluster with output file name change and other bugs while testing...
authorSarah Westcott <mothur.westcott@gmail.com>
Fri, 11 Jan 2013 13:16:14 +0000 (08:16 -0500)
committerSarah Westcott <mothur.westcott@gmail.com>
Fri, 11 Jan 2013 13:16:14 +0000 (08:16 -0500)
classifyotucommand.cpp
command.hpp
indicatorcommand.cpp
matrixoutputcommand.cpp
phylotypecommand.h
preclustercommand.h
venncommand.cpp

index 47b18410e6e2d61d2e58ec1b2ab170fbce34285f..d0ddc691236e59cdd0fcb6a2578249375fd8ad0e 100644 (file)
@@ -42,7 +42,7 @@ vector<string> 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";
index 7ed03f161e18b9ea5bd8374606585ccefb41772e..48dcf283c8874c8168ac6cf48748bf80851caef3 100644 (file)
@@ -50,14 +50,22 @@ class Command {
                         //find pattern to use based on number of variables passed in
                         string pattern = "";
                         bool foundPattern = false;
+                        vector<int> 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;
index b92c58b54852b35c80ad039720c847b8d35d02bb..8b9a88cc8116d679d5096be848f7b6a2c29b5215 100644 (file)
@@ -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;
index b7e1dae2f5c37e4deffc613ba5024f977906b7da..d2c29bdee9b6fc84481f89775f497b3165b72b4b 100644 (file)
@@ -796,7 +796,7 @@ int MatrixOutputCommand::process(vector<SharedRAbundVector*> 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);
index 7fe10af58dde8ae842be2496376b3569df49bd29..534dc8eefcc643bda6f71d23291462b01c4d3940 100644 (file)
@@ -42,7 +42,6 @@ private:
        int cutoff;
        map<string, string> namemap;
        vector<string> outputNames;
-       map<string, vector<string> > outputTypes;
        
        map<int, int> currentNodes;
        map<int, int> parentNodes;
index 0bd56c8662a5b8c622b57a4628f23cc829828f90..56bf1f36deaaea02b1357b1d229d87ad96bcafaa 100644 (file)
@@ -79,7 +79,6 @@ private:
        map<string, int>::iterator itSize; 
 //     map<string, bool> active; //maps sequence name to whether it has already been merged or not.
        vector<string> outputNames;
-       map<string, vector<string> > outputTypes;
        
        int readFASTA();
        void readNameFile();
index 70c35f713bd02a6a1f786668ed00b79784f05293..98796b3466fcc344b5e4c990015316a5ae2a0582 100644 (file)
@@ -46,7 +46,7 @@ vector<string> 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;