Accessing mutations in the genome of one individual? #160
-
Hello! I am trying to figure out how to look up which mutations occurred in the genome of an individual. #for example, looking up individual 10:
postslim.tscoal.individual(10) I get a bunch of information, but nothing that screams "use this to look up mutations". The only information seemingly shared between individuals and mutations is Apologies for the naive question and thanks for any help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hm, that's a good question - that ought to be an easy thing to do. This reason you haven't found it is because in the tree sequence it ends up being more natural to look up things by site instead of by genome - e.g., to iterate across trees. Now, a question: do you want to find all the mutations that either genome of a given individual has inherited? Or, all the alleles? The distinction is that a mutation object is unique, but there may be more than one unique mutation at a site that's produce the same allele (IBS but not IBD). The best answer is also going to depend on what you want to do with them. 1. Edit: my first answer was wrong; here's one based on @jeromekelleher's in this issue. If you want to get the mutations then we need to iterate over the trees and ask which nodes have inherited which mutations without intervening mutations. I'll then tabulate a vector of length equal to the number of mutations with the number of copies of each mutation that the individual carries, using some methods of the Tree object:
Then you could iterate over these mutations, for instance, like:
2. If you want to get the alleles then here's one way to do it, using the
|
Beta Was this translation helpful? Give feedback.
Hm, that's a good question - that ought to be an easy thing to do. This reason you haven't found it is because in the tree sequence it ends up being more natural to look up things by site instead of by genome - e.g., to iterate across trees.
Now, a question: do you want to find all the mutations that either genome of a given individual has inherited? Or, all the alleles? The distinction is that a mutation object is unique, but there may be more than one unique mutation at a site that's produce the same allele (IBS but not IBD). The best answer is also going to depend on what you want to do with them.
1. Edit: my first answer was wrong; here's one based on @jeromekelleher's in this issue. …