biotaphy.client.ot_service_wrapper.open_tree
Module for Open Tree of Life client.
Module Contents
Classes
Represents the label format constants used when calling induced subtree. |
Functions
|
Retrieves a Newick tree containing the nodes represented by the ids. |
|
Get information from the OTL taxon match service for a list of names. |
|
Quick and dirty sanitization of a name string. |
Attributes
- class biotaphy.client.ot_service_wrapper.open_tree.LABEL_FORMAT[source]
Represents the label format constants used when calling induced subtree.
- biotaphy.client.ot_service_wrapper.open_tree.PRODUCTION_SERVER = https://api.opentreeoflife.org/v3[source]
- biotaphy.client.ot_service_wrapper.open_tree.induced_subtree(ott_ids, label_format=LABEL_FORMAT.NAME)[source]
Retrieves a Newick tree containing the nodes represented by the ids.
Calls the Open Tree ‘induced_subtree’ service to retrieve a tree, in Newick format, containing the nodes represented by the provided Open Tree IDs.
- Parameters
ott_ids (list) – A list of Open Tree IDs. These will be converted to integers in the request.
label_format (str) – The label string format to use when creating the tree on the server. (see: LABEL_FORMAT)
- Returns
A dictionary of the subtree response after JSON processing.
- Return type
dict
- biotaphy.client.ot_service_wrapper.open_tree.resolve_names_otol(names_list)[source]
Get information from the OTL taxon match service for a list of names.
- Parameters
names_list (
list
ofstr
) – A list of taxon names to get information for.- Returns
- A dictionary where keys are the searched taxon names and the values are
dictionaries of values from Open Tree.
- Return type
dict