OpenTreeOfLife / phylesystem-api

API access to Open Tree of Life treestore
BSD 2-Clause "Simplified" License
10 stars 5 forks source link

Subtree method with nexson doesn't work #180

Open josephwb opened 8 years ago

josephwb commented 8 years ago

This is the result of the call used in the documentation:

curl https://api.opentreeoflife.org/v3/study/pg_10/subtree/tree3?subtree_id=ingroup
{"description": "Cannot convert from 1.2.1 to NexSON v0.0.0", "error": 1}

By pulling a Homer, I fluked upon a permutation that worked by specifying a newick return:

curl https://api.opentreeoflife.org/v3/study/pg_10/subtree/tree3.tre?subtree_id=ingroup

This also works with Nexus. So the problem seems to be localized to nexson.

@jimallman suggested appending &output_nexml2json=1.2.1:

curl https://api.opentreeoflife.org/v3/study/pg_10/subtree/tree3?subtree_id=ingroup&output_nexml2json=1.2.1

but that did not work.

mtholder commented 8 years ago

Hi, getting parts of the tree has never been supported with NexSON. I have just clarified that in the README. I agree that the "cannot convert..." error messages are not helpful and should be more targeted.

josephwb commented 8 years ago

Thanks. I clarified it a bit more with 580ba3abea5506d4450e29e519205ca6a40c644a.

josephwb commented 8 years ago

Maybe the default format should be set to newick, so no suffix need be specified? This would get around the nexson error.