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

Labeling phylogenetic tree programatically #40

Open
KittyMurphy opened this issue Jun 19, 2023 · 9 comments
Open

Labeling phylogenetic tree programatically #40

KittyMurphy opened this issue Jun 19, 2023 · 9 comments

Comments

@KittyMurphy
Copy link

Hello,

Thanks for such a great tool for phylogenomic analyses!

I was wondering if there was a way of labelling the branch of the last common ancestor of two species in a phylogenetic tree programatically? I need to do this for >3,000 genes that don't always have the same species in their trees due to pruning based on the multiple sequence alignment.

Many thanks,
Kitty.

@spond
Copy link
Member

spond commented Jun 19, 2023

Dear @KittyMurphy,

Just that one branch? For example the orange branch in the following example?

image

Best,
Sergei

@KittyMurphy
Copy link
Author

Dear @spond,

Yes exactly, and I want to do this for several pairs of species before running hyphy absrel.

Best,
Kitty

@spond
Copy link
Member

spond commented Jun 26, 2023

Dear @KittyMurphy,

I can modify the tree labeling script to do this. How do you anticipate specifying the two species? Would something like the following work?

hyphy label-mrca.bf --tree tree.nwk --species species_a --species species_b 

You would be able to specify two or more species, including those which are not present in the tree.

Best,
Sergei

@KittyMurphy
Copy link
Author

Dear @spond,

That would be fantastic, thank you.

Yes that looks suitable, would I have to run this separately for each set of species that I want to label the last common ancestor for? Or would it be possible to do this as a one-liner, e.g.

hyphy label-mrca.bf --tree tree.nwk --species BFNKILLIFISH, GOLDFISH --species LOOSEJAW, ZEBRAFISH

Best,
Kitty

@spond
Copy link
Member

spond commented Jul 3, 2023

Dear @KittyMurphy,

Are you looking to label all MRCAs with the same label or with different labels? I can definitely implement something like what you suggested above, optionally with a tag, like so

hyphy label-mrca.bf --tree tree.nwk --tag MRCA --species "BFNKILLIFISH,GOLDFISH" --species "LOOSEJAW,ZEBRAFISH,MRCA2"

So, if there are two comma-separated values, the default tag (MRCA here) is applied, otherwise a pair-specific tag is applied.

Best,
Sergei

@KittyMurphy
Copy link
Author

Yes, I would like to label all MRCAs of interest as foreground branches to use with aBSREL. This looks great though, thank you for your help @spond!

Best,
Kitty

@spond
Copy link
Member

spond commented Jul 11, 2023

@KittyMurphy
Copy link
Author

Dear @spond ,

This is fantastic, I'll test it out today. Thank you so much!

Best,
Kitty

@spond
Copy link
Member

spond commented Jul 12, 2023

Dear @KittyMurphy,

Great. Please let me know if you discover any issues.

Best,
Sergei

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