(Kmer source,
BloomFilterDeBruijnGraph graph,
int maxTipLength,
int bound,
int maxIndelSize,
float percentIdentity,
float minKmerCov)
| 7241 | } |
| 7242 | |
| 7243 | public static ArrayDeque<Kmer> extendLeft(Kmer source, |
| 7244 | BloomFilterDeBruijnGraph graph, |
| 7245 | int maxTipLength, |
| 7246 | int bound, |
| 7247 | int maxIndelSize, |
| 7248 | float percentIdentity, |
| 7249 | float minKmerCov) { |
| 7250 | int k = graph.getK(); |
| 7251 | int numHash = graph.getMaxNumHash(); |
| 7252 | |
| 7253 | ArrayDeque<Kmer> result = new ArrayDeque<>(); |
| 7254 | |
| 7255 | ArrayDeque<Kmer> neighbors = new ArrayDeque<>(4); |
| 7256 | source.getPredecessors(k, numHash, graph, neighbors, minKmerCov); |
| 7257 | Kmer best; |
| 7258 | |
| 7259 | while (!neighbors.isEmpty()) { |
| 7260 | |
| 7261 | if (neighbors.size() == 1) { |
| 7262 | best = neighbors.pop(); |
| 7263 | result.add(best); |
| 7264 | |
| 7265 | ArrayDeque<Kmer> b = naiveExtendLeft(best, graph, maxTipLength, bound-result.size(), minKmerCov); |
| 7266 | |
| 7267 | if (b.isEmpty()) { |
| 7268 | break; |
| 7269 | } |
| 7270 | else { |
| 7271 | result.addAll(b); |
| 7272 | best = result.peekLast(); |
| 7273 | } |
| 7274 | } |
| 7275 | else { |
| 7276 | best = null; |
| 7277 | |
| 7278 | ArrayDeque<ArrayDeque<Kmer>> branches = new ArrayDeque<>(4); |
| 7279 | |
| 7280 | float maxCov = -1; |
| 7281 | while (!neighbors.isEmpty()) { |
| 7282 | Kmer n = neighbors.pop(); |
| 7283 | |
| 7284 | // if (hasDepthLeft(n, graph, maxTipLength)) { |
| 7285 | if (n.hasDepthLeft(k, numHash, graph, maxTipLength)) { |
| 7286 | ArrayDeque<Kmer> b = naiveExtendLeft(n, graph, maxTipLength, bound-result.size(), minKmerCov); |
| 7287 | if (b.size() < maxTipLength) { |
| 7288 | // indicates too many branches; can't resolve |
| 7289 | return result; |
| 7290 | } |
| 7291 | |
| 7292 | b.addFirst(n); |
| 7293 | |
| 7294 | float c = getMedianKmerCoverage(b); |
| 7295 | if (c > maxCov) { |
| 7296 | maxCov = c; |
| 7297 | branches.addFirst(b); |
| 7298 | } |
| 7299 | else { |
| 7300 | branches.addLast(b); |
nothing calls this directly
no test coverage detected