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

Add ignore_missing_alns option to TreeAnc to extend use cases #178

Merged
merged 3 commits into from
Jan 20, 2022

Conversation

corneliusroemer
Copy link
Member

@corneliusroemer corneliusroemer commented Jan 19, 2022

Resolves #177

Context
When doing ancestral state reconstruction with a tree that has many tips without alignment (>1/3), treetime throws an error.

This PR introduces a new constructor parameter ignore_missing_alns=False that defaults to False in a backward compatible manner. Setting it to true means that no error is raised even when more than 1/3 of tips don't have alignments attached.

This extends use cases.

Testing
Tested with my script that needs this feature and both True and False do exactly what they're supposed to do. No error vs error.

Usage

tt = TreeAnc(tree=tree, aln=alignment, ignore_missing_alns=True)

Other commits

I noticed that defaults weren't documented in numpy style in the docs, so I fixed it where I saw it. Also fixed a typo and indentation.

@rneher rneher merged commit 3d4a321 into master Jan 20, 2022
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.

ENH: Allow ancestral reconstruction even if >30% of tip sequences are missing
2 participants