fafbseg.flywire.skid_to_id¶
- fafbseg.flywire.skid_to_id(x, sample=None, catmaid_instance=None, progress=True, *, dataset=None)[source]¶
Find the FlyWire root ID for a given (FAFB) CATMAID neuron.
- This function works by:
Fetch the skeleton for given CATMAID neuron.
Transform the skeleton to FlyWire space.
Map the x/y/z location of the skeleton nodes to root IDs.
Return the root ID that was seen the most often.
- Parameters:
x (int | list-like | str | TreeNeuron/List) – Anything that’s not a TreeNeuron/List will be passed directly to
pymaid.get_neuron
.sample (int | float, optional) – Number (>= 1) or fraction (< 1) of skeleton nodes to sample to find FlyWire root IDs. If
None
(default), will use all nodes.catmaid_instance (pymaid.CatmaidInstance, optional) – Connection to a CATMAID server. If
None
, will use the current global connection. See pymaid docs for details.progress (bool) – If True, shows progress bar.
dataset ("public" | "production" | "sandbox" | "flat_630", optional) – Against which FlyWire dataset to query. If
None
will fall back to the default dataset (seeset_default_dataset()
).
- Returns:
Mapping of skeleton IDs to FlyWire root IDs. Confidence is the difference between the frequency of the root ID that was seen most often and the second most seen ID.
- Return type:
pandas.DataFrame
See also
neuron_to_segments()
Takes already downloaded and transformed neuron(s) and returns corresponding FlyWire root IDs.
Examples
>>> from fafbseg import flywire >>> import pymaid >>> # Connect to the VFB's CATMAID >>> rm = pymaid.CatmaidInstance('https://fafb.catmaid.virtualflybrain.org/', ... project_id=1, api_token=None) >>> roots = flywire.skid_to_id([6762, 2379517]) >>> roots skeleton_id flywire_id confidence 0 6762 720575940608544011 0.80 1 2379517 720575940617229632 0.42