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

Method greedyExtendLeftOnce

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

Source from the content-addressed store, hash-verified

562 }
563
564 public static Kmer greedyExtendLeftOnce(final BloomFilterDeBruijnGraph graph, final ArrayDeque<Kmer> candidates, final int lookahead) {
565 if (candidates.isEmpty()) {
566 return null;
567 }
568 else {
569 if (candidates.size() == 1) {
570 return candidates.peek();
571 }
572 else {
573 float bestCov = -1;
574 Kmer bestKmer = null;
575 for (Kmer kmer : candidates) {
576 float c = getMaxMedianCoverageLeft(graph, kmer, lookahead);
577 if (c > bestCov) {
578 bestKmer = kmer;
579 bestCov = c;
580 }
581 else if (c == bestCov && kmer.count > bestKmer.count) {
582 bestKmer = kmer;
583 }
584 }
585 return bestKmer;
586 }
587 }
588 }
589
590 public static Kmer greedyExtendLeftOnce(final BloomFilterDeBruijnGraph graph, final Kmer source, final int lookahead) {
591 return greedyExtendLeftOnce(graph, source.getPredecessors(graph.getK(), graph.getMaxNumHash(), graph), lookahead);

Callers 4

getMaxCoveragePathMethod · 0.95
greedyExtendLeftMethod · 0.95
greedyExtendMethod · 0.95

Calls 5

getMaxNumHashMethod · 0.80
sizeMethod · 0.45
getPredecessorsMethod · 0.45
getKMethod · 0.45

Tested by

no test coverage detected