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
Consider ordering requirements for individual table. #1138
#1125 adds parents to the individual table. Currently there are no sorting requirements on the individual table.
@jeromekelleher and I discussed this and thought that enforcing that parents come before children in the table would presumably be useful and also ensure that there are no loops in the pedigree. Thoughts @petrelharp?
Hm. It would presumably be useful. But it would also totally mess up how SLiM use the individual table. That's fine as long as we don't require this for simplify_tables, but it's a bit awkward to have these caveats about this algorithm not needing that sortedness property, etcetera. On the other hand, I see how this would make developing pedigree algorithms much easier and more efficient! So, I guess my suggestions are:
we should at least have canonicalise put individual parents before children, and
we could either add it to the list of standard sortedness requirements, but ensure simplify doesn't require it, or
allow pedigree algorithms to require the property (which can be checked with two passes through the table).
Those two options aren't very different, as they're both introducing an extra property to keep track of; the question is just whether it's default or not. We could wait until someone starts developing pedigree algorithms to see how useful it is?
That's good to know, thanks @petrelharp. I think we could add the ordering to the standard tree sequence requirements without breaking simplify cleanly enough by adding a CHECK_INDIVIDUAL_ORDERING to the list of flags for check_integrity here. Simplify won't need to provide this flag, as all it'll be doing is remapping IDs.
That would mean that individual IDs in SLiM would need to be rejiggered at the end before output so that the output file is a valid tree sequence, but that could be done efficiently with some version of canonicalise/subset or whatever. If the original IDs are important, then I guess these could be tracked via metadata or something.
I thought that parents-being-before-children would have mapped very naturally to forward simulations - SLiM must be using the individual table quite differently then?
(which can be checked with two passes through the table).
It's just one pass, isn't it? All we're saying is basically there's no forward references: at row j, the parent values must be < j.
That would mean that individual IDs in SLiM would need to be rejiggered at the end before output so that the output file is a valid tree sequence, but that could be done efficiently with some version of canonicalise/subset or whatever. If the original IDs are important, then I guess these could be tracked via metadata or something.
Well, SLiM uses ordering in the output tables to ensure that if the tables are read back in to SLiM, everything is in the same internal state it was before. This is a very useful property to have, for reproducibility. You're right: it might actually be that parents would come before children naturally; and if not then I think we could deal with this by reordering using the SLiM IDs in metadata. But individual ordering has been a difficult can of worms before, so I'm not enthusiastic about rejiggering it. It probably wouldn't be too bad, though.
It's just one pass, isn't it? All we're saying is basically there's no forward references: at row j, the parent values must be < j.
You're right. =) It's sorting to ensure this property that requires two passes.
Activity
petrelharp commentedon Jan 25, 2021
Hm. It would presumably be useful. But it would also totally mess up how SLiM use the individual table. That's fine as long as we don't require this for
simplify_tables, but it's a bit awkward to have these caveats about this algorithm not needing that sortedness property, etcetera. On the other hand, I see how this would make developing pedigree algorithms much easier and more efficient! So, I guess my suggestions are:canonicaliseput individual parents before children, andThose two options aren't very different, as they're both introducing an extra property to keep track of; the question is just whether it's default or not. We could wait until someone starts developing pedigree algorithms to see how useful it is?
jeromekelleher commentedon Jan 25, 2021
That's good to know, thanks @petrelharp. I think we could add the ordering to the standard tree sequence requirements without breaking simplify cleanly enough by adding a
CHECK_INDIVIDUAL_ORDERINGto the list of flags for check_integrity here. Simplify won't need to provide this flag, as all it'll be doing is remapping IDs.That would mean that individual IDs in SLiM would need to be rejiggered at the end before output so that the output file is a valid tree sequence, but that could be done efficiently with some version of canonicalise/subset or whatever. If the original IDs are important, then I guess these could be tracked via metadata or something.
I thought that parents-being-before-children would have mapped very naturally to forward simulations - SLiM must be using the individual table quite differently then?
It's just one pass, isn't it? All we're saying is basically there's no forward references: at row
j, the parent values must be <j.petrelharp commentedon Jan 25, 2021
Well, SLiM uses ordering in the output tables to ensure that if the tables are read back in to SLiM, everything is in the same internal state it was before. This is a very useful property to have, for reproducibility. You're right: it might actually be that parents would come before children naturally; and if not then I think we could deal with this by reordering using the SLiM IDs in metadata. But individual ordering has been a difficult can of worms before, so I'm not enthusiastic about rejiggering it. It probably wouldn't be too bad, though.
You're right. =) It's sorting to ensure this property that requires two passes.
benjeffery commentedon Mar 4, 2021
Closed by #1199