natverse / fafbseg

Support functions for analysis of Drosophila connectomes especially the FAFB-FlyWire whole brain
https://natverse.org/fafbseg/
GNU General Public License v3.0
6 stars 4 forks source link
connectomics neuroanatomy-toolbox neuroscience r

natverse Lifecycle: experimental Release Version Docs R-CMD-check Codecov test coverage

fafbseg

The goal of fafbseg is to provide support for analysis of segmented EM data, focussed on the full adult female brain (FAFB) dataset.

Although there is support for a range of data sources and services, at this point the principal target is the FlyWire automated segmentation. Legacy support also exists for the Google brain automatic segmentation of FAFB data.

fafbseg is integrated with the NeuroAnatomy Toolbox suite (aka natverse) including elmr and catmaid.

fafbseg is also one building block for the coconatfly which provides a unified and simplified interface to a range of Drosophila connectome datasets. We actually recommend coconatfly as a good place to start for most users since it provides convenient access to specific FlyWire data releases as well as powerful cross-connectome analyses while requiring minimal configuration. See https://natverse.org/coconatfly/articles/getting-started.html for details.

Installation

Assuming you want to use the production (in progress) version of the FlyWire dataset or to access lower level functionality, then fafbseg is the way to go. You will need to install the package and then configure your environment including recording your authorisation token and likely downloading canned data releases.

Package installation

We recommend installing fafbseg from GitHub using the natmanager package:

# install natmanager if required
if (!requireNamespace("natmanager")) install.packages("natmanager")
natmanager::install(pkgs="fafbseg")

FlyWire setup

Basic steps for setting up to access FlyWire data:

library(fafbseg)
# record your authorisation token
flywire_set_token()
# install python tools required for some functionality
simple_python()
# fetch canned connectivity *and* cell type data 
download_flywire_release_data()

note that at the time of writing (Dec 2023) download_flywire_release_data() targets materialisation 783 of the FlyWire dataset, fetching both annotations and connectivity information.

Use

Detailed examples will follow in additional vignettes, but as a first motivation, this is how to do a connectivity query using precomputed data.

library(fafbseg)
dl4df=flytable_meta('DL4.*')
dl4df

dl4out <- flywire_partner_summary2(dl4df, partners = 'out', threshold = 3)
dl4out

Acknowledgements

The fafbseg package enables access to a number of published and many pre-publication resources. We hope that this will accelerate your science but we strongly request that you ensure that you acknowledge both the authors of this package and the original data sources to ensure that we and they can justify this free sharing of code and data.

For use of the proofread and annotated FlyWire dataset, please co-cite:

To acknowledge specific FAFB resources:

FlyWire coordinate transforms and synapse predictions make use of infrastructure contributed by Davi Bock, Gregory Jefferis, Philipp Schlegel and Eric Perlman, supported by NIH BRAIN Initiative (grant 1RF1MH120679-01); additional work including assembling ground truth data was also supported by Wellcome trust (203261/Z/16/Z).

For the fafbseg package itself, please include a reference to the github page in your methods section as well as a citation to Bates et al eLife 2020 along with the statement:

Development of the natverse including the fafbseg package has been supported by the NIH BRAIN Initiative (grant 1RF1MH120679-01), NSF/MRC Neuronex2 (NSF 2014862/MC_EX_MR/T046279/1) and core funding from the Medical Research Council (MC_U105188491).

Thank you!