Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ploidy being set as 1 #3

Closed
mufernando opened this issue Jan 8, 2020 · 2 comments
Closed

ploidy being set as 1 #3

mufernando opened this issue Jan 8, 2020 · 2 comments

Comments

@mufernando
Copy link
Member

see cc6c9cd

because we can have more than one subpopulation per tree sequence and we want to calculate some stats to each subpop individually, I need to subset my genotype matrix.
it is possible to get the indices belonging to a population for each haploid genome using tskit with ts.samples(population=i), but not for diploid genomes. If I were to treat the genotype matrix with ploidy=2, I wouldn't be able to do the subsetting this way.

ploidy should not matter for the stats we are using so far (pi and dxy), but could be an issue with other stats.

@petrelharp
Copy link
Collaborator

Well, let's see:

ind_pops = np.array([i.population for i in ts.individuals()])

gives you the population for each individual - is that what you need?

@mufernando
Copy link
Member Author

solved. see commit 3800681

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

No branches or pull requests

2 participants