Analyzing ancestry on females only #158
-
Hi, As suggested I used the code :
to remove males from the tree seq file within python. However we realized that in some simulations ancestry was over one. It looks like since males from the first generation are removed from the tree seq file, some tree that should have coalesced within these individuals instead coalesce in the next generation meaning in the hybrid population. Then when simplified these trees claim to root to population 2, not population 0 or 1 which would be the ancestral populations. to go around that we tried to add a line :
I just wanted to check if this was the correct solution. Also when I tried to use SLiM 3.6 I had a message saying that the function first_gen_nodes is no longer supported. Is there something else to use to be sure the script will still be working with a new version of SLiM? Thanks in advance, Best wishes, Maud |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi, Maud! Let's see. Simplification won't change where coalescence happens; but it will remove everything above the MRCA of the samples. If I understand correctly, the problem is that, for instance, the females have a MRCA who is in the hybrid population, so after simplification you can't trace back their ancestry to population 0 or 1? If so, the solution is easy: use the "keep_input_roots=True" option to simplify, and those initial nodes will be still there after simplification. So, just
Let me know if that solves your problem? If not I think I'll need some more information about how you're calling ancestry. |
Beta Was this translation helpful? Give feedback.
Hi, Maud! Let's see. Simplification won't change where coalescence happens; but it will remove everything above the MRCA of the samples. If I understand correctly, the problem is that, for instance, the females have a MRCA who is in the hybrid population, so after simplification you can't trace back their ancestry to population 0 or 1? If so, the solution is easy: use the "keep_input_roots=True" option to simplify, and those initial nodes will be still there after simplification. So, just
Let me know if that solves your problem? If not I think I'll need some more information about how you're calling ancestry.