X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=consensusseqscommand.cpp;h=d9a5e294c08d1cd3a68c7890b7c0a6ab7fbde04a;hb=6b32d112bb60e9f7eb6d4407a4eed4c49b67bced;hp=f0fc6bff9da6d6d8b0ed8b368ad2422f25cd732a;hpb=deba0af0ccdcb6005ed5b2b82649b137c63fbdf7;p=mothur.git diff --git a/consensusseqscommand.cpp b/consensusseqscommand.cpp index f0fc6bf..d9a5e29 100644 --- a/consensusseqscommand.cpp +++ b/consensusseqscommand.cpp @@ -219,12 +219,14 @@ int ConsensusSeqsCommand::execute(){ if (abort == true) { if (calledHelp) { return 0; } return 2; } + int start = time(NULL); + readFasta(); if (m->control_pressed) { return 0; } if (namefile != "") { readNames(); } - if (countfile != "") { ct.readTable(countfile); } + if (countfile != "") { ct.readTable(countfile, true, false); } if (m->control_pressed) { return 0; } @@ -310,7 +312,7 @@ int ConsensusSeqsCommand::execute(){ }else { - + InputData* input = new InputData(listfile, "list"); ListVector* list = input->getListVector(); @@ -391,6 +393,8 @@ int ConsensusSeqsCommand::execute(){ delete input; } + m->mothurOut("It took " + toString(time(NULL) - start) + " secs to find the consensus sequences."); + m->mothurOutEndLine(); m->mothurOut("Output File Names: "); m->mothurOutEndLine(); for (int i = 0; i < outputNames.size(); i++) { m->mothurOut(outputNames[i]); m->mothurOutEndLine(); } @@ -431,6 +435,8 @@ int ConsensusSeqsCommand::processList(ListVector*& list){ outSummary << "OTU#\tPositioninAlignment\tA\tT\tG\tC\tGap\tNumberofSeqs\tConsensusBase" << endl; + string snumBins = toString(list->getNumBins()); + vector binLabels = list->getLabels(); for (int i = 0; i < list->getNumBins(); i++) { if (m->control_pressed) { outSummary.close(); outName.close(); outFasta.close(); return 0; } @@ -438,8 +444,8 @@ int ConsensusSeqsCommand::processList(ListVector*& list){ string bin = list->get(i); string consSeq = getConsSeq(bin, outSummary, i); - outFasta << ">seq" << (i+1) << endl << consSeq << endl; - outName << "seq" << (i+1) << '\t' << "seq" << (i+1) << "," << bin << endl; + outFasta << ">" << binLabels[i] << endl << consSeq << endl; + outName << binLabels[i] << '\t' << binLabels[i] << "," << bin << endl; } outSummary.close(); outName.close(); outFasta.close();