Closed ducku closed 8 months ago
Changing to sort the first segment by existing y values first works better on this set of data, and I think it would work better overall.
I'm currently trying to make an example dataset showcasing this.
That's looking pretty good!
I guess in the second image it would be better if those reads on the inside coming down stayed on the inside when turning to go left, instead of going all the way down and coming left on the outside. But this is much cleaner than before.
Segments cycling on the first node had strange interactions since segments classified as "outgoing"(if its pathIndex == 0) had different methods of sorting.
Changes are made to how reads are placed outside of nodes when a cycle is detected, and inside of nodes when reads have the same source and destination Node.
A new tiebreaker is placed in sortByGoingTo for reads that start and end in the same node. Now they're placed based on the endmost node they were placed in, working its way back if there are no y values. Since these reads start and end in the same node, this should start the reads(in the first node) in the same order as the other nodes.
Segments outside of nodes now detects cycles, defined as the previous and next segments are in the node and going in the same direction. Segments outside of nodes and are between cycles now sort in reverse to keep the layout clean.
Extra space in between nodes are calculated after reads are added into the tracks variable.
Closes #321