Read neurons from the hemibrain connectome project. This function uses the package neuprintr to read neurons. It then uses hemibrain_flow_centrality to re-root and split neurons into putative axons and dendrites. Optionally, it may also convert neurons from their raw voxel space (as they are stored in neuPrint) to microns.

hemibrain_read_neurons(
  x = NULL,
  local = FALSE,
  microns = FALSE,
  reroot = TRUE,
  remote = TRUE,
  googlesheet = FALSE,
  remove.bad.synapses = FALSE,
  clean = FALSE,
  ...
)

scale_neurons(x, scaling = (8/1000), ...)

hemibrain_neurons(
  x = NULL,
  local = FALSE,
  brain = c("JRCFIB2018Fraw", "JRCFIB2018F", "FAFB14", "JFRC2", "JRC2018F", "FCWB"),
  mirror = FALSE,
  dotprops = FALSE,
  swc = FALSE,
  zip = FALSE,
  folder = "hemibrain_neurons/"
)

Arguments

x

a vector of bodyids that can be read from 'https://neuprint.janelia.org/'.

local

FALSE or path. By default (FALSE) data is read from options()$Drive_hemibrain_data), but the user can specify an alternative path.

microns

convert dimensions from raw voxels into microns (template brain: JRCFIB2018F, else JRCFIB2018Fraw).

reroot

logical, whether or not somas should be re-rooted. Note that if FALSE, re-rooting occurs anyway via hemibrain_flow_centrality. However, setting this argument to TRUE

remote

logical. Whether not to use hemibrain_neurons to try to read neurons stored on the hemibrainr google drive, and mounted with either rclone or google filestream.

googlesheet

logical, whether or not manually checked somas should be read from the Google Sheet

remove.bad.synapses

whether or not to run hemibrain_remove_bad_synapses on neurons pulled from neuPrint.

clean

whether or not to set synapse-less branches to Label = 0.

...

arguments passed to neuprintr::neuprint_read_neurons, hemibrain_remove_bad_synapses and hemibrain_flow_centrality

scaling

the factor by which neuron coordinates in raw voxel space should be multiplied. The default scales to microns.

brain

the brainspace in which hemibrain neurons have been registered. Defaults to raw voxel space for the hemibrain project.

mirror

logical, whether or not to read neurons that have been mirrored (i.e. flipped to the 'other' brain hemisphere).

dotprops

logical. Whether or not to retrieve a nat::dotprops object, i.e. vector cloud representations of neurons for NBLASTing. The dotprops object will be in JRC2018FIBF micron space.

swc

logical. When using neurons with hemibrain_neurons from the Google drive, whether to read .swc files (if TRUE), or a neuronlistfh object (default).

zip

logical. If TRUE then nat::neuronlistz is used to read neurons from a .zip archive. Otherwise, nat::neuronlistfh is used to read neurons from a .rds file with a linked 'data' folder. The .zip method is preferred. Both methods load a dynamic neuronlist, which only loads skeleton data into memory at the point where it is processed.

folder

the sub-folder in which to look for a nat::neuronlistfh .rds file and its data, representing hemibrain neurons. The function will look for this folder in the location: hemibrainr:::good_savedir(local=local), by default the mounted Google drive (options()$Gdrive_hemibrain_data) or locally ((options()$hemibrain_data))

Value

the neuron or neuron list object inputted, with centripetal flow centrality information added to neuron$d and a segregation index score. The neuron$d$Label now gives the compartment, where axon is Label = 2, dendrite Label = 3, primary dendrite Label = 4 and primary neurite Label = 7. Soma is Label = 1.

See also

Examples

# \donttest{ if (FALSE) { # Choose neurons ## In this case some antennal lobe local neurons al.local.neurons = c("1702323386", "2068966051", "2069311379", "1702305987", "5812996027", "1702336197", "1793744512", "1976565858", "2007578510", "2101339904", "5813003258", "2069647778", "1947192569", "1883788812", "1916485259", "1887177026", "2101348562", "2132375072", "2256863785", "5813002313", "5813054716", "5813018847", "5813055448", "1763037543", "2101391269", "1794037618", "5813018729", "2013333009") # Get neurons neurons = hemibrain_read_neurons(al.local.neurons) # Plot the split to check it nat::nopen3d() nlscan_split(neurons, WithConnectors = TRUE) }# }