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
{{ message }}
Repository navigation
Document example of using ts.simplify(filter=None).draw_svg() to the viz docs, for large trees #2604
At the (not insubstantial) risk of adding more parameters to the drawing methods, I think it might be useful to provide an argument to restrict the tree to only a certain subset of sample nodes. Under the hood, this would presumably do a "simplify-edges-only" (see tskit-dev/what-is-an-arg-paper#92 (reply in thread). This would help if we need to visualise large trees, but don't want the node, site, mutation etc IDs to change. The edge IDs will change, of course, but I think that's inevitable, so just need documenting).
Alternatively, we could just implement simplify-edges-only and tell people to do that before plotting.
We'd have to implement simplify-edges-only anyway in order to do this, so presumably that's the first step?
I use ts.simplify(subset).draw_svg(...) quite a bit at the moment and it works fine. Most of the time you're just following the node metadata anyway and the IDs don't matter so much.
We'd have to implement simplify-edges-only anyway in order to do this, so presumably that's the first step?
Yes, although we could embed this within the drawing code if it's only useful for that.
I use ts.simplify(subset).draw_svg(...) quite a bit at the moment and it works fine. Most of the time you're just following the node metadata anyway and the IDs don't matter so much.
Yes, although it's a hassle for looking at internal nodes, which often don't have metadata. And the fact that the sample IDs are always going to be 0..n even if you simplify for samples m .. m+n is bound to catch people out at some point in the future. Also I have found that the fact that the mutation IDs (which are plotted on the trees) change, and the empty sites are dropped, is confusing in the tutorials. That last point can be fixed using the filtering parameters in simplify, though.
I'm not sure we should do this, I think it would be better to help people understand how to pull out subsets by themselves. The edges-only thing is orthogonal.
It's a major change that requires updates to the C code - we'd have to test it in isolation anyway, it would have to be added to the API.
Yes, unless we use my hack in that discussion to implement it only in the (python) drawing code
I'm not sure we should do this, I think it would be better to help people understand how to pull out subsets by themselves. The edges-only thing is orthogonal.
If the edges-only-simplify is available, I think we should tell people to use that to pull out subsets for summary plotting. So it that simply option is to be implemented, I guess I agree, and we can close this (but presumably open a PR for that simplify functionality?)
Alternatively, we could just implement simplify-edges-only and tell people to do that before plotting.
ISTR that @molpopgen said that he had a different use for this functionality too.
The use case I have in mind would have a different name: SUPPRESS_NODE_REMAPPING, which would mean simplify everything but keep the output node table length the same as that of the input table.
Since we are implementing edges-only simplify, we don't need the additional functionality within the drawing functions, so we can change this to purely a documentation issue
changed the title [-]Subset argument to tree drawing methods[/-][+]Document example of using ts.simplify(filter=None).draw_svg() to the viz docs, for large trees[/+]on Jan 12, 2023
Activity
hyanwong commentedon Oct 17, 2022
ISTR that @molpopgen said that he had a different use for this functionality too.
jeromekelleher commentedon Oct 17, 2022
We'd have to implement simplify-edges-only anyway in order to do this, so presumably that's the first step?
I use
ts.simplify(subset).draw_svg(...)quite a bit at the moment and it works fine. Most of the time you're just following the node metadata anyway and the IDs don't matter so much.hyanwong commentedon Oct 17, 2022
Yes, although we could embed this within the drawing code if it's only useful for that.
Yes, although it's a hassle for looking at internal nodes, which often don't have metadata. And the fact that the sample IDs are always going to be 0..n even if you simplify for samples m .. m+n is bound to catch people out at some point in the future. Also I have found that the fact that the mutation IDs (which are plotted on the trees) change, and the empty sites are dropped, is confusing in the tutorials. That last point can be fixed using the filtering parameters in simplify, though.
jeromekelleher commentedon Oct 17, 2022
It's a major change that requires updates to the C code - we'd have to test it in isolation anyway, it would have to be added to the API.
jeromekelleher commentedon Oct 17, 2022
I'm not sure we should do this, I think it would be better to help people understand how to pull out subsets by themselves. The
edges-onlything is orthogonal.hyanwong commentedon Oct 17, 2022
Yes, unless we use my hack in that discussion to implement it only in the (python) drawing code
If the edges-only-simplify is available, I think we should tell people to use that to pull out subsets for summary plotting. So it that simply option is to be implemented, I guess I agree, and we can close this (but presumably open a PR for that simplify functionality?)
molpopgen commentedon Oct 17, 2022
The use case I have in mind would have a different name:
SUPPRESS_NODE_REMAPPING, which would mean simplify everything but keep the output node table length the same as that of the input table.jeromekelleher commentedon Oct 17, 2022
Let's keep the simplify discussion in #2605
hyanwong commentedon Jan 12, 2023
Since we are implementing edges-only simplify, we don't need the additional functionality within the drawing functions, so we can change this to purely a documentation issue
[-]Subset argument to tree drawing methods[/-][+]Document example of using ts.simplify(filter=None).draw_svg() to the viz docs, for large trees[/+]Add a node about filter_nodes=False for viz