Skip to main content

The Brain And Nerve Cord fly connectome

The BANC (said "the bank") is the Brain And Nerve Cord, a connectome of a female adult Drosophila melanogaster's central nervous system generated from a GridTape transmission electron microscopy dataset.

This repository contains a python package for interacting with the connectome data (see the folder banc/, and installation instructions below), mainly focused on the effort to build the connectome. Users interested in downloading and analyzing the connectome should go first to View & download publicly released data.

Have any questions? Please open an issue or contact Jasper Phelps (jasper.s.phelps@gmail.com).

Installing and configuring the banc python package

Before you start

As is always the case in python, consider making a virtual environment (using your preference of virtualenv/virtualenvwrapper or conda) before installing.

Installation option 1: pip install from PyPI

pip install banc

Installation option 2: pip install directly from GitHub

The code on GitHub will sometimes be slightly more up to date than the version on PyPI

pip install git+https://github.com/jasper-tms/BANC-fly-connectome.git

Installation option 3: Clone then install

This is the best option if you want to make changes yourself to the code

cd ~/repos  # or wherever you keep your repos
git clone https://github.com/jasper-tms/BANC-fly-connectome.git
cd BANC-fly-connectome
pip install -e .

Troubleshooting

Depending on your Python 3 version and your operating system, you may need to battle some bugs in order to get the pip install commands above to succeed.

If you get something that looks like

.. ERROR:: Could not find a local HDF5 installation.
   You may need to explicitly state where your local HDF5 headers and
   library can be found by setting the ``HDF5_DIR`` environment
   variable or by using the ``--hdf5`` command-line option.

and you're on a Mac, install brew (https://brew.sh) if you haven't yet, then use brew to install HDF5 with brew install hdf5, then put HDF5_DIR=/opt/homebrew/opt/hdf5 in front of your pip install command (e.g. HDF5_DIR=/opt/homebrew/opt/hdf5 pip install banc).

If you get an error that contains

Error compiling Cython file:
...
Cython.Compiler.Errors.CompileError: tables/utilsextension.pyx

try to pip install the latest version of tables from GitHub by running HDF5_DIR=/opt/homebrew/opt/hdf5 pip install git+https://github.com/PyTables/PyTables, or alternatively, use conda to install it (conda install tables). After you get this package installed successfully, try installing banc again.

Provide credentials

Access to the latest reconstruction of BANC is restricted to authorized users. If you are a member of the BANC community (see Collaborative community on this repo's wiki) and have been granted access, you can generate an API key by visiting https://global.daf-apis.com/auth/api/v1/create_token and logging in with your BANC-authorized google account. Copy the key that is displayed, then run the following commands in python to save your key to the appropriate file:

import banc
banc.save_cave_credentials("THE API KEY YOU COPIED")

Alternatively, you can manually do what the command above accomplishes, which is to create a text file at ~/.cloudvolume/secrets/cave-secret.json with these contents:

{
  "token": "THE API KEY YOU COPIED",
  "brain_and_nerve_cord": "THE API KEY YOU COPIED"
}

You can verify that your API key has been saved successfully by running:

import banc
client = banc.get_caveclient()

Optional installation steps for additional functionality

Install Elastix to transform neurons into alignment with the VNC template

The mesh manipulation and coordinate transform code requires pytransformix, which is itself a Python wrapper for Elastix. Therefore, Elastix must be installed and its lib and bin paths must be appended to the LD_LIBRARY_PATH and PATH environment variables. See pytransformix documentation for specific instructions.

Documentation

Technical note

The banc package is a fork on the fanc (Female Adult Nerve Cord) package, which can be found at the upstream repository. To make it easier to synchronize new features in banc and fanc packages, the folder banc/ in this repo is a link to the folder fanc/ – but files in this repo's version of the fanc/ folder have been adapted for use with the BANC.

Metadata

Release files for banc 0.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for banc 0.6.1
File Size Uploaded
banc-0.6.1.tar.gz 104.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for banc 0.6.1
File Interpreter ABI Platform
banc-0.6.1-py3-none-any.whl Python 3 none any Details

Total release size: 199.4 kB

Release files / banc-0.6.1.tar.gz

Download URL banc-0.6.1.tar.gz
Size 104.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d2129d6e2bd511b2715de0af68f111743c0f46ccc6caf2a574f3bdf01ede03e5
BLAKE2b-256 checksum
How to use checksums
da4f5f958c653afc040ea17e2c77eae12988351895e36ca6c97b9c73eb0acf21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 8, 2026.

Transparency log

Release files / banc-0.6.1-py3-none-any.whl

Download URL banc-0.6.1-py3-none-any.whl
Size 95.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
63e39bc733fe8c9528ab731b9d0069444fbf7852a85a5d5c0ada43090a6839d1
BLAKE2b-256 checksum
How to use checksums
7321058d6f1bad0324ac23d31d81b5b2fe0eb64f327820abf978015324593f84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 8, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.6.1 This release

2 release files

0.6.0

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page