Re-root neurons by predicting their soma location. Somas have been manually tagged by the FlyEM project. However, in some cases the roots are wrong, or somas are outside of the volume. The Fly Connectome team at the University of Cambridge has manually tagged better root points for these neurons. Soma locations, updated by this work, as saved as hemibrain_somas in this package. A user can read somas from here, or get a bleeding edge version from the Google Sheet. Alternatively, they can 'estimated' a good root-point. This works by finding the longest path outside of a given neuropil mesh/meshes, as in insect neurons the soma should be located in a cortex outside of the neuropil proper.

hemibrain_reroot(
  x,
  method = c("manual", "estimated"),
  meshes = NULL,
  googlesheet = FALSE,
  hemibrain_somas = hemibrainr::hemibrain_somas,
  ...
)

Arguments

x

a nat::neuronlist or nat::neuron object

method

whether to use the manually curated soma list or estimate soma location.

meshes

a list/a single object of class mesh3d or hxsurf. Only used for estimation. If NULL then hemibrain_roi_meshes is called.

googlesheet

logical, whether to read soma locations from the Google Sheet if method == "manual".

hemibrain_somas

a data.frame that gives soma locations for hemibrain neurons. See the default, hemibrain_somas. If googelsheet is TRUE this is read fresh from the hemibrain Google team drive overseen by the Drosophila Connectomics group.

...

methods sent to nat::nlapply

Value

a nat::neuronlist or nat::neuron object

See also

Examples

# \donttest{ # Choose some known trouble makers bad.soma = c("5813015982","885788485","5813013913") # Read in these neurons neurons.bs = neuprintr::neuprint_read_neurons(bad.soma) # Re-root neurons = hemibrain_reroot(neurons.bs, meshes = hemibrain.surf) if (FALSE) { # Let's check that this worked. Old root in red, new in green nat::nopen3d() for(i in 1:length(neurons)){ n = neurons[[i]] bs = neurons.bs[[i]] 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, col = "green") spheres3d(nat::xyzmatrix(bs)[nat::rootpoints(bs),],radius=500, alpha=0.5, col = "red") p = readline("Done? ") } }# }