Fetch the synapses associated with a bodyid and assign them to the nearest point in the skeleton. For this to work, the skeletons must be in the same brainspace as the synaptic data being pulled from neuprint. I.e. do not transform them to another brainspace, until after this step.

For some datasets, somata positions have been mapped to pixels within a soma volume in the image data. If your bodyids contain such an annotated pixel, you can retrieve its position.

neuprint_assign_connectors(x, bodyids = NULL, dataset = NULL, conn = NULL, ...)

  dataset = NULL,
  all_segments = TRUE,
  conn = NULL,



either an object of class neuron, or neuronlist


the body IDs for neurons/segments (bodies) you wish to query. This can be in any form understood by neuprint_ids.


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.


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


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


a neuron/neuronlist object as dictated used by the nat and rcatmaid packages

a data frame of X,Y,Z coordinates, a row for each bodyid supplied


# \donttest{
#>       bodyid    X     Y     Z
#> 1 5813115796 4345 27108 13968
# }