Thanks for your message. It sounds like you've already made great progress and in fact done the most difficult parts, but you still have quite a few small steps still to go. I'll give some pointers inline below, but I'm not going to be able to give step by step instructions for everything.
I am working on a project that involves identifying and studying four pairs of neurons in the fly brain that are labeled by a Gal4 line. I want to use the FAFB (full adult female brain) EM dataset to examine their morphology and connectivity. I have followed these steps so far:
- I acquired confocal images of the Gal4 > GFP flies, co-staining GFP and nc82.
- I registered the confocal images to the JFRC2 template brain using the CMTK package and the `Parallel_Fiji_CMTK_Registration_Win10_16.ijm`
- I traced the neurons in the registered images using the SNT plugin in Fiji and saved the traces as swc files.
- I loaded the swc flies into R using the `read.neurons` function from the `natverse` package.
However, I am stuck at the next steps, which are:
- Using the `nblast` function from the `natverse` package to search for similar neurons in the FAFB dataset.
- Query the FlyWire.ai dataset for additional information.
- Inspecting and selecting the best matches for my neurons from the search results.
- Performing further analysis on the selected neurons.
I have tried to find some examples and references online, but I could not find any that suit my needs. Can you please help me with these questions.
1. How can I use the `nblast` function to search for my neurons in the FAFB dataset?
First you need to map your neurons to FAFB space
library(nat.flybrains)
library(elmr)
myneurons.fafb=xform_brain(myneurons, sample = 'JFRC2', reference = 'FAFB14')
convert your query neurons to "dotprops" format suitable for NBLAST. You can do this with
dotprops(myneurons.fafb/1e3, k=5, resample=1)
(divide by 1000 to covert nm to microns; the extra arguments work best for most reconstructions coming)
Then you need a target set of neurons in the same dotprops format.
2. How can I access the FlyWire.ai dataset?
We have actually not release dotprops format neurons, but you can get the skeletons at the bottom of this page
Then read in using read.neurons and convert to dotprops as above. This will need a reasonably powerful computer.
finally use
library(nat.nblast)
nblast(myneurons, fwneuson, .progress="natprogress")
Choose eg the top 5 scores for each query neuron and inspect manually.
3. How can I inspect and compare the neurons returned by the `nblast` functions? What criteria should I use to select the most likely candidates for my neurons?
I recommend saving the flywire hits using the fafbeg package
library(fafbseg)
save_cloudvolume_meshes(<ids>, format='ply')
and then inspecting next to swcs written from the transformed neurons.
4. How can I perform further analysis on the selected neurons, such as visualizing their 3D structure, tracing their synaptic partners, or quantifying their connectivity? Which packages can I use?
I'm afraid that I'll have to leave that, but if you want to look at structure, synaptic connectivity in flywire you can either use
codex.flywire.ai online or use the coconatfly package to do simple queries.
Good luck!
Greg Jefferis.