X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=chimeraseqscommand.cpp;h=aaed3bab7b56b14460d06de90c9551df70c4351d;hb=dbd5da8043df1cb9f5ff7c6ddb5f550ea49b52c2;hp=105fd11b90afd8ce700bb3b20b66bcc9b39bdbb2;hpb=348a7bac1d3c5d17ae0e4a93b78f69f4e200a190;p=mothur.git diff --git a/chimeraseqscommand.cpp b/chimeraseqscommand.cpp index 105fd11..aaed3ba 100644 --- a/chimeraseqscommand.cpp +++ b/chimeraseqscommand.cpp @@ -22,7 +22,7 @@ ChimeraSeqsCommand::ChimeraSeqsCommand(string option){ else { //valid paramters for this command - string Array[] = {"fasta", "filter", "correction", "processors", "method", "window", "increment", "template" }; + string Array[] = {"fasta", "filter", "correction", "processors", "method", "window", "increment", "template", "conservation", "quantile" }; vector myArray (Array, Array+(sizeof(Array)/sizeof(string))); OptionParser parser(option); @@ -44,6 +44,14 @@ ChimeraSeqsCommand::ChimeraSeqsCommand(string option){ if (templatefile == "not open") { abort = true; } else if (templatefile == "not found") { templatefile = ""; } + consfile = validParameter.validFile(parameters, "conservation", true); + if (consfile == "not open") { abort = true; } + else if (consfile == "not found") { consfile = ""; } + + quanfile = validParameter.validFile(parameters, "quantile", true); + if (quanfile == "not open") { abort = true; } + else if (quanfile == "not found") { quanfile = ""; } + string temp; temp = validParameter.validFile(parameters, "filter", false); if (temp == "not found") { temp = "T"; } @@ -58,7 +66,7 @@ ChimeraSeqsCommand::ChimeraSeqsCommand(string option){ temp = validParameter.validFile(parameters, "window", false); if (temp == "not found") { temp = "0"; } convert(temp, window); - temp = validParameter.validFile(parameters, "increment", false); if (temp == "not found") { temp = "10"; } + temp = validParameter.validFile(parameters, "increment", false); if (temp == "not found") { temp = "25"; } convert(temp, increment); method = validParameter.validFile(parameters, "method", false); if (method == "not found") { method = "pintail"; } @@ -105,9 +113,16 @@ int ChimeraSeqsCommand::execute(){ if (abort == true) { return 0; } - if (method == "bellerophon") { chimera = new Bellerophon(fastafile); } - else if (method == "pintail") { chimera = new Pintail(fastafile); } - else { mothurOut("Not a valid method."); mothurOutEndLine(); return 0; } + if (method == "bellerophon") { chimera = new Bellerophon(fastafile); } + else if (method == "pintail") { chimera = new Pintail(fastafile, templatefile); + //saves time to avoid generating it + if (consfile != "") { chimera->setCons(consfile); } + else { chimera->setCons(""); } + + //saves time to avoid generating it + if (quanfile != "") { chimera->setQuantiles(quanfile); } + else { chimera->setQuantiles(""); } + }else { mothurOut("Not a valid method."); mothurOutEndLine(); return 0; } //set user options chimera->setFilter(filter); @@ -115,8 +130,7 @@ int ChimeraSeqsCommand::execute(){ chimera->setProcessors(processors); chimera->setWindow(window); chimera->setIncrement(increment); - chimera->setTemplate(templatefile); - + //find chimeras chimera->getChimeras(); @@ -139,6 +153,5 @@ int ChimeraSeqsCommand::execute(){ exit(1); } } - /**************************************************************************************************/