With the hemibrain projects somas and their tracts were not separately and explicitly detected. Some false synapse assignment has happened, adding synapses to soma and primary neurite locations, that should not exist based on an examination of the greyscale EM data. This function removes 'out-of-mesh' synapses, you might want to use all ROIs or the hemibrain mesh to remove these 'bad' synapses. In addition, synapses are removed if they are too near the soma / along the primary neurite.

hemibrain_remove_bad_synapses(
  x,
  meshes = hemibrainr::hemibrain.surf,
  soma = TRUE,
  min.nodes.from.soma = 100,
  min.nodes.from.pnt = 5,
  primary.branchpoint = 0.25,
  ...
)

Arguments

x

a nat::neuronlist or nat::neuron object. It is assumed that this neuron has been read in by neuprintr::neuprint_read_neurons or possibly catmaid::read.neurons.catmaid.

meshes

a list/a single object of class mesh3d or hxsurf. Defaults to hemibrain.surf. See examples for alternatives.

soma

logical, if TRUE it is assumed that the neuron being given has the soma as its route and an intact primary neurite tract. Synapses will then be pruned from both.

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 nat::resample on your neurons before using.

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.

primary.branchpoint

the proportion of the maximum branchpoint score needed for a point to be assigned as the primary branchpoint. Used only when soma = TRUE. See the first argument in primary_neurite for details.

...

methods sent to nat::nlapply

Value

a nat::neuronlist or nat::neuron object

See also

Examples

# \donttest{ # Read in a problematic neuron neuron = neuprint_read_neurons(5813020793) if (FALSE) { library(nat) plot3d(neuron) points3d(xyzmatrix(neuron[[1]]$connectors)) } # remove any synapses outside of this surface (or on the cell body fibre) neuron.fixed = hemibrain_remove_bad_synapses(neuron, meshes=hemibrain.surf) if (FALSE) { # previously we used all the individual hemibrain meshes. This may produce # slightly different results but using *hemibrain.surf* is much faster neuron.fixed = hemibrain_remove_bad_synapses(neuron, meshes=hemibrain_roi_meshes()) } if (FALSE) { library(nat) # Let's check that this worked plot3d(neuron.fixed) points3d(xyzmatrix(neuron.fixed[[1]]$connectors), size = 5, col = "green") }# }