Dear Marcella,
On 14 Sep 2020, at 18:34, Noorman, Marcella wrote:
> I am a postdoc in Ann Hermundstad’s lab and am working with Vivek
> Jayaraman’s lab on analyzing the neuprint data in the central
> complex. Thanks so much for the tools you and your team have
> developed, they are extremely helpful on this front.
Thanks for your message and interest in our natverse tools – glad to
hear they have been helpful for you.
> I was wondering if there is anyway to assign a new rootpoint to an
> ngraph and, subsequently, have the ngraph’s edges redirected to
> correspond with this new rootpoint (and following the convention
> stated in the “Neuron as Graphs” article)?
There is not really a general purpose reroot function in the nat package
(there ought to be) but this is fairly easy enough to achieve.
> For example, the EPG with bodyid 912601268 rootpoint seems to be an
> arbitrary point in the ellipsoid body (PointNo 32). I suspect this
> occurs because the neuron’s soma is not included in the data set.
> Suppose I wanted to assign a different point as the rootpoint though,
> for this example PointNo 9284 might be a good choice. Is there anyway
> to set this point as the rootpoint and have the edge directionality be
> reoriented to correspond to this new rootpoint?
You mention that you are interested in rerooting hemibrain neurons. If
your goal is to reroot on the soma then take a look at the function
https://flyconnectome.github.io/hemibrainr/reference/hemibrain_reroot.html
which does just that, in some cases using new information derived from
manual review by our group. Here it is operating on your neuron of
interest. As you can see it chooses the point that you thought made
sense.
> library(neuprintr)
> # nb always returns a neuronlist even if there is only one neurons
> # so extract neuron with [[1]]
> n912601268 = neuprintr::neuprint_read_neurons(912601268)[[1]]
> rootpoints(n912601268)
[1] 32
> library(hemibrainr)
> # Re-root on selected soma/primary neurite point
> n912601268.r = hemibrain_reroot(n912601268)
> rootpoints(n912601268.r )
[1] 9284
You can actually use
> n912601268.hb = hemibrainr::hemibrain_read_neurons(912601268)
Warning message:
In hemibrain_flow_centrality.neuronlist(neurons, ...) :
1 neurons have no soma tagged, split could be inaccurate for:
912601268
> rootpoints(n912601268.hb[[1]])
[1] 9284
Which does a range of useful tidying including re-rooting to the soma or
primary neurite when available. It also does an axon dendrite split.
If you are interested in rerooting the neuron graph in the more general
case, let me know and I can give some tips.
All the best,
Greg.
PS I have taken the liberty of ccing this message to the nat-user google
group since the answer may be of interest to others.
--
Gregory Jefferis, PhD
Division of Neurobiology
MRC Laboratory of Molecular Biology
Francis Crick Avenue
Cambridge Biomedical Campus
Cambridge, CB2 OQH, UK
http://www2.mrc-lmb.cam.ac.uk/group-leaders/h-to-m/g-jefferis
https://www.zoo.cam.ac.uk/research/groups/connectomics
http://jefferislab.org