X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=shhhercommand.cpp;h=40a4c8499a599207b56831c91e6f0f41c023eb2c;hb=116bbb1533575666a682910a10ae1fa2fc5b605c;hp=13e7ccfd496d035c151eaade308f9832af76b511;hpb=5eca3348fe3962b8965236ca877ef6f52e8fb104;p=mothur.git diff --git a/shhhercommand.cpp b/shhhercommand.cpp index 13e7ccf..40a4c84 100644 --- a/shhhercommand.cpp +++ b/shhhercommand.cpp @@ -251,19 +251,19 @@ ShhherCommand::ShhherCommand(string option) { temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); } m->setProcessors(temp); - convert(temp, processors); + m->mothurConvert(temp, processors); temp = validParameter.validFile(parameters, "cutoff", false); if (temp == "not found"){ temp = "0.01"; } - convert(temp, cutoff); + m->mothurConvert(temp, cutoff); temp = validParameter.validFile(parameters, "mindelta", false); if (temp == "not found"){ temp = "0.000001"; } - convert(temp, minDelta); + m->mothurConvert(temp, minDelta); temp = validParameter.validFile(parameters, "maxiter", false); if (temp == "not found"){ temp = "1000"; } - convert(temp, maxIters); + m->mothurConvert(temp, maxIters); temp = validParameter.validFile(parameters, "sigma", false);if (temp == "not found") { temp = "60"; } - convert(temp, sigma); + m->mothurConvert(temp, sigma); flowOrder = validParameter.validFile(parameters, "order", false); if (flowOrder == "not found"){ flowOrder = "TACG"; } @@ -2150,7 +2150,9 @@ void ShhherCommand::setOTUs(){ void ShhherCommand::writeQualities(vector otuCounts){ try { - string qualityFileName = flowFileName.substr(0,flowFileName.find_last_of('.')) + ".shhh.qual"; + string thisOutputDir = outputDir; + if (outputDir == "") { thisOutputDir += m->hasPath(flowFileName); } + string qualityFileName = thisOutputDir + flowFileName.substr(0,flowFileName.find_last_of('.')) + ".shhh.qual"; ofstream qualityFile; m->openOutputFile(qualityFileName, qualityFile); @@ -2255,8 +2257,9 @@ void ShhherCommand::writeQualities(vector otuCounts){ void ShhherCommand::writeSequences(vector otuCounts){ try { - - string fastaFileName = flowFileName.substr(0,flowFileName.find_last_of('.')) + ".shhh.fasta"; + string thisOutputDir = outputDir; + if (outputDir == "") { thisOutputDir += m->hasPath(flowFileName); } + string fastaFileName = thisOutputDir + flowFileName.substr(0,flowFileName.find_last_of('.')) + ".shhh.fasta"; ofstream fastaFile; m->openOutputFile(fastaFileName, fastaFile); @@ -2302,7 +2305,9 @@ void ShhherCommand::writeSequences(vector otuCounts){ void ShhherCommand::writeNames(vector otuCounts){ try { - string nameFileName = flowFileName.substr(0,flowFileName.find_last_of('.')) + ".shhh.names"; + string thisOutputDir = outputDir; + if (outputDir == "") { thisOutputDir += m->hasPath(flowFileName); } + string nameFileName = thisOutputDir + flowFileName.substr(0,flowFileName.find_last_of('.')) + ".shhh.names"; ofstream nameFile; m->openOutputFile(nameFileName, nameFile); @@ -2338,7 +2343,9 @@ void ShhherCommand::writeNames(vector otuCounts){ void ShhherCommand::writeGroups(){ try { - string fileRoot = flowFileName.substr(0,flowFileName.find_last_of('.')); + string thisOutputDir = outputDir; + if (outputDir == "") { thisOutputDir += m->hasPath(flowFileName); } + string fileRoot = thisOutputDir + flowFileName.substr(0,flowFileName.find_last_of('.')); string groupFileName = fileRoot + ".shhh.groups"; ofstream groupFile; m->openOutputFile(groupFileName, groupFile); @@ -2361,7 +2368,9 @@ void ShhherCommand::writeGroups(){ void ShhherCommand::writeClusters(vector otuCounts){ try { - string otuCountsFileName = flowFileName.substr(0,flowFileName.find_last_of('.')) + ".shhh.counts"; + string thisOutputDir = outputDir; + if (outputDir == "") { thisOutputDir += m->hasPath(flowFileName); } + string otuCountsFileName = thisOutputDir + flowFileName.substr(0,flowFileName.find_last_of('.')) + ".shhh.counts"; ofstream otuCountsFile; m->openOutputFile(otuCountsFileName, otuCountsFile);