MCPcopy Create free account
hub / github.com/arq5x/bedtools2 / doMean

Method doMean

src/coverageFile/coverageFile.cpp:172–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170}
171
172void CoverageFile::doMean(RecordOutputMgr *outputMgr, RecordKeyVector &hits)
173{
174 size_t sum =0;
175 for (size_t i= 0; i < _queryLen; i++) {
176 sum += _depthArray[i];
177 }
178 ostringstream s;
179 float mean = ((float)sum / (float)_queryLen);
180 char *meanString;
181 asprintf(&meanString, "%0.7f", mean);
182 s << meanString;
183 _finalOutput.append(s.str());
184 outputMgr->printRecord(hits.getKey(), _finalOutput);
185}
186
187
188void CoverageFile::doHist(RecordOutputMgr *outputMgr, RecordKeyVector &hits)

Callers

nothing calls this directly

Calls 4

strMethod · 0.80
appendMethod · 0.45
printRecordMethod · 0.45
getKeyMethod · 0.45

Tested by

no test coverage detected