Comments (5)
Thanks for the bug report @bomeara, I'll leave it to @fmichonneau to work out what rncl should do. Just thought I'd let you know of a possible work-around, in case this is a rate-limiting step for you at the moment.
You can use the 'internal' api-mapping functions to get a character representation of the tree, and ape to read that tree (note, for the example at least I had to remove the spaces from taxon names):
tr <- rotl:::.get_study_tree(study_id="pg_710",
tree_id="tree1277",
tip_label='ot:otttaxonname', #triple 't', double ''n"
format="newick")
parsed_tr <- ape::read.tree(text=gsub(" ", "_", tr)
parsed_tr
Phylogenetic tree with 108 tips and 107 internal nodes.
Tip labels:
'Helianthus_annuus', 'Canarina_canariensis', 'Jasione_montana', 'Legousia_hybrida', 'Campanula_asperuloides', 'Campanula_latifolia', ...
Rooted; includes branch lengths
Hope that's some help to you, and that we can find a less hack way for this to work in the long run :)
from rotl.
Beautiful, @dwinter, thank you. This will work nicely for now (datelife update to pull from OpenTree).
Minor note for those using the example: there's a missing right parens on this line
parsed_tr <- ape::read.tree(text=gsub(" ", "_", tr))
from rotl.
Thanks for bringing this up.
The issue is that NCL follows the strict definition of the NEXUS file format that doesn't allow duplicated taxon names. I don't think there is an easy way to fix this in the C++ code.
I think the best option would be to add a suffix, I'll try to implement this in a couple of weeks when I'm back home.
from rotl.
Hi @bomeara,
I implemented a fix for this. With get_study_tree
duplicated labels will be disambiguated by adding a suffix _1
, _2
, _3
, etc. before being parsed by NCL.
If you have a chance to give it a try, please let me know how it works for you.
from rotl.
Yes, this seems to work. Thanks!
from rotl.
Related Issues (20)
- Unable to recognise the tree labels/species name in the phylogenetic tree ??
- Adding annotation to trees is not possible because of the lack of edge lengths HOT 4
- tol_induced_subtree drops supporting studies information
- Tips not ordered alphabetically for polytomies HOT 2
- tnrs_match_names bug HOT 8
- use score from tnrs match names
- Error when a species not matched with `tnrs_match_names()` HOT 1
- Error in tnrs_match_names() for unmatched names HOT 3
- Linux install HOT 2
- do_approximate_matching= TRUE not working on tnrs_match_names using multiple inputs HOT 2
- SSL certificate error HOT 2
- studies_find_trees returning NULL match_tree_ids HOT 1
- "The requested subtree is too large" -- possible to read in downloaded xml? HOT 2
- error with tnrs_match_names names list
- HTTP failure to connect to localhost HOT 1
- SSL certificate problem: certificate has expired HOT 1
- optimize dependencies
- `tnrs_match_names` does not return the best match in some cases HOT 4
- New bulk node_info and taxon_info api call options HOT 2
- [CRAN] package documentation issue
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rotl.