|
2 | 2 |
|
3 | 3 | import nl.tudelft.dnainator.graph.impl.NodeLabels; |
4 | 4 | import nl.tudelft.dnainator.graph.impl.RelTypes; |
| 5 | +import nl.tudelft.dnainator.graph.impl.properties.BubbleProperties; |
5 | 6 | import nl.tudelft.dnainator.graph.impl.properties.SequenceProperties; |
6 | 7 |
|
7 | 8 | import org.neo4j.graphdb.Direction; |
@@ -65,7 +66,7 @@ public Iterable<Relationship> expand(Path path, |
65 | 66 |
|
66 | 67 | // Encode the unclosed propagated bubbles on the edges. |
67 | 68 | from.getRelationships(RelTypes.NEXT, Direction.OUTGOING) |
68 | | - .forEach(out -> relIDtoSourceIDs.put(out.getId(), toPropagate)); |
| 69 | + .forEach(out -> propagateSourceIDs(toPropagate, out)); |
69 | 70 |
|
70 | 71 | // Process all outgoing edges. |
71 | 72 | List<Relationship> expand = new LinkedList<>(); |
@@ -119,6 +120,12 @@ private void createBubbleSource(Node n, Set<Long> toPropagate) { |
119 | 120 | } |
120 | 121 | } |
121 | 122 |
|
| 123 | + private void propagateSourceIDs(Set<Long> propagatedUnique, Relationship out) { |
| 124 | + out.setProperty(BubbleProperties.BUBBLE_SOURCE_IDS.name(), |
| 125 | + propagatedUnique.stream().mapToLong(l -> l).toArray()); |
| 126 | + relIDtoSourceIDs.put(out.getId(), propagatedUnique); |
| 127 | + } |
| 128 | + |
122 | 129 | private void createBubbleSink(Node n) { |
123 | 130 | int degree = n.getDegree(RelTypes.NEXT, Direction.INCOMING); |
124 | 131 | if (degree >= 2) { |
|
0 commit comments