Skip to content

Individual admixture computation #2138

Answered by alxsimon
alxsimon asked this question in Q&A
Discussion options

You must be logged in to vote

Ok so thanks to @petrelharp, there are two ways of doing this.
The important point is to remember all ancestors at the point we define reference populations in our simulation, either using treeSeqRememberIndividuals in SLiM (I needed to use it in the early event in my case), or using a census event in msprime (not a sampling event).

Either find the admixture compositions with the ibd_segments (much slower):

def get_admixture_proportions(ts, admix_inds, popA_nodes, popB_nodes, max_time):
	proportions_A = []
	for i in admix_inds:
		span_A = ts.ibd_segments(
			between=[popA_nodes, ts.individual(i).nodes],
			max_time=max_time,
		).total_span
		span_B = ts.ibd_segments(
			between=[popB_node…

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
3 replies
@alxsimon
Comment options

@petrelharp
Comment options

@alxsimon
Comment options

Comment options

You must be logged in to vote
3 replies
@alxsimon
Comment options

@petrelharp
Comment options

@alxsimon
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by alxsimon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants