This function re-roots a neuron skeleton represented as a neuron
object at the location of the corresponding soma in the roots
data
frame. It uses the root_id
in the skeleton object to identify the soma
location.
Usage
banc_reroot(x, id = NULL, roots = NULL, estimate = TRUE, ...)
# S3 method for class 'neuron'
banc_reroot(x, id = NULL, roots = NULL, estimate = TRUE, ...)
# S3 method for class 'neuronlist'
banc_reroot(x, id = NULL, roots = NULL, estimate = TRUE, ...)
Arguments
- x
A
banc.neurite
object representing the neuron skeleton.- id
(Optional) The
root_id
of the neuron in theroots
data frame. If NULL, it will be taken from thex$root_id
slot.- roots
A data frame containing information about root points, i.e. nuclei obtained using
bancr:::banc_roots()
. This data frame is assumed to have columns namedroot_id
androot_position_nm
, whereroot_position_nm
specifies the 3D coordinates of the soma for eachroot_id
.- estimate
if
TRUE
and nucleus position is not inroots
, then root is estimated as a leaf node furthest outside of the brain neuropil.- ...
Methods passed to
nat::nlapply
.
Examples
if (FALSE) { # \dontrun{
x <- banc_read_l2skel(..., simplify = FALSE)
roots <- bancr:::banc_roots()
re-rooted_neuron <- banc_reroot(x, roots = roots)
} # }