From 1d898dc6edaf9e9f287fab53bf1f21fb29757a17 Mon Sep 17 00:00:00 2001 From: westcott Date: Wed, 6 Apr 2011 16:20:43 +0000 Subject: [PATCH] added getCommandInfoCommand for gui --- Mothur.xcodeproj/project.pbxproj | 6 + aligncommand.cpp | 36 ++--- amovacommand.cpp | 18 +-- anosimcommand.cpp | 2 +- binsequencecommand.cpp | 2 +- blastdb.cpp | 2 +- bstick.cpp | 2 +- chimerabellerophoncommand.cpp | 2 +- chimeraccodecommand.cpp | 4 +- chimeracheckcommand.cpp | 2 +- chimerapintailcommand.cpp | 2 +- chimeraslayercommand.cpp | 2 +- chopseqscommand.cpp | 2 +- classifyotucommand.cpp | 2 +- classifyseqscommand.cpp | 2 +- clearcut.cpp | 4 +- clustercommand.cpp | 2 +- clusterdoturcommand.cpp | 2 +- clusterfragmentscommand.cpp | 2 +- collectcommand.cpp | 18 +-- collectcommand.h | 1 - collectsharedcommand.cpp | 2 +- commandfactory.cpp | 41 ++--- commandfactory.hpp | 3 +- consensuscommand.cpp | 2 +- consensusseqscommand.cpp | 2 +- corraxescommand.cpp | 2 +- degapseqscommand.cpp | 2 +- deuniqueseqscommand.cpp | 2 +- distancecommand.cpp | 2 +- filterseqscommand.cpp | 2 +- getcommandinfocommand.cpp | 257 +++++++++++++++++++++++++++++++ getcommandinfocommand.h | 50 ++++++ getgroupscommand.cpp | 2 +- getlineagecommand.cpp | 2 +- getlistcountcommand.cpp | 2 +- getoturepcommand.cpp | 2 +- getotuscommand.cpp | 2 +- getrabundcommand.cpp | 2 +- getrelabundcommand.cpp | 2 +- getsabundcommand.cpp | 2 +- getseqscommand.cpp | 2 +- getsharedotucommand.cpp | 2 +- hclustercommand.cpp | 2 +- heatmapcommand.cpp | 2 +- heatmapsimcommand.cpp | 12 +- heatmapsimcommand.h | 1 - homovacommand.cpp | 2 +- indicatorcommand.cpp | 2 +- libshuffcommand.cpp | 2 +- listseqscommand.cpp | 2 +- makefastqcommand.cpp | 2 +- makegroupcommand.cpp | 2 +- mantelcommand.cpp | 2 +- matrixoutputcommand.cpp | 17 +- matrixoutputcommand.h | 1 - mergefilecommand.cpp | 2 +- mergegroupscommand.cpp | 2 +- metastatscommand.cpp | 2 +- mgclustercommand.cpp | 4 +- nmdscommand.cpp | 2 +- nocommands.cpp | 2 +- normalizesharedcommand.cpp | 2 +- otuhierarchycommand.cpp | 2 +- pairwiseseqscommand.cpp | 2 +- parselistscommand.cpp | 2 +- parsimonycommand.cpp | 2 +- pcacommand.cpp | 2 +- pcoacommand.cpp | 4 +- phylodiversitycommand.cpp | 2 +- phylotypecommand.cpp | 2 +- pipelinepdscommand.cpp | 4 +- preclustercommand.cpp | 2 +- rarefactcommand.cpp | 2 +- rarefactsharedcommand.cpp | 2 +- removegroupscommand.cpp | 2 +- removelineagecommand.cpp | 2 +- removeotuscommand.cpp | 2 +- removerarecommand.cpp | 2 +- removeseqscommand.cpp | 2 +- screenseqscommand.cpp | 2 +- secondarystructurecommand.cpp | 2 +- sensspeccommand.cpp | 2 +- seqerrorcommand.cpp | 4 +- seqsummarycommand.cpp | 2 +- setdircommand.cpp | 6 +- setlogfilecommand.cpp | 2 +- sffinfocommand.cpp | 2 +- splitabundcommand.cpp | 2 +- splitgroupscommand.cpp | 2 +- subsamplecommand.cpp | 2 +- summarycommand.cpp | 2 +- summarysharedcommand.cpp | 2 +- treegroupscommand.cpp | 2 +- trimflowscommand.cpp | 2 +- trimseqscommand.cpp | 4 +- unifracunweightedcommand.cpp | 2 +- unifracweightedcommand.cpp | 2 +- venncommand.cpp | 2 +- 99 files changed, 479 insertions(+), 172 deletions(-) create mode 100644 getcommandinfocommand.cpp create mode 100644 getcommandinfocommand.h diff --git a/Mothur.xcodeproj/project.pbxproj b/Mothur.xcodeproj/project.pbxproj index 582beaf..00f51b2 100644 --- a/Mothur.xcodeproj/project.pbxproj +++ b/Mothur.xcodeproj/project.pbxproj @@ -16,6 +16,7 @@ A71FE12C12EDF72400963CA7 /* mergegroupscommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A71FE12B12EDF72400963CA7 /* mergegroupscommand.cpp */; }; A727864412E9E28C00F86ABA /* removerarecommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A727864312E9E28C00F86ABA /* removerarecommand.cpp */; }; A75790591301749D00A30DAB /* homovacommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A75790581301749D00A30DAB /* homovacommand.cpp */; }; + A778FE6B134CA6CA00C0BA33 /* getcommandinfocommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A778FE6A134CA6CA00C0BA33 /* getcommandinfocommand.cpp */; }; A799F5B91309A3E000AEEFA0 /* makefastqcommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A799F5B81309A3E000AEEFA0 /* makefastqcommand.cpp */; }; A7A61F2D130062E000E05B6B /* amovacommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7A61F2C130062E000E05B6B /* amovacommand.cpp */; }; A7E9B88112D37EC400DA6239 /* ace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7E9B64F12D37EC300DA6239 /* ace.cpp */; }; @@ -325,6 +326,8 @@ A727864312E9E28C00F86ABA /* removerarecommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = removerarecommand.cpp; sourceTree = ""; }; A75790571301749D00A30DAB /* homovacommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = homovacommand.h; sourceTree = ""; }; A75790581301749D00A30DAB /* homovacommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = homovacommand.cpp; sourceTree = ""; }; + A778FE69134CA6CA00C0BA33 /* getcommandinfocommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getcommandinfocommand.h; sourceTree = ""; }; + A778FE6A134CA6CA00C0BA33 /* getcommandinfocommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = getcommandinfocommand.cpp; sourceTree = ""; }; A799F5B71309A3E000AEEFA0 /* makefastqcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = makefastqcommand.h; sourceTree = ""; }; A799F5B81309A3E000AEEFA0 /* makefastqcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = makefastqcommand.cpp; sourceTree = ""; }; A7A61F1A130035C800E05B6B /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = ""; }; @@ -1099,6 +1102,8 @@ A7E9B6CB12D37EC400DA6239 /* distancecommand.cpp */, A7E9B6E412D37EC400DA6239 /* filterseqscommand.h */, A7E9B6E312D37EC400DA6239 /* filterseqscommand.cpp */, + A778FE69134CA6CA00C0BA33 /* getcommandinfocommand.h */, + A778FE6A134CA6CA00C0BA33 /* getcommandinfocommand.cpp */, A7FE7C3E1330EA1000F7B327 /* getcurrentcommand.h */, A7FE7C3F1330EA1000F7B327 /* getcurrentcommand.cpp */, A7E9B6F312D37EC400DA6239 /* getgroupcommand.h */, @@ -1943,6 +1948,7 @@ A71CB160130B04A2001E7287 /* anosimcommand.cpp in Sources */, A7FE7C401330EA1000F7B327 /* getcurrentcommand.cpp in Sources */, A7FE7E6D13311EA400F7B327 /* setcurrentcommand.cpp in Sources */, + A778FE6B134CA6CA00C0BA33 /* getcommandinfocommand.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/aligncommand.cpp b/aligncommand.cpp index 5f64411..60a1dc2 100644 --- a/aligncommand.cpp +++ b/aligncommand.cpp @@ -56,24 +56,24 @@ vector AlignCommand::setParameters(){ string AlignCommand::getHelpString(){ try { string helpString = ""; - helpString += "The align.seqs command reads a file containing sequences and creates an alignment file and a report file.\n"; - helpString += "The align.seqs command parameters are reference, fasta, search, ksize, align, match, mismatch, gapopen, gapextend and processors.\n"; - helpString += "The reference and fasta parameters are required. You may leave fasta blank if you have a valid fasta file. You may enter multiple fasta files by separating their names with dashes. ie. fasta=abrecovery.fasta-amzon.fasta \n"; - helpString += "The search parameter allows you to specify the method to find most similar template. Your options are: suffix, kmer and blast. The default is kmer.\n"; - helpString += "The align parameter allows you to specify the alignment method to use. Your options are: gotoh, needleman, blast and noalign. The default is needleman.\n"; - helpString += "The ksize parameter allows you to specify the kmer size for finding most similar template to candidate. The default is 8.\n"; - helpString += "The match parameter allows you to specify the bonus for having the same base. The default is 1.0.\n"; - helpString += "The mistmatch parameter allows you to specify the penalty for having different bases. The default is -1.0.\n"; - helpString += "The gapopen parameter allows you to specify the penalty for opening a gap in an alignment. The default is -2.0.\n"; - helpString += "The gapextend parameter allows you to specify the penalty for extending a gap in an alignment. The default is -1.0.\n"; - helpString += "The flip parameter is used to specify whether or not you want mothur to try the reverse complement if a sequence falls below the threshold. The default is false.\n"; - helpString += "The threshold is used to specify a cutoff at which an alignment is deemed 'bad' and the reverse complement may be tried. The default threshold is 0.50, meaning 50% of the bases are removed in the alignment.\n"; - helpString += "If the flip parameter is set to true the reverse complement of the sequence is aligned and the better alignment is reported.\n"; - helpString += "The default for the threshold parameter is 0.50, meaning at least 50% of the bases must remain or the sequence is reported as potentially reversed.\n"; - helpString += "The align.seqs command should be in the following format: \n"; - helpString += "align.seqs(reference=yourTemplateFile, fasta=yourCandidateFile, align=yourAlignmentMethod, search=yourSearchmethod, ksize=yourKmerSize, match=yourMatchBonus, mismatch=yourMismatchpenalty, gapopen=yourGapopenPenalty, gapextend=yourGapExtendPenalty) \n"; - helpString += "Example align.seqs(candidate=candidate.fasta, template=core.filtered, align=kmer, search=gotoh, ksize=8, match=2.0, mismatch=3.0, gapopen=-2.0, gapextend=-1.0)\n"; - helpString += "Note: No spaces between parameter labels (i.e. candidate), '=' and parameters (i.e.yourFastaFile).\n\n"; + helpString += "The align.seqs command reads a file containing sequences and creates an alignment file and a report file."; + helpString += "The align.seqs command parameters are reference, fasta, search, ksize, align, match, mismatch, gapopen, gapextend and processors."; + helpString += "The reference and fasta parameters are required. You may leave fasta blank if you have a valid fasta file. You may enter multiple fasta files by separating their names with dashes. ie. fasta=abrecovery.fasta-amzon.fasta."; + helpString += "The search parameter allows you to specify the method to find most similar template. Your options are: suffix, kmer and blast. The default is kmer."; + helpString += "The align parameter allows you to specify the alignment method to use. Your options are: gotoh, needleman, blast and noalign. The default is needleman."; + helpString += "The ksize parameter allows you to specify the kmer size for finding most similar template to candidate. The default is 8."; + helpString += "The match parameter allows you to specify the bonus for having the same base. The default is 1.0."; + helpString += "The mistmatch parameter allows you to specify the penalty for having different bases. The default is -1.0."; + helpString += "The gapopen parameter allows you to specify the penalty for opening a gap in an alignment. The default is -2.0."; + helpString += "The gapextend parameter allows you to specify the penalty for extending a gap in an alignment. The default is -1.0."; + helpString += "The flip parameter is used to specify whether or not you want mothur to try the reverse complement if a sequence falls below the threshold. The default is false."; + helpString += "The threshold is used to specify a cutoff at which an alignment is deemed 'bad' and the reverse complement may be tried. The default threshold is 0.50, meaning 50% of the bases are removed in the alignment."; + helpString += "If the flip parameter is set to true the reverse complement of the sequence is aligned and the better alignment is reported."; + helpString += "The default for the threshold parameter is 0.50, meaning at least 50% of the bases must remain or the sequence is reported as potentially reversed."; + helpString += "The align.seqs command should be in the following format:"; + helpString += "align.seqs(reference=yourTemplateFile, fasta=yourCandidateFile, align=yourAlignmentMethod, search=yourSearchmethod, ksize=yourKmerSize, match=yourMatchBonus, mismatch=yourMismatchpenalty, gapopen=yourGapopenPenalty, gapextend=yourGapExtendPenalty)"; + helpString += "Example align.seqs(candidate=candidate.fasta, template=core.filtered, align=kmer, search=gotoh, ksize=8, match=2.0, mismatch=3.0, gapopen=-2.0, gapextend=-1.0)"; + helpString += "Note: No spaces between parameter labels (i.e. candidate), '=' and parameters (i.e.yourFastaFile)."; return helpString; } catch(exception& e) { diff --git a/amovacommand.cpp b/amovacommand.cpp index 8e3edd5..af867de 100644 --- a/amovacommand.cpp +++ b/amovacommand.cpp @@ -35,14 +35,14 @@ vector AmovaCommand::setParameters(){ string AmovaCommand::getHelpString(){ try { string helpString = ""; - helpString += "Referenced: Anderson MJ (2001). A new method for non-parametric multivariate analysis of variance. Austral Ecol 26: 32-46.\n"; - helpString += "The amova command outputs a .amova file. \n"; - helpString += "The amova command parameters are phylip, iters, and alpha. The phylip and design parameters are required, unless you have valid current files.\n"; - helpString += "The design parameter allows you to assign your samples to groups when you are running amova. It is required. \n"; - helpString += "The design file looks like the group file. It is a 2 column tab delimited file, where the first column is the sample name and the second column is the group the sample belongs to.\n"; - helpString += "The iters parameter allows you to set number of randomization for the P value. The default is 1000. \n"; - helpString += "The amova command should be in the following format: amova(phylip=file.dist, design=file.design).\n"; - helpString += "Note: No spaces between parameter labels (i.e. iters), '=' and parameters (i.e. 1000).\n\n"; + helpString += "Referenced: Anderson MJ (2001). A new method for non-parametric multivariate analysis of variance. Austral Ecol 26: 32-46."; + helpString += "The amova command outputs a .amova file."; + helpString += "The amova command parameters are phylip, iters, and alpha. The phylip and design parameters are required, unless you have valid current files."; + helpString += "The design parameter allows you to assign your samples to groups when you are running amova. It is required."; + helpString += "The design file looks like the group file. It is a 2 column tab delimited file, where the first column is the sample name and the second column is the group the sample belongs to."; + helpString += "The iters parameter allows you to set number of randomization for the P value. The default is 1000."; + helpString += "The amova command should be in the following format: amova(phylip=file.dist, design=file.design)."; + helpString += "Note: No spaces between parameter labels (i.e. iters), '=' and parameters (i.e. 1000)."; return helpString; } catch(exception& e) { @@ -282,7 +282,7 @@ double AmovaCommand::runAMOVA(ofstream& AMOVAFile, map > gro m->mothurOut("df\t" + toString(dfAmong) + '\t' + toString(dfWithin) + '\t' + toString(dfTotal) + '\n'); AMOVAFile << "MS\t" << MSAmong << '\t' << MSWithin << endl << endl; - m->mothurOut("MS\t" + toString(MSAmong) + '\t' + toString(MSWithin) + "\n\n"); + m->mothurOut("MS\t" + toString(MSAmong) + '\t' + toString(MSWithin) + "\n"); AMOVAFile << "Fs:\t" << Fs << endl; m->mothurOut("Fs:\t" + toString(Fs) + '\n'); diff --git a/anosimcommand.cpp b/anosimcommand.cpp index 623b433..2ee691e 100644 --- a/anosimcommand.cpp +++ b/anosimcommand.cpp @@ -41,7 +41,7 @@ string AnosimCommand::getHelpString(){ helpString += "The design file looks like the group file. It is a 2 column tab delimited file, where the first column is the sample name and the second column is the group the sample belongs to.\n"; helpString += "The iters parameter allows you to set number of randomization for the P value. The default is 1000. \n"; helpString += "The anosim command should be in the following format: anosim(phylip=file.dist, design=file.design).\n"; - helpString += "Note: No spaces between parameter labels (i.e. iters), '=' and parameters (i.e. 1000).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. iters), '=' and parameters (i.e. 1000).\n"; return helpString; } catch(exception& e) { diff --git a/binsequencecommand.cpp b/binsequencecommand.cpp index d1764ac..3f9378f 100644 --- a/binsequencecommand.cpp +++ b/binsequencecommand.cpp @@ -41,7 +41,7 @@ string BinSeqCommand::getHelpString(){ helpString += "The default value for label is all lines in your inputfile.\n"; helpString += "The bin.seqs command outputs a .fasta file for each distance you specify appending the OTU number to each name.\n"; helpString += "If you provide a groupfile, then it also appends the sequences group to the name.\n"; - helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFastaFile).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFastaFile).\n"; return helpString; } catch(exception& e) { diff --git a/blastdb.cpp b/blastdb.cpp index 7769555..6cfa3c6 100644 --- a/blastdb.cpp +++ b/blastdb.cpp @@ -150,7 +150,7 @@ vector BlastDB::findClosestMegaBlast(Sequence* seq, int n) { m8FileHandle.close(); remove((queryFileName+seq->getName()).c_str()); remove((blastFileName+seq->getName()).c_str()); -//cout << "\n\n" ; +//cout << "\n" ; return topMatches; } catch(exception& e) { diff --git a/bstick.cpp b/bstick.cpp index 9c36cd9..67507a9 100644 --- a/bstick.cpp +++ b/bstick.cpp @@ -68,7 +68,7 @@ EstOutput BStick::getValues(SAbundVector* rank){ data[2] = 1.031/sqrt(rdata.size()); /*m->mothurOut(critVal); m->mothurOutEndLine(); - m->mothurOut("If D-Statistic is less than the critical value then the data fits the Broken Stick model w/ 95% confidence.\n\n");*/ + m->mothurOut("If D-Statistic is less than the critical value then the data fits the Broken Stick model w/ 95% confidence.\n");*/ if (isnan(data[0]) || isinf(data[0])) { data[0] = 0; } diff --git a/chimerabellerophoncommand.cpp b/chimerabellerophoncommand.cpp index cc0aa43..db0a04c 100644 --- a/chimerabellerophoncommand.cpp +++ b/chimerabellerophoncommand.cpp @@ -48,7 +48,7 @@ string ChimeraBellerophonCommand::getHelpString(){ helpString += "The increment parameter allows you to specify how far you move each window while finding chimeric sequences, default is 25.\n"; helpString += "chimera.bellerophon(fasta=yourFastaFile, filter=yourFilter, correction=yourCorrection, processors=yourProcessors) \n"; helpString += "Example: chimera.bellerophon(fasta=AD.align, filter=True, correction=true, window=200) \n"; - helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFastaFile).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFastaFile).\n"; return helpString; } catch(exception& e) { diff --git a/chimeraccodecommand.cpp b/chimeraccodecommand.cpp index 0b6117a..2586e28 100644 --- a/chimeraccodecommand.cpp +++ b/chimeraccodecommand.cpp @@ -52,7 +52,7 @@ string ChimeraCcodeCommand::getHelpString(){ helpString += "The chimera.ccode command should be in the following format: \n"; helpString += "chimera.ccode(fasta=yourFastaFile, reference=yourTemplate) \n"; helpString += "Example: chimera.ccode(fasta=AD.align, reference=core_set_aligned.imputed.fasta) \n"; - helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFastaFile).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFastaFile).\n"; return helpString; } catch(exception& e) { @@ -287,7 +287,7 @@ int ChimeraCcodeCommand::execute(){ if (m->control_pressed) { MPI_File_close(&inMPI); MPI_File_close(&outMPI); MPI_File_close(&outMPIAccnos); for (int j = 0; j < outputNames.size(); j++) { remove(outputNames[j].c_str()); } outputTypes.clear(); delete chimera; return 0; } if (pid == 0) { //you are the root process - string outTemp = "For full window mapping info refer to " + mapInfo + "\n\n"; + string outTemp = "For full window mapping info refer to " + mapInfo + "\n"; //print header int length = outTemp.length(); diff --git a/chimeracheckcommand.cpp b/chimeracheckcommand.cpp index 5a72afd..067babd 100644 --- a/chimeracheckcommand.cpp +++ b/chimeracheckcommand.cpp @@ -53,7 +53,7 @@ string ChimeraCheckCommand::getHelpString(){ helpString += "The chimera.check command should be in the following format: \n"; helpString += "chimera.check(fasta=yourFastaFile, reference=yourTemplateFile, processors=yourProcessors, ksize=yourKmerSize) \n"; helpString += "Example: chimera.check(fasta=AD.fasta, reference=core_set_aligned,imputed.fasta, processors=4, ksize=8) \n"; - helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFastaFile).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFastaFile).\n"; return helpString; } catch(exception& e) { diff --git a/chimerapintailcommand.cpp b/chimerapintailcommand.cpp index 2b6ed03..f861554 100644 --- a/chimerapintailcommand.cpp +++ b/chimerapintailcommand.cpp @@ -57,7 +57,7 @@ string ChimeraPintailCommand::getHelpString(){ helpString += "The chimera.pintail command should be in the following format: \n"; helpString += "chimera.pintail(fasta=yourFastaFile, reference=yourTemplate) \n"; helpString += "Example: chimera.pintail(fasta=AD.align, reference=silva.bacteria.fasta) \n"; - helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFastaFile).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFastaFile).\n"; return helpString; } catch(exception& e) { diff --git a/chimeraslayercommand.cpp b/chimeraslayercommand.cpp index 1556cb2..15bf954 100644 --- a/chimeraslayercommand.cpp +++ b/chimeraslayercommand.cpp @@ -84,7 +84,7 @@ string ChimeraSlayerCommand::getHelpString(){ helpString += "The chimera.slayer command should be in the following format: \n"; helpString += "chimera.slayer(fasta=yourFastaFile, reference=yourTemplate, search=yourSearch) \n"; helpString += "Example: chimera.slayer(fasta=AD.align, reference=core_set_aligned.imputed.fasta, search=kmer) \n"; - helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFastaFile).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFastaFile).\n"; return helpString; } catch(exception& e) { diff --git a/chopseqscommand.cpp b/chopseqscommand.cpp index 8775d95..cbc55ef 100644 --- a/chopseqscommand.cpp +++ b/chopseqscommand.cpp @@ -43,7 +43,7 @@ string ChopSeqsCommand::getHelpString(){ helpString += "The short parameter allows you to specify you want to keep sequences that are too short to chop, default=false.\n"; helpString += "For example, if you ran chop.seqs with numbases=200 and short=t, if a sequence had 100 bases mothur would keep the sequence rather than eliminate it.\n"; helpString += "Example chop.seqs(fasta=amazon.fasta, numbases=200, keep=front).\n"; - helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n"; return helpString; } catch(exception& e) { diff --git a/classifyotucommand.cpp b/classifyotucommand.cpp index a70be07..5ac7e2c 100644 --- a/classifyotucommand.cpp +++ b/classifyotucommand.cpp @@ -54,7 +54,7 @@ string ClassifyOtuCommand::getHelpString(){ helpString += "The probs parameter shuts off the outputting of the consensus confidence results. The default is true, meaning you want the confidence to be shown.\n"; helpString += "The classify.otu command should be in the following format: classify.otu(taxonomy=yourTaxonomyFile, list=yourListFile, name=yourNamesFile, label=yourLabels).\n"; helpString += "Example classify.otu(taxonomy=abrecovery.silva.full.taxonomy, list=abrecovery.fn.list, label=0.10).\n"; - helpString += "Note: No spaces between parameter labels (i.e. list), '=' and parameters (i.e.yourListFile).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. list), '=' and parameters (i.e.yourListFile).\n"; return helpString; } catch(exception& e) { diff --git a/classifyseqscommand.cpp b/classifyseqscommand.cpp index 6f8bc7e..1619656 100644 --- a/classifyseqscommand.cpp +++ b/classifyseqscommand.cpp @@ -76,7 +76,7 @@ string ClassifySeqsCommand::getHelpString(){ helpString += "Example classify.seqs(fasta=amazon.fasta, reference=core.filtered, method=knn, search=gotoh, ksize=8, processors=2)\n"; helpString += "The .taxonomy file consists of 2 columns: 1 = your sequence name, 2 = the taxonomy for your sequence. \n"; helpString += "The .tax.summary is a summary of the different taxonomies represented in your fasta file. \n"; - helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFastaFile).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFastaFile).\n"; return helpString; } catch(exception& e) { diff --git a/clearcut.cpp b/clearcut.cpp index a4bd450..5246838 100644 --- a/clearcut.cpp +++ b/clearcut.cpp @@ -1443,11 +1443,11 @@ NJ_print_distance_matrix(DMAT *dmat) { } } - printf("\n\n"); + printf("\n"); } } - printf("\n"); + printf("\n\n"); return; } diff --git a/clustercommand.cpp b/clustercommand.cpp index 9b0fcfd..2216467 100644 --- a/clustercommand.cpp +++ b/clustercommand.cpp @@ -44,7 +44,7 @@ string ClusterCommand::getHelpString(){ helpString += "The cluster command parameter options are phylip, column, name, method, cuttoff, hard, precision, sim, showabund and timing. Phylip or column and name are required, unless you have a valid current file.\n"; helpString += "The cluster command should be in the following format: \n"; helpString += "cluster(method=yourMethod, cutoff=yourCutoff, precision=yourPrecision) \n"; - helpString += "The acceptable cluster methods are furthest, nearest, average and weighted. If no method is provided then furthest is assumed.\n\n"; + helpString += "The acceptable cluster methods are furthest, nearest, average and weighted. If no method is provided then furthest is assumed.\n"; return helpString; } catch(exception& e) { diff --git a/clusterdoturcommand.cpp b/clusterdoturcommand.cpp index a9d3214..4471b35 100644 --- a/clusterdoturcommand.cpp +++ b/clusterdoturcommand.cpp @@ -40,7 +40,7 @@ string ClusterDoturCommand::getHelpString(){ helpString += "The cluster.classic command parameter options are phylip, name, method, cuttoff, hard, sim, precision. Phylip is required, unless you have a valid current file.\n"; helpString += "The cluster.classic command should be in the following format: \n"; helpString += "cluster.classic(phylip=yourDistanceMatrix, method=yourMethod, cutoff=yourCutoff, precision=yourPrecision) \n"; - helpString += "The acceptable cluster methods are furthest, nearest, weighted and average. If no method is provided then furthest is assumed.\n\n"; + helpString += "The acceptable cluster methods are furthest, nearest, weighted and average. If no method is provided then furthest is assumed.\n"; return helpString; } catch(exception& e) { diff --git a/clusterfragmentscommand.cpp b/clusterfragmentscommand.cpp index baea496..c51a96a 100644 --- a/clusterfragmentscommand.cpp +++ b/clusterfragmentscommand.cpp @@ -58,7 +58,7 @@ string ClusterFragmentsCommand::getHelpString(){ helpString += "The cluster.fragments command should be in the following format: \n"; helpString += "cluster.fragments(fasta=yourFastaFile, names=yourNamesFile) \n"; helpString += "Example cluster.fragments(fasta=amazon.fasta).\n"; - helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n"; return helpString; } catch(exception& e) { diff --git a/collectcommand.cpp b/collectcommand.cpp index adaff9b..5549fd1 100644 --- a/collectcommand.cpp +++ b/collectcommand.cpp @@ -63,15 +63,16 @@ vector CollectCommand::setParameters(){ string CollectCommand::getHelpString(){ try { string helpString = ""; + ValidCalculators validCalculator; helpString += "The collect.single command parameters are list, sabund, rabund, shared, label, freq, calc and abund. list, sabund, rabund or shared is required unless you have a valid current file. \n"; helpString += "The collect.single command should be in the following format: \n"; helpString += "The freq parameter is used indicate when to output your data, by default it is set to 100. But you can set it to a percentage of the number of sequence. For example freq=0.10, means 10%. \n"; helpString += "collect.single(label=yourLabel, iters=yourIters, freq=yourFreq, calc=yourEstimators).\n"; helpString += "Example collect(label=unique-.01-.03, iters=10000, freq=10, calc=sobs-chao-ace-jack).\n"; helpString += "The default values for freq is 100, and calc are sobs-chao-ace-jack-shannon-npshannon-simpson.\n"; - helpString += validCalculator->printCalc("single"); + helpString += validCalculator.printCalc("single"); helpString += "The label parameter is used to analyze specific labels in your input.\n"; - helpString += "Note: No spaces between parameter labels (i.e. freq), '=' and parameters (i.e.yourFreq).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. freq), '=' and parameters (i.e.yourFreq).\n"; return helpString; } catch(exception& e) { @@ -123,7 +124,7 @@ CollectCommand::CollectCommand(string option) { allLines = 1; //allow user to run help - if(option == "help") { validCalculator = new ValidCalculators(); help(); delete validCalculator; abort = true; } + if(option == "help") { help(); abort = true; } else { vector myArray = setParameters(); @@ -310,10 +311,10 @@ int CollectCommand::execute(){ m->mothurOutEndLine(); m->mothurOut("Processing group " + groups[p]); m->mothurOutEndLine(); m->mothurOutEndLine(); } - validCalculator = new ValidCalculators(); + ValidCalculators validCalculator; for (int i=0; iisValidCalculator("single", Estimators[i]) == true) { + if (validCalculator.isValidCalculator("single", Estimators[i]) == true) { if (Estimators[i] == "sobs") { cDisplays.push_back(new CollectDisplay(new Sobs(), new OneColumnFile(fileNameRoot+"sobs"))); outputNames.push_back(fileNameRoot+"sobs"); outputTypes["sobs"].push_back(fileNameRoot+"sobs"); @@ -409,7 +410,6 @@ int CollectCommand::execute(){ for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } outputTypes.clear(); delete input; delete order; - delete validCalculator; m->Groups.clear(); return 0; } @@ -422,7 +422,6 @@ int CollectCommand::execute(){ for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } outputTypes.clear(); delete input; delete order; - delete validCalculator; m->Groups.clear(); return 0; } @@ -471,7 +470,6 @@ int CollectCommand::execute(){ for(int i=0;iGroups.clear(); return 0; } @@ -504,8 +502,7 @@ int CollectCommand::execute(){ for(int i=0;iGroups.clear(); return 0; } @@ -515,7 +512,6 @@ int CollectCommand::execute(){ for(int i=0;icontrol_pressed) { for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } return 0; } diff --git a/collectcommand.h b/collectcommand.h index 1884d04..c531520 100644 --- a/collectcommand.h +++ b/collectcommand.h @@ -47,7 +47,6 @@ private: OrderVector* order; InputData* input; Collect* cCurve; - ValidCalculators* validCalculator; vector cDisplays; int abund, size; float freq; diff --git a/collectsharedcommand.cpp b/collectsharedcommand.cpp index 0fe4d0f..3a2875a 100644 --- a/collectsharedcommand.cpp +++ b/collectsharedcommand.cpp @@ -89,7 +89,7 @@ string CollectSharedCommand::getHelpString(){ helpString += "The all parameter is used to specify if you want the estimate of all your groups together. This estimate can only be made for sharedsobs and sharedchao calculators. The default is false.\n"; helpString += "If you use sharedchao and run into memory issues, set all to false. \n"; helpString += "The groups parameter allows you to specify which of the groups in your groupfile you would like analyzed. You must enter at least 2 valid groups.\n"; - helpString += "Note: No spaces between parameter labels (i.e. list), '=' and parameters (i.e.yourListfile).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. list), '=' and parameters (i.e.yourListfile).\n"; return helpString; } catch(exception& e) { diff --git a/commandfactory.cpp b/commandfactory.cpp index a04ee16..fbafe57 100644 --- a/commandfactory.cpp +++ b/commandfactory.cpp @@ -8,9 +8,9 @@ */ #include "command.hpp" -//#include "readdistcommand.h" -//#include "readtreecommand.h" -//#include "readotucommand.h" +#include "readdistcommand.h" +#include "readtreecommand.h" +#include "readotucommand.h" #include "clustercommand.h" #include "collectcommand.h" #include "collectsharedcommand.h" @@ -116,6 +116,7 @@ #include "getcurrentcommand.h" #include "setcurrentcommand.h" #include "sharedcommand.h" +#include "getcommandinfocommand.h" /*******************************************************/ @@ -148,9 +149,9 @@ CommandFactory::CommandFactory(){ append = false; //initialize list of valid commands - //commands["read.dist"] = "read.dist"; - //commands["read.otu"] = "read.otu"; - //commands["read.tree"] = "read.tree"; + commands["read.dist"] = "read.dist"; + commands["read.otu"] = "read.otu"; + commands["read.tree"] = "read.tree"; commands["make.shared"] = "make.shared"; commands["bin.seqs"] = "bin.seqs"; commands["get.oturep"] = "get.oturep"; @@ -236,6 +237,7 @@ CommandFactory::CommandFactory(){ commands["merge.groups"] = "merge.groups"; commands["get.current"] = "get.current"; commands["set.current"] = "set.current"; + commands["get.commandinfo"] = "get.commandinfo"; commands["pairwise.seqs"] = "MPIEnabled"; commands["pipeline.pds"] = "MPIEnabled"; commands["classify.seqs"] = "MPIEnabled"; @@ -297,10 +299,10 @@ Command* CommandFactory::getCommand(string commandName, string optionString){ else { optionString += "inputdir=" + inputDir; } } - //if(commandName == "read.dist") { command = new ReadDistCommand(optionString); } - //else if(commandName == "read.otu") { command = new ReadOtuCommand(optionString); } - //else if(commandName == "read.tree") { command = new ReadTreeCommand(optionString); } - if(commandName == "cluster") { command = new ClusterCommand(optionString); } + if(commandName == "read.dist") { command = new ReadDistCommand(optionString); } + else if(commandName == "read.otu") { command = new ReadOtuCommand(optionString); } + else if(commandName == "read.tree") { command = new ReadTreeCommand(optionString); } + else if(commandName == "cluster") { command = new ClusterCommand(optionString); } else if(commandName == "unique.seqs") { command = new DeconvoluteCommand(optionString); } else if(commandName == "parsimony") { command = new ParsimonyCommand(optionString); } else if(commandName == "help") { command = new HelpCommand(optionString); } @@ -403,6 +405,7 @@ Command* CommandFactory::getCommand(string commandName, string optionString){ else if(commandName == "set.current") { command = new SetCurrentCommand(optionString); } else if(commandName == "anosim") { command = new AnosimCommand(optionString); } else if(commandName == "make.shared") { command = new SharedCommand(optionString); } + else if(commandName == "get.commandinfo") { command = new GetCommandInfoCommand(optionString); } else { command = new NoCommand(optionString); } return command; @@ -432,10 +435,10 @@ Command* CommandFactory::getCommand(string commandName, string optionString, str else { optionString += "inputdir=" + inputDir; } } - //if(commandName == "read.dist") { pipecommand = new ReadDistCommand(optionString); } - //else if(commandName == "read.otu") { pipecommand = new ReadOtuCommand(optionString); } - //else if(commandName == "read.tree") { pipecommand = new ReadTreeCommand(optionString); } - if(commandName == "cluster") { pipecommand = new ClusterCommand(optionString); } + if(commandName == "read.dist") { pipecommand = new ReadDistCommand(optionString); } + else if(commandName == "read.otu") { pipecommand = new ReadOtuCommand(optionString); } + else if(commandName == "read.tree") { pipecommand = new ReadTreeCommand(optionString); } + else if(commandName == "cluster") { pipecommand = new ClusterCommand(optionString); } else if(commandName == "unique.seqs") { pipecommand = new DeconvoluteCommand(optionString); } else if(commandName == "parsimony") { pipecommand = new ParsimonyCommand(optionString); } else if(commandName == "help") { pipecommand = new HelpCommand(optionString); } @@ -537,6 +540,7 @@ Command* CommandFactory::getCommand(string commandName, string optionString, str else if(commandName == "get.current") { pipecommand = new GetCurrentCommand(optionString); } else if(commandName == "set.current") { pipecommand = new SetCurrentCommand(optionString); } else if(commandName == "make.shared") { pipecommand = new SharedCommand(optionString); } + else if(commandName == "get.commandinfo") { pipecommand = new GetCommandInfoCommand(optionString); } else { pipecommand = new NoCommand(optionString); } return pipecommand; @@ -554,10 +558,10 @@ Command* CommandFactory::getCommand(string commandName){ try { delete shellcommand; //delete the old command - //if(commandName == "read.dist") { shellcommand = new ReadDistCommand(); } - //else if(commandName == "read.otu") { shellcommand = new ReadOtuCommand(); } - //else if(commandName == "read.tree") { shellcommand = new ReadTreeCommand(); } - if(commandName == "cluster") { shellcommand = new ClusterCommand(); } + if(commandName == "read.dist") { shellcommand = new ReadDistCommand(); } + else if(commandName == "read.otu") { shellcommand = new ReadOtuCommand(); } + else if(commandName == "read.tree") { shellcommand = new ReadTreeCommand(); } + else if(commandName == "cluster") { shellcommand = new ClusterCommand(); } else if(commandName == "unique.seqs") { shellcommand = new DeconvoluteCommand(); } else if(commandName == "parsimony") { shellcommand = new ParsimonyCommand(); } else if(commandName == "help") { shellcommand = new HelpCommand(); } @@ -659,6 +663,7 @@ Command* CommandFactory::getCommand(string commandName){ else if(commandName == "get.current") { shellcommand = new GetCurrentCommand(); } else if(commandName == "set.current") { shellcommand = new SetCurrentCommand(); } else if(commandName == "make.shared") { shellcommand = new SharedCommand(); } + else if(commandName == "get.commandinfo") { shellcommand = new GetCommandInfoCommand(); } else { shellcommand = new NoCommand(); } return shellcommand; diff --git a/commandfactory.hpp b/commandfactory.hpp index 8b08c00..3c19e87 100644 --- a/commandfactory.hpp +++ b/commandfactory.hpp @@ -33,7 +33,8 @@ public: bool getAppend() { return append; } string getOutputDir() { return outputDir; } bool MPIEnabled(string); - + map getListCommands() { return commands; } + private: Command* command; Command* shellcommand; diff --git a/consensuscommand.cpp b/consensuscommand.cpp index 75c6a3c..940f840 100644 --- a/consensuscommand.cpp +++ b/consensuscommand.cpp @@ -32,7 +32,7 @@ string ConcensusCommand::getHelpString(){ helpString += "The .consensus.tre file contains the consensus tree of the trees in your input file.\n"; helpString += "The branch lengths are the percentage of trees in your input file that had the given pair.\n"; helpString += "The .consensuspairs file contains a list of the internal nodes in your tree. For each node, the pair that was used in the consensus tree \n"; - helpString += "is reported with its percentage, as well as the other pairs that were seen for that node but not used and their percentages.\n\n"; + helpString += "is reported with its percentage, as well as the other pairs that were seen for that node but not used and their percentages.\n"; return helpString; } catch(exception& e) { diff --git a/consensusseqscommand.cpp b/consensusseqscommand.cpp index bc47d8c..f1c766d 100644 --- a/consensusseqscommand.cpp +++ b/consensusseqscommand.cpp @@ -43,7 +43,7 @@ string ConsensusSeqsCommand::getHelpString(){ helpString += "The consensus.seqs command should be in the following format: \n"; helpString += "consensus.seqs(fasta=yourFastaFile, list=yourListFile) \n"; helpString += "Example: consensus.seqs(fasta=abrecovery.align, list=abrecovery.fn.list) \n"; - helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFastaFile).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFastaFile).\n"; return helpString; } catch(exception& e) { diff --git a/corraxescommand.cpp b/corraxescommand.cpp index 82cfa36..ae91a24 100644 --- a/corraxescommand.cpp +++ b/corraxescommand.cpp @@ -46,7 +46,7 @@ string CorrAxesCommand::getHelpString(){ helpString += "The corr.axes command should be in the following format: corr.axes(axes=yourPcoaFile, shared=yourSharedFile, method=yourMethod).\n"; helpString += "Example corr.axes(axes=genus.pool.thetayc.genus.lt.pcoa, shared=genus.pool.shared, method=kendall).\n"; helpString += "The corr.axes command outputs a .corr.axes file.\n"; - helpString += "Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n"; return helpString; } catch(exception& e) { diff --git a/degapseqscommand.cpp b/degapseqscommand.cpp index 81002c8..00f627d 100644 --- a/degapseqscommand.cpp +++ b/degapseqscommand.cpp @@ -37,7 +37,7 @@ string DegapSeqsCommand::getHelpString(){ helpString += "The degap.seqs command should be in the following format: \n"; helpString += "degap.seqs(fasta=yourFastaFile) \n"; helpString += "Example: degap.seqs(fasta=abrecovery.align) \n"; - helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFastaFile).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFastaFile).\n"; return helpString; } catch(exception& e) { diff --git a/deuniqueseqscommand.cpp b/deuniqueseqscommand.cpp index fb02764..2443882 100644 --- a/deuniqueseqscommand.cpp +++ b/deuniqueseqscommand.cpp @@ -36,7 +36,7 @@ string DeUniqueSeqsCommand::getHelpString(){ helpString += "The deunique.seqs command should be in the following format: \n"; helpString += "deunique.seqs(fasta=yourFastaFile, name=yourNameFile) \n"; helpString += "Example deunique.seqs(fasta=abrecovery.unique.fasta, name=abrecovery.names).\n"; - helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n"; return helpString; } catch(exception& e) { diff --git a/distancecommand.cpp b/distancecommand.cpp index 029b581..1be3552 100644 --- a/distancecommand.cpp +++ b/distancecommand.cpp @@ -55,7 +55,7 @@ string DistanceCommand::getHelpString(){ helpString += "The dist.seqs command should be in the following format: \n"; helpString += "dist.seqs(fasta=yourFastaFile, calc=yourCalc, countends=yourEnds, cutoff= yourCutOff, processors=yourProcessors) \n"; helpString += "Example dist.seqs(fasta=amazon.fasta, calc=eachgap, countends=F, cutoff= 2.0, processors=3).\n"; - helpString += "Note: No spaces between parameter labels (i.e. calc), '=' and parameters (i.e.yourCalc).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. calc), '=' and parameters (i.e.yourCalc).\n"; return helpString; } catch(exception& e) { diff --git a/filterseqscommand.cpp b/filterseqscommand.cpp index 02bc192..a677eef 100644 --- a/filterseqscommand.cpp +++ b/filterseqscommand.cpp @@ -48,7 +48,7 @@ string FilterSeqsCommand::getHelpString(){ helpString += "The filter.seqs command should be in the following format: \n"; helpString += "filter.seqs(fasta=yourFastaFile, trump=yourTrump) \n"; helpString += "Example filter.seqs(fasta=abrecovery.fasta, trump=.).\n"; - helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n"; return helpString; } catch(exception& e) { diff --git a/getcommandinfocommand.cpp b/getcommandinfocommand.cpp new file mode 100644 index 0000000..7ca2453 --- /dev/null +++ b/getcommandinfocommand.cpp @@ -0,0 +1,257 @@ +/* + * getcommandinfo.cpp + * Mothur + * + * Created by westcott on 4/6/11. + * Copyright 2011 Schloss Lab. All rights reserved. + * + */ + +#include "getcommandinfocommand.h" + +//********************************************************************************************************************** +vector GetCommandInfoCommand::setParameters(){ + try { + CommandParameter poutput("output", "String", "", "", "", "", "",false,false); parameters.push_back(poutput); + CommandParameter pinputdir("inputdir", "String", "", "", "", "", "",false,false); parameters.push_back(pinputdir); + CommandParameter poutputdir("outputdir", "String", "", "", "", "", "",false,false); parameters.push_back(poutputdir); + + vector myArray; + for (int i = 0; i < parameters.size(); i++) { myArray.push_back(parameters[i].name); } + return myArray; + } + catch(exception& e) { + m->errorOut(e, "GetCommandInfoCommand", "setParameters"); + exit(1); + } +} +//********************************************************************************************************************** +string GetCommandInfoCommand::getHelpString(){ + try { + string helpString = ""; + helpString += "This command is used by the gui to get the information about current commands available in mothur.\n"; + return helpString; + } + catch(exception& e) { + m->errorOut(e, "GetCommandInfoCommand", "getHelpString"); + exit(1); + } +} +//********************************************************************************************************************** + +GetCommandInfoCommand::GetCommandInfoCommand(string option) { + try { + abort = false; calledHelp = false; + + //allow user to run help + if(option == "help") { help(); abort = true; calledHelp = true; } + + else { + vector myArray = setParameters(); + + OptionParser parser(option); + map parameters = parser.getParameters(); + + ValidParameters validParameter; + //check to make sure all parameters are valid for command + for (map::iterator it = parameters.begin(); it != parameters.end(); it++) { + if (validParameter.isValidParameter(it->first, myArray, it->second) != true) { abort = true; } + } + + output = validParameter.validFile(parameters, "output", false); + if (output == "not found") { output = ""; m->mothurOut("You must provide an output filename."); m->mothurOutEndLine(); abort=true; } + + } + } + catch(exception& e) { + m->errorOut(e, "GetCommandInfoCommand", "GetCommandInfoCommand"); + exit(1); + } +} +//********************************************************************************************************************** + +int GetCommandInfoCommand::execute(){ + try { + + if (abort == true) { if (calledHelp) { return 0; } return 2; } + + commandFactory = CommandFactory::getInstance(); + + ofstream out; + m->openOutputFile(output+".temp", out); + + int numNonHidden = 0; + + out << "mothurLocation=" << m->getFullPathName(m->argv) << endl; + out << "mothurVersion=" << m->getVersion() << endl; + + map commands = commandFactory->getListCommands(); + map::iterator it; + + //loop through each command outputting info + for (it = commands.begin(); it != commands.end(); it++) { + + if (m->control_pressed) { m->mothurOut("[ERROR]: did not complete making the file."); m->mothurOutEndLine(); out.close(); remove((output+".temp").c_str()); } + + Command* thisCommand = commandFactory->getCommand(it->first); + + //don't add hidden commands + if (thisCommand->getCommandCategory() != "Hidden") { + numNonHidden++; + + //general info + out << "commandName=" << thisCommand->getCommandName() << endl; + out << "commandCategory=" << thisCommand->getCommandCategory() << endl; + + //remove /n from help string since gui reads line by line + string myhelpString = thisCommand->getHelpString(); + string newHelpString = ""; + for (int i = 0; i < myhelpString.length(); i++) { + if (myhelpString[i] != '\n') { newHelpString += myhelpString[i]; } + } + out << "help=" << newHelpString << endl; + + //outputTypes - makes something like outputTypes=fasta-name-qfile + map > thisOutputTypes = thisCommand->getOutputFiles(); + map >::iterator itTypes; + + if (thisOutputTypes.size() == 0) { out << "outputTypes=none" << endl; } + else { + string types = ""; + for (itTypes = thisOutputTypes.begin(); itTypes != thisOutputTypes.end(); itTypes++) { types += itTypes->first + "-"; } + //rip off last - + types = types.substr(0, types.length()-1); + out << "outputTypes=" << types << endl; + } + + vector booleans; vector numbers; vector multiples; vector Strings; + vector inputGroupNames; map inputTypes; + + getInfo(thisCommand->getParameters(), booleans, numbers, multiples, Strings, inputGroupNames, inputTypes); + + //output booleans + out << "Boolean=" << booleans.size() << endl; + for (int i = 0; i < booleans.size(); i++) { out << booleans[i] << endl; } + + //output mulitples + out << "Multiple=" << multiples.size() << endl; + for (int i = 0; i < multiples.size(); i++) { out << multiples[i] << endl; } + + //output numbers + out << "Numbers=" << numbers.size() << endl; + for (int i = 0; i < numbers.size(); i++) { out << numbers[i] << endl; } + + //output strings + out << "String=" << Strings.size() << endl; + for (int i = 0; i < Strings.size(); i++) { out << Strings[i] << endl; } + + //output groups + out << "inputGroupNames=" << inputGroupNames.size() << endl; + for (int i = 0; i < inputGroupNames.size(); i++) { out << inputGroupNames[i] << endl; } + + //output input types + if (inputTypes.size() == 0) { out << "inputTypes=" << endl; } + else { + string types = ""; + for (map::iterator it2 = inputTypes.begin(); it2 != inputTypes.end(); it2++) { types += it2->first + "-"; } + //rip off last - + types = types.substr(0, types.length()-1); + out << "inputTypes=" << types << endl; + + for (map::iterator it2 = inputTypes.begin(); it2 != inputTypes.end(); it2++) { + out << it2->first << "=" << it2->second << endl; + } + } + + } + } + + out.close(); + + ofstream out2; + m->openOutputFile(output, out2); + out2 << numNonHidden << endl; + out2.close(); + + m->appendFiles(output+".temp", output); + remove((output+".temp").c_str()); + + m->mothurOutEndLine(); + m->mothurOut("Output File Names: "); m->mothurOutEndLine(); + m->mothurOut(output); m->mothurOutEndLine(); + m->mothurOutEndLine(); + + + return 0; + } + catch(exception& e) { + m->errorOut(e, "GetCommandInfoCommand", "execute"); + exit(1); + } +} +//********************************************************************************************************************** + +int GetCommandInfoCommand::getInfo(vector para, vector& booleans, vector& numbers, vector& multiples, vector& strings, vector& inputGroupNames, map& inputTypes){ + try { + + map > groups; + map >::iterator itGroups; + + for (int i = 0; i < para.size(); i++) { + if ((para[i].name == "inputdir") || (para[i].name == "outputdir")) {} //ignore + else { + if (para[i].type == "Boolean") { + string temp = para[i].name + "=" + para[i].optionsDefault; + booleans.push_back(temp); + }else if (para[i].type == "Multiple") { + string multAllowed = "F"; + if (para[i].multipleSelectionAllowed) { multAllowed = "T"; } + string temp = para[i].name + "=" + para[i].options + "|" + para[i].optionsDefault + "|" + multAllowed; + multiples.push_back(temp); + }else if (para[i].type == "Number") { + string temp = para[i].name + "=" + para[i].optionsDefault; + numbers.push_back(temp); + }else if (para[i].type == "String") { + string temp = para[i].name + "=" + para[i].optionsDefault; + strings.push_back(temp); + }else if (para[i].type == "InputTypes") { + string required = "F"; + if (para[i].required) { required = "T"; } + string temp = required + "|" + para[i].chooseOnlyOneGroup + "|" + para[i].chooseAtLeastOneGroup + "|" + para[i].linkedGroup; + inputTypes[para[i].name] = temp; + + //add choose only one groups + groups[para[i].chooseOnlyOneGroup].insert(para[i].name); + + //add at least one group names + groups[para[i].chooseAtLeastOneGroup].insert(para[i].name); + + //add at linked group names + groups[para[i].linkedGroup].insert(para[i].name); + + }else { m->mothurOut("[ERROR]: " + para[i].type + " is an unknown parameter type, please correct."); m->mothurOutEndLine(); } + } + } + + for (itGroups = groups.begin(); itGroups != groups.end(); itGroups++) { + if (itGroups->first != "none") { + set tempNames = itGroups->second; + string temp = itGroups->first + "="; + for (set::iterator itNames = tempNames.begin(); itNames != tempNames.end(); itNames++) { + temp += *itNames + "-"; + } + //rip off last - + temp = temp.substr(0, temp.length()-1); + inputGroupNames.push_back(temp); + } + } + + return 0; + + } + catch(exception& e) { + m->errorOut(e, "GetCommandInfoCommand", "getInfo"); + exit(1); + } +} +//**********************************************************************************************************************/ diff --git a/getcommandinfocommand.h b/getcommandinfocommand.h new file mode 100644 index 0000000..4c5b3ab --- /dev/null +++ b/getcommandinfocommand.h @@ -0,0 +1,50 @@ +#ifndef GETCOMMANDINFOCOMMAND_H +#define GETCOMMANDINFOCOMMAND_H + +/* + * getcommandinfo.h + * Mothur + * + * Created by westcott on 4/6/11. + * Copyright 2011 Schloss Lab. All rights reserved. + * + */ + + + +#include "command.hpp" +#include "commandfactory.hpp" + +/**********************************************************/ + +class GetCommandInfoCommand : public Command { + +public: + GetCommandInfoCommand(string); + GetCommandInfoCommand() { abort = true; calledHelp = true; setParameters(); } + ~GetCommandInfoCommand(){} + + vector setParameters(); + string getCommandName() { return "get.commandinfo"; } + string getCommandCategory() { return "Hidden"; } + string getHelpString(); + + int execute(); + void help() { m->mothurOut(getHelpString()); } + +private: + CommandFactory* commandFactory; + string output; + bool abort; + vector outputNames; + + int getInfo(vector, vector&, vector&, vector&, vector&, vector&, map&); + + + +}; + +/**********************************************************/ + +#endif + diff --git a/getgroupscommand.cpp b/getgroupscommand.cpp index aae7488..c7f96ec 100644 --- a/getgroupscommand.cpp +++ b/getgroupscommand.cpp @@ -46,7 +46,7 @@ string GetGroupsCommand::getHelpString(){ helpString += "The get.groups command should be in the following format: get.groups(accnos=yourAccnos, fasta=yourFasta, group=yourGroupFile).\n"; helpString += "Example get.groups(accnos=amazon.accnos, fasta=amazon.fasta, group=amazon.groups).\n"; helpString += "or get.groups(groups=pasture, fasta=amazon.fasta, group=amazon.groups).\n"; - helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n"; return helpString; } catch(exception& e) { diff --git a/getlineagecommand.cpp b/getlineagecommand.cpp index 5e35449..dd00c03 100644 --- a/getlineagecommand.cpp +++ b/getlineagecommand.cpp @@ -49,7 +49,7 @@ string GetLineageCommand::getHelpString(){ helpString += "Example get.lineage(taxonomy=amazon.silva.taxonomy, taxon=Bacteria;Firmicutes;Bacilli;Lactobacillales;).\n"; helpString += "Note: If you are running mothur in script mode you must wrap the taxon in ' characters so mothur will ignore the ; in the taxon.\n"; helpString += "Example get.lineage(taxonomy=amazon.silva.taxonomy, taxon='Bacteria;Firmicutes;Bacilli;Lactobacillales;').\n"; - helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n"; return helpString; } catch(exception& e) { diff --git a/getlistcountcommand.cpp b/getlistcountcommand.cpp index 404d353..eb9c980 100644 --- a/getlistcountcommand.cpp +++ b/getlistcountcommand.cpp @@ -40,7 +40,7 @@ string GetListCountCommand::getHelpString(){ helpString += "Example get.otulist(list=amazon.fn.list, label=0.10).\n"; helpString += "The default value for label is all lines in your inputfile.\n"; helpString += "The get.otulist command outputs a .otu file for each distance you specify listing the bin number and the names of the sequences in that bin.\n"; - helpString += "Note: No spaces between parameter labels (i.e. list), '=' and parameters (i.e.yourListFile).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. list), '=' and parameters (i.e.yourListFile).\n"; return helpString; } catch(exception& e) { diff --git a/getoturepcommand.cpp b/getoturepcommand.cpp index 0ab12ab..342190d 100644 --- a/getoturepcommand.cpp +++ b/getoturepcommand.cpp @@ -86,7 +86,7 @@ string GetOTURepCommand::getHelpString(){ helpString += "The groups parameter allows you to indicate that you want representative sequences for each group specified for each OTU, group name should be separated by dashes. ex. groups=A-B-C.\n"; helpString += "The get.oturep command outputs a .fastarep and .rep.names file for each distance you specify, selecting one OTU representative for each bin.\n"; helpString += "If you provide a groupfile, then it also appends the names of the groups present in that bin.\n"; - helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFastaFile).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFastaFile).\n"; return helpString; } catch(exception& e) { diff --git a/getotuscommand.cpp b/getotuscommand.cpp index 4a79d3a..b39b4ab 100644 --- a/getotuscommand.cpp +++ b/getotuscommand.cpp @@ -45,7 +45,7 @@ string GetOtusCommand::getHelpString(){ helpString += "The get.otus command should be in the following format: get.otus(accnos=yourAccnos, list=yourListFile, group=yourGroupFile, label=yourLabel).\n"; helpString += "Example get.otus(accnos=amazon.accnos, list=amazon.fn.list, group=amazon.groups, label=0.03).\n"; helpString += "or get.otus(groups=pasture, list=amazon.fn.list, amazon.groups, label=0.03).\n"; - helpString += "Note: No spaces between parameter labels (i.e. list), '=' and parameters (i.e.yourListFile).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. list), '=' and parameters (i.e.yourListFile).\n"; return helpString; } catch(exception& e) { diff --git a/getrabundcommand.cpp b/getrabundcommand.cpp index 570d64e..65eedaa 100644 --- a/getrabundcommand.cpp +++ b/getrabundcommand.cpp @@ -39,7 +39,7 @@ string GetRAbundCommand::getHelpString(){ helpString += "Example get.rabund(sorted=F).\n"; helpString += "The default value for label is all labels in your inputfile.\n"; helpString += "The get.rabund command outputs a .rabund file containing the lines you selected.\n"; - helpString += "Note: No spaces between parameter labels (i.e. label), '=' and parameters (i.e.yourLabels).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. label), '=' and parameters (i.e.yourLabels).\n"; return helpString; } catch(exception& e) { diff --git a/getrelabundcommand.cpp b/getrelabundcommand.cpp index 6397e35..74ec992 100644 --- a/getrelabundcommand.cpp +++ b/getrelabundcommand.cpp @@ -40,7 +40,7 @@ string GetRelAbundCommand::getHelpString(){ helpString += "Example get.relabund(groups=A-B-C, scale=averagegroup).\n"; helpString += "The default value for groups is all the groups in your groupfile, and all labels in your inputfile will be used.\n"; helpString += "The get.relabund command outputs a .relabund file.\n"; - helpString += "Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n"; return helpString; } catch(exception& e) { diff --git a/getsabundcommand.cpp b/getsabundcommand.cpp index 98bdcb2..ebfa839 100644 --- a/getsabundcommand.cpp +++ b/getsabundcommand.cpp @@ -37,7 +37,7 @@ string GetSAbundCommand::getHelpString(){ helpString += "Example get.sabund().\n"; helpString += "The default value for label is all labels in your inputfile.\n"; helpString += "The get.sabund command outputs a .sabund file containing the labels you selected.\n"; - helpString += "Note: No spaces between parameter labels (i.e. label), '=' and parameters (i.e.yourLabel).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. label), '=' and parameters (i.e.yourLabel).\n"; return helpString; } catch(exception& e) { diff --git a/getseqscommand.cpp b/getseqscommand.cpp index 5db2888..04c3bd3 100644 --- a/getseqscommand.cpp +++ b/getseqscommand.cpp @@ -45,7 +45,7 @@ string GetSeqsCommand::getHelpString(){ helpString += "The dups parameter allows you to add the entire line from a name file if you add any name from the line. default=false. \n"; helpString += "The get.seqs command should be in the following format: get.seqs(accnos=yourAccnos, fasta=yourFasta).\n"; helpString += "Example get.seqs(accnos=amazon.accnos, fasta=amazon.fasta).\n"; - helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n"; return helpString; } catch(exception& e) { diff --git a/getsharedotucommand.cpp b/getsharedotucommand.cpp index f12b1cd..f627aed 100644 --- a/getsharedotucommand.cpp +++ b/getsharedotucommand.cpp @@ -49,7 +49,7 @@ string GetSharedOTUCommand::getHelpString(){ helpString += "Example get.sharedseqs(list=amazon.fn.list, label=unique-0.01, group=forest-pasture, fasta=amazon.fasta, output=accnos).\n"; helpString += "The output to the screen is the distance and the number of otus at that distance for the groups you specified.\n"; helpString += "The default value for label is all labels in your inputfile. The default for groups is all groups in your file.\n"; - helpString += "Note: No spaces between parameter labels (i.e. label), '=' and parameters (i.e.yourLabel).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. label), '=' and parameters (i.e.yourLabel).\n"; return helpString; } catch(exception& e) { diff --git a/hclustercommand.cpp b/hclustercommand.cpp index 582fc45..503bc48 100644 --- a/hclustercommand.cpp +++ b/hclustercommand.cpp @@ -43,7 +43,7 @@ string HClusterCommand::getHelpString(){ helpString += "The name parameter allows you to enter your name file and is required if your distance file is in column format. \n"; helpString += "The hcluster command should be in the following format: \n"; helpString += "hcluster(column=youDistanceFile, name=yourNameFile, method=yourMethod, cutoff=yourCutoff, precision=yourPrecision) \n"; - helpString += "The acceptable hcluster methods are furthest, nearest, weighted and average.\n\n"; + helpString += "The acceptable hcluster methods are furthest, nearest, weighted and average.\n"; return helpString; } catch(exception& e) { diff --git a/heatmapcommand.cpp b/heatmapcommand.cpp index 10c15d8..2da1d24 100644 --- a/heatmapcommand.cpp +++ b/heatmapcommand.cpp @@ -52,7 +52,7 @@ string HeatMapCommand::getHelpString(){ helpString += "The default value for groups is all the groups in your groupfile, and all labels in your inputfile will be used.\n"; helpString += "The default value for scale is log10; your other options are log2 and linear.\n"; helpString += "The heatmap.bin command outputs a .svg file for each label you specify.\n"; - helpString += "Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n"; return helpString; } catch(exception& e) { diff --git a/heatmapsimcommand.cpp b/heatmapsimcommand.cpp index 5a84391..0ba5ef1 100644 --- a/heatmapsimcommand.cpp +++ b/heatmapsimcommand.cpp @@ -46,6 +46,7 @@ vector HeatMapSimCommand::setParameters(){ string HeatMapSimCommand::getHelpString(){ try { string helpString = ""; + ValidCalculators validCalculator; helpString += "The heatmap.sim command parameters are shared, phylip, column, name, groups, calc and label. shared or phylip or column and name are required unless valid current files exist.\n"; helpString += "There are two ways to use the heatmap.sim command. The first is with the read.otu command. \n"; helpString += "With the read.otu command you may use the groups, label and calc parameters. \n"; @@ -54,14 +55,14 @@ string HeatMapSimCommand::getHelpString(){ helpString += "The heatmap.sim command should be in the following format: heatmap.sim(groups=yourGroups, calc=yourCalc, label=yourLabels).\n"; helpString += "Example heatmap.sim(groups=A-B-C, calc=jabund).\n"; helpString += "The default value for groups is all the groups in your groupfile, and all labels in your inputfile will be used.\n"; - helpString += validCalculator->printCalc("heat"); + helpString += validCalculator.printCalc("heat"); helpString += "The default value for calc is jclass-thetayc.\n"; helpString += "The heatmap.sim command outputs a .svg file for each calculator you choose at each label you specify.\n"; helpString += "The second way to use the heatmap.sim command is with a distance file representing the distance bewteen your groups. \n"; helpString += "Using the command this way, the phylip or column parameter are required, and only one may be used. If you use a column file the name filename is required. \n"; helpString += "The heatmap.sim command should be in the following format: heatmap.sim(phylip=yourDistanceFile).\n"; helpString += "Example heatmap.sim(phylip=amazonGroups.dist).\n"; - helpString += "Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n"; return helpString; } catch(exception& e) { @@ -90,7 +91,7 @@ HeatMapSimCommand::HeatMapSimCommand(string option) { allLines = 1; //allow user to run help - if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; calledHelp = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { vector myArray = setParameters(); @@ -231,11 +232,11 @@ HeatMapSimCommand::HeatMapSimCommand(string option) { if (abort == false) { - validCalculator = new ValidCalculators(); + ValidCalculators validCalculator; int i; for (i=0; iisValidCalculator("heat", Estimators[i]) == true) { + if (validCalculator.isValidCalculator("heat", Estimators[i]) == true) { if (Estimators[i] == "jabund") { heatCalculators.push_back(new JAbund()); }else if (Estimators[i] == "sorabund") { @@ -285,7 +286,6 @@ int HeatMapSimCommand::execute(){ }else{ runCommandDist(); } delete heatmap; - delete validCalculator; if (m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } outputTypes.clear(); return 0; } diff --git a/heatmapsimcommand.h b/heatmapsimcommand.h index 2a2c367..dbaa684 100644 --- a/heatmapsimcommand.h +++ b/heatmapsimcommand.h @@ -36,7 +36,6 @@ private: InputData* input; vector lookup; vector heatCalculators; - ValidCalculators* validCalculator; HeatMapSim* heatmap; OptionParser* parser; bool abort, allLines; diff --git a/homovacommand.cpp b/homovacommand.cpp index 9f74830..f9d259d 100644 --- a/homovacommand.cpp +++ b/homovacommand.cpp @@ -41,7 +41,7 @@ string HomovaCommand::getHelpString(){ helpString += "The design file looks like the group file. It is a 2 column tab delimited file, where the first column is the sample name and the second column is the group the sample belongs to.\n"; helpString += "The iters parameter allows you to set number of randomization for the P value. The default is 1000. \n"; helpString += "The homova command should be in the following format: homova(phylip=file.dist, design=file.design).\n"; - helpString += "Note: No spaces between parameter labels (i.e. iters), '=' and parameters (i.e. 1000).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. iters), '=' and parameters (i.e. 1000).\n"; return helpString; } catch(exception& e) { diff --git a/indicatorcommand.cpp b/indicatorcommand.cpp index 8e80d53..01bc2f1 100644 --- a/indicatorcommand.cpp +++ b/indicatorcommand.cpp @@ -44,7 +44,7 @@ string IndicatorCommand::getHelpString(){ helpString += "The groups parameter allows you to specify which of the groups in your shared or relabund you would like analyzed, or if you provide a design file the groups in your design file. The groups may be entered separated by dashes.\n"; helpString += "The label parameter indicates at what distance your tree relates to the shared or relabund.\n"; helpString += "The indicator command should be used in the following format: indicator(tree=test.tre, shared=test.shared, label=0.03)\n"; - helpString += "Note: No spaces between parameter labels (i.e. tree), '=' and parameters (i.e.yourTreefile).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. tree), '=' and parameters (i.e.yourTreefile).\n"; return helpString; } catch(exception& e) { diff --git a/libshuffcommand.cpp b/libshuffcommand.cpp index dd3a65d..c827b52 100644 --- a/libshuffcommand.cpp +++ b/libshuffcommand.cpp @@ -56,7 +56,7 @@ string LibShuffCommand::getHelpString(){ helpString += "Example libshuff(groups=A-B-C, iters=500, form=discrete, step=0.01, cutOff=2.0).\n"; helpString += "The default value for groups is all the groups in your groupfile, iters is 10000, cutoff is 1.0, form is integral and step is 0.01.\n"; helpString += "The libshuff command output two files: .coverage and .slsummary their descriptions are in the manual.\n"; - helpString += "Note: No spaces between parameter labels (i.e. iters), '=' and parameters (i.e.yourIters).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. iters), '=' and parameters (i.e.yourIters).\n"; return helpString; } catch(exception& e) { diff --git a/listseqscommand.cpp b/listseqscommand.cpp index b977304..ebfd075 100644 --- a/listseqscommand.cpp +++ b/listseqscommand.cpp @@ -41,7 +41,7 @@ string ListSeqsCommand::getHelpString(){ helpString += "The list.seqs command parameters are fasta, name, group, list, taxonomy and alignreport. You must provide one of these parameters.\n"; helpString += "The list.seqs command should be in the following format: list.seqs(fasta=yourFasta).\n"; helpString += "Example list.seqs(fasta=amazon.fasta).\n"; - helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n"; return helpString; } catch(exception& e) { diff --git a/makefastqcommand.cpp b/makefastqcommand.cpp index 995dc66..b4c0e8c 100644 --- a/makefastqcommand.cpp +++ b/makefastqcommand.cpp @@ -37,7 +37,7 @@ string MakeFastQCommand::getHelpString(){ helpString += "You must also provide an accnos containing the list of groups to get or set the groups parameter to the groups you wish to select.\n"; helpString += "The make.fastq command should be in the following format: make.fastq(qfile=yourQualityFile, fasta=yourFasta).\n"; helpString += "Example make.fastq(fasta=amazon.fasta, qfile=amazon.qual).\n"; - helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n"; return helpString; } catch(exception& e) { diff --git a/makegroupcommand.cpp b/makegroupcommand.cpp index 6f640eb..326a96e 100644 --- a/makegroupcommand.cpp +++ b/makegroupcommand.cpp @@ -38,7 +38,7 @@ string MakeGroupCommand::getHelpString(){ helpString += "The make.group command should be in the following format: \n"; helpString += "make.group(fasta=yourFastaFiles, groups=yourGroups). \n"; helpString += "Example make.group(fasta=seqs1.fasta-seq2.fasta-seqs3.fasta, groups=A-B-C)\n"; - helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFastaFiles).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFastaFiles).\n"; return helpString; } catch(exception& e) { diff --git a/mantelcommand.cpp b/mantelcommand.cpp index c41cde3..0c0163b 100644 --- a/mantelcommand.cpp +++ b/mantelcommand.cpp @@ -41,7 +41,7 @@ string MantelCommand::getHelpString(){ helpString += "The iters parameter allows you to set number of randomization for the P value. The default is 1000. \n"; helpString += "The mantel command should be in the following format: mantel(phylip1=veg.dist, phylip2=env.dist).\n"; helpString += "The mantel command outputs a .mantel file.\n"; - helpString += "Note: No spaces between parameter labels (i.e. phylip1), '=' and parameters (i.e. veg.dist).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. phylip1), '=' and parameters (i.e. veg.dist).\n"; return helpString; } catch(exception& e) { diff --git a/matrixoutputcommand.cpp b/matrixoutputcommand.cpp index effc368..5dfba36 100644 --- a/matrixoutputcommand.cpp +++ b/matrixoutputcommand.cpp @@ -74,6 +74,7 @@ vector MatrixOutputCommand::setParameters(){ string MatrixOutputCommand::getHelpString(){ try { string helpString = ""; + ValidCalculators validCalculator; helpString += "The dist.shared command parameters are shared, groups, calc, output and label. shared is a required, unless you have a valid current file.\n"; helpString += "The groups parameter allows you to specify which of the groups in your groupfile you would like included used.\n"; helpString += "The group names are separated by dashes. The label parameter allows you to select what distance levels you would like distance matrices created for, and is also separated by dashes.\n"; @@ -82,9 +83,9 @@ string MatrixOutputCommand::getHelpString(){ helpString += "Example dist.shared(groups=A-B-C, calc=jabund-sorabund).\n"; helpString += "The default value for groups is all the groups in your groupfile.\n"; helpString += "The default value for calc is jclass and thetayc.\n"; - helpString += validCalculator->printCalc("matrix"); + helpString += validCalculator.printCalc("matrix"); helpString += "The dist.shared command outputs a .dist file for each calculator you specify at each distance you choose.\n"; - helpString += "Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n"; return helpString; } catch(exception& e) { @@ -113,7 +114,7 @@ MatrixOutputCommand::MatrixOutputCommand(string option) { allLines = 1; //allow user to run help - if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; calledHelp = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { vector myArray = setParameters(); @@ -189,11 +190,11 @@ MatrixOutputCommand::MatrixOutputCommand(string option) { if (abort == false) { - validCalculator = new ValidCalculators(); + ValidCalculators validCalculator; int i; for (i=0; iisValidCalculator("matrix", Estimators[i]) == true) { + if (validCalculator.isValidCalculator("matrix", Estimators[i]) == true) { if (Estimators[i] == "sharedsobs") { matrixCalculators.push_back(new SharedSobsCS()); }else if (Estimators[i] == "sharedchao") { @@ -288,11 +289,7 @@ MatrixOutputCommand::MatrixOutputCommand(string option) { //********************************************************************************************************************** -MatrixOutputCommand::~MatrixOutputCommand(){ - if (abort == false) { - delete validCalculator; - } -} +MatrixOutputCommand::~MatrixOutputCommand(){} //********************************************************************************************************************** diff --git a/matrixoutputcommand.h b/matrixoutputcommand.h index 40706b9..2871d5e 100644 --- a/matrixoutputcommand.h +++ b/matrixoutputcommand.h @@ -43,7 +43,6 @@ private: vector matrixCalculators; vector< vector > simMatrix; InputData* input; - ValidCalculators* validCalculator; vector lookup; string exportFileName, output, sharedfile; int numGroups; diff --git a/mergefilecommand.cpp b/mergefilecommand.cpp index cb241c6..cece52d 100644 --- a/mergefilecommand.cpp +++ b/mergefilecommand.cpp @@ -33,7 +33,7 @@ string MergeFileCommand::getHelpString(){ helpString += "The merge.file command takes a list of files separated by dashes and merges them into one file."; helpString += "The merge.file command parameters are input and output."; helpString += "Example merge.file(input=small.fasta-large.fasta, output=all.fasta)."; - helpString += "Note: No spaces between parameter labels (i.e. output), '=' and parameters (i.e.yourOutputFileName).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. output), '=' and parameters (i.e.yourOutputFileName).\n"; return helpString; } catch(exception& e) { diff --git a/mergegroupscommand.cpp b/mergegroupscommand.cpp index 74bf0de..cb990e4 100644 --- a/mergegroupscommand.cpp +++ b/mergegroupscommand.cpp @@ -43,7 +43,7 @@ string MergeGroupsCommand::getHelpString(){ helpString += "The merge.groups command should be in the following format: merge.groups(design=yourDesignFile, shared=yourSharedFile).\n"; helpString += "Example merge.groups(design=temp.design, groups=A-B-C, shared=temp.shared).\n"; helpString += "The default value for groups is all the groups in your sharedfile, and all labels in your inputfile will be used.\n"; - helpString += "Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n"; return helpString; } catch(exception& e) { diff --git a/metastatscommand.cpp b/metastatscommand.cpp index 4bb50ab..f637eec 100644 --- a/metastatscommand.cpp +++ b/metastatscommand.cpp @@ -52,7 +52,7 @@ string MetaStatsCommand::getHelpString(){ helpString += "The metastats command should be in the following format: metastats(design=yourDesignFile).\n"; helpString += "Example metastats(design=temp.design, groups=A-B-C).\n"; helpString += "The default value for groups is all the groups in your groupfile, and all labels in your inputfile will be used.\n"; - helpString += "Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n"; return helpString; } catch(exception& e) { diff --git a/mgclustercommand.cpp b/mgclustercommand.cpp index b6c4164..10932bc 100644 --- a/mgclustercommand.cpp +++ b/mgclustercommand.cpp @@ -44,7 +44,7 @@ string MGClusterCommand::getHelpString(){ helpString += "This command outputs a .list, .rabund and .sabund file that can be used with mothur other commands to estimate richness.\n"; helpString += "The cutoff parameter is used to specify the maximum distance you would like to cluster to. The default is 0.70.\n"; helpString += "The precision parameter's default value is 100. \n"; - helpString += "The acceptable mgcluster methods are furthest, nearest and average. If no method is provided then furthest is assumed.\n\n"; + helpString += "The acceptable mgcluster methods are furthest, nearest and average. If no method is provided then furthest is assumed.\n"; helpString += "The min parameter allows you to specify is you want the minimum or maximum blast score ratio used in calculating the distance. The default is true, meaning you want the minimum.\n"; helpString += "The length parameter is used to specify the minimum overlap required. The default is 5.\n"; helpString += "The penalty parameter is used to adjust the error rate. The default is 0.10.\n"; @@ -52,7 +52,7 @@ string MGClusterCommand::getHelpString(){ helpString += "The hcluster parameter allows you to use the hcluster algorithm when clustering. This may be neccessary if your file is too large to fit into RAM. The default is false.\n"; helpString += "The mgcluster command should be in the following format: \n"; helpString += "mgcluster(blast=yourBlastfile, name=yourNameFile, cutoff=yourCutOff).\n"; - helpString += "Note: No spaces between parameter labels (i.e. balst), '=' and parameters (i.e.yourBlastfile).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. balst), '=' and parameters (i.e.yourBlastfile).\n"; return helpString; } catch(exception& e) { diff --git a/nmdscommand.cpp b/nmdscommand.cpp index 8fa0145..3f8e342 100644 --- a/nmdscommand.cpp +++ b/nmdscommand.cpp @@ -46,7 +46,7 @@ string NMDSCommand::getHelpString(){ helpString += "The iters parameter allows you to select the number of random configuration to try. Default=10\n"; helpString += "The epsilon parameter allows you to select set an acceptable stopping point. Default=1e-12.\n"; helpString += "Example nmds(phylip=yourDistanceFile).\n"; - helpString += "Note: No spaces between parameter labels (i.e. phylip), '=' and parameters (i.e.yourDistanceFile).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. phylip), '=' and parameters (i.e.yourDistanceFile).\n"; return helpString; } catch(exception& e) { diff --git a/nocommands.cpp b/nocommands.cpp index 9c223ee..7df8edc 100644 --- a/nocommands.cpp +++ b/nocommands.cpp @@ -19,7 +19,7 @@ int NoCommand::execute(){ //Could choose to give more help here?fdsah cout << "Invalid command.\n"; - CommandFactory* valid = CommandFactory::getInstance(); + CommandFactory* valid = CommandFactory::getInstance(); valid->printCommands(cout); return 0; diff --git a/normalizesharedcommand.cpp b/normalizesharedcommand.cpp index 8a6b4ad..5f3cacb 100644 --- a/normalizesharedcommand.cpp +++ b/normalizesharedcommand.cpp @@ -45,7 +45,7 @@ string NormalizeSharedCommand::getHelpString(){ helpString += "Example normalize.shared(groups=A-B-C, scale=totalgroup).\n"; helpString += "The default value for groups is all the groups in your groupfile, and all labels in your inputfile will be used.\n"; helpString += "The normalize.shared command outputs a .norm.shared file.\n"; - helpString += "Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n"; return helpString; } catch(exception& e) { diff --git a/otuhierarchycommand.cpp b/otuhierarchycommand.cpp index 17e29d9..edfdaea 100644 --- a/otuhierarchycommand.cpp +++ b/otuhierarchycommand.cpp @@ -38,7 +38,7 @@ string OtuHierarchyCommand::getHelpString(){ helpString += "otu.hierarchy(list=yourListFile, label=yourLabels).\n"; helpString += "Example otu.hierarchy(list=amazon.fn.list, label=0.01-0.03).\n"; helpString += "The otu.hierarchy command outputs a .otu.hierarchy file which is described on the wiki.\n"; - helpString += "Note: No spaces between parameter labels (i.e. list), '=' and parameters (i.e.yourListFile).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. list), '=' and parameters (i.e.yourListFile).\n"; return helpString; } catch(exception& e) { diff --git a/pairwiseseqscommand.cpp b/pairwiseseqscommand.cpp index 0c9bcc5..9866753 100644 --- a/pairwiseseqscommand.cpp +++ b/pairwiseseqscommand.cpp @@ -69,7 +69,7 @@ string PairwiseSeqsCommand::getHelpString(){ helpString += "The pairwise.seqs command should be in the following format: \n"; helpString += "pairwise.seqs(fasta=yourfastaFile, align=yourAlignmentMethod) \n"; helpString += "Example pairwise.seqs(fasta=candidate.fasta, align=blast)\n"; - helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFastaFile).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFastaFile).\n"; return helpString; } catch(exception& e) { diff --git a/parselistscommand.cpp b/parselistscommand.cpp index 6e4082e..c79eb63 100644 --- a/parselistscommand.cpp +++ b/parselistscommand.cpp @@ -37,7 +37,7 @@ string ParseListCommand::getHelpString(){ helpString += "The label parameter is used to read specific labels in your input you want to use.\n"; helpString += "The parse.list command should be used in the following format: parse.list(list=yourListFile, group=yourGroupFile, label=yourLabels).\n"; helpString += "Example: parse.list(list=abrecovery.fn.list, group=abrecovery.groups, label=0.03).\n"; - helpString += "Note: No spaces between parameter labels (i.e. list), '=' and parameters (i.e.yourListfile).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. list), '=' and parameters (i.e.yourListfile).\n"; return helpString; } catch(exception& e) { diff --git a/parsimonycommand.cpp b/parsimonycommand.cpp index a8c2d15..be64ec2 100644 --- a/parsimonycommand.cpp +++ b/parsimonycommand.cpp @@ -43,7 +43,7 @@ string ParsimonyCommand::getHelpString(){ helpString += "Example parsimony(random=out, iters=500).\n"; helpString += "The default value for random is "" (meaning you want to use the trees in your inputfile, randomtree=out means you just want the random distribution of trees outputted to out.rd_parsimony),\n"; helpString += "and iters is 1000. The parsimony command output two files: .parsimony and .psummary their descriptions are in the manual.\n"; - helpString += "Note: No spaces between parameter labels (i.e. random), '=' and parameters (i.e.yourOutputFilename).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. random), '=' and parameters (i.e.yourOutputFilename).\n"; return helpString; } catch(exception& e) { diff --git a/pcacommand.cpp b/pcacommand.cpp index a91143b..8b0a51e 100644 --- a/pcacommand.cpp +++ b/pcacommand.cpp @@ -40,7 +40,7 @@ string PCACommand::getHelpString(){ helpString += "The metric parameter allows indicate you if would like the pearson correlation coefficient calculated. Default=True"; helpString += "Example pca(groups=yourGroups).\n"; helpString += "Example pca(groups=A-B-C).\n"; - helpString += "Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n"; return helpString; } catch(exception& e) { diff --git a/pcoacommand.cpp b/pcoacommand.cpp index 6ebf653..607256b 100644 --- a/pcoacommand.cpp +++ b/pcoacommand.cpp @@ -37,7 +37,7 @@ string PCOACommand::getHelpString(){ helpString += "The phylip parameter allows you to enter your distance file."; helpString += "The metric parameter allows indicate you if would like the pearson correlation coefficient calculated. Default=True"; helpString += "Example pcoa(phylip=yourDistanceFile).\n"; - helpString += "Note: No spaces between parameter labels (i.e. phylip), '=' and parameters (i.e.yourDistanceFile).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. phylip), '=' and parameters (i.e.yourDistanceFile).\n"; return helpString; } catch(exception& e) { @@ -157,7 +157,7 @@ int PCOACommand::execute(){ vector > G = D; //vector > copy_G; - m->mothurOut("\nProcessing...\n\n"); + m->mothurOut("\nProcessing...\n"); for(int count=0;count<2;count++){ linearCalc.recenter(offset, D, G); if (m->control_pressed) { return 0; } diff --git a/phylodiversitycommand.cpp b/phylodiversitycommand.cpp index 0822582..48d8555 100644 --- a/phylodiversitycommand.cpp +++ b/phylodiversitycommand.cpp @@ -52,7 +52,7 @@ string PhyloDiversityCommand::getHelpString(){ helpString += "The phylo.diversity command should be in the following format: phylo.diversity(groups=yourGroups, rarefy=yourRarefy, iters=yourIters).\n"; helpString += "Example phylo.diversity(groups=A-B-C, rarefy=T, iters=500).\n"; helpString += "The phylo.diversity command output two files: .phylo.diversity and if rarefy=T, .rarefaction.\n"; - helpString += "Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n"; return helpString; } catch(exception& e) { diff --git a/phylotypecommand.cpp b/phylotypecommand.cpp index e7d1296..70f2b2f 100644 --- a/phylotypecommand.cpp +++ b/phylotypecommand.cpp @@ -45,7 +45,7 @@ string PhylotypeCommand::getHelpString(){ helpString += "For the label parameter, levels count down from the root to keep the output similiar to mothur's other commands which report information from finer resolution to coarser resolutions.\n"; helpString += "The phylotype command should be in the following format: \n"; helpString += "phylotype(taxonomy=yourTaxonomyFile, cutoff=yourCutoff, label=yourLabels) \n"; - helpString += "Eaxample: phylotype(taxonomy=amazon.taxonomy, cutoff=5, label=1-3-5).\n\n"; + helpString += "Eaxample: phylotype(taxonomy=amazon.taxonomy, cutoff=5, label=1-3-5).\n"; return helpString; } catch(exception& e) { diff --git a/pipelinepdscommand.cpp b/pipelinepdscommand.cpp index 19e7886..d1309ed 100644 --- a/pipelinepdscommand.cpp +++ b/pipelinepdscommand.cpp @@ -51,7 +51,7 @@ string PipelineCommand::getHelpString(){ helpString += "Example: trim.seqs(processors=8, allfiles=T, maxambig=0, maxhomop=8, flip=T, bdiffs=1, pdiffs=2, qwindowaverage=35, qwindowsize=50, fasta=may1.v13.fasta, oligos=may1.v13.oligos, qfile=may1.v13.qual)\n"; helpString += "then, you could enter unique.seqs(fasta=current), and mothur would use the .trim.fasta file from the trim.seqs command. \n"; helpString += "then you could enter align.seqs(candidate=current, template=silva.v13.align, processors=8). , and mothur would use the .trim.unique.fasta file from the unique.seqs command. \n"; - helpString += "If no pipeline file is given then mothur will use Pat's pipeline. \n\n"; + helpString += "If no pipeline file is given then mothur will use Pat's pipeline. \n"; helpString += "Here is a list of the commands used in Pat's pipeline.\n"; helpString += "All paralellized commands will use the processors you entered.\n"; helpString += "The sffinfo command takes your sff file and extracts the fasta and quality files.\n"; @@ -76,7 +76,7 @@ string PipelineCommand::getHelpString(){ helpString += "The classify.otu command is used to get the concensus taxonomy for otu files from cluster and phylotype commands. \n"; helpString += "The phylo.diversity command run on the tree generated by clearcut with rarefy=T, iters=100. \n"; helpString += "The unifrac commands are also run on the tree generated by clearcut with random=F, distance=T. \n"; - helpString += "\n\n"; + helpString += "\n"; return helpString; } catch(exception& e) { diff --git a/preclustercommand.cpp b/preclustercommand.cpp index 550a6b7..9f96ebd 100644 --- a/preclustercommand.cpp +++ b/preclustercommand.cpp @@ -42,7 +42,7 @@ string PreClusterCommand::getHelpString(){ helpString += "The pre.cluster command should be in the following format: \n"; helpString += "pre.cluster(fasta=yourFastaFile, names=yourNamesFile, diffs=yourMaxDiffs) \n"; helpString += "Example pre.cluster(fasta=amazon.fasta, diffs=2).\n"; - helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n"; return helpString; } catch(exception& e) { diff --git a/rarefactcommand.cpp b/rarefactcommand.cpp index b6ad295..7f2a1d2 100644 --- a/rarefactcommand.cpp +++ b/rarefactcommand.cpp @@ -64,7 +64,7 @@ string RareFactCommand::getHelpString(){ helpString += "The default values for iters is 1000, freq is 100, and calc is rarefaction which calculates the rarefaction curve for the observed richness.\n"; validCalculator.printCalc("rarefaction"); helpString += "The label parameter is used to analyze specific labels in your input.\n"; - helpString += "Note: No spaces between parameter labels (i.e. freq), '=' and parameters (i.e.yourFreq).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. freq), '=' and parameters (i.e.yourFreq).\n"; return helpString; } catch(exception& e) { diff --git a/rarefactsharedcommand.cpp b/rarefactsharedcommand.cpp index 746b09e..fb5527a 100644 --- a/rarefactsharedcommand.cpp +++ b/rarefactsharedcommand.cpp @@ -49,7 +49,7 @@ string RareFactSharedCommand::getHelpString(){ helpString += validCalculator.printCalc("sharedrarefaction"); helpString += "The label parameter is used to analyze specific labels in your input.\n"; helpString += "The groups parameter allows you to specify which of the groups in your groupfile you would like analyzed. You must enter at least 2 valid groups.\n"; - helpString += "Note: No spaces between parameter labels (i.e. freq), '=' and parameters (i.e.yourFreq).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. freq), '=' and parameters (i.e.yourFreq).\n"; return helpString; } catch(exception& e) { diff --git a/removegroupscommand.cpp b/removegroupscommand.cpp index 76dc630..e0943cf 100644 --- a/removegroupscommand.cpp +++ b/removegroupscommand.cpp @@ -46,7 +46,7 @@ string RemoveGroupsCommand::getHelpString(){ helpString += "The remove.groups command should be in the following format: remove.groups(accnos=yourAccnos, fasta=yourFasta, group=yourGroupFile).\n"; helpString += "Example remove.groups(accnos=amazon.accnos, fasta=amazon.fasta, group=amazon.groups).\n"; helpString += "or remove.groups(groups=pasture, fasta=amazon.fasta, amazon.groups).\n"; - helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n"; return helpString; } catch(exception& e) { diff --git a/removelineagecommand.cpp b/removelineagecommand.cpp index 021b56c..75e2a07 100644 --- a/removelineagecommand.cpp +++ b/removelineagecommand.cpp @@ -49,7 +49,7 @@ string RemoveLineageCommand::getHelpString(){ helpString += "Example remove.lineage(taxonomy=amazon.silva.taxonomy, taxon=Bacteria;Firmicutes;Bacilli;Lactobacillales;).\n"; helpString += "Note: If you are running mothur in script mode you must wrap the taxon in ' characters so mothur will ignore the ; in the taxon.\n"; helpString += "Example remove.lineage(taxonomy=amazon.silva.taxonomy, taxon='Bacteria;Firmicutes;Bacilli;Lactobacillales;').\n"; - helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n"; return helpString; } catch(exception& e) { diff --git a/removeotuscommand.cpp b/removeotuscommand.cpp index d1c12c8..6c8cf6a 100644 --- a/removeotuscommand.cpp +++ b/removeotuscommand.cpp @@ -44,7 +44,7 @@ string RemoveOtusCommand::getHelpString(){ helpString += "The remove.otus command should be in the following format: remove.otus(accnos=yourAccnos, list=yourListFile, group=yourGroupFile, label=yourLabel).\n"; helpString += "Example remove.otus(accnos=amazon.accnos, list=amazon.fn.list, group=amazon.groups, label=0.03).\n"; helpString += "or remove.otus(groups=pasture, list=amazon.fn.list, amazon.groups, label=0.03).\n"; - helpString += "Note: No spaces between parameter labels (i.e. list), '=' and parameters (i.e.yourListFile).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. list), '=' and parameters (i.e.yourListFile).\n"; return helpString; } catch(exception& e) { diff --git a/removerarecommand.cpp b/removerarecommand.cpp index 41355b9..e46aa09 100644 --- a/removerarecommand.cpp +++ b/removerarecommand.cpp @@ -50,7 +50,7 @@ string RemoveRareCommand::getHelpString(){ helpString += "The nseqs parameter allows you to set the cutoff for an otu to be deemed rare. It is required.\n"; helpString += "The remove.rare command should be in the following format: remove.rare(shared=yourSharedFile, nseqs=yourRareCutoff).\n"; helpString += "Example remove.rare(shared=amazon.fn.shared, nseqs=2).\n"; - helpString += "Note: No spaces between parameter labels (i.e. shared), '=' and parameters (i.e.yourSharedFile).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. shared), '=' and parameters (i.e.yourSharedFile).\n"; return helpString; } catch(exception& e) { diff --git a/removeseqscommand.cpp b/removeseqscommand.cpp index 7e3b939..832bb9e 100644 --- a/removeseqscommand.cpp +++ b/removeseqscommand.cpp @@ -45,7 +45,7 @@ string RemoveSeqsCommand::getHelpString(){ helpString += "The dups parameter allows you to remove the entire line from a name file if you remove any name from the line. default=true. \n"; helpString += "The remove.seqs command should be in the following format: remove.seqs(accnos=yourAccnos, fasta=yourFasta).\n"; helpString += "Example remove.seqs(accnos=amazon.accnos, fasta=amazon.fasta).\n"; - helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n"; return helpString; } catch(exception& e) { diff --git a/screenseqscommand.cpp b/screenseqscommand.cpp index 7a6ea3a..0b7f3f0 100644 --- a/screenseqscommand.cpp +++ b/screenseqscommand.cpp @@ -59,7 +59,7 @@ string ScreenSeqsCommand::getHelpString(){ helpString += "screen.seqs(fasta=yourFastaFile, name=youNameFile, group=yourGroupFIle, start=yourStart, end=yourEnd, maxambig=yourMaxambig, \n"; helpString += "maxhomop=yourMaxhomop, minlength=youMinlength, maxlength=yourMaxlength) \n"; helpString += "Example screen.seqs(fasta=abrecovery.fasta, name=abrecovery.names, group=abrecovery.groups, start=..., end=..., maxambig=..., maxhomop=..., minlength=..., maxlength=...).\n"; - helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n"; return helpString; } catch(exception& e) { diff --git a/secondarystructurecommand.cpp b/secondarystructurecommand.cpp index fec93e6..d33805e 100644 --- a/secondarystructurecommand.cpp +++ b/secondarystructurecommand.cpp @@ -36,7 +36,7 @@ string AlignCheckCommand::getHelpString(){ helpString += "The align.check command parameters are fasta and map, both are required.\n"; helpString += "The align.check command should be in the following format: align.check(fasta=yourFasta, map=yourMap).\n"; helpString += "Example align.check(map=silva.ss.map, fasta=amazon.fasta).\n"; - helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n"; return helpString; } catch(exception& e) { diff --git a/sensspeccommand.cpp b/sensspeccommand.cpp index 7f5d9dc..1ce33e4 100644 --- a/sensspeccommand.cpp +++ b/sensspeccommand.cpp @@ -54,7 +54,7 @@ string SensSpecCommand::getHelpString(){ helpString += "The groups parameter allows you to indicate that you want representative sequences for each group specified for each OTU, group name should be separated by dashes. ex. groups=A-B-C.\n"; helpString += "The get.oturep command outputs a .fastarep and .rep.names file for each distance you specify, selecting one OTU representative for each bin.\n"; helpString += "If you provide a groupfile, then it also appends the names of the groups present in that bin.\n"; - helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFastaFile).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFastaFile).\n"; return helpString; } catch(exception& e) { diff --git a/seqerrorcommand.cpp b/seqerrorcommand.cpp index f0ff086..b4259bf 100644 --- a/seqerrorcommand.cpp +++ b/seqerrorcommand.cpp @@ -41,7 +41,7 @@ string SeqErrorCommand::getHelpString(){ helpString += "The seq.error command reads a query alignment file and a reference alignment file and creates .....\n"; helpString += "Example seq.error(...).\n"; helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n"; - helpString += "For more details please check out the wiki http://www.mothur.org/wiki/seq.error .\n\n"; + helpString += "For more details please check out the wiki http://www.mothur.org/wiki/seq.error .\n"; return helpString; } catch(exception& e) { @@ -374,7 +374,7 @@ int SeqErrorCommand::execute(){ ofstream errorCountFile; m->openOutputFile(errorCountFileName, errorCountFile); outputNames.push_back(errorCountFileName); outputTypes["error.count"].push_back(errorCountFileName); - m->mothurOut("Overall error rate:\t" + toString((double)(totalBases - totalMatches) / (double)totalBases) + "\n\n"); + m->mothurOut("Overall error rate:\t" + toString((double)(totalBases - totalMatches) / (double)totalBases) + "\n"); m->mothurOut("Errors\tSequences\n"); errorCountFile << "Errors\tSequences\n"; for(int i=0;i myArray (Array, Array+(sizeof(Array)/sizeof(string))); + vector myArray = setParameters(); OptionParser parser(option); map parameters = parser.getParameters(); diff --git a/setlogfilecommand.cpp b/setlogfilecommand.cpp index 00e702c..0a3dfc9 100644 --- a/setlogfilecommand.cpp +++ b/setlogfilecommand.cpp @@ -35,7 +35,7 @@ string SetLogFileCommand::getHelpString(){ helpString += "The set.logfile command parameters are name and append, name is required. Append is set to false by default.\n"; helpString += "The set.logfile command should be in the following format: set.logfile(name=yourLogFileName, append=T).\n"; helpString += "Example set.logfile(name=/Users/lab/desktop/output.txt, append=T).\n"; - helpString += "Note: No spaces between parameter labels (i.e. name), '=' and parameters (i.e.yourLogFileName).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. name), '=' and parameters (i.e.yourLogFileName).\n"; return helpString; } catch(exception& e) { diff --git a/sffinfocommand.cpp b/sffinfocommand.cpp index fda9604..5478ca4 100644 --- a/sffinfocommand.cpp +++ b/sffinfocommand.cpp @@ -47,7 +47,7 @@ string SffInfoCommand::getHelpString(){ helpString += "The trim parameter allows you to indicate if you would like a sequences and quality scores trimmed to the clipQualLeft and clipQualRight values. Default=True. \n"; helpString += "The accnos parameter allows you to provide a accnos file containing the names of the sequences you would like extracted. You may enter multiple files by separating them by -'s. \n"; helpString += "Example sffinfo(sff=mySffFile.sff, trim=F).\n"; - helpString += "Note: No spaces between parameter labels (i.e. sff), '=' and parameters (i.e.yourSffFileName).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. sff), '=' and parameters (i.e.yourSffFileName).\n"; return helpString; } catch(exception& e) { diff --git a/splitabundcommand.cpp b/splitabundcommand.cpp index 810b839..f7490f7 100644 --- a/splitabundcommand.cpp +++ b/splitabundcommand.cpp @@ -48,7 +48,7 @@ string SplitAbundCommand::getHelpString(){ helpString += "If you want .abund and .rare files for all groups, set groups=all. \n"; helpString += "The split.abund command should be used in the following format: split.abund(fasta=yourFasta, list=yourListFile, group=yourGroupFile, label=yourLabels, cutoff=yourCutoff).\n"; helpString += "Example: split.abund(fasta=abrecovery.fasta, list=abrecovery.fn.list, group=abrecovery.groups, label=0.03, cutoff=2).\n"; - helpString += "Note: No spaces between parameter labels (i.e. list), '=' and parameters (i.e.yourListfile).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. list), '=' and parameters (i.e.yourListfile).\n"; return helpString; } catch(exception& e) { diff --git a/splitgroupscommand.cpp b/splitgroupscommand.cpp index bdb6e7c..c212434 100644 --- a/splitgroupscommand.cpp +++ b/splitgroupscommand.cpp @@ -41,7 +41,7 @@ string SplitGroupCommand::getHelpString(){ helpString += "If you want .fasta and .names files for all groups, set groups=all. \n"; helpString += "The split.group command should be used in the following format: split.group(fasta=yourFasta, group=yourGroupFile).\n"; helpString += "Example: split.group(fasta=abrecovery.fasta, group=abrecovery.groups).\n"; - helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n"; return helpString; } catch(exception& e) { diff --git a/subsamplecommand.cpp b/subsamplecommand.cpp index 5bc49d6..3b89c6d 100644 --- a/subsamplecommand.cpp +++ b/subsamplecommand.cpp @@ -53,7 +53,7 @@ string SubSampleCommand::getHelpString(){ helpString += "Example sub.sample(list=abrecovery.fn.list, group=abrecovery.groups, groups=B-C, size=20).\n"; helpString += "The default value for groups is all the groups in your groupfile, and all labels in your inputfile will be used.\n"; helpString += "The sub.sample command outputs a .subsample file.\n"; - helpString += "Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n"; return helpString; } catch(exception& e) { diff --git a/summarycommand.cpp b/summarycommand.cpp index cc4b69f..6f4bb45 100644 --- a/summarycommand.cpp +++ b/summarycommand.cpp @@ -71,7 +71,7 @@ string SummaryCommand::getHelpString(){ helpString += "The default value calc is sobs-chao-ace-jack-shannon-npshannon-simpson\n"; helpString += "If you are running summary.single with a shared file and would like your summary results collated in one file, set groupmode=t. (Default=true).\n"; helpString += "The label parameter is used to analyze specific labels in your input.\n"; - helpString += "Note: No spaces between parameter labels (i.e. label), '=' and parameters (i.e.yourLabels).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. label), '=' and parameters (i.e.yourLabels).\n"; return helpString; } catch(exception& e) { diff --git a/summarysharedcommand.cpp b/summarysharedcommand.cpp index 6db7dab..13a77ed 100644 --- a/summarysharedcommand.cpp +++ b/summarysharedcommand.cpp @@ -89,7 +89,7 @@ string SummarySharedCommand::getHelpString(){ helpString += "The all parameter is used to specify if you want the estimate of all your groups together. This estimate can only be made for sharedsobs and sharedchao calculators. The default is false.\n"; helpString += "If you use sharedchao and run into memory issues, set all to false. \n"; helpString += "The groups parameter allows you to specify which of the groups in your groupfile you would like analyzed. You must enter at least 2 valid groups.\n"; - helpString += "Note: No spaces between parameter labels (i.e. label), '=' and parameters (i.e.yourLabel).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. label), '=' and parameters (i.e.yourLabel).\n"; return helpString; } catch(exception& e) { diff --git a/treegroupscommand.cpp b/treegroupscommand.cpp index e5b7e74..5d7df34 100644 --- a/treegroupscommand.cpp +++ b/treegroupscommand.cpp @@ -94,7 +94,7 @@ string TreeGroupCommand::getHelpString(){ helpString += validCalculator.printCalc("treegroup"); helpString += "Or the tree.shared command can be in the following format: tree.shared(phylip=yourPhylipFile).\n"; helpString += "Example tree.shared(phylip=abrecovery.dist).\n"; - helpString += "Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n"; return helpString; } catch(exception& e) { diff --git a/trimflowscommand.cpp b/trimflowscommand.cpp index e6c6fdf..c4b5f43 100644 --- a/trimflowscommand.cpp +++ b/trimflowscommand.cpp @@ -47,7 +47,7 @@ string TrimFlowsCommand::getHelpString(){ string helpString = ""; helpString += "The trim.flows command reads a flowgram file and creates .....\n"; helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n"; - helpString += "For more details please check out the wiki http://www.mothur.org/wiki/Trim.flows.\n\n"; + helpString += "For more details please check out the wiki http://www.mothur.org/wiki/Trim.flows.\n"; return helpString; } catch(exception& e) { diff --git a/trimseqscommand.cpp b/trimseqscommand.cpp index 9ff75df..b5393a3 100644 --- a/trimseqscommand.cpp +++ b/trimseqscommand.cpp @@ -80,7 +80,7 @@ string TrimSeqsCommand::getHelpString(){ helpString += "maxhomop=yourMaxhomop, minlength=youMinlength, maxlength=yourMaxlength) \n"; helpString += "Example trim.seqs(fasta=abrecovery.fasta, flip=..., oligos=..., maxambig=..., maxhomop=..., minlength=..., maxlength=...).\n"; helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n"; - helpString += "For more details please check out the wiki http://www.mothur.org/wiki/Trim.seqs .\n\n"; + helpString += "For more details please check out the wiki http://www.mothur.org/wiki/Trim.seqs .\n"; return helpString; } catch(exception& e) { @@ -583,7 +583,7 @@ int TrimSeqsCommand::driverCreateTrim(string filename, string qFileName, string if(barcodes.size() != 0){ string thisGroup = barcodeNameVector[barcodeIndex]; - if (primers.size() != 0) { if (primerNameVector[primerIndex] != "") { thisGroup += "." + primerNameVector[primerIndex]; } } + if (primers.size() != 0) { thisGroup += "." + primerNameVector[primerIndex]; } outGroupsFile << currSeq.getName() << '\t' << thisGroup << endl; diff --git a/unifracunweightedcommand.cpp b/unifracunweightedcommand.cpp index a8c656c..81601a1 100644 --- a/unifracunweightedcommand.cpp +++ b/unifracunweightedcommand.cpp @@ -48,7 +48,7 @@ string UnifracUnweightedCommand::getHelpString(){ helpString += "Example unifrac.unweighted(groups=A-B-C, iters=500).\n"; helpString += "The default value for groups is all the groups in your groupfile, and iters is 1000.\n"; helpString += "The unifrac.unweighted command output two files: .unweighted and .uwsummary their descriptions are in the manual.\n"; - helpString += "Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n"; return helpString; } catch(exception& e) { diff --git a/unifracweightedcommand.cpp b/unifracweightedcommand.cpp index 29cdf94..7915cac 100644 --- a/unifracweightedcommand.cpp +++ b/unifracweightedcommand.cpp @@ -48,7 +48,7 @@ string UnifracWeightedCommand::getHelpString(){ helpString += "Example unifrac.weighted(groups=A-B-C, iters=500).\n"; helpString += "The default value for groups is all the groups in your groupfile, and iters is 1000.\n"; helpString += "The unifrac.weighted command output two files: .weighted and .wsummary their descriptions are in the manual.\n"; - helpString += "Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n"; return helpString; } catch(exception& e) { diff --git a/venncommand.cpp b/venncommand.cpp index c66d1e3..c6d534e 100644 --- a/venncommand.cpp +++ b/venncommand.cpp @@ -56,7 +56,7 @@ string VennCommand::getHelpString(){ helpString += "If you have more than 4 groups, the permute parameter will find all possible combos of 4 of your groups and create pictures for them, default=F.\n"; helpString += "The only estimators available four 4 groups are sharedsobs and sharedchao.\n"; helpString += "The venn command outputs a .svg file for each calculator you specify at each distance you choose.\n"; - helpString += "Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n"; return helpString; } catch(exception& e) { -- 2.39.2