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
We currently have a time_units top-level attribute. In #495 (comment)@petrelharp argues for storing the genomic units too (presumably usually "basepairs" or "bp", unless you are running msprime.simulate. In that issue there is also discussion about whether this should be metadata or an attribute: the general idea is that if tskit uses it internally, it shouldn't be metadata. Another problem with metadata is that is is not accessible easily from C.
One trivial use of a genome_units value would be in visualisation, allowing us to label the x axis on a plot correctly (and express it in kb or Mb, see #2345). I don't know if this is a strong enough argument to make it a top-level attribute?
I can't think of any at the moment. But if we ever wanted to use the tree sequence format to store a set of correlated trees that weren't along a genome, but simply e.g. a set of MCMC outputs, then I guess this might be useful.
It would be helpful, perhaps, if we have a reference sequence, to check that the units of the original tree sequence are "base pairs". Similarly, if we are comparing 2 tree sequences, e.g. with ts.coiterate(), it would be sensible to check that the position units are the same between the two tree sequences being compared.
Oh, also, if a RateMap object knew what its internal units were, it could check them against the tree sequence genome_units before applying the rate. But that's a further elaboration which might be a step too far.
I don't think we have a strong enough use-case at the moment to justify doing the actual work here. I agree it's a nice to have, but I think you can basically assume things are in units of basepairs at the moment.
Activity
benjeffery commentedon Nov 25, 2022
Are there stats methods that would use this to error/warn if the dimension wasn't correct? Such as with
time_units?hyanwong commentedon Nov 25, 2022
I can't think of any at the moment. But if we ever wanted to use the tree sequence format to store a set of correlated trees that weren't along a genome, but simply e.g. a set of MCMC outputs, then I guess this might be useful.
It would be helpful, perhaps, if we have a reference sequence, to check that the units of the original tree sequence are "base pairs". Similarly, if we are comparing 2 tree sequences, e.g. with
ts.coiterate(), it would be sensible to check that the position units are the same between the two tree sequences being compared.hyanwong commentedon Nov 25, 2022
Oh, also, if a RateMap object knew what its internal units were, it could check them against the tree sequence genome_units before applying the rate. But that's a further elaboration which might be a step too far.
jeromekelleher commentedon Nov 28, 2022
I don't think we have a strong enough use-case at the moment to justify doing the actual work here. I agree it's a nice to have, but I think you can basically assume things are in units of basepairs at the moment.
benjeffery commentedon Nov 28, 2022
I've added the "future" label, closing for now.