fafbseg.flywire.search_community_annotations#

fafbseg.flywire.search_community_annotations(x, exact=False, case=False, regex=True, clear_cache=False, *, materialization='auto', dataset=None)[source]#

Search community cell identification annotations for given term/root IDs.

This function loads and caches the cell type information table, i.e. the first call might take a while but subsequent calls should be very fast.

Parameter#

xstr | int | Neuron/List | list of ints | None

Term (str) or root ID(s) to search for. Set to None to fetch all annotations.

exactbool

Whether term must be an exact match. For example, if exact=False (default), ‘sensory’ will match to e.g. ‘sensory,olfactory’ or ‘AN sensory’.

casebool

If True (default = False), search for term will be case sensitive.

regexbool

Whether to interpret term as regex.

clear_cachebool

If True, will clear the cached annotation table(s).

materialization“auto” | “live” | “latest” | int | bool

Which materialization version to search. You can also provide an ID (int) for a specific materialization version (see get_materialization_versions). “auto” is only relevant if x is a list of root IDs.

dataset“public” | “production”, optional

Against which FlyWire dataset to query. If None will fall back to the default dataset (see also set_default_dataset()).

returns:

DataFrame with annotations matching x. Coordinates are in 4x4x40nm voxel space.

rtype:

pandas.DataFrame

See also

search_annotations()

Use this to search through the hierarchical annotations.

get_hierarchical_annotations()

Use this to load a table with all hierarchical annotations.

Examples

>>> from fafbseg import flywire

Search for annotations for given root ID(s):

>>> an = flywire.search_community_annotations(720575940628857210)
Using materialization version 783.
>>> an.iloc[0]                                              
id                                             46699
created             2022-04-20 17:26:55.132886+00:00
superceded_id                                    NaN
pt_position_x                                 419980
pt_position_y                                 189644
pt_position_z                                 217360
tag                           unclassified_IN_FW_112
user                                 Stefanie Hampel
user_id                                          125
pt_supervoxel_id                   77830580511126708
pt_root_id                        720575940628857210
Name: 0, dtype: object

Search for all tags matching a given pattern:

>>> mi1 = flywire.search_community_annotations('Mi1')
>>> mi1.head()                                              
      id   pos_x  pos_y  ...                      tag  user  user_id
0  61866  200890  58482  ...  Medulla Intrinsic - Mi1  TR77     2843
1  61867  192776  41653  ...  Medulla Intrinsic - Mi1  TR77     2843
2  61869  194704  97128  ...  Medulla Intrinsic - Mi1  TR77     2843
3  61871  191574  82521  ...  Medulla Intrinsic - Mi1  TR77     2843
4  61877  195454  43026  ...  Medulla Intrinsic - Mi1  TR77     2843