X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=shhhercommand.cpp;h=508e2a90610d1b3705972a976580d90937358427;hb=e339f9008daa7d37c9a9034829565620a6abe783;hp=49e2faa03c1cd2eb74ea502ee5952c0512678644;hpb=f816b683e586575bfe3479760a8afd5ab08e8573;p=mothur.git diff --git a/shhhercommand.cpp b/shhhercommand.cpp index 49e2faa..508e2a9 100644 --- a/shhhercommand.cpp +++ b/shhhercommand.cpp @@ -136,7 +136,7 @@ ShhherCommand::ShhherCommand(string option) { flowFileName = validParameter.validFile(parameters, "flow", true); flowFilesFileName = validParameter.validFile(parameters, "file", true); if (flowFileName == "not found" && flowFilesFileName == "not found") { - m->mothurOut("values for either flow or file must be provided for the shhh.seqs command."); + m->mothurOut("values for either flow or file must be provided for the shhh.flows command."); m->mothurOutEndLine(); abort = true; } @@ -218,7 +218,7 @@ ShhherCommand::ShhherCommand(string option) { if (flowFileVector.size() == 0) { m->mothurOut("[ERROR]: no valid files."); m->mothurOutEndLine(); abort = true; } } else{ - outputDir += m->hasPath(flowFileName); + if (outputDir == "") { outputDir = m->hasPath(flowFileName); } flowFileVector.push_back(flowFileName); } @@ -431,6 +431,8 @@ int ShhherCommand::execute(){ if (m->control_pressed) { break; } + + getOTUData(listFileName); m->mothurRemove(distFileName); @@ -443,6 +445,7 @@ int ShhherCommand::execute(){ if (m->control_pressed) { break; } + for(int i=1;ireadMap(); read->read(clusterNameMap); - + ListVector* list = read->getListVector(); SparseMatrix* matrix = read->getMatrix(); @@ -2980,7 +2983,7 @@ void ShhherCommand::writeQualities(int numOTUs, int numFlowCells, string filenam try { string thisOutputDir = outputDir; - if (outputDir == "") { thisOutputDir += m->hasPath(filename); } + if (outputDir == "") { thisOutputDir = m->hasPath(filename); } string qualityFileName = thisOutputDir + m->getRootName(m->getSimpleName(filename)) + "shhh.qual"; ofstream qualityFile; @@ -3088,7 +3091,7 @@ void ShhherCommand::writeQualities(int numOTUs, int numFlowCells, string filenam void ShhherCommand::writeSequences(string thisCompositeFASTAFileName, int numOTUs, int numFlowCells, string filename, vector otuCounts, vector& uniqueFlowgrams, vector& seqNameVector, vector >& aaI, vector& centroids){ try { string thisOutputDir = outputDir; - if (outputDir == "") { thisOutputDir += m->hasPath(filename); } + if (outputDir == "") { thisOutputDir = m->hasPath(filename); } string fastaFileName = thisOutputDir + m->getRootName(m->getSimpleName(filename)) + "shhh.fasta"; ofstream fastaFile; m->openOutputFile(fastaFileName, fastaFile); @@ -3136,7 +3139,7 @@ void ShhherCommand::writeSequences(string thisCompositeFASTAFileName, int numOTU void ShhherCommand::writeNames(string thisCompositeNamesFileName, int numOTUs, string filename, vector otuCounts, vector& seqNameVector, vector >& aaI, vector& nSeqsPerOTU){ try { string thisOutputDir = outputDir; - if (outputDir == "") { thisOutputDir += m->hasPath(filename); } + if (outputDir == "") { thisOutputDir = m->hasPath(filename); } string nameFileName = thisOutputDir + m->getRootName(m->getSimpleName(filename)) + "shhh.names"; ofstream nameFile; m->openOutputFile(nameFileName, nameFile); @@ -3174,7 +3177,7 @@ void ShhherCommand::writeNames(string thisCompositeNamesFileName, int numOTUs, s void ShhherCommand::writeGroups(string filename, int numSeqs, vector& seqNameVector){ try { string thisOutputDir = outputDir; - if (outputDir == "") { thisOutputDir += m->hasPath(filename); } + if (outputDir == "") { thisOutputDir = m->hasPath(filename); } string fileRoot = thisOutputDir + m->getRootName(m->getSimpleName(filename)); string groupFileName = fileRoot + "shhh.groups"; ofstream groupFile; @@ -3199,7 +3202,7 @@ void ShhherCommand::writeGroups(string filename, int numSeqs, vector& se void ShhherCommand::writeClusters(string filename, int numOTUs, int numFlowCells, vector otuCounts, vector& centroids, vector& uniqueFlowgrams, vector& seqNameVector, vector >& aaI, vector& nSeqsPerOTU, vector& lengths, vector& flowDataIntI){ try { string thisOutputDir = outputDir; - if (outputDir == "") { thisOutputDir += m->hasPath(filename); } + if (outputDir == "") { thisOutputDir = m->hasPath(filename); } string otuCountsFileName = thisOutputDir + m->getRootName(m->getSimpleName(filename)) + "shhh.counts"; ofstream otuCountsFile; m->openOutputFile(otuCountsFileName, otuCountsFile);