(final BloomFilterDeBruijnGraph graph, final ArrayDeque<Kmer> candidates, final int lookahead)
| 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); |
no test coverage detected