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