(Kmer source,
BloomFilterDeBruijnGraph graph,
int maxTipLength,
int bound,
int maxIndelSize,
float percentIdentity,
float minKmerCov)
| 7112 | } |
| 7113 | |
| 7114 | public static ArrayDeque<Kmer> extendRight(Kmer source, |
| 7115 | BloomFilterDeBruijnGraph graph, |
| 7116 | int maxTipLength, |
| 7117 | int bound, |
| 7118 | int maxIndelSize, |
| 7119 | float percentIdentity, |
| 7120 | float minKmerCov) { |
| 7121 | int k = graph.getK(); |
| 7122 | int numHash = graph.getMaxNumHash(); |
| 7123 | ArrayDeque<Kmer> result = new ArrayDeque<>(); |
| 7124 | |
| 7125 | ArrayDeque<Kmer> neighbors = new ArrayDeque<>(4); |
| 7126 | source.getSuccessors(k, numHash, graph, neighbors, minKmerCov); |
| 7127 | Kmer best; |
| 7128 | |
| 7129 | while (!neighbors.isEmpty() && result.size() <= bound) { |
| 7130 | |
| 7131 | if (neighbors.size() == 1) { |
| 7132 | best = neighbors.pop(); |
| 7133 | result.add(best); |
| 7134 | |
| 7135 | ArrayDeque<Kmer> b = naiveExtendRight(best, graph, maxTipLength, bound-result.size(), minKmerCov); |
| 7136 | |
| 7137 | if (b.isEmpty()) { |
| 7138 | break; |
| 7139 | } |
| 7140 | else { |
| 7141 | result.addAll(b); |
| 7142 | best = result.peekLast(); |
| 7143 | } |
| 7144 | } |
| 7145 | else { |
| 7146 | best = null; |
| 7147 | |
| 7148 | ArrayDeque<ArrayDeque<Kmer>> branches = new ArrayDeque<>(4); |
| 7149 | |
| 7150 | float maxCov = -1; |
| 7151 | while (!neighbors.isEmpty()) { |
| 7152 | Kmer n = neighbors.pop(); |
| 7153 | |
| 7154 | if (n.hasDepthRight(k, numHash, graph, maxTipLength)) { |
| 7155 | ArrayDeque<Kmer> b = naiveExtendRight(n, graph, maxTipLength, bound-result.size(), minKmerCov); |
| 7156 | |
| 7157 | if (b.size() < maxTipLength) { |
| 7158 | // indicates too many branches; can't resolve |
| 7159 | return result; |
| 7160 | } |
| 7161 | |
| 7162 | b.addFirst(n); |
| 7163 | |
| 7164 | float c = getMedianKmerCoverage(b); |
| 7165 | if (c > maxCov) { |
| 7166 | maxCov = c; |
| 7167 | branches.addFirst(b); |
| 7168 | } |
| 7169 | else { |
| 7170 | branches.addLast(b); |
| 7171 | } |
nothing calls this directly
no test coverage detected