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

Method getSuccessorsRanked

src/rnabloom/util/GraphUtils.java:5518–5567  ·  view source on GitHub ↗
(Kmer source, BloomFilterDeBruijnGraph graph, int lookahead, float covThreshold)

Source from the content-addressed store, hash-verified

5516// }
5517
5518 private static LinkedList<Kmer> getSuccessorsRanked(Kmer source, BloomFilterDeBruijnGraph graph, int lookahead, float covThreshold) {
5519 LinkedList<Kmer> results = new LinkedList<>();
5520 ArrayDeque<Kmer> neighbors = source.getSuccessors(graph.getK(), graph.getMaxNumHash(), graph);
5521 if (neighbors.isEmpty()) {
5522 return results;
5523 }
5524 else if (neighbors.size() == 1) {
5525 results.add(neighbors.peek());
5526 return results;
5527 }
5528
5529 LinkedList<Float> values = new LinkedList<>();
5530
5531 ListIterator<Kmer> resultsItr;
5532 ListIterator<Float> valuesItr;
5533
5534 for (Kmer n : neighbors) {
5535 if (n.count >= covThreshold) {
5536 float c = getMaxMedianCoverageRight(graph, n, lookahead);
5537
5538 if (results.isEmpty()) {
5539 results.add(n);
5540 values.add(c);
5541 }
5542 else {
5543 resultsItr = results.listIterator();
5544 valuesItr = values.listIterator();
5545
5546 float val;
5547 while (valuesItr.hasNext()) {
5548 resultsItr.next();
5549 val = valuesItr.next();
5550
5551 if (c > val) {
5552 if (valuesItr.hasPrevious()) {
5553 resultsItr.previous();
5554 valuesItr.previous();
5555 }
5556
5557 resultsItr.add(n);
5558 valuesItr.add(c);
5559 break;
5560 }
5561 }
5562 }
5563 }
5564 }
5565
5566 return results;
5567 }
5568
5569 private static LinkedList<Kmer> getPredecessorsRanked(Kmer source, BloomFilterDeBruijnGraph graph, int lookahead, float covThreshold) {
5570 LinkedList<Kmer> results = new LinkedList<>();

Callers 1

findPathMethod · 0.95

Calls 8

getMaxNumHashMethod · 0.80
addMethod · 0.65
hasNextMethod · 0.65
nextMethod · 0.65
getSuccessorsMethod · 0.45
getKMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected