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 1796818119 sum
#> 425790257          2          7   9
#> 478613576          5          5  10
#> 480590566          6          1   7
#> 487144598          2          2   4
#> 512982243          2          1   3
#> 513323340          1          7   8
# }