navis 1.4.0
  • Install
  • Quickstart
  • Tutorials
  • API
  • Changelog
  • Github
  • Ecosystem
  • Site
    • Page
        • navis.synapse_similarity
          • synapse_similarity()

    navis.synapse_similarity¶

    navis.synapse_similarity(x, sigma, omega, mu_score=True, restrict_cn=None, n_cores=1)[source]¶

    Cluster neurons based on their synapse placement.

    Distances score is calculated by calculating for each synapse of neuron A: (1) the (Euclidian) distance to the closest synapse in neuron B and (2) comparing the synapse density around synapse A and B. This is type-sensitive: presynapses will only be matched with presynapses, post with post, etc. The formula is described in Schlegel et al., eLife (2017):

    f(i_{s},j_{k}) = \exp(\frac{-d^{2}_{sk}}{2\sigma^{2}}) \exp(\frac{|n(i_{s})-n(j_{k})|}{n(i_{s})+n(j_{k})})

    The synapse similarity score for neurons i and j being the average of f(i_{s},j_{k}) over all synapses s of i. Synapse k is the closest synapse of the same sign (pre/post) in neuron j to synapse s. d^{2}_{sk} is the Euclidian distance between these distances. Variable \sigma (sigma) determines what distance between s and k is considered “close”. n(i_{s}) and n(j_{k}) are defined as the number of synapses of neuron i/j that are within given radius \omega (omega) of synapse s and j, respectively (same sign only). This esnures that in cases of a strong disparity between n(i_{s}) and n(j_{k}), the synapse similarity will be close to zero even if the distance between s and k is very small.

    Parameters:
    • x (NeuronList) – Neurons to compare. Must have connectors.

    • sigma (int | float) – Distance between synapses that is considered to be “close”.

    • omega (int | float) – Radius over which to calculate synapse density.

    • mu_score (bool) – If True, score is calculated as mean between A->B and B->A comparison.

    • restrict_cn (int | list | None) – Restrict to given connector types. Must map to a type, relation or label column in the connector tables. If None, will use all connector types. Use either single integer or list. E.g. restrict_cn=[0, 1] to use only pre- and postsynapses.

    • n_cores (int) – Number of parallel processes to use. Defaults to half the available cores.

    Return type:

    pandas.DataFrame

    See also

    navis.synblast()

    NBLAST variant using synapses.

    Examples

    >>> import navis
    >>> nl = navis.example_neurons(5)
    >>> scores = navis.synapse_similarity(nl, omega=5000/8, sigma=2000/8)
    

    Back to top

    Source

    © Copyright 2018, Philipp Schlegel.
    Created using Sphinx 5.3.0.