depthPlusOne.incAll(1); final Set<MultiSampleEdge> nextEdges = backwards ? incomingEdgesOf(v) : outgoingEdgesOf(v); for (final MultiSampleEdge e : nextEdges) {
@Test public void testIncrease() { final int CAPACITY = 10; final CountSet subject = new CountSet(CAPACITY); final HashSet<Integer> reasuranceSet = new HashSet<>(CAPACITY); final int REPEATS = 1000; final Random rnd = new Random(13); final int[] values = new int[REPEATS]; final Integer[] valueWrappers = new Integer[REPEATS]; for (int i = 0; i < REPEATS; i++) { int newInt = rnd.nextInt(500); values[i] = newInt; valueWrappers[i] = newInt; } subject.incAll(3); for (final int j : reasuranceSet) Assert.assertTrue(subject.contains(j+3)); for (int j = 0; j < 501; j++) Assert.assertEquals(subject.contains(j+3),reasuranceSet.contains(j)); }
/** * Move on vertex along the reference path checking for the presence of new opening alternative paths. * * @param anchoring anchoring information on the targeted read. * @param backwards whether we are extending the block backwards or forwards. * @param currentVertex the current vertex. * @param pathSizes current block path sizes. * @param expectedAlternativePathRejoins information about location of vertices along the reference path where open alternative paths will rejoin. * @return the next current-vertex, never {@code null} unless there is a bug. */ private MultiDeBruijnVertex advanceOnReferencePath(final ReadAnchoring anchoring, final boolean backwards, final MultiDeBruijnVertex currentVertex, final CountSet pathSizes, final Map<MultiDeBruijnVertex, CountSet> expectedAlternativePathRejoins) { final Set<MultiSampleEdge> nextEdges = backwards ? graph.incomingEdgesOf(currentVertex) : graph.outgoingEdgesOf(currentVertex); MultiDeBruijnVertex nextReferenceVertex = null; for (final MultiSampleEdge e : nextEdges) { final MultiDeBruijnVertex nextVertex = backwards ? graph.getEdgeSource(e) : graph.getEdgeTarget(e); if (e.isRef()) nextReferenceVertex = nextVertex; else { final CountSet pathSizesPlusOne = pathSizes.clone(); pathSizesPlusOne.incAll(1); graph.calculateRejoins(nextVertex, expectedAlternativePathRejoins, anchoring.referenceWithinAnchorsMap.keySet(), pathSizesPlusOne, true, backwards); } } return nextReferenceVertex; }
pathSizes.incAll(1); blockLength++;