Skip to content

Activate "keep unary in individuals" - #155

Closed
hyanwong wants to merge 1 commit into
MesserLab:masterfrom
hyanwong:keep-unary-in-individuals-activate
Closed

hyanwong wants to merge 1 commit into
MesserLab:masterfrom
hyanwong:keep-unary-in-individuals-activate

Conversation

@hyanwong

@hyanwong hyanwong commented Feb 3, 2021

Copy link
Copy Markdown
Contributor

As it might be a little while until the tskit fix for keep unary in individuals makes it into a release, I have hacked in the fix by hand in the PR. I have also renamed some of the tests as per #142 (comment) to replace 000 with ___ which I think is less confusing. There's also a new suite of python tests intended to test the results of specific SLiM recipes, rather than more general tests of any TS produced by SLiM.

I'm now move on to documenting this in pyslim, so that @petrelharp can release a compatible version.

And (for the moment) correct the bug in tskit by hand.
@hyanwong
hyanwong force-pushed the keep-unary-in-individuals-activate branch from b7dc8ae to 925b903 Compare February 3, 2021 12:32
@bhaller

bhaller commented Feb 3, 2021

Copy link
Copy Markdown
Contributor

This all sounds great, thanks! Is it ready to merge? Should @petrelharp review it, or is there no need?

@hyanwong

hyanwong commented Feb 3, 2021

Copy link
Copy Markdown
Contributor Author

This all sounds great, thanks! Is it ready to merge? Should @petrelharp review it, or is there no need?

I think it might be helpful, if he has time. Perhaps at the same time as looking at the pyslim changes I'm about to push to keep this in sync?

Comment thread treerec/tests/conftest.py
if pedigree_id in slim:
# We have a duplicate:
if slim[pedigree_id].type == "remember":
continue # "remember"ed takes priority: do not overwrite

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not getting the whole picture here, but do we also need a "retain takes priority over retain if unary" here?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, I see, we only check below if this starts with retain, so it doesn't matter? still, it'd be nice to get the right thing in here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We never have both retain_if_unary and retain in the same simulation, so it's never an issue.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, well, perhaps we should have them both in the same simulation?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we only specify "retainCoalescentOnly" for the entire TS recording, we have no way of doing this. But I can change the logic in case we ever do implement something similar? I can't see how it would work though!

@hyanwong hyanwong Feb 4, 2021 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we can do that. If so, we need to mark all retained individuals as "retain". If, at the top, we use retainCoalescentOnly=F, we mark all retained individuals as "retain_if_unary".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that "retain" and "retain_if_unary" are only convenience flags in the text-save of the individuals, for testing. And also note that any individuals we zap with treeSeqRememberIndividuals(..., permanent=T) are marked as "remember" which always overrides either "retain" marking.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'm being slow here, but: we can do retainCoalescentOnly=T, and then only mark SOME of the individuals to retain; this will produce a mix of retain and retain_if_unary. Ah, I see - if retainCoalescentOnly=T, then should retain have no effect? (Still, we could be checking nothing weird happens.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's some confusion here. retainCoalescentOnly=T only applies during treeSeqInitialize(). So either it's on for the whole simulation, or off for the whole simulation.

If "on", then any node permanently remembered is output with a "remember" tag, and and node temporarily retained is output with a "retain" flag.

If "off", then any node permanently remembered is output with a "remember" tag, and and node temporarily retained is output with a "retain_if_unary" flag.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack, sorry, I think I need some more coffee now.

@bhaller

bhaller commented Feb 7, 2021

Copy link
Copy Markdown
Contributor

I see there was some review by @petrelharp. Is that complete? Is this ready to merge? Don't mean to nag, just wondering if this has stalled for no reason. :->

@hyanwong

hyanwong commented Feb 7, 2021

Copy link
Copy Markdown
Contributor Author

AFAIK this just needs @petrelharp 's sign-off. it's linked to tskit-dev/pyslim#125 which needs, I think, one extra test, is that right @petrelharp ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants