Skip to content

Generating a genome-wide tree topology count #989

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

Closed
MatteoSebastianelli opened this issue Jan 13, 2025 · 2 comments
Closed

Generating a genome-wide tree topology count #989

MatteoSebastianelli opened this issue Jan 13, 2025 · 2 comments

Comments

@MatteoSebastianelli
Copy link

Hello,

I have been generating tree sequences with tsinfer and would like to get a tree topology count across the entire genome. Would that be possible? I was thinking I should loop through my .trees files with the union function to merge them (it seems it cannot merge more than 2 files) and then use that output to count tree topologies. Does this sounds like a reasonable approach? I may be missing it, perhaps there is a functions that does this already?

Thanks in advance!

Matteo

@hyanwong
Copy link
Member

hyanwong commented Jan 13, 2025

Hi Matteo

If you mean that you want to summarize across multiple chromosomes, each inferred separately by tsinfer, then I think it may not be necessary to union the tree sequences: you can probably summarise the topology results across chromosomes by just adding the means (weighted by the chromosome length) and dividing by the total genome length. Note that you might want to remove centromeres and other "blank" regions from the length calculations.

Within a chromosome, however, there are fast methods for counting topologies: see tskit-dev/tskit#671 and the link from there to https://github.com/tskit-dev/tskit/blob/829fd1f42037ca404c44ea58eb6286df8d5d803d/python/tskit/combinatorics.py#L37. We should probably make this available as an API, if people are going to use it extensively.

@hyanwong
Copy link
Member

P.s. I think this should be a tskit GitHub discussion (not a tsinfer GitHut issue), so I've moved it to tskit-dev/tskit#3082

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