Synapse Filters¶
The following filters are accepted by functionalizer’s --filters command
line option.
To use any of the filters, remove the Filter suffix if present, e.g.,
BoutonDistanceFilter becomes BoutonDistance.
Parametrized Synapse Reduction¶
- class BoutonDistanceFilter(recipe, source, target)[source]¶
Bases:
DatasetOperationFilter synapses based on the distance from the soma.
This filter reads distances for inhibitory and excitatory synapses from the recipe definition and filters out all synapses closer to the soma.
- class SomaDistanceFilter(recipe, source, target)[source]¶
Bases:
DatasetOperationFilter touches based on distance from soma.
Removes all touches that are located within the soma.
- class TouchReductionFilter(recipe, source, target)[source]¶
Bases:
DatasetOperationFilter touches based on a simple probability.
Defined in the recipe as TouchReduction, restrict connections according to the survival_rate defined.
- class TouchRulesFilter(recipe, source, target)[source]¶
Bases:
DatasetOperationFilter touches based on recipe rules.
Defined in the recipe as TouchRules, restrict connections between mtypes and types (dendrite/soma). Any touches not allowed are removed.
This filter is deterministic.
Synapse Identification¶
- class AddIDFilter(recipe, source, target)[source]¶
Bases:
DatasetOperationAdds a column synapse_id to a circuit.
Note
The synapse id added by this filter will yield reproducible synapse properties, but should not be used for any processing involving probabilities, i.e., reduce and cut.
- class DenseIDFilter(recipe, source, target)[source]¶
Bases:
DatasetOperationMakes the synapse_id column continuous.
This filter should be used if the range of the synapse id field exceeds numerical limitiations when generating output files.
In particular, this filter should be included before
GapJunctionFilterto make the gap junction ids fit into the numerical range accepted by neuron.
Generating Properties for Gap-Junctions¶
- class GapJunctionFilter(recipe, source, target)[source]¶
Bases:
DatasetOperationSynchronize gap junctions.
Ensures that:
Dendro-dentro and dendro-soma touches are present as src-dst and the corresponding dst-src pair. The sections of the touches have to be aligned exactly, while the segment may deviate to neighboring ones.
Dendro-somatic touches: the structure of the neuron morphology is traversed and from all touches that are within a distance of 3 soma radii on the same branch only the “parent” ones are kept.
- class GapJunctionProperties(recipe, source, target)[source]¶
Bases:
DatasetOperationAssign gap-junction properties.
This “filter” augments touches with properties of gap-junctions by adding the field
conductance representing the conductance of the gap-junction with a default value of 0.2
as specified by the gap_junction_properties part of the recipe.
Sampled Reduction¶
- class SpineLengthFilter(recipe, source, target)[source]¶
Bases:
DatasetOperationFilter synapses by spine length to match a desired distribution.
- apply(circuit)[source]¶
Reduce edges until the real spine length distribution matches the desired one.
Determines the survival rate of edges by dividing the desired spine length distribution by the one found in the data, scaling to the value for each bin to [1.0, 0.0]. Then generates random numbers and selects the edges below the cut threshold.
- class ReduceAndCut(recipe, source, target)[source]¶
Bases:
DatasetOperationReduce and cut touch distributions.
Goes through the touches and matches up distributions present and expected by random sampling. Steps:
Pathway statistics are determined and reduction factors are calculated
Calulate pP_A, pMu_A, bouton reduction factor, and legacy active fraction based on the number of touches per pathway and pathway count.
Reduction factors are applied to the touches
Based on pP_A calculated previously, with random numbers drawn for sampling.
Survival rates of the remaining touches are calculated
Trim src-dst connections based on the survival of the previous step, and relying on pMu_A, calculates a survival rate and keeps “surviving” connections by sampling.
Active connection fractions are deduced from survival rates and applied
Using the bouton_reduction_factor from the ConnectionRules part of the recipe to determine the overall fraction of the touches that every mtype–mtype connection class is allowed to have active.
To calculate random numbers, a seed derived from the synapseSeed in the recipe is used.
The internal implementation uses Pandas UDFs calling into Cython/Highfive for the random number generation.
- calc_cut_active_fraction(cut_touch_counts_connection, params_df)[source]¶
Cut according to the active_fractions.
- Parameters:
params_df – the parameters DF (pA, uA, active_fraction_legacy)
cut_touch_counts_connection – the DF with the cut touch counts per connection (built previously in an optimized way)
- Returns:
The final cut touches
- calc_cut_survival_rate(reduced_touches, params_df)[source]¶
Apply cut filter.
Cut computes a survivalRate and activeFraction for each post neuron And filters out those not passing the random test
- compute_reduce_cut_params(full_touches)[source]¶
Computes pathway parameters for reduce and cut.
Based on the number of touches per pathway and the total number of connections (unique pathways).
- Parameters:
full_touches – touches with a pathway column
- Returns:
a dataframe containing reduce and cut parameters
Generating Properties of Chemical Synapses¶
- class SynapseReposition(recipe, source, target)[source]¶
Bases:
DatasetOperationReposition synapses.
Shifts the post-section of synapses for ChC and SpAA cells to the soma according to the SynapsesReposition rules of the recipe.
- class SynapseProperties(recipe, source, target)[source]¶
Bases:
DatasetOperationAssign synapse properties.
This “filter” augments touches with properties of synapses by adding the fields
conductance following a Gamma-distribution
depression_time following a Gamma-distribution
facilitation_time following a Gamma-distribution
u_syn following a truncated Normal-distribution
decay_time following a truncated Normal-distribution
n_rrp_vesicles following a Poisson-distribution
conductance_scale_factor, taken verbatim from the recipe
u_hill_coefficient, also taken verbatim from the recipe
as specified by the synapse_properties.classes part of the recipe.
To draw from the distributions, a seed derived from the seed in the recipe is used.
The internal implementation uses Pandas UDFs calling into Cython/Highfive for the random number generation.