neuprint_connection_table | R Documentation |
Get the upstream and downstream connectivity of a body, restricted to within an ROI if specified
neuprint_connection_table(
bodyids,
partners = c("inputs", "outputs"),
prepost = c("PRE", "POST"),
roi = NULL,
by.roi = FALSE,
threshold = 1L,
summary = FALSE,
details = FALSE,
superLevel = FALSE,
progress = FALSE,
dataset = NULL,
chunk = TRUE,
all_segments = FALSE,
conn = NULL,
...
)
bodyids |
the body IDs for neurons/segments (bodies) you wish to query.
This can be in any form understood by |
partners |
|
prepost |
|
roi |
a single ROI. Use |
by.roi |
logical, whether or not to break neurons' connectivity down by region of interest (ROI) |
threshold |
Only return partners >= to an integer value. Default of 1
returns all partners. This threshold will be applied to the ROI weight when
the |
summary |
When |
details |
When |
superLevel |
When |
progress |
default FALSE. If TRUE, the API is called separately for each
neuron and you can assess its progress, if an error is thrown by any one
|
dataset |
optional, a dataset you want to query. If |
chunk |
A logical specifying whether to split the query into multiple
chunks or an integer specifying the size of those chunks (which defaults to
20 when |
all_segments |
if TRUE, all bodies are considered, if FALSE, only 'Neurons', i.e. bodies with a status roughly traced status. |
conn |
optional, a neuprintr connection object, which also specifies the
neuPrint server. If NULL, the defaults set in your
|
... |
methods passed to |
Note that by default neuprint_connection_table only returns upstream
or downstream connections with objects that were large enough to be
designated as "Neurons". Smaller objects (Segments) can be included when
all_segments=TRUE
. When this is done then the total counts will
match what is reported by neuprint_get_meta
.
The user must ensure that any columns named in the details
argument
are correct (non-existent columns will be filled with NA
). For
historical reasons the column displayed by neuprintr as name
must be
referred to as instance
in this argument (but will be renamed to
name
). File an
issue if this bothers you and I will try to do something smarter.
a data frame with one row for each unique combination of query neuron, partner neuron and (where specified) ROI.
bodyid query neuron identifier
partner neuron identifier
prepost 0 for upstream/input partners; 1 for downstream/output partners.
weight total number of connections between the query and partner neuron.
. When by.roi=TRUE
roi the name of the ROI
ROIweight the number of connections within that ROI
Note that when by.roi=TRUE
there may be multiple rows for each
unique pair of neurons and connections may appear in more than one
row when some ROIs are contained within larger ROIs. For example the
CA(R)
is contained within the MB(R)
ROI. Therefore you cannot
sum the ROIweight
to match the total connection strength (which is
available as the weight
column).
neuprint_fetch_custom
,
neuprint_simple_connectivity
,
neuprint_common_connectivity
, neuprint_ROIs
## Unitary connection strengths between two chosen neurons,
## and their downstream targets
c1 = neuprint_connection_table(c(818983130, 1796818119), prepost = "POST")
head(c1)
# query of regex against cell type
# summarised per partner with additional details column
c1s = neuprint_connection_table("/DA2.*lPN", partners='out', summary=TRUE, details=TRUE)
head(c1s)
# Kenyon cells typically receive fewer multiple inputs than other partners
table(n=c1s$n, KC=grepl("^KC", c1s$type))
## The same connections broken down by ROI
c2 = neuprint_connection_table(c(818983130, 1796818119), prepost = "POST",
by.roi = TRUE)
head(c2)
## The same connections broken down by super-level ROIs only
c3 = neuprint_connection_table(c(818983130, 1796818119), prepost = "POST",
by.roi = TRUE, superLevel = TRUE)
nrow(c3)
nrow(c2)
## Find only the connections within a specific ROI
c4 = neuprint_connection_table(c(818983130, 1796818119), prepost = "POST",
by.roi = TRUE, roi = "LH(R)")
# compare pre/post/upstream/downstream when all_segments=TRUE or FALSE
neuprint_get_meta('/DP1m.*vPN')
sum(neuprint_connection_table('/DP1m.*vPN', partners = 'in')$weight)
sum(neuprint_connection_table('/DP1m.*vPN', partners = 'in', all_segments = TRUE)$weight)
sum(neuprint_connection_table('/DP1m.*vPN', partners = 'out')$weight)
sum(neuprint_connection_table('/DP1m.*vPN', partners = 'out', all_segments = TRUE)$weight)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.