Get the neurons that are shared synaptic partners for a set of given bodyids, either upstream or downstream.

neuprint_common_connectivity(
  bodyids,
  statuses = NULL,
  prepost = c("PRE", "POST"),
  all_segments = FALSE,
  dataset = NULL,
  conn = NULL,
  ...
)

Arguments

bodyids

the cypher by which to make your search

statuses

if not NULL, only bodies with the given status are considered. Statuses include: Unimportant,0.5assign,Leaves,Prelim Roughly Traced, Anchor, Orphan.

prepost

whether to look for partners presynaptic or postsynaptic to the given bodyids. So when prepost="PRE" you will return inputs (upstream partners) of your starting neurons.

all_segments

if TRUE, all bodies are considered, if FALSE, only 'Neurons', i.e. bodies with a status roughly traced status.

dataset

optional, a dataset you want to query. If NULL, the default specified by your R environ file is used or, failing that the current connection, is used. See neuprint_login for details.

conn

optional, a neuprintr connection object, which also specifies the neuPrint server. If NULL, the defaults set in your .Rprofile or .Renviron are used. See neuprint_login for details.

...

methods passed to neuprint_login

Value

a n x m matrix where n correspond to the neurons that all connect to m bodyids

Examples

# \donttest{
da2s=neuprint_search('.*DA2.*')
da2conn = neuprint_common_connectivity(da2s$bodyid[1:2], prepost='PRE')
plot(t(da2conn))

head(cbind(t(da2conn), sum=colSums(da2conn)))
#>           1796817841 1827516355 sum
#> 425790257          2          2   4
#> 478613576          5          3   8
#> 480590566          6          4  10
#> 513323340          1          5   6
#> 543679473          1          1   2
#> 573695941          7          9  16
# }