NeuronCriteria¶
- class neuprint.queries.NeuronCriteria(matchvar='n', *, bodyId=None, type=None, instance=None, regex='guess', status=None, statusLabel=None, rois=None, inputRois=None, outputRois=None, roi_req='all', min_roi_inputs=1, min_roi_outputs=1, group=None, serial=None, zapbenchId=None, cropped=None, flywireType=None, hemibrainType=None, mancType=None, birthtime=None, cellBodyFiber=None, celltypePredictedNt=None, class_=None, consensusNt=None, description=None, dimorphism=None, entryNerve=None, exitNerve=None, flywireId=None, fruDsx=None, hemibrainBodyId=None, hemilineage=None, itoleeHl=None, locationType=None, longTract=None, matchingNotes=None, mcnsSerial=None, modality=None, ntReference=None, origin=None, otherNt=None, otherNtReference=None, predictedNt=None, prefix=None, receptorType=None, rootSide=None, serialMotif=None, somaNeuromere=None, somaSide=None, source=None, subclass=None, subclassabbr=None, superclass=None, supertype=None, synonyms=None, systematicType=None, tag=None, target=None, transmission=None, trumanHl=None, vfbId=None, label=None, min_pre=0, min_post=0, max_closestLandmarkDistanceMicrons=inf, somaLocation=None, tosomaLocation=None, rootLocation=None, soma=None, client=None)[source]¶
Neuron selection criteria.
Specifies which fields to filter by when searching for a Neuron (or Segment). This class does not send queries itself, but you use it to specify search criteria for various query functions.
Note
For simple queries involving only particular bodyId(s) or type(s)/instance(s), you can usually just pass the
bodyIdortypeto the query function, without constructing a fullNeuronCriteria.from neuprint import fetch_neurons, NeuronCriteria as NC # Equivalent neuron_df, conn_df = fetch_neurons(NC(bodyId=329566174)) neuron_df, conn_df = fetch_neurons(329566174) # Equivalent # (Criteria is satisfied if either type or instance matches.) neuron_df, conn_df = fetch_neurons(NC(type="OA-VPM3", instance="OA-VPM3")) neuron_df, conn_df = fetch_neurons("OA-VPM3")
All criteria must be passed as keyword arguments.
Note
Only
bodyId,type,instance, and ROI-related criteria are applicable to all datasets. The applicability of all other criteria depends on the dataset being accessed (e.g. hemibrain, manc, etc.).Note
Options for specifying ROI criteria
The
roisargument merely matches neurons that intersect the given ROIs at all (without distinguishing between inputs and outputs).The
inputRoisandoutputRoisarguments allow you to put requirements on whether or not neurons have inputs or outputs in the listed ROIs. It produces a more expensive query, but it’s more selective. It also enables you to require a minimum number of connections in the giveninputRoisoroutputRoisusing themin_roi_inputsandmin_roi_outputscriteria.In either case, use use
roi_reqto specify whether a neuron must match just one (any) of the listed ROIs, orallof them.Note
Matching against missing values (NULL)
To search for neurons which are missing given property entirely, you can use a list containing
None, or the special valueneuprint.IsNull. For example, to find neurons with no type, usetype=[None]ortype=IsNull.Matching against any value (NOT NULL)
To search for any non-null value, you can use
neuprint.NotNull. For example, to find neurons that have a type (no matter what the type is), usetype=NotNull.- Parameters:
matchvar (str) – An arbitrary cypher variable name to use when this
NeuronCriteriais used to construct cypher queries. Must begin with a lowercase letter.bodyId (int or list of ints) – List of bodyId values.
type (str or list of str) – Cell type. Matches depend on the the
regexargument. If bothtypeandinstancecriteria are supplied, any neuron that matches EITHER criteria will match the overall criteria.instance (str or list of str) – Cell instance (specific cell name). Matches depend on the the
regexargument. If bothtypeandinstancecriteria are supplied, any neuron that matches EITHER criteria will match the overall criteria.regex (bool) – If
True, theinstanceand alltype-style arguments will be interpreted as regular expressions, rather than exact match strings. IfFalse, only exact matches will be found. By default, the matching method will be automatically chosen by inspecting thetypeandinstancestrings. If they contain regex-like characters, then we assume you intend regex matching. (You can see which method was chosen by checking theregexfield after theNeuronCriteriais constructed.)status (str or list of str) – Indicates the status of the neuron’s reconstruction quality. Typically, named/annotated neurons have
Tracedstatus, the best quality.statusLabel (str or list of str) –
statusLabelis typically more fine-grained thanstatus, and mostly of interest during the construction of the connectome, not for end-users. The possible values ofstatusLabeldo not correspond one-to-one to those ofstatus.rois (str or list of str) – ROIs that merely intersect the neuron, without specifying whether they’re intersected by input or output synapses. If not provided, will be auto-set from
inputRoisandoutputRois.inputRois (str or list of str) – Only Neurons which have inputs in EVERY one of the given ROIs will be matched.
regexdoes not apply to this parameter.outputRois (str or list of str) – Only Neurons which have outputs in EVERY one of the given ROIs will be matched.
regexdoes not apply to this parameter.min_roi_inputs (int) – How many input (post) synapses a neuron must have in each ROI to satisfy the
inputRoiscriteria. Can only be used if you providedinputRois.min_roi_outputs (int) – How many output (pre) synapses a neuron must have in each ROI to satisfy the
outputRoiscriteria. Can only be used if you providedoutputRois.roi_req (Either
'any'or'all') – Whether a neuron must intersect all of the listed input/output ROIs, or any of the listed input/output ROIs. When using ‘any’, each neuron must still match at least one input AND at least one output ROI.group (int or list of int) – In some datasets, the
groupID is used to associate neurons morphological type, including left-right homologues. Neurons with the same group ID have matching morphology.serial (int or list of int) – Similar to
group, but used for associating neurons across segmental neuropils in the nerve cord. Neurons with the sameserialID are analogous to one another, but in different leg segments.cropped (bool) – If given, restrict results to neurons that are cropped or not.
fields (dataset-specific exact string) –
birthtime (str or list of str): cellBodyFiber (str or list of str): superclass (str or list of str): class_ (str or list of str):
Matches for the neuron
classfield.entryNerve (str or list of str): exitNerve (str or list of str): flywireType (str or list of str, regex-optional): hemibrainType (str or list of str, regex-optional): hemilineage (str or list of str): itoleeHl (str or list of str): longTract (str or list of str): mancType (str or list of str, regex-optional): modality (str or list of str): origin (str or list of str): predictedNt (str or list of str): serialMotif (str or list of str): somaNeuromere (str or list of str): somaSide (str or list of str):
Valid choices are ‘RHS’, ‘LHS’, ‘Midline’
subclass (str or list of str): synonyms (str or list of str): systematicType (str or list of str): target (str or list of str): trumanHl (str or list of str): zapbenchId
to (possibiliy including but not limited) –
birthtime (str or list of str): cellBodyFiber (str or list of str): superclass (str or list of str): class_ (str or list of str):
Matches for the neuron
classfield.entryNerve (str or list of str): exitNerve (str or list of str): flywireType (str or list of str, regex-optional): hemibrainType (str or list of str, regex-optional): hemilineage (str or list of str): itoleeHl (str or list of str): longTract (str or list of str): mancType (str or list of str, regex-optional): modality (str or list of str): origin (str or list of str): predictedNt (str or list of str): serialMotif (str or list of str): somaNeuromere (str or list of str): somaSide (str or list of str):
Valid choices are ‘RHS’, ‘LHS’, ‘Midline’
subclass (str or list of str): synonyms (str or list of str): systematicType (str or list of str): target (str or list of str): trumanHl (str or list of str): zapbenchId
label (Either
'Neuron'or'Segment') – Which node label to match with. (In neuprint, allNeuronnodes are alsoSegmentnodes.) By default,'Neuron'is used, unless you provided a non-emptybodyIdlist. In that case,'Segment'is the default. (It’s assumed you’re really interested in the bodies you explicitly listed, whether or not they have the'Neuron'label.)min_pre (int) – Exclude neurons that don’t have at least this many t-bars (outputs) overall, regardless of how many t-bars exist in any particular ROI.
min_post (int) – Exclude neurons that don’t have at least this many PSDs (inputs) overall, regardless of how many PSDs exist in any particular ROI.
somaLocation – The
somaLocationproperty of:Neuronobjects contains the[X,Y,Z]coordinate (in voxels) of the cell body.NeuronCriteriadoes not allow you to match a specific coordinate, but you may set this argument toNotNull` (or ```IsNull) to search for cells with (or without) a recorded cell body.tosomaLocation – Neurons which could not be successfully attached to their cell body do not have a recorded
somaLocation. Instead, they have an annotaiton on the cell body fiber, on the severed end extending out toward the cell body. LikesomaLocation, you can’t match a specific coordinate usingNeuronCriteria, but you can useNotNull/IsNull.rootLocation – Some (but not all) Neurons which have no soma in the tissue sample are tagged with a
rootLocation, indicating where they enter/exit the sample. LikesomaLocation, you can’t match a specific coordinate usingNeuronCriteria, but you can useNotNull/IsNull.soma (Either
True,False, orNone) – DEPRECATED. UsesomaLocation=NotNullorsomaLocation=IsNull.zapbenchId (int or list of int) – (zebrafish only) This field is used to identify neurons that have been matched to neurons in the ZAPBench dataset.
max_closestLandmarkDistanceMicrons (float) – (zebrafish only) The maximum distance (in microns) from the closest landmark that a neuron must have to be included in the results.
client (
neuprint.client.Client) – Used to validate ROI names.
- neuprint.queries.SegmentCriteria = <class 'neuprint.queries.neuroncriteria.NeuronCriteria'>[source]¶
Neuron selection criteria.
Specifies which fields to filter by when searching for a Neuron (or Segment). This class does not send queries itself, but you use it to specify search criteria for various query functions.
Note
For simple queries involving only particular bodyId(s) or type(s)/instance(s), you can usually just pass the
bodyIdortypeto the query function, without constructing a fullNeuronCriteria.from neuprint import fetch_neurons, NeuronCriteria as NC # Equivalent neuron_df, conn_df = fetch_neurons(NC(bodyId=329566174)) neuron_df, conn_df = fetch_neurons(329566174) # Equivalent # (Criteria is satisfied if either type or instance matches.) neuron_df, conn_df = fetch_neurons(NC(type="OA-VPM3", instance="OA-VPM3")) neuron_df, conn_df = fetch_neurons("OA-VPM3")