allensdk.api.queries.ontologies_api module¶
- class allensdk.api.queries.ontologies_api.OntologiesApi(base_uri=None)[source]¶
Bases:
RmaTemplate
See: Atlas Drawings and Ontologies
- get_atlases_table(atlas_ids=None, brief=True)[source]¶
List Atlases available through the API with associated ontologies and structure graphs.
- Parameters:
- atlas_idsinteger or list of integers, optional
only select specific atlases
- briefboolean, optional
True (default) requests only name and id fields.
- Returns:
- dictatlas metadata
Notes
This query is based on the table of available Atlases. See also: Class: Atlas
- get_structures(structure_graph_ids=None, structure_graph_names=None, structure_set_ids=None, structure_set_names=None, order=['structures.graph_order'], num_rows='all', count=False, **kwargs)[source]¶
Retrieve data about anatomical structures.
- Parameters:
- structure_graph_idsint or list of ints, optional
database keys to get all structures in particular graphs
- structure_graph_namesstring or list of strings, optional
list of graph names to narrow the query
- structure_set_idsint or list of ints, optional
database keys to get all structures in a particular set
- structure_set_namesstring or list of strings, optional
list of set names to narrow the query.
- orderlist of strings
list of RMA order clauses for sorting
- num_rowsint
how many records to retrieve
- Returns:
- dict
the parsed json response containing data from the API
Notes
Only one of the methods of limiting the query should be used at a time.
- get_structures_with_sets(structure_graph_ids, order=['structures.graph_order'], num_rows='all', count=False, **kwargs)[source]¶
Download structures along with the sets to which they belong.
- Parameters:
- structure_graph_idsint or list of int
Only fetch structure records from these graphs.
- orderlist of strings
list of RMA order clauses for sorting
- num_rowsint
how many records to retrieve
- Returns:
- dict
the parsed json response containing data from the API
- rma_templates = {'ontology_queries': [{'name': 'structures_by_graph_ids', 'description': 'see name', 'model': 'Structure', 'criteria': '[graph_id$in{{ graph_ids }}]', 'order': ['structures.graph_order'], 'num_rows': 'all', 'count': False, 'criteria_params': ['graph_ids']}, {'name': 'structures_by_graph_names', 'description': 'see name', 'model': 'Structure', 'criteria': 'graph[structure_graphs.name$in{{ graph_names }}]', 'order': ['structures.graph_order'], 'num_rows': 'all', 'count': False, 'criteria_params': ['graph_names']}, {'name': 'structures_by_set_ids', 'description': 'see name', 'model': 'Structure', 'criteria': '[structure_set_id$in{{ set_ids }}]', 'order': ['structures.graph_order'], 'num_rows': 'all', 'count': False, 'criteria_params': ['set_ids']}, {'name': 'structures_by_set_names', 'description': 'see name', 'model': 'Structure', 'criteria': 'structure_sets[name$in{{ set_names }}]', 'order': ['structures.graph_order'], 'num_rows': 'all', 'count': False, 'criteria_params': ['set_names']}, {'name': 'structure_graphs_list', 'description': 'see name', 'model': 'StructureGraph', 'num_rows': 'all', 'count': False}, {'name': 'structure_sets_list', 'description': 'see name', 'model': 'StructureSet', 'num_rows': 'all', 'count': False}, {'name': 'atlases_list', 'description': 'see name', 'model': 'Atlas', 'num_rows': 'all', 'count': False}, {'name': 'atlases_table', 'description': 'see name', 'model': 'Atlas', 'criteria': '{% if atlas_ids is defined %}[id$in{{ atlas_ids }}],{%endif%}structure_graph(ontology),graphic_group_labels', 'include': 'structure_graph(ontology),graphic_group_labels', 'only': ['atlases.id', 'atlases.name', 'atlases.image_type', 'ontologies.id', 'ontologies.name', 'structure_graphs.id', 'structure_graphs.name', 'graphic_group_labels.id', 'graphic_group_labels.name'], 'num_rows': 'all', 'count': False, 'criteria_params': ['atlas_ids']}, {'name': 'structures_with_sets', 'description': 'see name', 'model': 'Structure', 'include': 'structure_sets', 'criteria': '[graph_id$in{{ graph_ids }}]', 'order': ['structures.graph_order'], 'num_rows': 'all', 'count': False, 'criteria_params': ['graph_ids']}, {'name': 'structure_sets_by_id', 'description': 'see name', 'model': 'StructureSet', 'criteria': '[id$in{{ set_ids }}]', 'num_rows': 'all', 'count': False, 'criteria_params': ['set_ids']}]}¶