You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would find it useful to get a list of nodes in the same order as required by the edge table, that is, by time of node, then by node ID (I think of this as a "canonical" node order). Would this be a useful (if trivial) addition to tskit? At the moment we can only iterate over tree sequence nodes by node ID using ts.nodes(). In python, the required order is given by
One option would be to provide an order parameter to ts.nodes, like there is for tree.nodes. It would default to "id", but could be e.g. "time". It might be useful to have something like this because when hand coding it, it's easy to forget about what happens when there are ties (nodes at the same time).
The text was updated successfully, but these errors were encountered:
Part of the rationale is to add features that help when thinking of the tree sequence as a large graph (aka ARG) rather than when wanting to deal with the trees one-by-one. See #2469
Gosh, I have a short memory. This is already an issue: #2370 , although we didn't note the requirement to sort secondarily by node ID, so as to break ties and match the edge table order.
I would find it useful to get a list of nodes in the same order as required by the edge table, that is, by time of node, then by node ID (I think of this as a "canonical" node order). Would this be a useful (if trivial) addition to tskit? At the moment we can only iterate over tree sequence nodes by node ID using
ts.nodes()
. In python, the required order is given byOne option would be to provide an
order
parameter tots.nodes
, like there is for tree.nodes. It would default to "id", but could be e.g. "time". It might be useful to have something like this because when hand coding it, it's easy to forget about what happens when there are ties (nodes at the same time).The text was updated successfully, but these errors were encountered: