From 1b4aa03040e61f4c2d47ce32cb12726dcdadb917 Mon Sep 17 00:00:00 2001 From: westcott Date: Thu, 26 Aug 2010 15:18:13 +0000 Subject: [PATCH] added clearcut source to mothur, fixed mislabeled sharedcalcs --- Mothur.xcodeproj/project.pbxproj | 30 +++++----- clearcut.c => clearcut.cpp | 13 +++-- clearcut.h | 14 +++-- clearcutcommand.cpp | 91 ++++++++++++++++++++---------- cmdargs.c => cmdargs.cpp | 4 +- distclearcut.c => distclearcut.cpp | 2 +- dmat.c => dmat.cpp | 0 fasta.c => fasta.cpp | 0 getopt_long.c => getopt_long.cpp | 1 - mothur.cpp | 5 +- prng.c => prng.cpp | 0 screenseqscommand.cpp | 4 +- sharedace.h | 2 +- sharedchao1.h | 2 +- sharedjabund.h | 2 +- sharedjclass.h | 2 +- sharedjest.h | 2 +- sharedsorabund.h | 2 +- sharedsorclass.h | 2 +- sharedsorest.h | 2 +- sharedthetan.h | 2 +- summarysharedcommand.cpp | 1 + whittaker.h | 2 +- 23 files changed, 110 insertions(+), 75 deletions(-) rename clearcut.c => clearcut.cpp (99%) rename cmdargs.c => cmdargs.cpp (99%) rename distclearcut.c => distclearcut.cpp (99%) rename dmat.c => dmat.cpp (100%) rename fasta.c => fasta.cpp (100%) rename getopt_long.c => getopt_long.cpp (99%) rename prng.c => prng.cpp (100%) diff --git a/Mothur.xcodeproj/project.pbxproj b/Mothur.xcodeproj/project.pbxproj index ebe8a90..bdcb7e6 100644 --- a/Mothur.xcodeproj/project.pbxproj +++ b/Mothur.xcodeproj/project.pbxproj @@ -30,6 +30,7 @@ A7118EE611CFCAC000CFDE03 /* degapseqscommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = degapseqscommand.cpp; sourceTree = ""; }; A7118F0F11CFD5DC00CFDE03 /* getrelabundcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getrelabundcommand.h; sourceTree = ""; }; A7118F1011CFD5DC00CFDE03 /* getrelabundcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = getrelabundcommand.cpp; sourceTree = ""; }; + A71BA75F1225694E00C57506 /* clearcut.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = clearcut.cpp; sourceTree = ""; }; A71D924211AEB42400D00CBC /* clustersplitcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = clustersplitcommand.cpp; sourceTree = ""; }; A71D924311AEB42400D00CBC /* clustersplitcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = clustersplitcommand.h; sourceTree = ""; }; A71D924411AEB42400D00CBC /* splitabundcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = splitabundcommand.cpp; sourceTree = ""; }; @@ -466,21 +467,20 @@ A7DA217A113FECD400BF472F /* weighted.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = weighted.h; sourceTree = ""; }; A7DA217B113FECD400BF472F /* whittaker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = whittaker.cpp; sourceTree = ""; }; A7DA217C113FECD400BF472F /* whittaker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = whittaker.h; sourceTree = ""; }; - A7DF0AD3121EBB14004A03EA /* clearcut.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = clearcut.c; sourceTree = ""; }; A7DF0AD4121EBB14004A03EA /* clearcut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = clearcut.h; sourceTree = ""; }; - A7DF0AD5121EBB14004A03EA /* cmdargs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cmdargs.c; sourceTree = ""; }; + A7DF0AD5121EBB14004A03EA /* cmdargs.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = cmdargs.cpp; sourceTree = ""; }; A7DF0AD6121EBB14004A03EA /* cmdargs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cmdargs.h; sourceTree = ""; }; A7DF0AD7121EBB14004A03EA /* common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = common.h; sourceTree = ""; }; A7DF0AD8121EBB14004A03EA /* dayhoff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dayhoff.h; sourceTree = ""; }; - A7DF0AD9121EBB14004A03EA /* distclearcut.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = distclearcut.c; sourceTree = ""; }; + A7DF0AD9121EBB14004A03EA /* distclearcut.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = distclearcut.cpp; sourceTree = ""; }; A7DF0ADA121EBB14004A03EA /* distclearcut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = distclearcut.h; sourceTree = ""; }; - A7DF0ADB121EBB14004A03EA /* dmat.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = dmat.c; sourceTree = ""; }; + A7DF0ADB121EBB14004A03EA /* dmat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dmat.cpp; sourceTree = ""; }; A7DF0ADC121EBB14004A03EA /* dmat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dmat.h; sourceTree = ""; }; - A7DF0ADD121EBB14004A03EA /* fasta.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = fasta.c; sourceTree = ""; }; + A7DF0ADD121EBB14004A03EA /* fasta.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fasta.cpp; sourceTree = ""; }; A7DF0ADE121EBB14004A03EA /* fasta.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fasta.h; sourceTree = ""; }; - A7DF0ADF121EBB14004A03EA /* getopt_long.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = getopt_long.c; sourceTree = ""; }; + A7DF0ADF121EBB14004A03EA /* getopt_long.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = getopt_long.cpp; sourceTree = ""; }; A7DF0AE0121EBB14004A03EA /* getopt_long.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getopt_long.h; sourceTree = ""; }; - A7DF0AE1121EBB14004A03EA /* prng.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = prng.c; sourceTree = ""; }; + A7DF0AE1121EBB14004A03EA /* prng.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = prng.cpp; sourceTree = ""; }; A7DF0AE2121EBB14004A03EA /* prng.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = prng.h; sourceTree = ""; }; A7E8338B115BBDAA00739EC4 /* parsesffcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = parsesffcommand.cpp; sourceTree = ""; }; A7E8338C115BBDAA00739EC4 /* parsesffcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = parsesffcommand.h; sourceTree = ""; }; @@ -1008,21 +1008,21 @@ isa = PBXGroup; children = ( A7DF0AD4121EBB14004A03EA /* clearcut.h */, - A7DF0AD3121EBB14004A03EA /* clearcut.c */, - A7DF0AD6121EBB14004A03EA /* cmdargs.h */, + A71BA75F1225694E00C57506 /* clearcut.cpp */, A7DF0AD7121EBB14004A03EA /* common.h */, A7DF0AD8121EBB14004A03EA /* dayhoff.h */, - A7DF0AD5121EBB14004A03EA /* cmdargs.c */, - A7DF0AD9121EBB14004A03EA /* distclearcut.c */, + A7DF0AD6121EBB14004A03EA /* cmdargs.h */, + A7DF0AD5121EBB14004A03EA /* cmdargs.cpp */, + A7DF0AD9121EBB14004A03EA /* distclearcut.cpp */, A7DF0ADA121EBB14004A03EA /* distclearcut.h */, - A7DF0ADB121EBB14004A03EA /* dmat.c */, + A7DF0ADB121EBB14004A03EA /* dmat.cpp */, A7DF0ADC121EBB14004A03EA /* dmat.h */, - A7DF0ADD121EBB14004A03EA /* fasta.c */, + A7DF0ADD121EBB14004A03EA /* fasta.cpp */, A7DF0ADE121EBB14004A03EA /* fasta.h */, - A7DF0ADF121EBB14004A03EA /* getopt_long.c */, + A7DF0ADF121EBB14004A03EA /* getopt_long.cpp */, A7DF0AE0121EBB14004A03EA /* getopt_long.h */, A7DF0AE2121EBB14004A03EA /* prng.h */, - A7DF0AE1121EBB14004A03EA /* prng.c */, + A7DF0AE1121EBB14004A03EA /* prng.cpp */, ); name = clearcutsource; sourceTree = ""; diff --git a/clearcut.c b/clearcut.cpp similarity index 99% rename from clearcut.c rename to clearcut.cpp index 3a13ab6..b06aa5b 100644 --- a/clearcut.c +++ b/clearcut.cpp @@ -1,3 +1,4 @@ + /* * clearcut.c * @@ -58,7 +59,7 @@ #include #include -#include "dist.h" +#include "distclearcut.h" #include "dmat.h" #include "fasta.h" #include "cmdargs.h" @@ -67,16 +68,13 @@ #include "prng.h" - /* * main() - * * The entry point to the program. * */ -int -main(int argc, - char *argv[]) { +int clearcut_main(int argc, char *argv[]) { DMAT *dmat; /* The working distance matrix */ DMAT *dmat_backup = NULL;/* A backup distance matrix */ @@ -91,6 +89,7 @@ main(int argc, /* check and parse supplied command-line arguments */ nj_args = NJ_handle_args(argc, argv); + if(!nj_args) { fprintf(stderr, "Clearcut: Error processing command-line arguments.\n"); exit(-1); @@ -232,7 +231,7 @@ main(int argc, } } - exit(0); + //exit(0); } @@ -2156,3 +2155,5 @@ NJ_min_transform(DMAT *dmat, + + diff --git a/clearcut.h b/clearcut.h index 2710a8d..f3124e3 100644 --- a/clearcut.h +++ b/clearcut.h @@ -1,3 +1,6 @@ + + + /* * clearcut.h * @@ -47,10 +50,11 @@ #ifndef _INC_CLEARCUT_H_ #define _INC_CLEARCUT_H_ 1 +extern "C" { + #include "common.h" #include "cmdargs.h" - #define NJ_VERSION "1.0.9" @@ -180,11 +184,8 @@ typedef struct _STRUCT_NJ_VERTEX { } NJ_VERTEX; - - - - /* some function prototypes */ +int clearcut_main(int, char**); /* core function for performing Relaxed Neighbor Joining */ NJ_TREE * @@ -272,6 +273,8 @@ NJ_min_transform(DMAT *dmat, long int *ret_i, long int *ret_j); +} + #endif /* _INC_CLEARCUT_H_ */ @@ -279,3 +282,4 @@ NJ_min_transform(DMAT *dmat, + diff --git a/clearcutcommand.cpp b/clearcutcommand.cpp index d6c284d..7d0d539 100644 --- a/clearcutcommand.cpp +++ b/clearcutcommand.cpp @@ -8,6 +8,8 @@ */ #include "clearcutcommand.h" +#include "clearcut.h" + /**************************************************************************************/ ClearcutCommand::ClearcutCommand(string option) { @@ -177,52 +179,81 @@ int ClearcutCommand::execute() { //prepare filename string outputName = outputDir + m->getRootName(m->getSimpleName(inputFile)) + "tre"; - //get location of clearcut - GlobalData* globaldata = GlobalData::getInstance(); - string path = globaldata->argv; - path = path.substr(0, (path.find_last_of('m'))); + vector cPara; - string clearcutCommand = path + "clearcut "; + char* tempClearcut = new char[8]; strcpy(tempClearcut, "clearcut"); cPara.push_back(tempClearcut); //you gave us a distance matrix - if (phylipfile != "") { clearcutCommand += "--distance "; } + if (phylipfile != "") { char* temp = new char[10]; strcpy(temp, "--distance"); cPara.push_back(temp); } //you gave us a fastafile - if (fastafile != "") { clearcutCommand += "--alignment "; } + if (fastafile != "") { char* temp = new char[11]; strcpy(temp, "--alignment"); cPara.push_back(temp); } - if (version) { clearcutCommand += "--version "; } - if (verbose) { clearcutCommand += "--verbose "; } - if (quiet) { clearcutCommand += "--quiet "; } - if (seed != "*") { clearcutCommand += "--seed=" + seed + " "; } - if (norandom) { clearcutCommand += "--norandom "; } - if (shuffle) { clearcutCommand += "--shuffle "; } - if (neighbor) { clearcutCommand += "--neighbor "; } + if (version) { char* temp = new char[9]; strcpy(temp, "--version"); cPara.push_back(temp); } + if (verbose) { char* temp = new char[9]; strcpy(temp, "--verbose"); cPara.push_back(temp); } + if (quiet) { char* temp = new char[7]; strcpy(temp, "--quiet"); cPara.push_back(temp); } + if (seed != "*") { + string tempSeed = "--seed=" + seed; + char* temp = new char[tempSeed.length()]; + strcpy(temp, tempSeed.c_str()); + cPara.push_back(temp); + } + if (norandom) { char* temp = new char[10]; strcpy(temp, "--norandom"); cPara.push_back(temp); } + if (shuffle) { char* temp = new char[9]; strcpy(temp, "--shuffle"); cPara.push_back(temp); } + if (neighbor) { char* temp = new char[10]; strcpy(temp, "--neighbor"); cPara.push_back(temp); } + string tempIn = ""; #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) - clearcutCommand += "--in=" + inputFile + " "; + tempIn += "--in=" + inputFile; #else - clearcutCommand += "--in=\"" + inputFile + "\" "; + tempIn += "--in=\"" + inputFile + "\""; #endif - if (stdoutWanted) { clearcutCommand += "--stdout "; } + char* tempI = new char[tempIn.length()]; + strcpy(tempI, tempIn.c_str()); + cPara.push_back(tempI); + + if (stdoutWanted) { char* temp = new char[8]; strcpy(temp, "--stdout"); cPara.push_back(temp); } else{ + string tempOut = ""; #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) - clearcutCommand += "--out=" + outputName + " "; } + tempOut += "--out=" + outputName; #else - clearcutCommand += "--out=\"" + outputName + "\" "; } + tempOut += "--out=\"" + outputName + "\""; #endif + + char* temp = new char[tempOut.length()]; + strcpy(temp, tempOut.c_str()); + cPara.push_back(temp); + } + + if (DNA) { char* temp = new char[5]; strcpy(temp, "--DNA"); cPara.push_back(temp); } + if (protein) { char* temp = new char[9]; strcpy(temp, "--protein"); cPara.push_back(temp); } + if (jukes) { char* temp = new char[7]; strcpy(temp, "--jukes"); cPara.push_back(temp); } + if (kimura) { char* temp = new char[8]; strcpy(temp, "--kimura"); cPara.push_back(temp); } + if (matrixout != "") { + string tempMatrix = "--matrixout=" + matrixout; + char* temp = new char[tempMatrix.length()]; + strcpy(temp, tempMatrix.c_str()); + cPara.push_back(temp); + } + + if (ntrees != "1") { + string tempNtrees = "--ntrees=" + ntrees; + char* temp = new char[tempNtrees.length()]; + strcpy(temp, tempNtrees.c_str()); + cPara.push_back(temp); + } + + if (expblen) { char* temp = new char[9]; strcpy(temp, "--expblen"); cPara.push_back(temp); } + if (expdist) { char* temp = new char[9]; strcpy(temp, "--expdist"); cPara.push_back(temp); } + + char** clearcutParameters; + clearcutParameters = new char*[cPara.size()]; + for (int i = 0; i < cPara.size(); i++) { clearcutParameters[i] = cPara[i]; } + int numArgs = cPara.size(); - if (DNA) { clearcutCommand += "--DNA "; } - if (protein) { clearcutCommand += "--protein "; } - if (jukes) { clearcutCommand += "--jukes "; } - if (kimura) { clearcutCommand += "--kimura "; } - if (matrixout != "") { clearcutCommand += "--matrixout=" + matrixout + " "; } - if (ntrees != "1") { clearcutCommand += "--ntrees=" + ntrees + " "; } - if (expblen) { clearcutCommand += "--expblen "; } - if (expdist) { clearcutCommand += "--expdist "; } - - //run clearcut - system(clearcutCommand.c_str()); + clearcut_main(numArgs, clearcutParameters); if (!stdoutWanted) { m->mothurOutEndLine(); diff --git a/cmdargs.c b/cmdargs.cpp similarity index 99% rename from cmdargs.c rename to cmdargs.cpp index 156b1da..416ced8 100644 --- a/cmdargs.c +++ b/cmdargs.cpp @@ -130,12 +130,12 @@ NJ_handle_args(int argc, nj_args.expdist = 0; while(1) { + c = getopt_long(argc, argv, "i:o:s:m:n:vqduahVSIOrDPjkNeE", NJ_long_options, &option_index); - if(c == -1) { break; } @@ -247,7 +247,7 @@ NJ_handle_args(int argc, exit(-1); } } - + if(optind < argc) { fprintf(stderr, "Clearcut: Unknown command-line argument:\n --> %s\n", argv[optind]); NJ_usage(); diff --git a/distclearcut.c b/distclearcut.cpp similarity index 99% rename from distclearcut.c rename to distclearcut.cpp index b688aa6..a4ac777 100644 --- a/distclearcut.c +++ b/distclearcut.cpp @@ -57,7 +57,7 @@ #include "common.h" #include "dayhoff.h" #include "fasta.h" -#include "dist.h" +#include "distclearcut.h" diff --git a/dmat.c b/dmat.cpp similarity index 100% rename from dmat.c rename to dmat.cpp diff --git a/fasta.c b/fasta.cpp similarity index 100% rename from fasta.c rename to fasta.cpp diff --git a/getopt_long.c b/getopt_long.cpp similarity index 99% rename from getopt_long.c rename to getopt_long.cpp index 1756a2e..c113881 100644 --- a/getopt_long.c +++ b/getopt_long.cpp @@ -310,7 +310,6 @@ getopt_long(int argc, char **argv, puts_argv(&argv[optind]); */ opt = argv[optind]; - if (shortoptind == 0 && is_option(opt) == 1) { shortoptind++; } diff --git a/mothur.cpp b/mothur.cpp index 18d8d43..9ed0dfc 100644 --- a/mothur.cpp +++ b/mothur.cpp @@ -35,8 +35,7 @@ void ctrlc_handler ( int sig ) { /***********************************************************************/ int main(int argc, char *argv[]){ MothurOut* m = MothurOut::getInstance(); - try { - + try { signal(SIGINT, ctrlc_handler ); time_t ltime = time(NULL); /* calendar time */ @@ -150,7 +149,7 @@ int main(int argc, char *argv[]){ Engine* mothur; bool bail = 0; string input; - + if(argc>1){ input = argv[1]; diff --git a/prng.c b/prng.cpp similarity index 100% rename from prng.c rename to prng.cpp diff --git a/screenseqscommand.cpp b/screenseqscommand.cpp index d98a4cf..1b3cc93 100644 --- a/screenseqscommand.cpp +++ b/screenseqscommand.cpp @@ -421,7 +421,7 @@ int ScreenSeqsCommand::screenNameGroupFile(set badSeqNames){ outputNames.push_back(goodNameFile); ofstream goodNameOut; m->openOutputFile(goodNameFile, goodNameOut); - + while(!inputNames.eof()){ if (m->control_pressed) { goodNameOut.close(); inputNames.close(); remove(goodNameFile.c_str()); return 0; } @@ -449,7 +449,7 @@ int ScreenSeqsCommand::screenNameGroupFile(set badSeqNames){ } inputNames.close(); goodNameOut.close(); - + //we were unable to remove some of the bad sequences if (badSeqNames.size() != 0) { for (it = badSeqNames.begin(); it != badSeqNames.end(); it++) { diff --git a/sharedace.h b/sharedace.h index d8f69e1..94fa006 100644 --- a/sharedace.h +++ b/sharedace.h @@ -19,7 +19,7 @@ It is a child of the calculator class. */ class SharedAce : public Calculator { public: - SharedAce(int n=10) : abund(n), Calculator("sharedace", 3, false) {}; + SharedAce(int n=10) : abund(n), Calculator("sharedace", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); private: diff --git a/sharedchao1.h b/sharedchao1.h index 243039e..e802cc3 100644 --- a/sharedchao1.h +++ b/sharedchao1.h @@ -21,7 +21,7 @@ It is a child of the calculator class. */ class SharedChao1 : public Calculator { public: - SharedChao1() : Calculator("sharedchao", 3, true) {}; + SharedChao1() : Calculator("sharedchao", 1, true) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); private: diff --git a/sharedjabund.h b/sharedjabund.h index a5fab2f..1bd4198 100644 --- a/sharedjabund.h +++ b/sharedjabund.h @@ -20,7 +20,7 @@ It is a child of the calculator class. */ class JAbund : public Calculator { public: - JAbund() : Calculator("jabund", 3, false) {}; + JAbund() : Calculator("jabund", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); private: diff --git a/sharedjclass.h b/sharedjclass.h index d18dfee..59aea19 100644 --- a/sharedjclass.h +++ b/sharedjclass.h @@ -19,7 +19,7 @@ It is a child of the calculator class. */ class Jclass : public Calculator { public: - Jclass() : Calculator("jclass", 3, false) {}; + Jclass() : Calculator("jclass", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); private: diff --git a/sharedjest.h b/sharedjest.h index 8eaf70f..c4111bc 100644 --- a/sharedjest.h +++ b/sharedjest.h @@ -20,7 +20,7 @@ It is a child of the calculator class. */ class Jest : public Calculator { public: - Jest() : Calculator("jest", 3, false) {}; + Jest() : Calculator("jest", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); private: diff --git a/sharedsorabund.h b/sharedsorabund.h index 0dbf4a4..7ec112e 100644 --- a/sharedsorabund.h +++ b/sharedsorabund.h @@ -20,7 +20,7 @@ It is a child of the calculator class. */ class SorAbund : public Calculator { public: - SorAbund() : Calculator("sorabund", 3, false) {}; + SorAbund() : Calculator("sorabund", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); private: diff --git a/sharedsorclass.h b/sharedsorclass.h index 75df657..dc6f14c 100644 --- a/sharedsorclass.h +++ b/sharedsorclass.h @@ -20,7 +20,7 @@ It is a child of the calculator class. */ class SorClass : public Calculator { public: - SorClass() : Calculator("sorclass", 3, false) {}; + SorClass() : Calculator("sorclass", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); private: diff --git a/sharedsorest.h b/sharedsorest.h index 8e044aa..94bcc32 100644 --- a/sharedsorest.h +++ b/sharedsorest.h @@ -20,7 +20,7 @@ It is a child of the calculator class. */ class SorEst : public Calculator { public: - SorEst() : Calculator("sorest", 3, false) {}; + SorEst() : Calculator("sorest", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); private: diff --git a/sharedthetan.h b/sharedthetan.h index 4637b97..b3693d6 100644 --- a/sharedthetan.h +++ b/sharedthetan.h @@ -20,7 +20,7 @@ It is a child of the calculator class. */ class ThetaN : public Calculator { public: - ThetaN() : Calculator("thetan", 3, false) {}; + ThetaN() : Calculator("thetan", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); private: diff --git a/summarysharedcommand.cpp b/summarysharedcommand.cpp index cda2ef0..1046c1b 100644 --- a/summarysharedcommand.cpp +++ b/summarysharedcommand.cpp @@ -234,6 +234,7 @@ int SummarySharedCommand::execute(){ outputFileHandle << "label" <<'\t' << "comparison" << '\t'; for(int i=0;igetName(); + if (sumCalculators[i]->getCols() == 3) { outputFileHandle << "\tlci\thci"; } } outputFileHandle << endl; diff --git a/whittaker.h b/whittaker.h index 540dc0b..7ffd0cc 100644 --- a/whittaker.h +++ b/whittaker.h @@ -18,7 +18,7 @@ class Whittaker : public Calculator { public: - Whittaker() : Calculator("whittaker", 3, false) {}; + Whittaker() : Calculator("whittaker", 1, false) {}; EstOutput getValues(SAbundVector*) {return data;}; EstOutput getValues(vector); -- 2.39.2