X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=sffinfocommand.cpp;h=3562dcc3e88265a93c23af38fa69b3b2c776e4c1;hb=bf83aa09a52403a2faf1a1f82489d1e0c8c32283;hp=66409e88f9013abd8deb9fd2ba78f6bfdf249a38;hpb=3e2465c16d187247ce3befd29811c2d5dfc15ee8;p=mothur.git diff --git a/sffinfocommand.cpp b/sffinfocommand.cpp index 66409e8..3562dcc 100644 --- a/sffinfocommand.cpp +++ b/sffinfocommand.cpp @@ -316,7 +316,7 @@ int SffInfoCommand::extractSffInfo(string input, string accnos){ if (sfftxt) { m->openOutputFile(sfftxtFileName, outSfftxt); outSfftxt.setf(ios::fixed, ios::floatfield); outSfftxt.setf(ios::showpoint); outputNames.push_back(sfftxtFileName); outputTypes["sfftxt"].push_back(sfftxtFileName); } if (fasta) { m->openOutputFile(outFastaFileName, outFasta); outputNames.push_back(outFastaFileName); outputTypes["fasta"].push_back(outFastaFileName); } if (qual) { m->openOutputFile(outQualFileName, outQual); outputNames.push_back(outQualFileName); outputTypes["qual"].push_back(outQualFileName); } - if (flow) { m->openOutputFile(outFlowFileName, outFlow); outputNames.push_back(outFlowFileName); outputTypes["flow"].push_back(outFlowFileName); } + if (flow) { m->openOutputFile(outFlowFileName, outFlow); outputNames.push_back(outFlowFileName); outFlow.setf(ios::fixed, ios::floatfield); outFlow.setf(ios::showpoint); outputTypes["flow"].push_back(outFlowFileName); } ifstream in; in.open(input.c_str(), ios::binary); @@ -331,8 +331,9 @@ int SffInfoCommand::extractSffInfo(string input, string accnos){ if (header.version != "0001") { m->mothurOut("Version is not supported, only support version 0001."); m->mothurOutEndLine(); return count; } //print common header - if (sfftxt) { printCommonHeader(outSfftxt, header); } - + if (sfftxt) { printCommonHeader(outSfftxt, header); } + if (flow) { outFlow << header.numFlowsPerRead << endl; } + //read through the sff file while (!in.eof()) { @@ -778,10 +779,16 @@ int SffInfoCommand::printQualSeqData(ofstream& out, seqRead& read, Header& heade //********************************************************************************************************************** int SffInfoCommand::printFlowSeqData(ofstream& out, seqRead& read, Header& header) { try { + if(header.clipQualRight > header.clipQualLeft){ + + int rightIndex = 0; + for (int i = 0; i < header.clipQualRight; i++) { rightIndex += read.flowIndex[i]; } + + out << header.name << ' ' << rightIndex; + for (int i = 0; i < read.flowgram.size(); i++) { out << setprecision(2) << ' ' << (read.flowgram[i]/(float)100); } + out << endl; + } - out << ">" << header.name << " xy=" << header.xy << endl; - for (int i = 0; i < read.flowgram.size(); i++) { out << setprecision(2) << (read.flowgram[i]/(float)100) << '\t'; } - out << endl; return 0; }