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

Convert taxon structure to newick format #17

MichWeb75 opened this issue Mar 4, 2020 · 2 comments

Convert taxon structure to newick format #17

MichWeb75 opened this issue Mar 4, 2020 · 2 comments


Copy link

@MichWeb75 MichWeb75 commented Mar 4, 2020

Do you know a simple way to convert the result of a taxonomic search into newick format to plot it with ggtree or ITOL ?
I found a function here, but maybe you know a more elegant way ?


This comment has been minimized.

Copy link

@sherrillmix sherrillmix commented Mar 5, 2020

That might be interesting to incorporate. I guess as a first pass, maybe a function like:


where taxa would be the output from getTaxonomy e.g.

taxaId<-getId(c('Homo sapiens','Bos taurus','Homo','Alces alces'),'accessionTaxa.sql')

Producing an output like:

(((((((Homo sapiens,_)Homo)Hominidae)Primates,(((Bos taurus)Bos)Bovidae,((Alces alces)Alces)Cervidae)_)Mammalia)Chordata)Eukaryota)

Is that what you're looking for? I guess I could incorporate that into the package if useful.


This comment has been minimized.

Copy link

@MichWeb75 MichWeb75 commented Mar 6, 2020

That is exactly what I was looking for and very smart implementation without any need for additional network structure. This function would be useful to load the graph into other packages such ape and ggtree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.