X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=shhhercommand.cpp;h=c34f25de509c78b9e1b97b7c303142864e3c7e01;hb=529ec122f7cac4af987e121d150b878d7c7a0d5d;hp=97629b600031c06c063f405175dd9fa369ae7c93;hpb=49d2b7459c5027557564b21e9487dadafbbbdc96;p=mothur.git diff --git a/shhhercommand.cpp b/shhhercommand.cpp index 97629b6..c34f25d 100644 --- a/shhhercommand.cpp +++ b/shhhercommand.cpp @@ -802,7 +802,7 @@ string ShhherCommand::createNamesFile(){ duplicateNames[mapSeqToUnique[i]] += seqNameVector[i] + ','; } - string nameFileName = outputDir + m->getRootName(m->getSimpleName(flowFileName) + getOutputFileNameTag("name"); + string nameFileName = outputDir + m->getRootName(m->getSimpleName(flowFileName)) + getOutputFileNameTag("name"); ofstream nameFile; m->openOutputFile(nameFileName, nameFile); @@ -1839,14 +1839,17 @@ void ShhherCommand::writeGroups(){ try { string thisOutputDir = outputDir; if (outputDir == "") { thisOutputDir += m->hasPath(flowFileName); } - string fileRoot = thisOutputDir + m->getRootName(m->getSimpleName(flowFileName)); - string groupFileName = fileRoot + getOutputFileNameTag("group"); + string fileRoot = m->getRootName(m->getSimpleName(flowFileName)); + int pos = fileRoot.find_first_of('.'); + string fileGroup = fileRoot; + if (pos != string::npos) { fileGroup = fileRoot.substr(pos+1, (fileRoot.length()-1-(pos+1))); } + string groupFileName = thisOutputDir + fileRoot + getOutputFileNameTag("group"); ofstream groupFile; m->openOutputFile(groupFileName, groupFile); for(int i=0;icontrol_pressed) { break; } - groupFile << seqNameVector[i] << '\t' << fileRoot << endl; + groupFile << seqNameVector[i] << '\t' << fileGroup << endl; } groupFile.close(); outputNames.push_back(groupFileName); @@ -2306,7 +2309,7 @@ int ShhherCommand::driver(vector filenames, string thisCompositeFASTAFil if (m->control_pressed) { break; } vector otuCounts(numOTUs, 0); - for(int i=0;i filenames, string thisCompositeFASTAFil string fastaFileName = thisOutputDir + m->getRootName(m->getSimpleName(flowFileName)) + getOutputFileNameTag("fasta"); string nameFileName = thisOutputDir + m->getRootName(m->getSimpleName(flowFileName)) + getOutputFileNameTag("name"); string otuCountsFileName = thisOutputDir + m->getRootName(m->getSimpleName(flowFileName)) + getOutputFileNameTag("counts"); - string fileRoot = thisOutputDir + m->getRootName(m->getSimpleName(flowFileName)); - string groupFileName = fileRoot + getOutputFileNameTag("group"); + string fileRoot = m->getRootName(m->getSimpleName(flowFileName)); + int pos = fileRoot.find_first_of('.'); + string fileGroup = fileRoot; + if (pos != string::npos) { fileGroup = fileRoot.substr(pos+1, (fileRoot.length()-1-(pos+1))); } + string groupFileName = thisOutputDir + fileRoot + getOutputFileNameTag("group"); writeQualities(numOTUs, numFlowCells, qualityFileName, otuCounts, nSeqsPerOTU, seqNumber, singleTau, flowDataIntI, uniqueFlowgrams, cumNumSeqs, mapUniqueToSeq, seqNameVector, centroids, aaI); if (m->control_pressed) { break; } writeSequences(thisCompositeFASTAFileName, numOTUs, numFlowCells, fastaFileName, otuCounts, uniqueFlowgrams, seqNameVector, aaI, centroids);if (m->control_pressed) { break; } writeNames(thisCompositeNamesFileName, numOTUs, nameFileName, otuCounts, seqNameVector, aaI, nSeqsPerOTU); if (m->control_pressed) { break; } writeClusters(otuCountsFileName, numOTUs, numFlowCells,otuCounts, centroids, uniqueFlowgrams, seqNameVector, aaI, nSeqsPerOTU, lengths, flowDataIntI); if (m->control_pressed) { break; } - writeGroups(groupFileName, fileRoot, numSeqs, seqNameVector); if (m->control_pressed) { break; } + writeGroups(groupFileName, fileGroup, numSeqs, seqNameVector); if (m->control_pressed) { break; } if (large) { if (g > 0) { @@ -2626,7 +2632,7 @@ int ShhherCommand::cluster(string filename, string distFileName, string namesFil read->read(clusterNameMap); ListVector* list = read->getListVector(); - SparseMatrix* matrix = read->getMatrix(); + SparseDistanceMatrix* matrix = read->getDMatrix(); delete read; delete clusterNameMap;