Skip to content

Commit c407dc0

Browse files
committed
Add back propagateSourceIDs, and also store the propagatedSources for clustering
1 parent be99c47 commit c407dc0

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

dnainator-core/src/main/java/nl/tudelft/dnainator/graph/impl/command/TopologicalPathExpander.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import nl.tudelft.dnainator.graph.impl.NodeLabels;
44
import nl.tudelft.dnainator.graph.impl.RelTypes;
5+
import nl.tudelft.dnainator.graph.impl.properties.BubbleProperties;
56
import nl.tudelft.dnainator.graph.impl.properties.SequenceProperties;
67

78
import org.neo4j.graphdb.Direction;
@@ -65,7 +66,7 @@ public Iterable<Relationship> expand(Path path,
6566

6667
// Encode the unclosed propagated bubbles on the edges.
6768
from.getRelationships(RelTypes.NEXT, Direction.OUTGOING)
68-
.forEach(out -> relIDtoSourceIDs.put(out.getId(), toPropagate));
69+
.forEach(out -> propagateSourceIDs(toPropagate, out));
6970

7071
// Process all outgoing edges.
7172
List<Relationship> expand = new LinkedList<>();
@@ -119,6 +120,12 @@ private void createBubbleSource(Node n, Set<Long> toPropagate) {
119120
}
120121
}
121122

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+
122129
private void createBubbleSink(Node n) {
123130
int degree = n.getDegree(RelTypes.NEXT, Direction.INCOMING);
124131
if (degree >= 2) {
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package nl.tudelft.dnainator.graph.impl.properties;
2+
3+
/**
4+
* Properties of nodes within bubbles.
5+
*/
6+
public enum BubbleProperties {
7+
BUBBLE_SOURCE_IDS
8+
}

0 commit comments

Comments
 (0)