MCPcopy Create free account
hub / github.com/BirolLab/abyss / writeEstimate

Function writeEstimate

DistanceEst/DistanceEst.cpp:297–335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

295}
296
297static void writeEstimate(ostream& out,
298 const ContigNode& id0, const ContigNode& id1,
299 unsigned len0, unsigned len1,
300 const Pairs& pairs, const PMF& pmf)
301{
302 if (pairs.size() < opt::npairs)
303 return;
304
305 DistanceEst est;
306 est.distance = estimateDistance(len0, len1,
307 pairs, pmf, est.numPairs);
308 est.stdDev = pmf.getSampleStdDev(est.numPairs);
309
310 std::pair<ContigNode, ContigNode> e(id0, id1 ^ id0.sense());
311 if (est.numPairs >= opt::npairs) {
312 if (opt::format == DOT) {
313#pragma omp critical(out)
314 out << get(g_contigNames, e) << " [" << est << "]\n";
315 } else if (opt::format == GFA2) {
316 // Output only one of the two complementary edges.
317 if (len1 < opt::seedLen || e.first < e.second || e.first == e.second)
318#pragma omp critical(out)
319 out << "G\t*"
320 << '\t' << get(g_contigNames, e.first)
321 << '\t' << get(g_contigNames, e.second)
322 << '\t' << est.distance
323 << '\t' << (int)ceilf(est.stdDev)
324 << "\tFC:i:" << est.numPairs
325 << '\n';
326 } else
327 out << ' ' << get(g_contigNames, id1) << ',' << est;
328 } else if (opt::verbose > 1) {
329#pragma omp critical(cerr)
330 cerr << "warning: " << get(g_contigNames, e)
331 << " [d=" << est.distance << "] "
332 << est.numPairs << " of " << pairs.size()
333 << " pairs fit the expected distribution\n";
334 }
335}
336
337/** Generate distance estimates for the specified alignments. */
338static void writeEstimates(ostream& out,

Callers 1

writeEstimatesFunction · 0.85

Calls 5

estimateDistanceFunction · 0.85
getSampleStdDevMethod · 0.80
senseMethod · 0.80
getFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected