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

Show trees of Pango lineages #351

Merged
merged 2 commits into from
Oct 9, 2024

Conversation

hyanwong
Copy link
Contributor

@hyanwong hyanwong commented Oct 9, 2024

No tests: is there a test ARG we can call a function like this on?

Use like e.g.

pango = "B.1.1.7"
ti.plot_pango_lineage_subtree(pango, collapse_tracked=0.99365, node_labels={}, time_scale="time")

Currently waiting on tskit-dev/tskit#3015 to be merged before this actually works.

@hyanwong
Copy link
Contributor Author

hyanwong commented Oct 9, 2024

In the plot title, I would also like to print the name of the file from which the ts was loaded, or some other indicator of the provenance of the ARG. I'm not sure if it's possible to obtain this from the tree sequence or the TreeInfo object?

Here's an example of running ti.plot_pango_lineage_subtree("B.1.1.7", size=(600, 600), collapse_tracked=0.99365, time_scale="time") (root of Alpha) on "clipends-v2-mm_4-noexact-f500-clustloc-mrm_2-rw_10-mgs_10-2021-04-10", having set all the mutation times to UNKNOWN_TIME:

Screenshot 2024-10-09 at 12 37 48

@jeromekelleher
Copy link
Owner

In the plot title, I would also like to print the name of the file from which the ts was loaded, or some other indicator of the provenance of the ARG. I'm not sure if it's possible to obtain this from the tree sequence or the TreeInfo object?

We can probably make the title an optional argument to this function, which would then easily be parameterised in an analysis notebook.

@jeromekelleher
Copy link
Owner

No infrastructure yet for systematically testing tree info stuff, I'll do this as soon as we have the data cleaning done.

@jeromekelleher jeromekelleher merged commit bdf0a94 into jeromekelleher:main Oct 9, 2024
3 checks passed
@hyanwong
Copy link
Contributor Author

hyanwong commented Oct 9, 2024

In the plot title, I would also like to print the name of the file from which the ts was loaded, or some other indicator of the provenance of the ARG. I'm not sure if it's possible to obtain this from the tree sequence or the TreeInfo object?

We can probably make the title an optional argument to this function, which would then easily be parameterised in an analysis notebook.

Actually, title is already a parameter, but it's helpful to default to a something that shows some extra detail without having to code it explicitly. I guess I could grab something out of the metadata, or just quote the date the TS was made, the latests sample dates, and the total number of samples.

@jeromekelleher
Copy link
Owner

the top-level metadata will have the date

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

Successfully merging this pull request may close these issues.

2 participants