From 81ff02ef4064fe4dec986ea3110c1cb8e1285fe6 Mon Sep 17 00:00:00 2001 From: westcott Date: Fri, 20 Mar 2009 16:14:10 +0000 Subject: [PATCH] documentation --- coverage.cpp | 6 ++++++ libshuffcommand.cpp | 18 +++++++++--------- validparameter.cpp | 40 ++++++++++++++++++++-------------------- 3 files changed, 35 insertions(+), 29 deletions(-) diff --git a/coverage.cpp b/coverage.cpp index cd8138d..6b514fb 100644 --- a/coverage.cpp +++ b/coverage.cpp @@ -7,6 +7,12 @@ * */ +/* This class library coverage at the given distances of the Cramer-von Mises statistic. + you may refer to the "Integration of Microbial Ecology and Statistics: A Test To Compare Gene Libraries" + paper in Applied and Environmental Microbiology, Sept. 2004, p. 5485-5492 0099-2240/04/$8.00+0 + DOI: 10.1128/AEM.70.9.5485-5492.2004 Copyright 2004 American Society for Microbiology for more information. */ + + #include "coverage.h" //********************************************************************************************************************** diff --git a/libshuffcommand.cpp b/libshuffcommand.cpp index 9ab9108..a51b327 100644 --- a/libshuffcommand.cpp +++ b/libshuffcommand.cpp @@ -7,6 +7,12 @@ * */ +/* This class is designed to implement an integral form of the Cramer-von Mises statistic. + you may refer to the "Integration of Microbial Ecology and Statistics: A Test To Compare Gene Libraries" + paper in Applied and Environmental Microbiology, Sept. 2004, p. 5485-5492 0099-2240/04/$8.00+0 + DOI: 10.1128/AEM.70.9.5485-5492.2004 Copyright 2004 American Society for Microbiology for more information. */ + + #include "libshuffcommand.h" //********************************************************************************************************************** @@ -108,7 +114,7 @@ int LibShuffCommand::execute(){ //don't save AA to AA if (i != j) { //(Caa - Cab)^2 - deltaValues[p].push_back( (abs(cValues[p][i][i]-cValues[p][i][j]) * abs(cValues[p][i][i]-cValues[p][i][j])) ); + deltaValues[p].push_back((cValues[p][i][i]-cValues[p][i][j]) * (cValues[p][i][i]-cValues[p][i][j])); sumDelta[count] += deltaValues[p][count]; count++; } @@ -146,24 +152,18 @@ int LibShuffCommand::execute(){ //don't save AA to AA if (i != j) { //(Caa - Cab)^2 - rsumDelta[count][m] += ((abs(cValues[p][i][i]-cValues[p][i][j]) * abs(cValues[p][i][i]-cValues[p][i][j]))); + rsumDelta[count][m] += ((cValues[p][i][i]-cValues[p][i][j]) * (cValues[p][i][i]-cValues[p][i][j])); count++; } } } } -//cout << "iter " << m << endl; + //clear out old Values reading->update(m); cValues.clear(); -//cout << "random sum delta for iter " << m << endl; -//for (int i = 0; i < rsumDelta.size(); i++) { -// cout << setprecision(6) << rsumDelta[i][m] << '\t'; -//} -//cout << endl; - } reading->finish(); diff --git a/validparameter.cpp b/validparameter.cpp index efbd0a4..61fd044 100644 --- a/validparameter.cpp +++ b/validparameter.cpp @@ -52,7 +52,7 @@ bool ValidParameters::isValidParameter(string parameter, string command) { if ((readdist.find(parameter)) != (readdist.end())) { return true; }else { - cout << parameter << " is not a valid parameter for the read.dist command. Valid parameters are "; + cout << parameter << " is not a valid parameter for the " + command + " command. Valid parameters are "; for (it = readdist.begin(); it != readdist.end(); it++) { cout << it->first << ", "; } @@ -63,7 +63,7 @@ bool ValidParameters::isValidParameter(string parameter, string command) { if ((readotu.find(parameter)) != (readotu.end())) { return true; }else { - cout << parameter << " is not a valid parameter for the read.otu command. Valid parameters are "; + cout << parameter << " is not a valid parameter for the " + command + " command. Valid parameters are "; for (it = readotu.begin(); it != readotu.end(); it++) { cout << it->first << ", "; } @@ -75,7 +75,7 @@ bool ValidParameters::isValidParameter(string parameter, string command) { if ((readtree.find(parameter)) != (readtree.end())) { return true; }else { - cout << parameter << " is not a valid parameter for the read.tree command. Valid parameters are "; + cout << parameter << " is not a valid parameter for the " + command + " command. Valid parameters are "; for (it = readtree.begin(); it != readtree.end(); it++) { cout << it->first << ", "; } @@ -87,7 +87,7 @@ bool ValidParameters::isValidParameter(string parameter, string command) { if ((cluster.find(parameter)) != (cluster.end())) { return true; }else { - cout << parameter << " is not a valid parameter for the cluster command. Valid parameters are "; + cout << parameter << " is not a valid parameter for the " + command + " command. Valid parameters are "; for (it = cluster.begin(); it != cluster.end(); it++) { cout << it->first << ", "; } @@ -98,7 +98,7 @@ bool ValidParameters::isValidParameter(string parameter, string command) { if ((deconvolute.find(parameter)) != (deconvolute.end())) { return true; }else { - cout << parameter << " is not a valid parameter for the deconvolute command. Valid parameter is "; + cout << parameter << " is not a valid parameter for the " + command + " command. Valid parameters are "; for (it = deconvolute.begin(); it != deconvolute.end(); it++) { cout << it->first; } @@ -109,7 +109,7 @@ bool ValidParameters::isValidParameter(string parameter, string command) { if ((parsimony.find(parameter)) != (parsimony.end())) { return true; }else { - cout << parameter << " is not a valid parameter for the parsimony command. Valid parameters are "; + cout << parameter << " is not a valid parameter for the " + command + " command. Valid parameters are "; for (it = parsimony.begin(); it != parsimony.end(); it++) { cout << it->first << ", "; } @@ -120,7 +120,7 @@ bool ValidParameters::isValidParameter(string parameter, string command) { if ((collectsingle.find(parameter)) != (collectsingle.end())) { return true; }else { - cout << parameter << " is not a valid parameter for the collect.single command. Valid parameters are "; + cout << parameter << " is not a valid parameter for the " + command + " command. Valid parameters are "; for (it = collectsingle.begin(); it != collectsingle.end(); it++) { cout << it->first << ", "; } @@ -131,7 +131,7 @@ bool ValidParameters::isValidParameter(string parameter, string command) { if ((collectshared.find(parameter)) != (collectshared.end())) { return true; }else { - cout << parameter << " is not a valid parameter for the collect.shared command. Valid parameters are "; + cout << parameter << " is not a valid parameter for the " + command + " command. Valid parameters are "; for (it = collectshared.begin(); it != collectshared.end(); it++) { cout << it->first << ", "; } @@ -142,7 +142,7 @@ bool ValidParameters::isValidParameter(string parameter, string command) { if ((rarefactsingle.find(parameter)) != (rarefactsingle.end())) { return true; }else { - cout << parameter << " is not a valid parameter for the rarefaction.single command. Valid parameters are "; + cout << parameter << " is not a valid parameter for the " + command + " command. Valid parameters are "; for (it = rarefactsingle.begin(); it != rarefactsingle.end(); it++) { cout << it->first << ", "; } @@ -153,7 +153,7 @@ bool ValidParameters::isValidParameter(string parameter, string command) { if ((rarefactshared.find(parameter)) != (rarefactshared.end())) { return true; }else { - cout << parameter << " is not a valid parameter for the rarefaction.shared command. Valid parameters are "; + cout << parameter << " is not a valid parameter for the " + command + " command. Valid parameters are "; for (it = rarefactshared.begin(); it != rarefactshared.end(); it++) { cout << it->first << ", "; } @@ -164,7 +164,7 @@ bool ValidParameters::isValidParameter(string parameter, string command) { if ((summarysingle.find(parameter)) != (summarysingle.end())) { return true; }else { - cout << parameter << " is not a valid parameter for the summary.single command. Valid parameters are "; + cout << parameter << " is not a valid parameter for the " + command + " command. Valid parameters are "; for (it = summarysingle.begin(); it != summarysingle.end(); it++) { cout << it->first << ", "; } @@ -175,7 +175,7 @@ bool ValidParameters::isValidParameter(string parameter, string command) { if ((summaryshared.find(parameter)) != (summaryshared.end())) { return true; }else { - cout << parameter << " is not a valid parameter for the summary.shared command. Valid parameters are "; + cout << parameter << " is not a valid parameter for the " + command + " command. Valid parameters are "; for (it = summaryshared.begin(); it != summaryshared.end(); it++) { cout << it->first << ", "; } @@ -186,7 +186,7 @@ bool ValidParameters::isValidParameter(string parameter, string command) { if ((unifracweighted.find(parameter)) != (unifracweighted.end())) { return true; }else { - cout << parameter << " is not a valid parameter for the unifrac.weighted command. Valid parameters are "; + cout << parameter << " is not a valid parameter for the " + command + " command. Valid parameters are "; for (it = unifracweighted.begin(); it != unifracweighted.end(); it++) { cout << it->first << ", "; } @@ -197,7 +197,7 @@ bool ValidParameters::isValidParameter(string parameter, string command) { if ((unifracunweighted.find(parameter)) != (unifracunweighted.end())) { return true; }else { - cout << parameter << " is not a valid parameter for the unifrac.unweighted command. Valid parameters are "; + cout << parameter << " is not a valid parameter for the " + command + " command. Valid parameters are "; for (it = unifracunweighted.begin(); it != unifracunweighted.end(); it++) { cout << it->first << ", "; } @@ -208,18 +208,18 @@ bool ValidParameters::isValidParameter(string parameter, string command) { if ((libshuff.find(parameter)) != (libshuff.end())) { return true; }else { - cout << parameter << " is not a valid parameter for the libshuff command. Valid parameters are "; + cout << parameter << " is not a valid parameter for the " + command + " command. Valid parameters are "; for (it = libshuff.begin(); it != libshuff.end(); it++) { cout << it->first << ", "; } cout << endl; return false; } //not a valid paramter - }else if (command == "help") { cout << parameter << " is not a valid parameter for the help command. There are no vaild parameters."; - }else if (command == "quit") { cout << parameter << " is not a valid parameter for the quit command. There are no vaild parameters."; - }else if (command == "get.group") { cout << parameter << " is not a valid parameter for the get.group command. There are no vaild parameters."; - }else if (command == "get.label") { cout << parameter << " is not a valid parameter for the get.label command. There are no vaild parameters."; - }else if (command == "get.line") { cout << parameter << " is not a valid parameter for the get.line command. There are no vaild parameters."; } + }else if (command == "help") { cout << parameter << " is not a valid parameter for the " + command + " command. There are no vaild parameters." << endl; + }else if (command == "quit") { cout << parameter << " is not a valid parameter for the " + command + " command. There are no vaild parameters." << endl; + }else if (command == "get.group") { cout << parameter << " is not a valid parameter for the " + command + " command. There are no vaild parameters." << endl; + }else if (command == "get.label") { cout << parameter << " is not a valid parameter for the " + command + " command. There are no vaild parameters." << endl; + }else if (command == "get.line") { cout << parameter << " is not a valid parameter for the " + command + " command. There are no vaild parameters." << endl; } return false; -- 2.39.2