Skip to content
Jonathan A Rees edited this page Feb 13, 2016 · 22 revisions

Copied from v2 doc, to be updated for v3

Taxonomy

Methods for accessing information about the current Open Tree of Life taxonomy. These methods require Open Tree of Life Taxonomy identifiers (ott ids), which can be determined using the tnrs to match against taxon names.

URL Verb Summary
/taxonomy/about POST Return information about the taxonomy, including version.
/taxonomy/lica POST Given a set of ott ids, get the taxon that is the least inclusive common ancestor (the LICA) of all the identified taxa.
/taxonomy/subtree POST Given an ott id, return complete taxonomy subtree descended from specified taxon.
/taxonomy/taxon POST Given an ott id, return information about the specified taxon.

about (taxonomy)

Return information about the taxonomy, including version.

POST    /taxonomy/about

Return metadata and information about the taxonomy itself. Currently the available metadata is fairly sparse, but includes (at least) the version, and the location from which the complete taxonomy source files can be downloaded.

Parameters:

Parameters with bold type definitions are required.

Example command:

$ curl -X POST https://api.opentreeoflife.org/v2/taxonomy/about

Example result:

{
  "weburl" : "https://github.com/OpenTreeOfLife/opentree/wiki/Open-Tree-Taxonomy",
  "author" : "open tree of life project",
  "source" : "ott2.9draft12"
}

lica

Given a set of ott ids, get the taxon that is the least inclusive common ancestor (the LICA) of all the identified taxa.

POST    /taxonomy/lica

Return information about the least inclusive common ancestral taxon (the LICA) of the identified taxa. A taxonomic LICA is analogous to a most recent common ancestor (MRCA) in a phylogenetic tree. For example, the LICA for the taxa 'Pan' and 'Lemur' in the taxonomy represented by the newick string '(((Pan,Homo,Gorilla)Hominidae,Gibbon)Hominoidea,Lemur)Primates' is 'Primates'.

Parameters:

Parameters with bold type definitions are required.

ott_ids : longs
The ott ids (in an array) for the taxa whose LICA is to be found.

include_lineage : boolean
Whether or not to include information about the higher level taxa that include the identified LICA. By default, this option is set to false. If it is set to true, the lineage will be provided in an ordered array, with the least inclusive taxa at lower indices (i.e. higher indices are higher taxa).

Example command:

$ curl -X POST https://api.opentreeoflife.org/v2/taxonomy/lica \
-H 'content-type:application/json' -d \
'{"ott_ids":[515698,590452,409712,643717]}'

Example result:

{
  "lica" : {
    "tax_sources" : [ "ncbi:4209", "worms:234044", "gbif:414", "irmng:10011" ],
    "unique_name" : "",
    "ot:ottId" : 1042120,
    "synonyms" : [ "Asterales" ],
    "flags" : [ ],
    "rank" : "order",
    "ot:ottTaxonName" : "Asterales",
    "node_id" : 3468117
  },
  "ott_ids_not_found" : [ 409712 ]
}

subtree (taxonomy)

Given an ott id, return complete taxonomy subtree descended from specified taxon.

POST    /taxonomy/subtree

Extract and return the inclusive taxonomic subtree i.e. (a subset of the taxonomy) below a given taxon. The taxonomy subtree is returned in newick format.

Parameters:

Parameters with bold type definitions are required.

ott_id : long
The OTT id of the taxon of interest.

label_format : string
The format for the labels. If provided, this must be one of the options: ["name", "id", "name_and_id","original_name"], indicating whether the node labels should contain (respecitvely) just the cleaned name (i.e. with punctuation and whitespace replaced with underscores), just the ott id, the cleaned name and as well as the ott id (default), or the original name without punctuation removed.

Example command:

$ curl -X POST https://api.opentreeoflife.org/v2/taxonomy/subtree \
-H 'Content-type:application/json' -d '{"ott_id":515698}'

Example result:

{
  "subtree" : "(Barnadesia_sp._1151_ott825484,Barnadesia_caryophylla_ott515696,Barnadesia_parviflora_ott503064,Barnadesia_odorata_ott503066,Barnadesia_glomerata_ott503056,Barnadesia_dombeyana_ott503058,(Barnadesia_lehmannii_var._lehmannii_ott1084324,Barnadesia_lehmannii_var._villosa_ott1084322)Barnadesia_lehmannii_ott503060,Barnadesia_jelskii_ott503062,Barnadesia_arborea_ott503052,Barnadesia_pycnophylla_ott503043,Barnadesia_polyacantha_ott503045,Barnadesia_sp._Palmer_180_ott124782,Barnadesia_spinosa_ott13308)Barnadesia_ott515698;"
}

taxon

Given an ott id, return information about the specified taxon.

POST    /taxonomy/taxon

Get information about a known taxon in the taxonomy.

Parameters:

Parameters with bold type definitions are required.

ott_id : long
The OTT id of the taxon of interest.

include_children : boolean
Whether or not to include information about all the children of this taxon. By default, this option is set to false. If it is set to true, the children will be provided in an array.

include_lineage : boolean
Whether or not to include information about all the higher level taxa that include this one. By default, this option is set to false. If it is set to true, the lineage will be provided in an ordered array, with the least inclusive taxa at lower indices (i.e. higher indices are higher taxa).

list_terminal_descendants : boolean
Provide a list of terminal OTT ids contained by this taxon.

Example command:

$ curl -X POST https://api.opentreeoflife.org/v2/taxonomy/taxon \
-H 'content-type:application/json' -d '{"ott_id":515698}'

Example result:

{
  "tax_sources" : [ "ncbi:4237", "gbif:3105285", "irmng:1046392" ],
  "unique_name" : "",
  "ot:ottId" : 515698,
  "synonyms" : [ "Barnadesia", "Barnadesia Mutis" ],
  "flags" : [ ],
  "rank" : "genus",
  "ot:ottTaxonName" : "Barnadesia",
  "node_id" : 3472412
}