From 8f7f4fc08b8c70d9ef0f79607813dba4e926e102 Mon Sep 17 00:00:00 2001 From: westcott Date: Wed, 11 May 2011 14:52:39 +0000 Subject: [PATCH] working on citations --- Mothur.xcodeproj/project.pbxproj | 2 - ace.h | 1 + aligncommand.h | 2 +- amovacommand.h | 2 +- anosimcommand.h | 2 +- bergerparker.h | 1 + blastdb.cpp | 18 ++- boneh.h | 1 + bootstrap.h | 1 + bootstrapsharedcommand.cpp | 5 + bstick.h | 2 +- calculator.h | 2 + canberra.h | 1 + catchallcommand.h | 2 +- chao1.h | 1 + chimerabellerophoncommand.h | 2 +- chimeraccodecommand.h | 2 +- chimeracheckcommand.h | 2 +- chimerapintailcommand.h | 3 +- chimeraslayercommand.h | 2 +- classifyotucommand.h | 2 +- classifyseqscommand.h | 2 +- clearcutcommand.h | 2 +- clustercommand.h | 2 +- clusterdoturcommand.h | 2 +- clustersplitcommand.h | 2 +- collectcommand.cpp | 5 + collectcommand.h | 2 +- collectsharedcommand.cpp | 5 + collectsharedcommand.h | 2 +- corraxescommand.h | 2 +- coverage.h | 1 + dist.h | 1 + distancecommand.h | 2 +- eachgapdist.h | 1 + efron.h | 1 + geom.h | 2 +- getcommandinfocommand.cpp | 1 + goodscoverage.h | 1 + gower.h | 1 + hamming.h | 1 + hclustercommand.h | 2 +- heatmapsimcommand.cpp | 5 + heip.h | 1 + hellinger.h | 1 + homovacommand.h | 2 +- indicatorcommand.h | 2 +- invsimpson.h | 1 + jackknife.h | 1 + libshuffcommand.h | 2 +- logsd.h | 1 + manhattan.h | 1 + mantelcommand.h | 2 +- matrixoutputcommand.cpp | 5 + memchi2.h | 1 + memchord.h | 1 + memeuclidean.h | 1 + mempearson.h | 1 + metastatscommand.h | 2 +- mgclustercommand.h | 2 +- nmdscommand.h | 2 +- npshannon.h | 1 + nseqs.h | 1 + odum.h | 1 + pairwiseseqscommand.h | 2 +- parsimonycommand.h | 2 +- pcacommand.h | 2 +- pcoacommand.h | 2 +- phylodiversitycommand.h | 2 +- qstat.h | 1 + rarefactcommand.cpp | 5 + rarefactcommand.h | 2 +- rarefactsharedcommand.cpp | 5 + rarefactsharedcommand.h | 2 +- sensspeccommand.h | 2 +- shannon.h | 1 + shannoneven.h | 1 + sharedace.h | 1 + sharedanderberg.h | 30 ----- sharedanderbergs.h | 1 + sharedbraycurtis.h | 1 + sharedchao1.h | 1 + sharedjabund.h | 1 + sharedjackknife.h | 1 + sharedjclass.h | 1 + sharedjest.h | 1 + sharedkstest.h | 1 + sharedkulczynski.h | 1 + sharedkulczynskicody.h | 1 + sharedlennon.h | 1 + sharedmarczewski.h | 1 + sharedmorisitahorn.h | 1 + sharednseqs.h | 1 + sharedochiai.h | 1 + sharedsobs.h | 1 + sharedsobscollectsummary.h | 1 + sharedsorabund.h | 1 + sharedsorclass.h | 1 + sharedsorest.h | 1 + sharedthetan.h | 1 + sharedthetayc.h | 1 + shen.h | 1 + simpson.h | 1 + simpsoneven.h | 1 + smithwilson.h | 1 + sobs.h | 1 + soergel.h | 1 + solow.h | 1 + spearman.h | 1 + speciesprofile.h | 1 + structchi2.h | 1 + structchord.h | 1 + structeuclidean.h | 1 + structkulczynski.h | 1 + structpearson.h | 1 + summarycommand.cpp | 5 + summarysharedcommand.cpp | 5 + treegroupscommand.cpp | 5 + trimseqscommand.cpp | 36 +++++- unifracunweightedcommand.h | 2 +- unifracweightedcommand.h | 2 +- validcalculator.cpp | 212 ++++++++++++++++++++++++++++--- validcalculator.h | 2 + venncommand.cpp | 5 + whittaker.h | 1 + 125 files changed, 411 insertions(+), 93 deletions(-) delete mode 100644 sharedanderberg.h diff --git a/Mothur.xcodeproj/project.pbxproj b/Mothur.xcodeproj/project.pbxproj index 4d37747..49ad9cc 100644 --- a/Mothur.xcodeproj/project.pbxproj +++ b/Mothur.xcodeproj/project.pbxproj @@ -740,7 +740,6 @@ A7E9B7E812D37EC400DA6239 /* shannoneven.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = shannoneven.h; sourceTree = ""; }; A7E9B7E912D37EC400DA6239 /* sharedace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedace.cpp; sourceTree = ""; }; A7E9B7EA12D37EC400DA6239 /* sharedace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedace.h; sourceTree = ""; }; - A7E9B7EB12D37EC400DA6239 /* sharedanderberg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedanderberg.h; sourceTree = ""; }; A7E9B7EC12D37EC400DA6239 /* sharedanderbergs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedanderbergs.cpp; sourceTree = ""; }; A7E9B7ED12D37EC400DA6239 /* sharedanderbergs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedanderbergs.h; sourceTree = ""; }; A7E9B7EE12D37EC400DA6239 /* sharedbraycurtis.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedbraycurtis.cpp; sourceTree = ""; }; @@ -1338,7 +1337,6 @@ A7E9B7E812D37EC400DA6239 /* shannoneven.h */, A7E9B7E912D37EC400DA6239 /* sharedace.cpp */, A7E9B7EA12D37EC400DA6239 /* sharedace.h */, - A7E9B7EB12D37EC400DA6239 /* sharedanderberg.h */, A7E9B7EC12D37EC400DA6239 /* sharedanderbergs.cpp */, A7E9B7ED12D37EC400DA6239 /* sharedanderbergs.h */, A7E9B7EE12D37EC400DA6239 /* sharedbraycurtis.cpp */, diff --git a/ace.h b/ace.h index 26d93b1..ce56b76 100644 --- a/ace.h +++ b/ace.h @@ -23,6 +23,7 @@ public: Ace(int n) : abund(n), Calculator("ace", 3, false) {}; EstOutput getValues(SAbundVector*); EstOutput getValues(vector) {return data;}; + string getCitation() { return "http://www.mothur.org/wiki/Ace"; } private: int abund; }; diff --git a/aligncommand.h b/aligncommand.h index 1e1ebdc..c014751 100644 --- a/aligncommand.h +++ b/aligncommand.h @@ -27,7 +27,7 @@ public: string getCommandName() { return "align.seqs"; } string getCommandCategory() { return "Sequence Processing"; } string getHelpString(); - string getCitation() { return "http://www.mothur.org/wiki/Align.seqs"; } + string getCitation() { return "DeSantis TZ, Jr., Hugenholtz P, Keller K, Brodie EL, Larsen N, Piceno YM, Phan R, Andersen GL (2006). NAST: a multiple sequence alignment server for comparative analysis of 16S rRNA genes. Nucleic Acids Res 34: W394-9.\nSchloss PD (2009). A high-throughput DNA sequence aligner for microbial ecology studies. PLoS ONE 4: e8230.\nSchloss PD (2010). The effects of alignment quality, distance calculation method, sequence filtering, and region on the analysis of 16S rRNA gene-based studies. PLoS Comput Biol 6: e1000844.\nhttp://www.mothur.org/wiki/Align.seqs http://www.mothur.org/wiki/Align.seqs"; } int execute(); void help() { m->mothurOut(getHelpString()); } diff --git a/amovacommand.h b/amovacommand.h index ff82ac6..e9ae481 100644 --- a/amovacommand.h +++ b/amovacommand.h @@ -24,7 +24,7 @@ public: string getCommandName() { return "amova"; } string getCommandCategory() { return "Hypothesis Testing"; } string getHelpString(); - string getCitation() { return "Referenced: Anderson MJ (2001). A new method for non-parametric multivariate analysis of variance. Austral Ecol 26: 32-46. http://www.mothur.org/wiki/Amova"; } + string getCitation() { return "Anderson MJ (2001). A new method for non-parametric multivariate analysis of variance. Austral Ecol 26: 32-46.\nhttp://www.mothur.org/wiki/Amova"; } int execute(); void help() { m->mothurOut(getHelpString()); } diff --git a/anosimcommand.h b/anosimcommand.h index aad676a..593033d 100644 --- a/anosimcommand.h +++ b/anosimcommand.h @@ -26,7 +26,7 @@ public: string getCommandName() { return "anosim"; } string getCommandCategory() { return "Hypothesis Testing"; } string getHelpString(); - string getCitation() { return "Referenced: Clarke, K. R. (1993). Non-parametric multivariate analysis of changes in community structure. _Australian Journal of Ecology_ 18, 117-143. http://www.mothur.org/wiki/Anosim"; } + string getCitation() { return "Clarke, K. R. (1993). Non-parametric multivariate analysis of changes in community structure. _Australian Journal of Ecology_ 18, 117-143.\nhttp://www.mothur.org/wiki/Anosim"; } int execute(); void help() { m->mothurOut(getHelpString()); } diff --git a/bergerparker.h b/bergerparker.h index 7b1dac9..6ce6221 100644 --- a/bergerparker.h +++ b/bergerparker.h @@ -22,6 +22,7 @@ public: BergerParker() : Calculator("bergerparker", 1, false) {}; EstOutput getValues(SAbundVector*); EstOutput getValues(vector) {return data;}; + string getCitation() { return "http://www.mothur.org/wiki/Bergerparker"; } private: }; diff --git a/blastdb.cpp b/blastdb.cpp index d227bc6..4f3047d 100644 --- a/blastdb.cpp +++ b/blastdb.cpp @@ -128,9 +128,15 @@ vector BlastDB::findClosestMegaBlast(Sequence* seq, int n, int minPerID) { // wordsize used in megablast. I'm sure we're sacrificing accuracy for speed, but anyother way would take way too // long. With this setting, it seems comparable in speed to the suffix tree approach. //7000004128189528left 0 100 66 0 0 1 66 61 126 1e-31 131 + string blastCommand; + #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) + blastCommand = path + "blast/bin/megablast -e 1e-10 -d " + dbFileName + " -m 8 -b " + toString(n) + " -v " + toString(n); //-W 28 -p blastn + blastCommand += (" -i " + (queryFileName+seq->getName()) + " -o " + blastFileName+seq->getName()); + #else + blastCommand = path + "blast\\bin\\megablast -e 1e-10 -d " + dbFileName + " -m 8 -b " + toString(n) + " -v " + toString(n); //-W 28 -p blastn + blastCommand += (" -i " + (queryFileName+seq->getName()) + " -o " + blastFileName+seq->getName()); + #endif - string blastCommand = path + "blast/bin/megablast -e 1e-10 -d " + dbFileName + " -m 8 -b " + toString(n) + " -v " + toString(n); //-W 28 -p blastn - blastCommand += (" -i " + (queryFileName+seq->getName()) + " -o " + blastFileName+seq->getName()); system(blastCommand.c_str()); ifstream m8FileHandle; @@ -195,7 +201,13 @@ void BlastDB::generateDB() { for (int i = 0; i < path.length(); i++) { tempPath[i] = tolower(path[i]); } path = path.substr(0, (tempPath.find_last_of('m'))); - string formatdbCommand = path + "blast/bin/formatdb -p F -o T -i " + dbFileName; // format the database, -o option gives us the ability + string formatdbCommand; + + #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) + formatdbCommand = path + "blast/bin/formatdb -p F -o T -i " + dbFileName; // format the database, -o option gives us the ability + #else + formatdbCommand = path + "blast\\bin\\formatdb -p F -o T -i " + dbFileName; + #endif system(formatdbCommand.c_str()); // to get the right sequence names, i think. -p F // option tells formatdb that seqs are DNA, not prot //m->mothurOut("DONE."); m->mothurOutEndLine(); m->mothurOutEndLine(); cout.flush(); diff --git a/boneh.h b/boneh.h index d2d06c0..d16ffa7 100644 --- a/boneh.h +++ b/boneh.h @@ -23,6 +23,7 @@ public: Boneh(int size) : f(size), Calculator("boneh", 1, false) {}; EstOutput getValues(SAbundVector*); EstOutput getValues(vector) {return data;}; + string getCitation() { return "http://www.mothur.org/wiki/Boneh"; } private: double getV(double, double, double); int f; diff --git a/bootstrap.h b/bootstrap.h index 70fdf05..962780a 100644 --- a/bootstrap.h +++ b/bootstrap.h @@ -23,6 +23,7 @@ public: Bootstrap() : Calculator("bootstrap", 1, false) {}; EstOutput getValues(SAbundVector*); EstOutput getValues(vector) {return data;}; + string getCitation() { return "http://www.mothur.org/wiki/Bootstrap"; } }; diff --git a/bootstrapsharedcommand.cpp b/bootstrapsharedcommand.cpp index cc0cfb6..f63f2f4 100644 --- a/bootstrapsharedcommand.cpp +++ b/bootstrapsharedcommand.cpp @@ -144,6 +144,11 @@ BootSharedCommand::BootSharedCommand(string option) { if (calc == "default") { calc = "jclass-thetayc"; } } m->splitAtDash(calc, Estimators); + if (m->inUsersGroups("citation", Estimators)) { + ValidCalculators validCalc; validCalc.printCitations(Estimators); + //remove citation from list of calcs + for (int i = 0; i < Estimators.size(); i++) { if (Estimators[i] == "citation") { Estimators.erase(Estimators.begin()+i); break; } } + } string temp; temp = validParameter.validFile(parameters, "iters", false); if (temp == "not found") { temp = "1000"; } diff --git a/bstick.h b/bstick.h index 476b588..11f4b8c 100644 --- a/bstick.h +++ b/bstick.h @@ -21,7 +21,7 @@ public: BStick() : Calculator("bstick", 3, false) {}; EstOutput getValues(SAbundVector*); EstOutput getValues(vector) {return data;}; - + string getCitation() { return "http://www.mothur.org/wiki/Bstick"; } private: double invSum(int, double); RAbundVector getRAbundVector(SAbundVector*); diff --git a/calculator.h b/calculator.h index 3be6488..2c41329 100644 --- a/calculator.h +++ b/calculator.h @@ -33,6 +33,8 @@ public: virtual int getCols() { return cols; } virtual bool getMultiple() { return multiple; } virtual bool getNeedsAll() { return needsAll; } + virtual string getCitation() = 0; + void citation() { m->mothurOut(getCitation()); m->mothurOutEndLine(); } protected: MothurOut* m; EstOutput data; diff --git a/canberra.h b/canberra.h index 94caf85..483d119 100644 --- a/canberra.h +++ b/canberra.h @@ -22,6 +22,7 @@ public: Canberra() : Calculator("canberra", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/Canberra"; } private: }; diff --git a/catchallcommand.h b/catchallcommand.h index c9fe285..d32989b 100644 --- a/catchallcommand.h +++ b/catchallcommand.h @@ -32,7 +32,7 @@ public: string getCommandName() { return "catchall"; } string getCommandCategory() { return "OTU-Based Approaches"; } string getHelpString(); - string getCitation() { return "http://www.northeastern.edu/catchall/index.html http://www.mothur.org/wiki/Catchall"; } + string getCitation() { return "Bunge, J. (2011). Estimating the number of species with CatchAll. Forthcoming in Proceedings of the Pacific Symposium on Biocomputing 2011.\nhttp://www.northeastern.edu/catchall/index.html http://www.mothur.org/wiki/Catchall"; } int execute(); void help() { m->mothurOut(getHelpString()); } diff --git a/chao1.h b/chao1.h index 1322aac..21224eb 100644 --- a/chao1.h +++ b/chao1.h @@ -22,6 +22,7 @@ public: Chao1() : Calculator("chao", 3, false) {}; EstOutput getValues(SAbundVector*); EstOutput getValues(vector) {return data;}; + string getCitation() { return "http://www.mothur.org/wiki/Chao"; } }; diff --git a/chimerabellerophoncommand.h b/chimerabellerophoncommand.h index b048459..ce85b77 100644 --- a/chimerabellerophoncommand.h +++ b/chimerabellerophoncommand.h @@ -27,7 +27,7 @@ public: string getCommandName() { return "chimera.bellerophon"; } string getCommandCategory() { return "Sequence Processing"; } string getHelpString(); - string getCitation() { return "http://www.mothur.org/wiki/Chimera.bellerophon"; } + string getCitation() { return "Huber T, Faulkner G, Hugenholtz P (2004). Bellerophon: a program to detect chimeric sequences in multiple sequence alignments. Bioinformatics 20: 2317-9. \nhttp://www.mothur.org/wiki/Chimera.bellerophon"; } int execute(); diff --git a/chimeraccodecommand.h b/chimeraccodecommand.h index cedec2f..36584e0 100644 --- a/chimeraccodecommand.h +++ b/chimeraccodecommand.h @@ -27,7 +27,7 @@ public: string getCommandName() { return "chimera.ccode"; } string getCommandCategory() { return "Sequence Processing"; } string getHelpString(); - string getCitation() { return "Evaluating putative chimeric sequences from PCR-amplified products' paper by Juan M. Gonzalez, Johannes Zimmerman and Cesareo Saiz-Jimenez. http://www.mothur.org/wiki/Chimera.ccode"; } + string getCitation() { return "Gonzalez JM, Zimmermann J, Saiz-Jimenez C (2005). Evaluating putative chimeric sequences from PCR-amplified products. Bioinformatics 21: 333-7. \nhttp://www.mothur.org/wiki/Chimera.ccode"; } int execute(); void help() { m->mothurOut(getHelpString()); } diff --git a/chimeracheckcommand.h b/chimeracheckcommand.h index fbd49da..9238871 100644 --- a/chimeracheckcommand.h +++ b/chimeracheckcommand.h @@ -28,7 +28,7 @@ public: string getCommandName() { return "chimera.check"; } string getCommandCategory() { return "Sequence Processing"; } string getHelpString(); - string getCitation() { return "CHIMERA_CHECK version 2.7 written by Niels Larsen. http://www.mothur.org/wiki/Chimera.check"; } + string getCitation() { return "CHIMERA_CHECK version 2.7 written by Niels Larsen (http://wdcm.nig.ac.jp/RDP/docs/chimera_doc.html) \nhttp://www.mothur.org/wiki/Chimera.check"; } int execute(); void help() { m->mothurOut(getHelpString()); } diff --git a/chimerapintailcommand.h b/chimerapintailcommand.h index 49912c6..8dec0ac 100644 --- a/chimerapintailcommand.h +++ b/chimerapintailcommand.h @@ -29,9 +29,8 @@ public: string getCommandName() { return "chimera.pintail"; } string getCommandCategory() { return "Sequence Processing"; } string getHelpString(); - string getCitation() { return "At Least 1 in 20 16S rRNA Sequence Records Currently Held in the Public Repositories is Estimated To Contain Substantial Anomalies' paper by Kevin E. Ashelford 1, Nadia A. Chuzhanova 3, John C. Fry 1, Antonia J. Jones 2 and Andrew J. Weightman 1. http://www.mothur.org/wiki/Chimera.pintail"; } + string getCitation() { return "Ashelford KE, Chuzhanova NA, Fry JC, Jones AJ, Weightman AJ (2005). At least 1 in 20 16S rRNA sequence records currently held in public repositories is estimated to contain substantial anomalies. Appl Environ Microbiol 71: 7724-36. \nAshelford KE, Chuzhanova NA, Fry JC, Jones AJ, Weightman AJ (2006). New screening software shows that most recent large 16S rRNA gene clone libraries contain chimeras. Appl Environ Microbiol 72: 5734-41. \nhttp://www.mothur.org/wiki/Chimera.pintail"; } - int execute(); void help() { m->mothurOut(getHelpString()); } private: diff --git a/chimeraslayercommand.h b/chimeraslayercommand.h index 8d2a428..90f6b62 100644 --- a/chimeraslayercommand.h +++ b/chimeraslayercommand.h @@ -26,7 +26,7 @@ public: string getCommandName() { return "chimera.slayer"; } string getCommandCategory() { return "Sequence Processing"; } string getHelpString(); - string getCitation() { return "http://www.mothur.org/wiki/Chimera.slayer"; } + string getCitation() { return "Haas BJ, Gevers D, Earl A, Feldgarden M, Ward DV, Giannokous G, Ciulla D, Tabbaa D, Highlander SK, Sodergren E, Methe B, Desantis TZ, Petrosino JF, Knight R, Birren BW (2011). Chimeric 16S rRNA sequence formation and detection in Sanger and 454-pyrosequenced PCR amplicons. Genome Res. \nhttp://www.mothur.org/wiki/Chimera.slayer"; } int execute(); diff --git a/classifyotucommand.h b/classifyotucommand.h index c38a7c9..f6bf78d 100644 --- a/classifyotucommand.h +++ b/classifyotucommand.h @@ -26,7 +26,7 @@ public: string getCommandName() { return "classify.otu"; } string getCommandCategory() { return "Phylotype Analysis"; } string getHelpString(); - string getCitation() { return "http://www.mothur.org/wiki/Classify.otu"; } + string getCitation() { return "Schloss PD, Westcott SL (2011). Assessing and improving methods used in OTU-based approaches for 16S rRNA gene sequence analysis. Appl Environ Microbiol. \nhttp://www.mothur.org/wiki/Classify.otu"; } int execute(); diff --git a/classifyseqscommand.h b/classifyseqscommand.h index b813d40..f075b41 100644 --- a/classifyseqscommand.h +++ b/classifyseqscommand.h @@ -35,7 +35,7 @@ public: string getCommandName() { return "classify.seqs"; } string getCommandCategory() { return "Phylotype Analysis"; } string getHelpString(); - string getCitation() { return "http://www.mothur.org/wiki/Classify.seqs"; } + string getCitation() { return "Wang Q, Garrity GM, Tiedje JM, Cole JR (2007). Naive Bayesian classifier for rapid assignment of rRNA sequences into the new bacterial taxonomy. Appl Environ Microbiol 73: 5261-7. [ for Bayesian classifier ] \nAltschul SF, Madden TL, Schaffer AA, Zhang J, Zhang Z, Miller W, Lipman DJ (1997). Gapped BLAST and PSI-BLAST: a new generation of protein database search programs. Nucleic Acids Res 25: 3389-402. [ for BLAST ] \nDeSantis TZ, Hugenholtz P, Larsen N, Rojas M, Brodie EL, Keller K, Huber T, Dalevi D, Hu P, Andersen GL (2006). Greengenes, a chimera-checked 16S rRNA gene database and workbench compatible with ARB. Appl Environ Microbiol 72: 5069-72. [ for kmer ] \nhttp://www.mothur.org/wiki/Classify.seqs"; } int execute(); diff --git a/clearcutcommand.h b/clearcutcommand.h index 702fd7e..ee64724 100644 --- a/clearcutcommand.h +++ b/clearcutcommand.h @@ -31,7 +31,7 @@ public: string getCommandName() { return "clearcut"; } string getCommandCategory() { return "Hypothesis Testing"; } string getHelpString(); - string getCitation() { return "The clearcut program written by Initiative for Bioinformatics and Evolutionary Studies (IBEST) at the University of Idaho. http://www.mothur.org/wiki/Clearcut"; } + string getCitation() { return "Sheneman L, Evans J, Foster JA (2006). Clearcut: a fast implementation of relaxed neighbor joining. Bioinformatics 22: 2823-4. \nhttp://www.mothur.org/wiki/Clearcut"; } int execute(); void help() { m->mothurOut(getHelpString()); } diff --git a/clustercommand.h b/clustercommand.h index 23f7287..3dd4410 100644 --- a/clustercommand.h +++ b/clustercommand.h @@ -35,7 +35,7 @@ public: string getCommandName() { return "cluster"; } string getCommandCategory() { return "Clustering"; } string getHelpString(); - string getCitation() { return "http://www.mothur.org/wiki/Cluster"; } + string getCitation() { return "Schloss PD, Westcott SL (2011). Assessing and improving methods used in OTU-based approaches for 16S rRNA gene sequence analysis. Appl Environ Microbiol. \nhttp://www.mothur.org/wiki/Cluster"; } int execute(); void help() { m->mothurOut(getHelpString()); } diff --git a/clusterdoturcommand.h b/clusterdoturcommand.h index e76332c..42be4a6 100644 --- a/clusterdoturcommand.h +++ b/clusterdoturcommand.h @@ -28,7 +28,7 @@ public: string getCommandName() { return "cluster.classic"; } string getCommandCategory() { return "Clustering"; } string getHelpString(); - string getCitation() { return "http://www.mothur.org/wiki/Cluster.classic"; } + string getCitation() { return "Schloss PD, Handelsman J (2005). Introducing DOTUR, a computer program for defining operational taxonomic units and estimating species richness. Appl Environ Microbiol 71: 1501-6. \nhttp://www.mothur.org/wiki/Cluster.classic"; } int execute(); void help() { m->mothurOut(getHelpString()); } diff --git a/clustersplitcommand.h b/clustersplitcommand.h index 1485613..c115283 100644 --- a/clustersplitcommand.h +++ b/clustersplitcommand.h @@ -29,7 +29,7 @@ public: string getCommandName() { return "cluster.split"; } string getCommandCategory() { return "Clustering"; } string getHelpString(); - string getCitation() { return "http://www.mothur.org/wiki/Cluster.split"; } + string getCitation() { return "Schloss PD, Westcott SL (2011). Assessing and improving methods used in OTU-based approaches for 16S rRNA gene sequence analysis. Appl Environ Microbiol. \nhttp://www.mothur.org/wiki/Cluster.split"; } int execute(); void help() { m->mothurOut(getHelpString()); } diff --git a/collectcommand.cpp b/collectcommand.cpp index 9521314..7b8364b 100644 --- a/collectcommand.cpp +++ b/collectcommand.cpp @@ -272,6 +272,11 @@ CollectCommand::CollectCommand(string option) { if (calc == "default") { calc = "sobs-chao-ace-jack-shannon-npshannon-simpson"; } } m->splitAtDash(calc, Estimators); + if (m->inUsersGroups("citation", Estimators)) { + ValidCalculators validCalc; validCalc.printCitations(Estimators); + //remove citation from list of calcs + for (int i = 0; i < Estimators.size(); i++) { if (Estimators[i] == "citation") { Estimators.erase(Estimators.begin()+i); break; } } + } string temp; temp = validParameter.validFile(parameters, "freq", false); if (temp == "not found") { temp = "100"; } diff --git a/collectcommand.h b/collectcommand.h index d250126..9e51398 100644 --- a/collectcommand.h +++ b/collectcommand.h @@ -37,7 +37,7 @@ public: vector setParameters(); string getCommandName() { return "collect.single"; } string getCommandCategory() { return "OTU-Based Approaches"; } - string getCitation() { return "http://www.mothur.org/wiki/Collect.single"; } + string getCitation() { return "Schloss PD, Handelsman J (2006). Introducing SONS, A tool that compares the membership of microbial communities. Appl Environ Microbiol 72: 6773-9. \nhttp://www.mothur.org/wiki/Collect.single"; } string getHelpString(); int execute(); diff --git a/collectsharedcommand.cpp b/collectsharedcommand.cpp index b9b3606..46f49b2 100644 --- a/collectsharedcommand.cpp +++ b/collectsharedcommand.cpp @@ -259,6 +259,11 @@ CollectSharedCommand::CollectSharedCommand(string option) { if (calc == "default") { calc = "sharedsobs-sharedchao-sharedace-jabund-sorabund-jclass-sorclass-jest-sorest-thetayc-thetan"; } } m->splitAtDash(calc, Estimators); + if (m->inUsersGroups("citation", Estimators)) { + ValidCalculators validCalc; validCalc.printCitations(Estimators); + //remove citation from list of calcs + for (int i = 0; i < Estimators.size(); i++) { if (Estimators[i] == "citation") { Estimators.erase(Estimators.begin()+i); break; } } + } groups = validParameter.validFile(parameters, "groups", false); if (groups == "not found") { groups = ""; } diff --git a/collectsharedcommand.h b/collectsharedcommand.h index a10fd55..3eb56fe 100644 --- a/collectsharedcommand.h +++ b/collectsharedcommand.h @@ -30,7 +30,7 @@ public: string getCommandName() { return "collect.shared"; } string getCommandCategory() { return "OTU-Based Approaches"; } string getHelpString(); - string getCitation() { return "http://www.mothur.org/wiki/Collect.shared"; } + string getCitation() { return "Schloss PD, Handelsman J (2006). Introducing SONS, A tool that compares the membership of microbial communities. Appl Environ Microbiol 72: 6773-9. \nhttp://www.mothur.org/wiki/Collect.shared"; } int execute(); void help() { m->mothurOut(getHelpString()); } diff --git a/corraxescommand.h b/corraxescommand.h index f4a3dfe..45b6989 100644 --- a/corraxescommand.h +++ b/corraxescommand.h @@ -25,7 +25,7 @@ public: string getCommandName() { return "corr.axes"; } string getCommandCategory() { return "Hypothesis Testing"; } string getHelpString(); - string getCitation() { return "http://www.mothur.org/wiki/Corr.axes"; } + string getCitation() { return "McCune B, Grace JB, Urban DL (2002). Analysis of ecological communities. MjM Software Design: Gleneden Beach, OR. \nLegendre P, Legendre L (1998). Numerical Ecology. Elsevier: New York. \nhttp://www.mothur.org/wiki/Corr.axes"; } int execute(); void help() { m->mothurOut(getHelpString()); } diff --git a/coverage.h b/coverage.h index 7b89c1e..8d6fead 100644 --- a/coverage.h +++ b/coverage.h @@ -23,6 +23,7 @@ public: Coverage() : Calculator("coverage", 1, false) {}; EstOutput getValues(SAbundVector*); EstOutput getValues(vector) {return data;}; + string getCitation() { return "http://www.mothur.org/wiki/Coverage"; } }; diff --git a/dist.h b/dist.h index b914d0d..71055ae 100644 --- a/dist.h +++ b/dist.h @@ -21,6 +21,7 @@ public: virtual ~Dist() {} virtual void calcDist(Sequence, Sequence) = 0; double getDist() { return dist; } + protected: double dist; MothurOut* m; diff --git a/distancecommand.h b/distancecommand.h index 71eac7d..81267d1 100644 --- a/distancecommand.h +++ b/distancecommand.h @@ -28,7 +28,7 @@ public: string getCommandName() { return "dist.seqs"; } string getCommandCategory() { return "Sequence Processing"; } string getHelpString(); - string getCitation() { return "http://www.mothur.org/wiki/Dist.seqs"; } + string getCitation() { return "Schloss PD (2010). The effects of alignment quality, distance calculation method, sequence filtering, and region on the analysis of 16S rRNA gene-based studies. PLoS Comput Biol 6: e1000844. \nhttp://www.mothur.org/wiki/Dist.seqs"; } int execute(); void help() { m->mothurOut(getHelpString()); } diff --git a/eachgapdist.h b/eachgapdist.h index d66b40c..84fe56e 100644 --- a/eachgapdist.h +++ b/eachgapdist.h @@ -17,6 +17,7 @@ class eachGapDist : public Dist { public: + void calcDist(Sequence A, Sequence B){ int diff = 0; int length = 0; diff --git a/efron.h b/efron.h index 44aee5a..e485c53 100644 --- a/efron.h +++ b/efron.h @@ -23,6 +23,7 @@ public: Efron(int size) : f(size), Calculator("efron", 1, false) {}; EstOutput getValues(SAbundVector*); EstOutput getValues(vector) {return data;}; + string getCitation() { return "http://www.mothur.org/wiki/Efron"; } private: int f; }; diff --git a/geom.h b/geom.h index be60de3..a07676b 100644 --- a/geom.h +++ b/geom.h @@ -24,7 +24,7 @@ public: EstOutput getValues(SAbundVector*); EstOutput getValues(vector) {return data;}; - + string getCitation() { return "http://www.mothur.org/wiki/Geometric"; } private: double kEq(double, double); RAbundVector getRAbundVector(SAbundVector*); diff --git a/getcommandinfocommand.cpp b/getcommandinfocommand.cpp index e75897f..283cd40 100644 --- a/getcommandinfocommand.cpp +++ b/getcommandinfocommand.cpp @@ -102,6 +102,7 @@ int GetCommandInfoCommand::execute(){ //general info out << "commandName=" << thisCommand->getCommandName() << endl; + //cout << thisCommand->getCommandName() << " current citation = " << thisCommand->getCitation() << endl; out << "commandCategory=" << thisCommand->getCommandCategory() << endl; //remove /n from help string since gui reads line by line diff --git a/goodscoverage.h b/goodscoverage.h index 4cce78b..0ec7730 100644 --- a/goodscoverage.h +++ b/goodscoverage.h @@ -22,6 +22,7 @@ public: GoodsCoverage() : Calculator("goodscoverage", 1, false) {}; EstOutput getValues(SAbundVector*); EstOutput getValues(vector) {return data;}; + string getCitation() { return "http://www.mothur.org/wiki/GoodsCoverage"; } private: }; diff --git a/gower.h b/gower.h index b6337ce..a04ef10 100644 --- a/gower.h +++ b/gower.h @@ -21,6 +21,7 @@ public: Gower() : Calculator("gower", 1, false, true) {}; //the true means this calculator needs all groups to calculate the pair value EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/Gower"; } private: }; diff --git a/hamming.h b/hamming.h index 6d89292..77eb51d 100644 --- a/hamming.h +++ b/hamming.h @@ -22,6 +22,7 @@ public: Hamming() : Calculator("hamming", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/Hamming"; } private: }; diff --git a/hclustercommand.h b/hclustercommand.h index f27837a..adf9f25 100644 --- a/hclustercommand.h +++ b/hclustercommand.h @@ -39,7 +39,7 @@ public: string getCommandName() { return "hcluster"; } string getCommandCategory() { return "Clustering"; } string getHelpString(); - string getCitation() { return "http://www.mothur.org/wiki/Hcluster"; } + string getCitation() { return "Sun Y, Cai Y, Liu L, Yu F, Farrell ML, Mckendree W, Farmerie W (2009). ESPRIT: estimating species richness using large collections of 16S rRNA pyrosequences. Nucleic Acids Res 37: e76. \nhttp://www.mothur.org/wiki/Hcluster"; } int execute(); void help() { m->mothurOut(getHelpString()); } diff --git a/heatmapsimcommand.cpp b/heatmapsimcommand.cpp index 0de3ffc..92271d9 100644 --- a/heatmapsimcommand.cpp +++ b/heatmapsimcommand.cpp @@ -223,6 +223,11 @@ HeatMapSimCommand::HeatMapSimCommand(string option) { if (calc == "default") { calc = "jest-thetayc"; } } m->splitAtDash(calc, Estimators); + if (m->inUsersGroups("citation", Estimators)) { + ValidCalculators validCalc; validCalc.printCitations(Estimators); + //remove citation from list of calcs + for (int i = 0; i < Estimators.size(); i++) { if (Estimators[i] == "citation") { Estimators.erase(Estimators.begin()+i); break; } } + } groups = validParameter.validFile(parameters, "groups", false); if (groups == "not found") { groups = ""; } diff --git a/heip.h b/heip.h index 3ae115f..806b299 100644 --- a/heip.h +++ b/heip.h @@ -20,6 +20,7 @@ public: Heip() : Calculator("heip", 1, false) {}; EstOutput getValues(SAbundVector*); EstOutput getValues(vector) {return data;}; + string getCitation() { return "http://www.mothur.org/wiki/Heip"; } }; /***********************************************************************/ diff --git a/hellinger.h b/hellinger.h index 6382685..a06cfce 100644 --- a/hellinger.h +++ b/hellinger.h @@ -21,6 +21,7 @@ public: Hellinger() : Calculator("hellinger", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/Hellinger"; } private: }; diff --git a/homovacommand.h b/homovacommand.h index 8b31cc5..d9daa0e 100644 --- a/homovacommand.h +++ b/homovacommand.h @@ -27,7 +27,7 @@ public: string getCommandName() { return "homova"; } string getCommandCategory() { return "Hypothesis Testing"; } string getHelpString(); - string getCitation() { return "Stewart CN, Excoffier L (1996). Assessing population genetic structure and variability with RAPD data: Application to Vaccinium macrocarpon (American Cranberry). J Evol Biol 9: 153-71. http://www.mothur.org/wiki/Homova"; } + string getCitation() { return "Stewart CN, Excoffier L (1996). Assessing population genetic structure and variability with RAPD data: Application to Vaccinium macrocarpon (American Cranberry). J Evol Biol 9: 153-71. \nhttp://www.mothur.org/wiki/Homova"; } int execute(); void help() { m->mothurOut(getHelpString()); } diff --git a/indicatorcommand.h b/indicatorcommand.h index 9c8c6d4..578aa95 100644 --- a/indicatorcommand.h +++ b/indicatorcommand.h @@ -27,7 +27,7 @@ public: string getCommandName() { return "indicator"; } string getCommandCategory() { return "Hypothesis Testing"; } string getHelpString(); - string getCitation() { return "http://www.mothur.org/wiki/Indicator"; } + string getCitation() { return "Dufrene M, Legendre P (1997). Species assemblages and indicator species: The need for a flexible asymmetrical approach. Ecol Monogr 67: 345-66.\n McCune B, Grace JB, Urban DL (2002). Analysis of ecological communities. MjM Software Design: Gleneden Beach, OR. \nLegendre P, Legendre L (1998). Numerical Ecology. Elsevier: New York. \nhttp://www.mothur.org/wiki/Indicator"; } int execute(); void help() { m->mothurOut(getHelpString()); } diff --git a/invsimpson.h b/invsimpson.h index e89d8a2..1471a6c 100644 --- a/invsimpson.h +++ b/invsimpson.h @@ -22,6 +22,7 @@ public: InvSimpson() : Calculator("invsimpson", 3, false) {}; EstOutput getValues(SAbundVector*); EstOutput getValues(vector) {return data;}; + string getCitation() { return "http://www.mothur.org/wiki/InvSimpson"; } }; /***********************************************************************/ diff --git a/jackknife.h b/jackknife.h index ce9497b..fe9f6b6 100644 --- a/jackknife.h +++ b/jackknife.h @@ -23,6 +23,7 @@ public: Jackknife() : Calculator("jackknife", 3, false) { getAMatrix(); }; EstOutput getValues(SAbundVector*); EstOutput getValues(vector) {return data;}; + string getCitation() { return "http://www.mothur.org/wiki/Jackknife"; } private: static const int maxOrder = 30; diff --git a/libshuffcommand.h b/libshuffcommand.h index 25b1281..96e68f3 100644 --- a/libshuffcommand.h +++ b/libshuffcommand.h @@ -27,7 +27,7 @@ public: string getCommandName() { return "libshuff"; } string getCommandCategory() { return "Hypothesis Testing"; } string getHelpString(); - string getCitation() { return "http://www.mothur.org/wiki/Libshuff"; } + string getCitation() { return "Singleton DR, Furlong MA, Rathbun SL, Whitman WB (2001). Quantitative comparisons of 16S rRNA gene sequence libraries from environmental samples. Appl Environ Microbiol 67: 4374-6. \nSchloss PD, Larget BR, Handelsman J (2004). Integration of microbial ecology and statistics: a test to compare gene libraries. Appl Environ Microbiol 70: 5485-92. \nhttp://www.mothur.org/wiki/Libshuff"; } int execute(); void help() { m->mothurOut(getHelpString()); } diff --git a/logsd.h b/logsd.h index 70d584d..c9e7088 100644 --- a/logsd.h +++ b/logsd.h @@ -23,6 +23,7 @@ public: LogSD() : Calculator("logseries", 3, false) {}; EstOutput getValues(SAbundVector*); EstOutput getValues(vector) {return data;}; + string getCitation() { return "http://www.mothur.org/wiki/LogSeries"; } private: double logS(double); diff --git a/manhattan.h b/manhattan.h index 3115da6..91d73a8 100644 --- a/manhattan.h +++ b/manhattan.h @@ -21,6 +21,7 @@ public: Manhattan() : Calculator("manhattan", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/Manhattan"; } private: }; diff --git a/mantelcommand.h b/mantelcommand.h index 1a6f27b..5b2fe6f 100644 --- a/mantelcommand.h +++ b/mantelcommand.h @@ -23,7 +23,7 @@ public: string getCommandName() { return "mantel"; } string getCommandCategory() { return "Hypothesis Testing"; } string getHelpString(); - string getCitation() { return "Sokal, R. R., & Rohlf, F. J. (1995). Biometry, 3rd edn. New York: Freeman. http://www.mothur.org/wiki/Mantel"; } + string getCitation() { return "McCune B, Grace JB, Urban DL (2002). Analysis of ecological communities. MjM Software Design: Gleneden Beach, OR. \nLegendre P, Legendre L (1998). Numerical Ecology. Elsevier: New York. \nhttp://www.mothur.org/wiki/Mantel"; } int execute(); void help() { m->mothurOut(getHelpString()); } diff --git a/matrixoutputcommand.cpp b/matrixoutputcommand.cpp index 4ea8f02..7fbd830 100644 --- a/matrixoutputcommand.cpp +++ b/matrixoutputcommand.cpp @@ -188,6 +188,11 @@ MatrixOutputCommand::MatrixOutputCommand(string option) { if (calc == "default") { calc = "jclass-thetayc"; } } m->splitAtDash(calc, Estimators); + if (m->inUsersGroups("citation", Estimators)) { + ValidCalculators validCalc; validCalc.printCitations(Estimators); + //remove citation from list of calcs + for (int i = 0; i < Estimators.size(); i++) { if (Estimators[i] == "citation") { Estimators.erase(Estimators.begin()+i); break; } } + } if (abort == false) { diff --git a/memchi2.h b/memchi2.h index a81296c..c230154 100644 --- a/memchi2.h +++ b/memchi2.h @@ -22,6 +22,7 @@ public: MemChi2() : Calculator("memchi2", 1, false, true) {}; //the true means this calculator needs all groups to calculate the pair value EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/Memchi2"; } private: }; diff --git a/memchord.h b/memchord.h index fc705ab..8c4628b 100644 --- a/memchord.h +++ b/memchord.h @@ -21,6 +21,7 @@ public: MemChord() : Calculator("memchord", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/Memchord"; } private: }; diff --git a/memeuclidean.h b/memeuclidean.h index ae22be1..aeae07a 100644 --- a/memeuclidean.h +++ b/memeuclidean.h @@ -21,6 +21,7 @@ public: MemEuclidean() : Calculator("memeuclidean", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/Memeuclidean"; } private: }; diff --git a/mempearson.h b/mempearson.h index d94f2ac..c09dce3 100644 --- a/mempearson.h +++ b/mempearson.h @@ -22,6 +22,7 @@ public: MemPearson() : Calculator("mempearson", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/Mempearson"; } private: }; diff --git a/metastatscommand.h b/metastatscommand.h index 491e076..04c3443 100644 --- a/metastatscommand.h +++ b/metastatscommand.h @@ -25,7 +25,7 @@ public: string getCommandName() { return "metastats"; } string getCommandCategory() { return "OTU-Based Approaches"; } string getHelpString(); - string getCitation() { return "White, J.R., Nagarajan, N. & Pop, M. Statistical methods for detecting differentially abundant features in clinical metagenomic samples. PLoS Comput Biol 5, e1000352 (2009). http://www.mothur.org/wiki/Metastats"; } + string getCitation() { return "White JR, Nagarajan N, Pop M (2009). Statistical methods for detecting differentially abundant features in clinical metagenomic samples. PLoS Comput Biol 5: e1000352. \nhttp://www.mothur.org/wiki/Metastats"; } int execute(); void help() { m->mothurOut(getHelpString()); } diff --git a/mgclustercommand.h b/mgclustercommand.h index d5c784e..6ad1855 100644 --- a/mgclustercommand.h +++ b/mgclustercommand.h @@ -32,7 +32,7 @@ public: string getCommandName() { return "mgcluster"; } string getCommandCategory() { return "Clustering"; } string getHelpString(); - string getCitation() { return "http://www.mothur.org/wiki/Mgcluster"; } + string getCitation() { return "Schloss PD, Handelsman J (2008). A statistical toolbox for metagenomics. BMC Bioinformatics 9: 34. \nhttp://www.mothur.org/wiki/Mgcluster"; } int execute(); void help() { m->mothurOut(getHelpString()); } diff --git a/nmdscommand.h b/nmdscommand.h index f099f95..0b7f5a8 100644 --- a/nmdscommand.h +++ b/nmdscommand.h @@ -38,7 +38,7 @@ public: string getCommandName() { return "nmds"; } string getCommandCategory() { return "Hypothesis Testing"; } string getHelpString(); - string getCitation() { return "Non-metric multidimensional scaling function using the majorization algorithm from Borg & Groenen 1997, Modern Multidimensional Scaling. http://www.mothur.org/wiki/Nmds"; } + string getCitation() { return "Borg, Groenen (1997). Non-metric multidimensional scaling function using the majorization algorithm, in Modern Multidimensional Scaling. Ed. T.F. Cox and M.A.A. Cox. Chapman and Hall. \nhttp://www.mothur.org/wiki/Nmds"; } int execute(); void help() { m->mothurOut(getHelpString()); } diff --git a/npshannon.h b/npshannon.h index 2e9578b..ea870d3 100644 --- a/npshannon.h +++ b/npshannon.h @@ -23,6 +23,7 @@ public: NPShannon() : Calculator("npshannon", 1, false) {}; EstOutput getValues(SAbundVector*); EstOutput getValues(vector) {return data;}; + string getCitation() { return "http://www.mothur.org/wiki/Npshannon"; } private: }; diff --git a/nseqs.h b/nseqs.h index c011f10..e82684b 100644 --- a/nseqs.h +++ b/nseqs.h @@ -44,6 +44,7 @@ public: return data; } + string getCitation() { return "http://www.mothur.org/wiki/Nseqs"; } }; /***********************************************************************/ diff --git a/odum.h b/odum.h index 14641fd..ff2a3a7 100644 --- a/odum.h +++ b/odum.h @@ -22,6 +22,7 @@ public: Odum() : Calculator("odum", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/Odum"; } private: }; diff --git a/pairwiseseqscommand.h b/pairwiseseqscommand.h index 6978518..cbd5aa4 100644 --- a/pairwiseseqscommand.h +++ b/pairwiseseqscommand.h @@ -29,7 +29,7 @@ public: string getCommandName() { return "pairwise.seqs"; } string getCommandCategory() { return "Sequence Processing"; } string getHelpString(); - string getCitation() { return "http://www.mothur.org/wiki/Pairwise.seqs"; } + string getCitation() { return "Needleman SB, Wunsch CD (1970). A general method applicable to the search for similarities in the amino acid sequence of two proteins. J Mol Biol 48: 443-53. [ for needleman ]\nGotoh O (1982). An improved algorithm for matching biological sequences. J Mol Biol 162: 705-8. [ for gotoh ] \nhttp://www.mothur.org/wiki/Pairwise.seqs"; } int execute(); void help() { m->mothurOut(getHelpString()); } diff --git a/parsimonycommand.h b/parsimonycommand.h index 30c8332..5e5484f 100644 --- a/parsimonycommand.h +++ b/parsimonycommand.h @@ -29,7 +29,7 @@ public: string getCommandName() { return "parsimony"; } string getCommandCategory() { return "Hypothesis Testing"; } string getHelpString(); - string getCitation() { return "http://www.mothur.org/wiki/Parsimony"; } + string getCitation() { return "Slatkin M, Maddison WP (1989). A cladistic measure of gene flow inferred from the phylogenies of alleles. Genetics 123: 603-13. \nSlatkin M, Maddison WP (1990). Detecting isolation by distance using phylogenies of genes. Genetics 126: 249-60. \nMartin AP (2002). Phylogenetic approaches for describing and comparing the diversity of microbial communities. Appl Environ Microbiol 68: 3673-82. \nSchloss PD, Handelsman J (2006). Introducing TreeClimber, a test to compare microbial community structure. Appl Environ Microbiol 72: 2379-84.\nhttp://www.mothur.org/wiki/Parsimony"; } int execute(); void help() { m->mothurOut(getHelpString()); } diff --git a/pcacommand.h b/pcacommand.h index 9b4a881..f139214 100644 --- a/pcacommand.h +++ b/pcacommand.h @@ -26,7 +26,7 @@ public: string getCommandName() { return "pca"; } string getCommandCategory() { return "Hypothesis Testing"; } string getHelpString(); - string getCitation() { return "http://www.mothur.org/wiki/Pca"; } + string getCitation() { return "McCune B, Grace JB, Urban DL (2002). Analysis of ecological communities. MjM Software Design: Gleneden Beach, OR. \nLegendre P, Legendre L (1998). Numerical Ecology. Elsevier: New York. \nhttp://www.mothur.org/wiki/Pca"; } int execute(); void help() { m->mothurOut(getHelpString()); } diff --git a/pcoacommand.h b/pcoacommand.h index d9aa270..5b84d48 100644 --- a/pcoacommand.h +++ b/pcoacommand.h @@ -26,7 +26,7 @@ public: string getCommandName() { return "pcoa"; } string getCommandCategory() { return "Hypothesis Testing"; } string getHelpString(); - string getCitation() { return "http://www.mothur.org/wiki/Pcoa"; } + string getCitation() { return "McCune B, Grace JB, Urban DL (2002). Analysis of ecological communities. MjM Software Design: Gleneden Beach, OR. \nLegendre P, Legendre L (1998). Numerical Ecology. Elsevier: New York. \nhttp://www.mothur.org/wiki/Pcoa"; } int execute(); void help() { m->mothurOut(getHelpString()); } diff --git a/phylodiversitycommand.h b/phylodiversitycommand.h index 1be0e07..52295cf 100644 --- a/phylodiversitycommand.h +++ b/phylodiversitycommand.h @@ -27,7 +27,7 @@ class PhyloDiversityCommand : public Command { string getCommandName() { return "phylo.diversity"; } string getCommandCategory() { return "Hypothesis Testing"; } string getHelpString(); - string getCitation() { return "http://www.mothur.org/wiki/Phylo.diversity"; } + string getCitation() { return "Faith DP (1994). Phylogenetic pattern and the quantification of organismal biodiversity. Philos Trans R Soc Lond B Biol Sci 345: 45-58. \nhttp://www.mothur.org/wiki/Phylo.diversity"; } int execute(); void help() { m->mothurOut(getHelpString()); } diff --git a/qstat.h b/qstat.h index 5bc6d9e..699ba55 100644 --- a/qstat.h +++ b/qstat.h @@ -22,6 +22,7 @@ public: EstOutput getValues(SAbundVector*); EstOutput getValues(vector) {return data;}; + string getCitation() { return "http://www.mothur.org/wiki/Qstat"; } private: RAbundVector rdata; diff --git a/rarefactcommand.cpp b/rarefactcommand.cpp index 1c04bc4..82251c4 100644 --- a/rarefactcommand.cpp +++ b/rarefactcommand.cpp @@ -243,6 +243,11 @@ RareFactCommand::RareFactCommand(string option) { if (calc == "default") { calc = "sobs"; } } m->splitAtDash(calc, Estimators); + if (m->inUsersGroups("citation", Estimators)) { + ValidCalculators validCalc; validCalc.printCitations(Estimators); + //remove citation from list of calcs + for (int i = 0; i < Estimators.size(); i++) { if (Estimators[i] == "citation") { Estimators.erase(Estimators.begin()+i); break; } } + } string temp; temp = validParameter.validFile(parameters, "freq", false); if (temp == "not found") { temp = "100"; } diff --git a/rarefactcommand.h b/rarefactcommand.h index 58e6819..0bf8a45 100644 --- a/rarefactcommand.h +++ b/rarefactcommand.h @@ -27,7 +27,7 @@ public: string getCommandName() { return "rarefaction.single"; } string getCommandCategory() { return "OTU-Based Approaches"; } string getHelpString(); - string getCitation() { return "http://www.mothur.org/wiki/Rarefaction.single"; } + string getCitation() { return "Magurran AE (2004). Measuring biological diversity. Blackwell Pub.: Malden, Ma. \nhttp://www.mothur.org/wiki/Rarefaction.single"; } int execute(); void help() { m->mothurOut(getHelpString()); } diff --git a/rarefactsharedcommand.cpp b/rarefactsharedcommand.cpp index 0292cba..fe92f97 100644 --- a/rarefactsharedcommand.cpp +++ b/rarefactsharedcommand.cpp @@ -147,6 +147,11 @@ RareFactSharedCommand::RareFactSharedCommand(string option) { if (calc == "default") { calc = "sharedobserved"; } } m->splitAtDash(calc, Estimators); + if (m->inUsersGroups("citation", Estimators)) { + ValidCalculators validCalc; validCalc.printCitations(Estimators); + //remove citation from list of calcs + for (int i = 0; i < Estimators.size(); i++) { if (Estimators[i] == "citation") { Estimators.erase(Estimators.begin()+i); break; } } + } groups = validParameter.validFile(parameters, "groups", false); if (groups == "not found") { groups = ""; } diff --git a/rarefactsharedcommand.h b/rarefactsharedcommand.h index 54d0495..7d4dc5e 100644 --- a/rarefactsharedcommand.h +++ b/rarefactsharedcommand.h @@ -26,7 +26,7 @@ public: string getCommandName() { return "rarefaction.shared"; } string getCommandCategory() { return "OTU-Based Approaches"; } string getHelpString(); - string getCitation() { return "http://www.mothur.org/wiki/Rarefaction.shared"; } + string getCitation() { return "Magurran AE (2004). Measuring biological diversity. Blackwell Pub.: Malden, Ma. \nhttp://www.mothur.org/wiki/Rarefaction.shared"; } int execute(); void help() { m->mothurOut(getHelpString()); } diff --git a/sensspeccommand.h b/sensspeccommand.h index b2833bf..47d6e4e 100644 --- a/sensspeccommand.h +++ b/sensspeccommand.h @@ -25,7 +25,7 @@ public: string getCommandName() { return "sens.spec"; } string getCommandCategory() { return "OTU-Based Approaches"; } string getHelpString(); - string getCitation() { return "http://www.mothur.org/wiki/Sens.spec"; } + string getCitation() { return "Schloss PD, Westcott SL (2011). Assessing and improving methods used in OTU-based approaches for 16S rRNA gene sequence analysis. Appl Environ Microbiol. \nhttp://www.mothur.org/wiki/Sens.spec"; } int execute(); void help() { m->mothurOut(getHelpString()); } diff --git a/shannon.h b/shannon.h index 7fbcafc..3d9ecde 100644 --- a/shannon.h +++ b/shannon.h @@ -23,6 +23,7 @@ public: Shannon() : Calculator("shannon", 3, false) {}; EstOutput getValues(SAbundVector* rank); EstOutput getValues(vector) {return data;}; + string getCitation() { return "http://www.mothur.org/wiki/Shannon"; } private: }; diff --git a/shannoneven.h b/shannoneven.h index 5b03d72..44d0766 100644 --- a/shannoneven.h +++ b/shannoneven.h @@ -20,6 +20,7 @@ public: ShannonEven() : Calculator("shannoneven", 1, false) {}; EstOutput getValues(SAbundVector*); EstOutput getValues(vector) {return data;}; + string getCitation() { return "http://www.mothur.org/wiki/Shannoneven"; } }; /***********************************************************************/ diff --git a/sharedace.h b/sharedace.h index 94fa006..9ea0d6a 100644 --- a/sharedace.h +++ b/sharedace.h @@ -22,6 +22,7 @@ public: SharedAce(int n=10) : abund(n), Calculator("sharedace", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/SharedAce"; } private: int abund; }; diff --git a/sharedanderberg.h b/sharedanderberg.h deleted file mode 100644 index 4de5ca2..0000000 --- a/sharedanderberg.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef SHAREDANDERBERG_H -#define SHAREDANDERBERG_H -/* - * sharedanderberg.h - * Mothur - * - * Created by Sarah Westcott on 3/23/09. - * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved. - * - */ - -#include "calculator.h" - -/***********************************************************************/ - -class SharedAnderberg : public Calculator { - -public: - SharedAnderberg() : Calculator("anderberg", 1) {}; - EstOutput getValues(SAbundVector*) {return data;}; - EstOutput getValues(SharedRAbundVector*, SharedRAbundVector*); -private: - -}; - -/***********************************************************************/ - - - -#endif \ No newline at end of file diff --git a/sharedanderbergs.h b/sharedanderbergs.h index becfe7d..785e52b 100644 --- a/sharedanderbergs.h +++ b/sharedanderbergs.h @@ -19,6 +19,7 @@ class Anderberg : public Calculator { Anderberg() : Calculator("anderberg", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/Anderberg"; } private: }; diff --git a/sharedbraycurtis.h b/sharedbraycurtis.h index 7a8ef11..200f08c 100644 --- a/sharedbraycurtis.h +++ b/sharedbraycurtis.h @@ -18,6 +18,7 @@ public: BrayCurtis() : Calculator("braycurtis", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/Braycurtis"; } private: }; diff --git a/sharedchao1.h b/sharedchao1.h index e802cc3..ae07a87 100644 --- a/sharedchao1.h +++ b/sharedchao1.h @@ -24,6 +24,7 @@ class SharedChao1 : public Calculator { SharedChao1() : Calculator("sharedchao", 1, true) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/Sharedchao"; } private: IntNode* f1root; IntNode* f2root; diff --git a/sharedjabund.h b/sharedjabund.h index 1bd4198..083ad23 100644 --- a/sharedjabund.h +++ b/sharedjabund.h @@ -23,6 +23,7 @@ public: JAbund() : Calculator("jabund", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/Jabund"; } private: UVEst* uv; diff --git a/sharedjackknife.h b/sharedjackknife.h index 9f4ef72..1e9cbf5 100644 --- a/sharedjackknife.h +++ b/sharedjackknife.h @@ -23,6 +23,7 @@ public: SharedJackknife() : numGroups(-1), callCount(0), count(0), currentCallDone(true), Calculator("sharedjackknife", 3, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/Sharedjackknife"; } private: int numGroups, callCount, count; diff --git a/sharedjclass.h b/sharedjclass.h index 59aea19..015b8ac 100644 --- a/sharedjclass.h +++ b/sharedjclass.h @@ -22,6 +22,7 @@ public: Jclass() : Calculator("jclass", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/Jclass"; } private: }; diff --git a/sharedjest.h b/sharedjest.h index c4111bc..5f06884 100644 --- a/sharedjest.h +++ b/sharedjest.h @@ -23,6 +23,7 @@ public: Jest() : Calculator("jest", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/Jest"; } private: }; diff --git a/sharedkstest.h b/sharedkstest.h index 6509b53..1ffae83 100644 --- a/sharedkstest.h +++ b/sharedkstest.h @@ -21,6 +21,7 @@ public: KSTest() : Calculator("kstest", 3, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/Kstest"; } private: }; diff --git a/sharedkulczynski.h b/sharedkulczynski.h index 0bace81..675ce4d 100644 --- a/sharedkulczynski.h +++ b/sharedkulczynski.h @@ -20,6 +20,7 @@ public: Kulczynski() : Calculator("kulczynski", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/Kulczynski"; } private: }; diff --git a/sharedkulczynskicody.h b/sharedkulczynskicody.h index 1df563a..9cb651f 100644 --- a/sharedkulczynskicody.h +++ b/sharedkulczynskicody.h @@ -21,6 +21,7 @@ public: KulczynskiCody() : Calculator("kulczynskicody", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/Kulczynskicody"; } private: }; diff --git a/sharedlennon.h b/sharedlennon.h index 77eb629..cf1831e 100644 --- a/sharedlennon.h +++ b/sharedlennon.h @@ -21,6 +21,7 @@ public: Lennon() : Calculator("lennon", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/Lennon"; } private: }; diff --git a/sharedmarczewski.h b/sharedmarczewski.h index 2bbd622..66a18f7 100644 --- a/sharedmarczewski.h +++ b/sharedmarczewski.h @@ -20,6 +20,7 @@ public: SharedMarczewski() : Calculator("sharedmarczewski", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/Sharedmarczewski"; } private: }; diff --git a/sharedmorisitahorn.h b/sharedmorisitahorn.h index a7980d0..7f0b6e9 100644 --- a/sharedmorisitahorn.h +++ b/sharedmorisitahorn.h @@ -20,6 +20,7 @@ public: MorHorn() : Calculator("morisitahorn", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/Morisitahorn"; } private: }; diff --git a/sharednseqs.h b/sharednseqs.h index aa989bc..5d403fa 100644 --- a/sharednseqs.h +++ b/sharednseqs.h @@ -23,6 +23,7 @@ public: data[0] = (double)shared[0]->getNumSeqs() + (double)shared[1]->getNumSeqs(); return data; } + string getCitation() { return "http://www.mothur.org/wiki/Sharednseqs"; } }; /***********************************************************************/ diff --git a/sharedochiai.h b/sharedochiai.h index 78ec0ae..fb799de 100644 --- a/sharedochiai.h +++ b/sharedochiai.h @@ -19,6 +19,7 @@ public: Ochiai() : Calculator("ochiai", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/ochiai"; } private: }; diff --git a/sharedsobs.h b/sharedsobs.h index e71b6b8..3fa32ce 100644 --- a/sharedsobs.h +++ b/sharedsobs.h @@ -22,6 +22,7 @@ public: SharedSobs() : Calculator("sharedsobs", 1, false) {}; EstOutput getValues(SAbundVector* rank){ return data; }; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/sharedsobs"; } }; /***********************************************************************/ diff --git a/sharedsobscollectsummary.h b/sharedsobscollectsummary.h index 6c8e7c3..d35a2ac 100644 --- a/sharedsobscollectsummary.h +++ b/sharedsobscollectsummary.h @@ -21,6 +21,7 @@ public: SharedSobsCS() : Calculator("sharedsobs", 1, true) {}; EstOutput getValues(SAbundVector* rank){ return data; }; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/Sharedsobs"; } }; /***********************************************************************/ diff --git a/sharedsorabund.h b/sharedsorabund.h index 7ec112e..aa85622 100644 --- a/sharedsorabund.h +++ b/sharedsorabund.h @@ -23,6 +23,7 @@ public: SorAbund() : Calculator("sorabund", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/Sorabund"; } private: UVEst* uv; diff --git a/sharedsorclass.h b/sharedsorclass.h index dc6f14c..49ada2d 100644 --- a/sharedsorclass.h +++ b/sharedsorclass.h @@ -23,6 +23,7 @@ public: SorClass() : Calculator("sorclass", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/Sorclass"; } private: }; diff --git a/sharedsorest.h b/sharedsorest.h index 94bcc32..904a712 100644 --- a/sharedsorest.h +++ b/sharedsorest.h @@ -23,6 +23,7 @@ public: SorEst() : Calculator("sorest", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/Sorest"; } private: }; diff --git a/sharedthetan.h b/sharedthetan.h index b3693d6..2d30ecc 100644 --- a/sharedthetan.h +++ b/sharedthetan.h @@ -23,6 +23,7 @@ public: ThetaN() : Calculator("thetan", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/Thetan"; } private: }; diff --git a/sharedthetayc.h b/sharedthetayc.h index 536306c..b132a56 100644 --- a/sharedthetayc.h +++ b/sharedthetayc.h @@ -23,6 +23,7 @@ public: ThetaYC() : Calculator("thetayc", 3, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/Thetayc"; } private: }; diff --git a/shen.h b/shen.h index 1016e4c..ad0eda4 100644 --- a/shen.h +++ b/shen.h @@ -23,6 +23,7 @@ public: Shen(int size, int n) : f(size), abund(n), Calculator("shen", 1, false) {}; EstOutput getValues(SAbundVector*); EstOutput getValues(vector) {return data;}; + string getCitation() { return "http://www.mothur.org/wiki/Shen"; } private: int f; int abund; diff --git a/simpson.h b/simpson.h index 0214217..d3d93a7 100644 --- a/simpson.h +++ b/simpson.h @@ -23,6 +23,7 @@ public: Simpson() : Calculator("simpson", 3, false) {}; EstOutput getValues(SAbundVector*); EstOutput getValues(vector) {return data;}; + string getCitation() { return "http://www.mothur.org/wiki/Simpson"; } }; /***********************************************************************/ diff --git a/simpsoneven.h b/simpsoneven.h index 0fb8949..b793e54 100644 --- a/simpsoneven.h +++ b/simpsoneven.h @@ -20,6 +20,7 @@ public: SimpsonEven() : Calculator("simpsoneven", 1, false) {}; EstOutput getValues(SAbundVector*); EstOutput getValues(vector) {return data;}; + string getCitation() { return "http://www.mothur.org/wiki/Simpsoneven"; } }; /***********************************************************************/ diff --git a/smithwilson.h b/smithwilson.h index 6e060d9..46c3af9 100644 --- a/smithwilson.h +++ b/smithwilson.h @@ -20,6 +20,7 @@ public: SmithWilson() : Calculator("smithwilson", 1, false) {}; EstOutput getValues(SAbundVector*); EstOutput getValues(vector) {return data;}; + string getCitation() { return "http://www.mothur.org/wiki/Smithwilson"; } }; /***********************************************************************/ diff --git a/sobs.h b/sobs.h index 2259244..05956a4 100644 --- a/sobs.h +++ b/sobs.h @@ -28,6 +28,7 @@ public: return data; } EstOutput getValues(vector) {return data;}; + string getCitation() { return "http://www.mothur.org/wiki/Sobs"; } }; /***********************************************************************/ diff --git a/soergel.h b/soergel.h index c26473a..11df65e 100644 --- a/soergel.h +++ b/soergel.h @@ -21,6 +21,7 @@ public: Soergel() : Calculator("soergel", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/Soergel"; } private: }; diff --git a/solow.h b/solow.h index 0850141..38e7776 100644 --- a/solow.h +++ b/solow.h @@ -23,6 +23,7 @@ public: Solow(int size) : f(size), Calculator("solow", 1, false) {}; EstOutput getValues(SAbundVector*); EstOutput getValues(vector) {return data;}; + string getCitation() { return "http://www.mothur.org/wiki/Solow"; } private: int f; }; diff --git a/spearman.h b/spearman.h index f49d86f..06a4aa9 100644 --- a/spearman.h +++ b/spearman.h @@ -22,6 +22,7 @@ public: Spearman() : Calculator("spearman", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/Spearman"; } private: }; diff --git a/speciesprofile.h b/speciesprofile.h index 1ec8dd6..f2c5ff4 100644 --- a/speciesprofile.h +++ b/speciesprofile.h @@ -21,6 +21,7 @@ public: SpeciesProfile() : Calculator("speciesprofile", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/Speciesprofile"; } private: }; diff --git a/structchi2.h b/structchi2.h index 614db07..a444dd3 100644 --- a/structchi2.h +++ b/structchi2.h @@ -21,6 +21,7 @@ public: StructChi2() : Calculator("structchi2", 1, false, true) {}; //the true means this calculator needs all groups to calculate the pair value EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/Structchi2"; } private: }; diff --git a/structchord.h b/structchord.h index f35c890..b92007e 100644 --- a/structchord.h +++ b/structchord.h @@ -21,6 +21,7 @@ public: StructChord() : Calculator("structchord", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/Structchord"; } private: }; diff --git a/structeuclidean.h b/structeuclidean.h index 37c54fc..2a7bd5c 100644 --- a/structeuclidean.h +++ b/structeuclidean.h @@ -22,6 +22,7 @@ public: StructEuclidean() : Calculator("structeuclidean", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/Structeuclidean"; } private: }; diff --git a/structkulczynski.h b/structkulczynski.h index 75cd8a6..a0e4b9d 100644 --- a/structkulczynski.h +++ b/structkulczynski.h @@ -21,6 +21,7 @@ public: StructKulczynski() : Calculator("structkulczynski", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/Structkulczynski"; } private: }; diff --git a/structpearson.h b/structpearson.h index c3b9455..c0cbf9b 100644 --- a/structpearson.h +++ b/structpearson.h @@ -22,6 +22,7 @@ public: StructPearson() : Calculator("structpearson", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/Structpearson"; } private: }; diff --git a/summarycommand.cpp b/summarycommand.cpp index 076c5eb..4d71c07 100644 --- a/summarycommand.cpp +++ b/summarycommand.cpp @@ -223,6 +223,11 @@ SummaryCommand::SummaryCommand(string option) { if (calc == "default") { calc = "sobs-chao-ace-jack-shannon-npshannon-simpson"; } } m->splitAtDash(calc, Estimators); + if (m->inUsersGroups("citation", Estimators)) { + ValidCalculators validCalc; validCalc.printCitations(Estimators); + //remove citation from list of calcs + for (int i = 0; i < Estimators.size(); i++) { if (Estimators[i] == "citation") { Estimators.erase(Estimators.begin()+i); break; } } + } string temp; temp = validParameter.validFile(parameters, "abund", false); if (temp == "not found") { temp = "10"; } diff --git a/summarysharedcommand.cpp b/summarysharedcommand.cpp index 4cc32e3..8e162ee 100644 --- a/summarysharedcommand.cpp +++ b/summarysharedcommand.cpp @@ -184,6 +184,11 @@ SummarySharedCommand::SummarySharedCommand(string option) { if (calc == "default") { calc = "sharedsobs-sharedchao-sharedace-jabund-sorabund-jclass-sorclass-jest-sorest-thetayc-thetan"; } } m->splitAtDash(calc, Estimators); + if (m->inUsersGroups("citation", Estimators)) { + ValidCalculators validCalc; validCalc.printCitations(Estimators); + //remove citation from list of calcs + for (int i = 0; i < Estimators.size(); i++) { if (Estimators[i] == "citation") { Estimators.erase(Estimators.begin()+i); break; } } + } groups = validParameter.validFile(parameters, "groups", false); if (groups == "not found") { groups = ""; } diff --git a/treegroupscommand.cpp b/treegroupscommand.cpp index b5849d3..582a323 100644 --- a/treegroupscommand.cpp +++ b/treegroupscommand.cpp @@ -248,6 +248,11 @@ TreeGroupCommand::TreeGroupCommand(string option) { if (calc == "default") { calc = "jclass-thetayc"; } } m->splitAtDash(calc, Estimators); + if (m->inUsersGroups("citation", Estimators)) { + ValidCalculators validCalc; validCalc.printCitations(Estimators); + //remove citation from list of calcs + for (int i = 0; i < Estimators.size(); i++) { if (Estimators[i] == "citation") { Estimators.erase(Estimators.begin()+i); break; } } + } string temp; temp = validParameter.validFile(parameters, "precision", false); if (temp == "not found") { temp = "100"; } diff --git a/trimseqscommand.cpp b/trimseqscommand.cpp index ae37a2a..6d87f89 100644 --- a/trimseqscommand.cpp +++ b/trimseqscommand.cpp @@ -798,7 +798,7 @@ int TrimSeqsCommand::createProcessesCreateTrim(string filename, string qFileName int TrimSeqsCommand::setLines(string filename, string qfilename, vector& fastaFilePos, vector& qfileFilePos) { try { - + #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) //set file positions for fasta file fastaFilePos = m->divideFile(filename, processors); @@ -871,6 +871,40 @@ int TrimSeqsCommand::setLines(string filename, string qfilename, vectorerrorOut(e, "TrimSeqsCommand", "setLines"); diff --git a/unifracunweightedcommand.h b/unifracunweightedcommand.h index 74ba2b2..415279c 100644 --- a/unifracunweightedcommand.h +++ b/unifracunweightedcommand.h @@ -28,7 +28,7 @@ class UnifracUnweightedCommand : public Command { string getCommandName() { return "unifrac.unweighted"; } string getCommandCategory() { return "Hypothesis Testing"; } string getHelpString(); - string getCitation() { return "http://www.mothur.org/wiki/Unifrac.unweighted"; } + string getCitation() { return "Lozupone C, Knight R (2005). UniFrac: a new phylogenetic method for comparing microbial communities. Appl Environ Microbiol 71: 8228-35. \nhttp://www.mothur.org/wiki/Unifrac.unweighted"; } int execute(); void help() { m->mothurOut(getHelpString()); } diff --git a/unifracweightedcommand.h b/unifracweightedcommand.h index 2e2ba3a..fe5d76c 100644 --- a/unifracweightedcommand.h +++ b/unifracweightedcommand.h @@ -29,7 +29,7 @@ class UnifracWeightedCommand : public Command { string getCommandName() { return "unifrac.weighted"; } string getCommandCategory() { return "Hypothesis Testing"; } string getHelpString(); - string getCitation() { return "http://www.mothur.org/wiki/Unifrac.weighted"; } + string getCitation() { return "Lozupone CA, Hamady M, Kelley ST, Knight R (2007). Quantitative and qualitative beta diversity measures lead to different insights into factors that structure microbial communities. Appl Environ Microbiol 73: 1576-85. \nhttp://www.mothur.org/wiki/Unifrac.weighted"; } int execute(); void help() { m->mothurOut(getHelpString()); } diff --git a/validcalculator.cpp b/validcalculator.cpp index 2798b53..a22ece2 100644 --- a/validcalculator.cpp +++ b/validcalculator.cpp @@ -8,36 +8,214 @@ */ #include "validcalculator.h" +#include "ace.h" +#include "sobs.h" +#include "nseqs.h" +#include "chao1.h" +#include "bootstrap.h" +#include "simpson.h" +#include "simpsoneven.h" +#include "invsimpson.h" +#include "npshannon.h" +#include "shannon.h" +#include "smithwilson.h" +#include "heip.h" +#include "shannoneven.h" +#include "jackknife.h" +#include "geom.h" +#include "qstat.h" +#include "logsd.h" +#include "bergerparker.h" +#include "bstick.h" +#include "goodscoverage.h" +#include "efron.h" +#include "boneh.h" +#include "solow.h" +#include "shen.h" +#include "coverage.h" +#include "sharedsobscollectsummary.h" +#include "sharedchao1.h" +#include "sharedace.h" +#include "sharedjabund.h" +#include "sharedsorabund.h" +#include "sharedjclass.h" +#include "sharedsorclass.h" +#include "sharedjest.h" +#include "sharedsorest.h" +#include "sharedthetayc.h" +#include "sharedthetan.h" +#include "sharedkstest.h" +#include "whittaker.h" +#include "sharednseqs.h" +#include "sharedochiai.h" +#include "sharedanderbergs.h" +#include "sharedkulczynski.h" +#include "sharedkulczynskicody.h" +#include "sharedlennon.h" +#include "sharedmorisitahorn.h" +#include "sharedbraycurtis.h" +#include "sharedjackknife.h" +#include "whittaker.h" +#include "odum.h" +#include "canberra.h" +#include "structeuclidean.h" +#include "structchord.h" +#include "hellinger.h" +#include "manhattan.h" +#include "structpearson.h" +#include "soergel.h" +#include "spearman.h" +#include "structkulczynski.h" +#include "structchi2.h" +#include "speciesprofile.h" +#include "hamming.h" +#include "gower.h" +#include "memchi2.h" +#include "memchord.h" +#include "memeuclidean.h" +#include "mempearson.h" +#include "sharedsobs.h" +#include "sharednseqs.h" + /********************************************************************/ ValidCalculators::ValidCalculators() { try { - m = MothurOut::getInstance(); + m = MothurOut::getInstance(); + + initialSingle(); + initialShared(); + initialRarefaction(); + initialSharedRarefact(); + initialSummary(); + initialSharedSummary(); + initialVennSingle(); + initialVennShared(); + initialTreeGroups(); + initialBoot(); + initialDistance(); + initialMatrix(); + initialHeat(); + + for(it = single.begin(); it != single.end(); it++) { allCalcs.insert(it->first); } + for(it = shared.begin(); it != shared.end(); it++) { allCalcs.insert(it->first); } + for(it = rarefaction.begin(); it != rarefaction.end(); it++) { allCalcs.insert(it->first); } + for(it = summary.begin(); it != summary.end(); it++) { allCalcs.insert(it->first); } + for(it = sharedrarefaction.begin(); it != sharedrarefaction.end(); it++) { allCalcs.insert(it->first); } + for(it = sharedsummary.begin(); it != sharedsummary.end(); it++) { allCalcs.insert(it->first); } + for(it = vennsingle.begin(); it != vennsingle.end(); it++) { allCalcs.insert(it->first); } + for(it = vennshared.begin(); it != vennshared.end(); it++) { allCalcs.insert(it->first); } + for(it = treegroup.begin(); it != treegroup.end(); it++) { allCalcs.insert(it->first); } + for(it = matrix.begin(); it != matrix.end(); it++) { allCalcs.insert(it->first); } + for(it = heat.begin(); it != heat.end(); it++) { allCalcs.insert(it->first); } + for(it = boot.begin(); it != boot.end(); it++) { allCalcs.insert(it->first); } + for(it = distance.begin(); it != distance.end(); it++) { allCalcs.insert(it->first); } - initialSingle(); - initialShared(); - initialRarefaction(); - initialSharedRarefact(); - initialSummary(); - initialSharedSummary(); - initialVennSingle(); - initialVennShared(); - initialTreeGroups(); - initialBoot(); - initialDistance(); - initialMatrix(); - initialHeat(); } catch(exception& e) { m->errorOut(e, "ValidCalculator", "ValidCalculator"); exit(1); } } - /********************************************************************/ - ValidCalculators::~ValidCalculators() {} - +/********************************************************************/ +void ValidCalculators::printCitations(vector Estimators) { + try { + + for (int i = 0; i < Estimators.size(); i++) { + //is this citation, do nothing + if ((Estimators[i] == "citation") || (Estimators[i] == "default") || (Estimators[i] == "eachgap") || (Estimators[i] == "nogaps") || (Estimators[i] == "onegap")) {} + //is this a valid calculator + else if (allCalcs.count(Estimators[i]) != 0) { + if (Estimators[i] == "sobs") { Calculator* temp = new Sobs(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "chao") { Calculator* temp = new Chao1(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "nseqs") { Calculator* temp = new NSeqs(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "coverage") { Calculator* temp = new Coverage(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "ace") { Calculator* temp = new Ace(10); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + + }else if (Estimators[i] == "jack") { Calculator* temp = new Jackknife(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "shannon") { Calculator* temp = new Shannon(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "shannoneven") { Calculator* temp = new ShannonEven(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "npshannon") { Calculator* temp = new NPShannon(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "heip") { Calculator* temp = new Heip(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + + }else if (Estimators[i] == "smithwilson") { Calculator* temp = new SmithWilson(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "simpson") { Calculator* temp = new Simpson(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "simpsoneven") { Calculator* temp = new SimpsonEven(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "invsimpson") { Calculator* temp = new InvSimpson(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "bootstrap") { Calculator* temp = new Bootstrap(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + + }else if (Estimators[i] == "geometric") { Calculator* temp = new Geom(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "qstat") { Calculator* temp = new QStat(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "logseries") { Calculator* temp = new LogSD(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "bergerparker") { Calculator* temp = new BergerParker(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "bstick") { Calculator* temp = new BStick(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + + }else if (Estimators[i] == "goodscoverage") { Calculator* temp = new GoodsCoverage(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "efron") { Calculator* temp = new Efron(10); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "boneh") { Calculator* temp = new Boneh(10); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "solow") { Calculator* temp = new Solow(10); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "shen") { Calculator* temp = new Shen(10, 10); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + + }else if (Estimators[i] == "sharedchao") { Calculator* temp = new SharedChao1(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "sharedsobs") { Calculator* temp = new SharedSobsCS(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "sharedace") { Calculator* temp = new SharedAce(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "jabund") { Calculator* temp = new JAbund(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "sorabund") { Calculator* temp = new SorAbund(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + + }else if (Estimators[i] == "jclass") { Calculator* temp = new Jclass(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "sorclass") { Calculator* temp = new SorClass(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "jest") { Calculator* temp = new Jest(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "sorest") { Calculator* temp = new SorEst(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "thetayc") { Calculator* temp = new ThetaYC(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + + }else if (Estimators[i] == "thetan") { Calculator* temp = new ThetaN(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "kstest") { Calculator* temp = new KSTest(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "whittaker") { Calculator* temp = new Whittaker(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "sharednseqs") { Calculator* temp = new SharedNSeqs(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "ochiai") { Calculator* temp = new Ochiai(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + + }else if (Estimators[i] == "anderberg") { Calculator* temp = new Anderberg(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "skulczynski") { Calculator* temp = new Kulczynski(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "kulczynskicody") { Calculator* temp = new KulczynskiCody(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "lennon") { Calculator* temp = new Lennon(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "morisitahorn") { Calculator* temp = new MorHorn(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + + }else if (Estimators[i] == "braycurtis") { Calculator* temp = new BrayCurtis(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "odum") { Calculator* temp = new Odum(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "canberra") { Calculator* temp = new Canberra(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "structeuclidean") { Calculator* temp = new StructEuclidean(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "structchord") { Calculator* temp = new StructChord(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + + }else if (Estimators[i] == "hellinger") { Calculator* temp = new Hellinger(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "manhattan") { Calculator* temp = new Manhattan(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "structpearson") { Calculator* temp = new StructPearson(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "soergel") { Calculator* temp = new Soergel(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "spearman") { Calculator* temp = new Spearman(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + + }else if (Estimators[i] == "structkulczynski") { Calculator* temp = new StructKulczynski(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "speciesprofile") { Calculator* temp = new SpeciesProfile(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "hamming") { Calculator* temp = new Hamming(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "structchi2") { Calculator* temp = new StructChi2(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "gower") { Calculator* temp = new Gower(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + + }else if (Estimators[i] == "memchi2") { Calculator* temp = new MemChi2(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "memchord") { Calculator* temp = new MemChord(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "memeuclidean") { Calculator* temp = new MemEuclidean(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "mempearson") { Calculator* temp = new MemPearson(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "sharedobserved") { Calculator* temp = new SharedSobs(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else if (Estimators[i] == "kulczynski") { Calculator* temp = new Kulczynski(); m->mothurOut(temp->getName() + ": "); temp->citation(); delete temp; + }else { m->mothurOut("[ERROR]: Missing else if for " + Estimators[i] + " in printCitations."); m->mothurOutEndLine(); } + }else { m->mothurOut(Estimators[i] + " is not a valid calculator, no citation will be given."); m->mothurOutEndLine(); } + } + + } + catch(exception& e) { + m->errorOut(e, "ValidCalculator", "printCitations"); + exit(1); + } +} /********************************************************************/ bool ValidCalculators::isValidCalculator(string parameter, string calculator) { diff --git a/validcalculator.h b/validcalculator.h index 6cdd4ae..59f6bb3 100644 --- a/validcalculator.h +++ b/validcalculator.h @@ -25,6 +25,7 @@ class ValidCalculators { bool isValidCalculator(string, string); void printCalc(string, ostream&); string printCalc(string); + void printCitations(vector); private: map single; @@ -41,6 +42,7 @@ class ValidCalculators { map boot; map distance; map::iterator it; + set allCalcs; void initialSingle(); void initialShared(); diff --git a/venncommand.cpp b/venncommand.cpp index fb0560b..cae0417 100644 --- a/venncommand.cpp +++ b/venncommand.cpp @@ -183,6 +183,11 @@ VennCommand::VennCommand(string option) { } } m->splitAtDash(calc, Estimators); + if (m->inUsersGroups("citation", Estimators)) { + ValidCalculators validCalc; validCalc.printCitations(Estimators); + //remove citation from list of calcs + for (int i = 0; i < Estimators.size(); i++) { if (Estimators[i] == "citation") { Estimators.erase(Estimators.begin()+i); break; } } + } string temp; temp = validParameter.validFile(parameters, "abund", false); if (temp == "not found") { temp = "10"; } diff --git a/whittaker.h b/whittaker.h index 7ffd0cc..3bbd94a 100644 --- a/whittaker.h +++ b/whittaker.h @@ -21,6 +21,7 @@ public: Whittaker() : Calculator("whittaker", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); + string getCitation() { return "http://www.mothur.org/wiki/Whittaker"; } }; -- 2.39.2