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"),
  ...
)

Arguments

a, b

neurons or neuronlists

s

the approach distance to consider a potential synapse

...

Additional arguments passed to methods (see details )

sigma

the smoothing parameter in the approximate method (see details)

bounds

Optional bounding box to restrict comparison

method

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

seglength

how long to consider each distance between points.

Details

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.

References

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

See also

Other neuron: neuron(), ngraph(), plot.dotprops(), prune(), resample(), rootpoints(), spine(), subset.neuron()

Examples

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)
}