Repository navigation
First pass at solving #25 #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
bhaller
merged 3 commits into
MesserLab:master
from
hyanwong:cull-remembered-individuals
Jan 12, 2021
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@petrelharp any reason to keep the old deprecated flag? Is there any potential issue with @hyanwong re-using the same (1 << 18) value for his new flag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for picking that up. I was going to ask...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I don't think so. Maybe pyslim needs to know what it is to be able to read old trees files, but we don't need it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides, the flags have similar meanings: "this individual is in the tree sequence just 'cause it happens to still be here", sort of.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. I guess pyslim can have logic that says "if this flag is set and the tree sequence version is less than X, then it means "first gen", otherwise it means "retained". SLiM would need that logic too, perhaps, in its tree sequence reading code? Do we do anything with these flags when we read a tree sequence in? Should we?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This last question remains unanswered. @petrelharp, do we need to do anything with this new flag (or with the possible existence of the deprecated SLIM_TSK_INDIVIDUAL_FIRST_GEN flag in an old file, now that we are re-using the same flag value) when we read in a tree sequence? It makes me nervous re-using the same value. If an old tree sequence has individuals marked with SLIM_TSK_INDIVIDUAL_FIRST_GEN, would they then be marked as "retained" when we read that old tree sequence in the new SLiM? And if so, is that OK, or should we worry about it? There are lots of people still using old versions of SLiM, so this is a real concern. (Somebody recently published a paper that cited SLiM 1.8!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, let's see:
SLIM_TSK_INDIVIDUAL_FIRST_GENflag for anything; we know this because it's actually commented out of the source code.So: tree sequences produced by old versions of SLiM will have the FIRST_GEN individuals in the tree sequence. These are read into SLiM no problem. And, these are read into pyslim, and retain the FIRST_GEN flags, but the only thing this affects is how people use the tree sequence: sometimes they'd get confused about why there's individuals that aren't alive at the end of the simulation. It doesn't affect how anything works, or even any recommended workflows.
If we re-use the flag, but rename it RETAINED, then what will happen if we use an old tree sequence with the FIRST_GEN flag? Well, in SLiM those FIRST_GEN individuals will act as if they were RETAIN'ed. Which is fine, since they actually were (just for a different reason). And again, in pyslim, we don't actually use the REMEMBERED flag for anything, so this won't mess anything up.
So - I think this is fine - we can re-use the flag, and given that the two flags actually mean more or less the same thing (that the individual doesn't necessarily have nodes that are samples), we should re-use it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hurrah. Merge away!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Thanks for the reassurance; this makes sense. I'll merge now.