Read skeleton(s) from brainmaps API into a nat::neuron object
Source: R/brainmaps-api.R
read.neuron.brainmaps.RdRead skeleton(s) from brainmaps API into a nat::neuron object
Arguments
- x
A vector of segment ids or any Neuroglancer scene specification that includes segments ids (see examples and
ngl_segmentsfor details).- ...
Additional arguments passed to
brainmaps_skeletonand then on tobrainmaps_fetch. These may include askeletonuriargument, a brainmaps URI specifying the remote source of the skeletons. Seebrainmaps_skeletonfor details.- OmitFailures
Whether to omit neurons for which
FUNgives an error. The default value (NA) will result innlapplystopping with an error message the moment there is an error. For other values, see details.- df
Optional data frame containing information about each neuron
Value
a nat::neuron object
Details
When OmitFailures is not NA, FUN will be
wrapped in a call to try to ensure that failure for any
single neuron does not abort the nlapply call. When
OmitFailures=TRUE the resultant neuronlist will be
subsetted down to return values for which FUN evaluated
successfully. When OmitFailures=FALSE, "try-error" objects will be
left in place. In either of the last 2 cases error messages will not be
printed because the call is wrapped as try(expr, silent=TRUE).
The optional dataframe (df) detailing each neuron should have
rownames that match the names of each neuron. It would also make
sense if the same key was present in a column of the data frame. If the
dataframe contains more rows than neurons, the superfluous rows are dropped
with a warning. If the dataframe is missing rows for some neurons an error
is generated. If SortOnUpdate=TRUE then updating an existing
neuronlist should result in a new neuronlist
with ordering identical to reading all neurons from scratch.
Examples
if (FALSE) { # \dontrun{
n=read.neuron.brainmaps(22427007374)
nm=read.neurons.brainmaps(find_merged_segments(7186840767))
# you would specify a particular skeleton source like so
read.neurons.brainmaps(find_merged_segments(7186840767),
skeletonuri="brainmaps://<volume>/<meshName>")
} # }