Skip to content

funkelab/synful_fafb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Automatic Detection of Synaptic Partners in a Whole-Brain Drosophila EM Dataset

Overview

This repository serves as an entry point for accessing and interacting with predicted synaptic partners in the full adult fly brain (FAFB) dataset [Zheng et al. 2018].

method_figure

Details about the method can be found in our bioRxiv preprint.

If you are interested in

  • using predicted synapses for circuit reconstruction in CATMAID, see the CircuitMap application

  • explore synapses linked to google's neuron segmentation in neuroglancer

  • downloading all 244 million predicted synaptic connections in FAFB, see this section and use our circuit query library SynfulCircuit to analyze the data (a good starting point is this example jupyter notebook)

  • using our evaluation data to compare your own synapse prediction method, see this section

  • training and/or predicting on your own data, go to the synful repository!

Please don't hesitate to open an issue or write us an email (Julia Buhmann or Jan Funke) if you have any questions!

Synapse SQL files

The 244M predicted synaptic partners have been intersected with an automatically generated neuron segmentation [Li et al. 2019]. So far, we released two different files:

  • 20191211_fafbv14_buhmann2019_li20190805.db: synapses mapped onto Li-segmentation version 20190805 (synapse file released Dec 2019) download link
  • fafbv14_buhmann2019_li20200412.db: synapses mapped onto Li-segmentation version 20200412 (synapse file released April 2021) download link

You can use our synfulcircuit library to work with the data. In case you prefer to work with the raw data, here is short description of relevant columns:

  • pre_x, pre_y, pre_z --> presynaptic location in nm
  • post_x, post_y, post_z --> postsynaptic location in nm
  • segmentid_post
  • segmentid_pre
  • scores --> synful score inferred from the neural network output probability map (see Paper)
  • cleft_scores --> score inferred from cleft score predictions (Heinrich et al. 2018), see Paper

System Requirements

  • Hardware requirements
    • No special hardware requirements - standard computer with enough RAM (~ 8 GB, of course: more is always better).
  • Software requirements
    • Software has been tested on Linux (Ubuntu 16.04)

Installation Guide

Scripts in this repository (evaluation/*.py) for evaluation depend on the synful package. Please install from synful repository. Installation takes ~ 3 min.

Benchmark dataset and evaluation

Ground-truth datasets

  • Neuron skeletons are available in evaluation/data/gt_skeletons/<brain_region>_skeletons.json
  • Ground-truth synaptic links are available in evaluation/data/<brain_region>full_gt.json
Dataset Connection count Brain Region Source
InCalyx 59,155 calyx Zheng, Li et al. (2020) (Bock Lab)
OutLH 11,429 lateral horn Bates, Schlegel et al. (2020) (Jefferis Lab)
InOutEB 61,280 ellipsoid body Turner-Evans et al. (2019) (Jayaraman Lab)
InOutPB 14,779 protocerebral bridge "

For more details on the datasets, please refer to our preprint, Table 1 and section 3.4.1 Evaluation:Datasets.

Evaluation

Evaluation code depends on the synful package. Please install from synful repository.

We also added our predicted synful-synapses as example files. Run evaluation on synful-synapses:

cd evaluation
python run_evaluate.py configs/pb_eval.json

This should output:

final fscore 0.59
final precision 0.62, recall 0.57

Evaluation runtime of above code is ~1 minute.

To test your own predicted synapses:

  1. Predict synapses in the three brain regions in FAFB for which ground-truth is available. Get the raw data for example via cloudvolume, for an example see this section
  2. Map predicted synapses onto ground-truth skeletons provided in this repository
  3. Write synapses out into the here required format, see this section
  4. Adapt the config file and replace pred_synlinks with your predicted synapse-filepath (this line in the config file).
Synapse Format

Synapses are stored in a json file, each synapse is represented with:

{"id": 822988374080568,
"id_skel_pre": 4429537,
"id_skel_post": 4210786,
"location_pre": [89200, 159400, 512924],
"location_post": [89200, 159412, 512816],
"score": 8.599292755126953

See this file for an example of predicted synapses stored in the required format. Locations are provided in physical units (nm) and z,y,x order.

Neuron Format

Neurons are represented with a list of nodes. One example node:

{"id": 1760159,
"position": [171240, 157706, 482924],
"neuron_id": 1274114,
"parent_id": 19713274}

See this file for an example of ground truth neurons. Locations are provided in physical units (nm) and z,y,x order.

Download the raw data with cloudvolume

install cloudvolume from: https://github.com/seung-lab/cloud-volume/tree/master

After installation, you can download the data:

from cloudvolume import CloudVolume
CLOUDVOLUME_URL = 'precomputed://gs://neuroglancer-fafb-data/fafb_v14/fafb_v14_orig'
cv = CloudVolume(CLOUDVOLUME_URL, use_https=True)
data = cv[<x1>:<x2>, <y1>:<y2>, <z1>:<z2>]
Visualization with neuroglancer

If you want to have a quick look at the data, there is a script that you just need to run from inside the repository:

Example usage, if you want to visualize the ground truth data for skeleton id 607812 in EB.

cd evaluation/data
python -i visualize_data_with_neuroglancer.py gt_skeletons/eb_skeletons.json ebfull_gt.json 607812

or if you want to have a look at our synapse predictions mapped onto the same skeleton.

python -i visualize_data_with_neuroglancer.py gt_skeletons/eb_skeletons.json synful_predictions/ebfull_pred.json 607812