Calculating inbreeding coefficients from pedigrees #2711
-
Hi all, I have tree sequence data from a pretty simple non-WF SLIM simulation and I'm wondering if anyone has advice for a straightforward way to calculate pedigree-based inbreeding coefficients. The best method I can think of is to try building some sort of recursive algorithm that loops through individuals.parents, but I'm not sure if there is an easier/more efficient way. For context, I am currently only interested in pedigree-based metrics. So, my chromosome length is set to 1 and a mutation rate of 0. Thank you for your help. Sorry if this is a silly question or the wrong place to post this. I'm very new to using tskit. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 16 replies
-
Hi @JimmyPeniston 👋 We don't have any code for directly computing pedigree statistics in tskit, but there are some very powerful methods in sgkit like pedigree_inbreeding which will hopefully do what you need. The sgkit code has just been released and I don't think anyone has linked up simulations with it yet. I guess the main thing is whether SLiM saves the pedigree information in the individual table (which I'm not sure about). Can you run a very small example, and print out the contents of the individual and node tables here please (e.g. This is probably quite a useful thing in general, so we should document how to do it somewhere, I guess (assuming it works). |
Beta Was this translation helpful? Give feedback.
Hi @JimmyPeniston 👋
We don't have any code for directly computing pedigree statistics in tskit, but there are some very powerful methods in sgkit like pedigree_inbreeding which will hopefully do what you need.
The sgkit code has just been released and I don't think anyone has linked up simulations with it yet. I guess the main thing is whether SLiM saves the pedigree information in the individual table (which I'm not sure about).
Can you run a very small example, and print out the contents of the individual and node tables here please (e.g.
print(ts.tables.nodes)
)? Hopefully hooking the tskit data to sgkit will then be fairly straightforward.This is probably quite a useful thing in gener…