X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=classifysharedcommand.cpp;h=c7eb6cd0daa18f5627824a94d297270a1ff32147;hb=a0f1fca79d2ddfa7ad36b4485039c68b5704fe8d;hp=d9864b94e6eb43f0cba337175907edc65db63271;hpb=c2f279a697c7267b5d91882087ab91f7e6653aa2;p=mothur.git diff --git a/classifysharedcommand.cpp b/classifysharedcommand.cpp index d9864b9..c7eb6cd 100755 --- a/classifysharedcommand.cpp +++ b/classifysharedcommand.cpp @@ -22,9 +22,9 @@ vector ClassifySharedCommand::setParameters(){ CommandParameter pnumtrees("numtrees", "Number", "", "100", "", "", "","",false,false); parameters.push_back(pnumtrees); // parameters related to pruning - CommandParameter pdopruning("prune", "Boolean", "", "F", "", "", "", "", false, false); parameters.push_back(pdopruning); + CommandParameter pdopruning("prune", "Boolean", "", "T", "", "", "", "", false, false); parameters.push_back(pdopruning); CommandParameter ppruneaggrns("pruneaggressiveness", "Number", "", "0.9", "", "", "", "", false, false); parameters.push_back(ppruneaggrns); - CommandParameter pdiscardhetrees("discarderrortrees", "Boolean", "", "F", "", "", "", "", false, false); parameters.push_back(pdiscardhetrees); + CommandParameter pdiscardhetrees("discarderrortrees", "Boolean", "", "T", "", "", "", "", false, false); parameters.push_back(pdiscardhetrees); CommandParameter phetdiscardthreshold("errorthreshold", "Number", "", "0.4", "", "", "", "", false, false); parameters.push_back(phetdiscardthreshold); CommandParameter psdthreshold("stdthreshold", "Number", "", "0.0", "", "", "", "", false, false); parameters.push_back(psdthreshold); // pruning params end @@ -359,8 +359,11 @@ void ClassifySharedCommand::processSharedAndDesignData(vector > dataSet(numRows, vector(numColumns, 0)); + vector names; + for (int i = 0; i < lookup.size(); i++) { string sharedGroupName = lookup[i]->getGroup(); + names.push_back(sharedGroupName); string treatmentName = designMap.getGroup(sharedGroupName); int j = 0; @@ -375,15 +378,24 @@ void ClassifySharedCommand::processSharedAndDesignData(vector variables; - variables["[filename]"] = outputDir + m->getRootName(m->getSimpleName(sharedfile)); + variables["[filename]"] = outputDir + m->getRootName(m->getSimpleName(sharedfile)) + "RF."; variables["[distance]"] = lookup[0]->getLabel(); string filename = getOutputFileName("summary", variables); outputNames.push_back(filename); outputTypes["summary"].push_back(filename); - randomForest.calcForrestVariableImportance(filename); + // + map variable; + variable["[filename]"] = outputDir + m->getRootName(m->getSimpleName(sharedfile)) + "misclassifications."; + variable["[distance]"] = lookup[0]->getLabel(); + string mc_filename = getOutputFileName("summary", variable); + outputNames.push_back(mc_filename); outputTypes["summary"].push_back(mc_filename); + randomForest.getMissclassifications(mc_filename, intToTreatmentMap, names); + // + m->mothurOutEndLine(); } catch(exception& e) {