MCPcopy Create free account
hub / github.com/BirolLab/RNA-Bloom / greedyExtendRightOnce

Method greedyExtendRightOnce

src/rnabloom/util/GraphUtils.java:501–525  ·  view source on GitHub ↗
(final BloomFilterDeBruijnGraph graph, final ArrayDeque<Kmer> candidates, final int lookahead)

Source from the content-addressed store, hash-verified

499 }
500
501 public static Kmer greedyExtendRightOnce(final BloomFilterDeBruijnGraph graph, final ArrayDeque<Kmer> candidates, final int lookahead) {
502 if (candidates.isEmpty()) {
503 return null;
504 }
505 else {
506 if (candidates.size() == 1) {
507 return candidates.peek();
508 }
509 else {
510 float bestCov = -1;
511 Kmer bestKmer = null;
512 for (Kmer kmer : candidates) {
513 float c = getMaxMedianCoverageRight(graph, kmer, lookahead);
514 if (c > bestCov) {
515 bestKmer = kmer;
516 bestCov = c;
517 }
518 else if (c == bestCov && kmer.count > bestKmer.count) {
519 bestKmer = kmer;
520 }
521 }
522 return bestKmer;
523 }
524 }
525 }
526
527 public static Kmer greedyExtendRightOnce(final BloomFilterDeBruijnGraph graph, final Kmer source, final int lookahead) {
528 return greedyExtendRightOnce(graph, source.getSuccessors(graph.getK(), graph.getMaxNumHash(), graph), lookahead);

Callers 3

getMaxCoveragePathMethod · 0.95
greedyExtendRightMethod · 0.95
greedyExtendMethod · 0.95

Calls 5

getMaxNumHashMethod · 0.80
sizeMethod · 0.45
getSuccessorsMethod · 0.45
getKMethod · 0.45

Tested by

no test coverage detected