R/synapses.R
neuprint_get_synapses.RdGet the xyz locations, IDs and confidences of pre- and post
synapses associated with a body. The connector_id for each synapse
is for the 'presynaptic' object. Separate IDs exist for the postsynapses in
neuPrint, and these are not fetched b this function. This is similar to the
logic use in rcatmaid.
neuprint_get_synapses(
bodyids,
roi = NULL,
remove.autapses = TRUE,
chunk = TRUE,
progress = NULL,
dataset = NULL,
conn = NULL,
...
)the body IDs for neurons/segments (bodies) you wish to query.
This can be in any form understood by neuprint_ids.
a ROI (i.e. neuropil volume) you want to query. Use
neuprint_ROIs to see what is available. Defaults to 'all',
which will return synapses in all ROIs.
Whether to remove autaptic connections (default TRUE) from the results. It appears that there is a relatively high number of false positive autapses.
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 chunk=TRUE).
if TRUE, a progress bar will be shown. This may slow the data
fetching process for smaller queries (<100 body ids). The default of
progress=NULL will only show a progress bar if the query will be
split into multiple chunks based on the chunk argument.
optional, a dataset you want to query. If NULL, the default
specified by your R environ file is used. See neuprint_login
for details.
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
a data frame, where each row is a connection between one query
bodyid and a single partner neuron. The prepost column
should be interpreted as follows:
prepost=0a downstream or output partner, postsynaptic to the query neuron
prepost=1an upstream or input partner, presynaptic to the query neuron
Each connection is associated with a synapse that has its own unique
connector_id, XYZ coordinates and a confidence in its existence.
# \donttest{
syns=neuprint_get_synapses(c(818983130, 1796818119))
head(syns)
#> connector_id prepost x y z confidence bodyid partner
#> 1 133497213 1 6323 17828 14144 0.852126 818983130 975432645
#> 2 132847104 1 5265 16547 13869 0.897000 818983130 974753221
#> 3 132991410 1 5360 16498 13893 0.562622 818983130 974753207
#> 4 132542739 1 5657 16563 13786 0.929711 818983130 974753105
#> 5 133238601 1 4957 16595 13991 0.333720 818983130 974749962
#> 6 133083035 1 4846 16575 14000 0.575020 818983130 974745316
# }