Codex provides two complementary ways to search neurons: free-form and structured queries.
With free-form search, you can simply type anything into the search bar and Codex will scan across all available annotations/labels, e.g. cell class, cell type, gene, neurotransmitter predictions, and more - much like a Google-style search. Results are ranked by quality of match: exact whole-word matches appear first, while partial or fuzzy matches are shown lower in the list (you can adjust these ranking rules in the settings menu). This makes free-form search especially useful for exploration when you don’t know exactly which field to query.
When you need precision, Codex also supports a structured query language.
Here you can build expressions that filter by specific attributes such as
cell_type, nt_type, side, or hemilineage,
and combine them with logical operators. For example,
class == olfactory retrieves neurons annotated with olfactory cell class,
while nt_type != GABA excludes neurons predicted as GABAergic.
More advanced operators let you ask about connectivity,
pathways between cells, or similarity in shape and projection patterns.
Each operator can be written in both a long form
(e.g. {equal}) and a short form
(e.g. ==), so you can choose whichever style you find most intuitive.
Below are some examples for various structured queries (you can click them to see matches).
For a full list of attributes and search operators refer to the FAQ page.Equality & InequalityEqual
Selects all neurons whose class is annotated as 'olfactory'
class {equal} olfactoryclass == olfactoryNot Equal
Finds all neurons whose neurotransmitter type is not GABA
nt_type {not_equal} GABAnt_type != GABALike / Fuzzy
Matches neurons with type that approximately equals 'Pm2' (fuzzy match)
cell_type {like} Pm2cell_type ~= Pm2String MatchingStarts With
Returns all neurons whose cell type name begins with 'T4'
cell_type {starts_with} T4cell_type ^* T4Ends With
Returns all neurons whose cell type ends with '4a'
cell_type {ends_with} 4acell_type ^$ 4aContains
Finds neurons with a gene attribute that contains the substring 'fru'
gene {contains} frugene >> fruNot Contains
Finds neurons with a label that does not contain the substring 'dsx'
label {not_contains} dsxlabel !> dsxMembershipIn Set
Matches neurons whose super class is 'sensory' or 'motor'
super_class {in} sensory, motorsuper_class << sensory, motorNot In Set
Excludes neurons whose soma is on the left or right hemisphere
side {not_in} left, rightside !< left, rightConnectivity (Region/Pathways)Upstream Region
Finds neurons upstream of the given cell with synapses in the GNG region
GNG {upstream_region} 720575940614730914GNG ^R 720575940614730914Downstream Region
Finds neurons downstream of the given cell with synapses in the LO_R region
LO_R {downstream_region} 720575940628731140LO_R !R 720575940628731140Pathways
Finds all neurons along the shortest pathway from one cell ID to another
720575940625448968 {pathways} 720575940640978048720575940625448968 => 720575940640978048Unary OperatorsHas
Returns neurons where the 'cell_type' field is not empty
{has} cell_type$$ cell_typeMissing
Returns neurons that do not have any value for 'hemilineage'
{missing} hemilineage!$ hemilineageUpstream
Finds neurons upstream of the given cell ID
{upstream} 720575940640978048^^ 720575940640978048Downstream
Finds neurons downstream of the given cell ID
{downstream} 720575940625448968!^ 720575940625448968Reciprocal
Finds neurons that are both upstream and downstream of the given cell (reciprocal connections)
{reciprocal} 720575940622872870^v 720575940622872870Similar Shape
Finds neurons with morphology similar to the given cell
{similar_shape} 720575940622872870~~ 720575940622872870Similar Connectivity Upstream
Finds neurons with similar upstream inputs as the given cell
{similar_connectivity_upstream} 720575940622872870~u 720575940622872870Similar Connectivity Downstream
Finds neurons with similar downstream outputs as the given cell
{similar_connectivity_downstream} 720575940622872870~d 720575940622872870Similar Connectivity Both
Finds neurons with overall connectivity (inputs and outputs) similar to the given cell
{similar_connectivity} 720575940622872870~c 720575940622872870Similar Projection Upstream
Finds neurons with similar input projections to the given cell
{similar_projection_upstream} 720575940622872870~pu 720575940622872870Similar Projection Downstream
Finds neurons with similar output projections to the given cell
{similar_projection_downstream} 720575940622872870~pd 720575940622872870Similar Projection Both
Finds neurons with overall similar projection patterns (inputs and outputs) to the given cell
{similar_projection} 720575940622872870~pc 720575940622872870Advanced ChainingGrouping And Not
Selects neurons that are olfactory OR visual, and excludes those whose cell_type starts with 'T'
{{class {equal} olfactory || class {equal} visual}} && {not} cell_type {starts_with} T{{class == olfactory || class == visual}} && !! cell_type ^* TAdditional ExamplesGlutamatergic Mbons
This query uses the {and} operator (&&) to combine two conditions. The first condition filters for mushroom body output neurons (class == MBON), and the second condition filters for neurons that are glutamatergic (nt_type == GLUT)
class {equal} MBON {and} nt_type {equal} GLUTclass == MBON && nt_type == GLUTVisual Projection Neurons To Right Lateral Horn
This query selects visual projection neurons (super_class == visual_projection) and further restricts to those that have the right lateral horn (LH_R) as one of their output regions
super_class {equal} visual_projection {and} output_neuropils {equal} LH_Rsuper_class == visual_projection && output_neuropils == LH_RDownstream Cells With Lineage Or Type
The {downstream} operator (!^) finds cells that are post-synaptic to the given cell. The second part of the query restricts results to cells that have either a hemilineage or a cell_type annotation
{downstream} 720575940638757464 {and} {{ {has} hemilineage {or} {has} cell_type }}!^ 720575940638757464 && {{ $$ hemilineage || $$ cell_type }}Kenyon Cell Subtypes
This query first selects cells with a cell_type starting with 'kc'. It then further filters to those whose cell_type contains either 'bp-m' or 'bp-ap2'. The double curly braces {{ ... }} ensure the contains checks are evaluated together before the {and}
cell_type {starts_with} kc {and} {{ cell_type {contains} bp-m {or} cell_type {contains} bp-ap2 }}cell_type ^* kc && {{ cell_type >> bp-m || cell_type >> bp-ap2 }}Two-Step Downstream T4C
The {downstream} operator (!^) finds immediate downstream partners of the given cell. The {downstream_union} operator (~DU) then expands to neurons downstream of those partners (two steps total). Finally, the filter restricts the result to cells of type T4c
{downstream_union} {downstream} 720575940629180422 {and} cell_type {equal} T4c~DU !^ 720575940629180422 && cell_type == T4c