This implements the method of Stepanyants and Chklovskii

potential_synapses(a, b, s, ...)

# S3 method for neuronlist
potential_synapses(a, b, s, ...)

# S3 method for neuron
potential_synapses(a, b, s, sigma = s, bounds,
  method = c("direct", "approx"), ...)

# S3 method for dotprops
potential_synapses(a, b, s, sigma = s,
  seglength = 1, bounds = NULL, method = c("direct", "approx"), ...)


a, b

neurons or neuronlists


the approach distance to consider a potential synapse


Additional arguments passed to methods (see details )


the smoothing parameter in the approximate method (see details)


Optional bounding box to restrict comparison


Whether to use the direct or approximate method (see details)


how long to consider each distance between points.


Note that potential_synapses.neuronlist uses nlapply to process its first argument (a). This enables progress bars, robustness to errors and simple parallel execution. See the nlapply examples for further details of these arguments in action.

For this reason if you have two neuronlists of unequal sizes, it is recommended to put the larger one in argument a.


Neurogeometry and potential synaptic connectivity. Stepanyants A, Chklovskii DB. Trends Neurosci. 2005 Jul;28(7):387-94.

See also


potential_synapses(Cell07PNs[1], Cell07PNs[1:3], s=2)
#> EBH11R #> EBH11R 902 #> EBH20L 219 #> EBH20R 192
if (FALSE) { # if you have many neurons to calculate you should get a progress bar potential_synapses(Cell07PNs[1:10], Cell07PNs[11:20], s=2) # you can also use parallel execution, here over 7 cores # doMC::registerDoMC(7) potential_synapses(Cell07PNs[1:10], Cell07PNs[11:20], s=2, .parallel=TRUE) }