cave module provides utilities for working with CAVE (Connectome Annotation Versioning Engine) neuroscience databases. These functions help retrieve neuron metadata, synapses, and map them to mesh structures.
Overview
CAVE is a framework for storing and versioning large-scale connectomics data. This module provides functions to:- Find nucleus locations for neurons
- Query synaptic connections
- Map synapses to mesh vertices
Functions
find_nucleus_point
Find the nucleus point for a given neuron root ID in the CAVE database.The root ID of the neuron in the chunked graph.
An initialized CAVEclient instance connected to the desired datastack.
Whether to update the root_id to the latest version. Can be:
True: Automatically update to latest rootFalse: Use the provided root_id as-is"check": Verify the root_id is current and raise error if not
get_synapses
Retrieve synapses for one or more neurons from the CAVE database.Single root ID or collection of root IDs to query synapses for.
An initialized CAVEclient instance.
Which side of the synapse to query:
"pre": Presynaptic (output) synapses"post": Postsynaptic (input) synapses
Specific materialization version to query. If None, uses the latest version.
Timestamp for querying synapses at a specific point in time.
get_synapses_at_oldest
Retrieve synapses for a neuron at the oldest available materialization version.The root ID of the neuron.
An initialized CAVEclient instance.
Which side of the synapse to query (“pre” or “post”).
Whether to verify the root exists at the oldest timestamp.
get_synapse_mapping
Map synapses to their nearest vertices on a mesh.The root ID of the neuron.
The mesh to map synapses onto. Can be a tuple of (vertices, faces) or a mesh object.
An initialized CAVEclient instance.
Materialization version to use. If set to 0, uses the oldest version. If None, uses latest.
Timestamp for querying synapses.
Maximum distance in nm for mapping a synapse to a mesh vertex. Synapses beyond this distance are excluded.
Column prefix to use for synapse position coordinates.
Which side of the synapse to query (“pre” or “post”).
Notes
- All coordinates are in nanometers (nm) as used by CAVE databases
- The module supports both “minnie” and “v1dd” datastacks with dataset-specific logic
- Synapses are automatically filtered to exclude autapses (self-connections)
- Root IDs may change over time as proofreading occurs; use
update_root_idparameter to handle versioning