View source: R/hemibrain_reroot.R
hemibrain_skeleton_check | R Documentation |
Call hemibrain_reroot
on neurons read from
the hemibrain neuprintr project, that have no marked soma, and
remove_bad_synapses
on all neurons. Does not prune synapses
from soma positions / along the primary neurite, but does remove synapses outside
of the hemibrain volume.
hemibrain_skeleton_check(
x,
meshes = hemibrainr::hemibrain.surf,
min.nodes.from.soma = 100,
min.nodes.from.pnt = 5,
OmitFailures = FALSE,
...
)
x |
a |
meshes |
a list/a single object of class |
min.nodes.from.soma |
the minimum number of nodes (geodesic distance) a
synapse can be from the soma. Synapses closes than this will be removed.
For comparable results across neurons, recommended to use
|
min.nodes.from.pnt |
the minimum number of nodes (geodesic distance) a synapse can be from a point along the primary neurite. Synapses closes than this will be removed. |
OmitFailures |
Whether to omit neurons for which FUN gives an error. The default value (NA) will result in nlapply stopping with an error message the moment there is an error. |
... |
methods sent to |
a nat::neuronlist
or nat::neuron
object
hemibrain_reroot
# Choose some known trouble makers
ids = c("5813056323", "579912201", "5813015982", "973765182", "885788485",
"915451074", "5813032740", "1006854683", "5813013913", "5813020138",
"853726809", "916828438", "5813078494", "420956527", "486116439",
"573329873", "5813010494", "5813040095", "514396940", "665747387",
"793702856", "451644891", "482002701", "391631218", "390948259",
"390948580", "452677169", "511262901", "422311625", "451987038"
)
# just use a subset for documentation purposes
ids=ids[1:3]
# Read in these neurons
neurons = neuprintr::neuprint_read_neurons(ids)
## Not run:
# Get all the roi meshes
hemibrain.rois = hemibrain_roi_meshes()
## Using this as the argument for 'meshes' will also
## give you the ROI for each point and synapse in a neuron's skeleton!!
# Re-root
neurons.checked = hemibrain_skeleton_check(neurons, meshes = hemibrain.rois)
## End(Not run)
# Alternatively, we can do this faster using a single surface model for the
# whole hemibrain
neurons.checked = hemibrain_skeleton_check(neurons, meshes = hemibrain.surf)
## Not run:
# Let's check that this worked
nat::nopen3d()
for(n in neurons.checked){
clear3d();
message(n$bodyid)
plot3d(n,col="brown",lwd=2)
points3d(nat::xyzmatrix(n$connectors),col="black")
spheres3d(nat::xyzmatrix(n)[nat::rootpoints(n),],radius=500, alpha=0.5)
p = readline("Done? ")
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.