Package: fanc-fly
FANC_auto_reconFANC (pronounced "fancy") is the Female Adult Nerve Cord, a GridTape-TEM dataset of an adultDrosophila melanogaster's ventral nerve cord. The dataset was first published inPhelps, Hildebrand, Graham et al. 2021Cell, after which we applied automated methods for reconstructing neurons, synapses, and nuclei to accelerate reconstruction of the ventral nerve cord connectome, as described inAzevedo, Lesser, Mark, Phelps et al. 2022bioRxiv.This repository contains:A python package for interacting with the connectome data (see the folderfanc/, and installation instructions below)Other files and information related to the automated reconstructions (e.g.nuclei_prediction/,synapse_prediction/)Information for the collaborative proofreading community (see thewiki).Have any questions? Pleaseopen an issueor contactJasper Phelps (jasper.s.phelps@gmail.com).Installing and configuring thefancpython packageBefore you startAs 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 PyPIpip install fanc-flyInstallation option 2: pip install directly from GitHubThe code on GitHub will sometimes be slightly more up to date than the version on PyPIpip install git+https://github.com/htem/FANC_auto_recon.gitInstallation option 3: Clone then installThis is the best option if you want to make changes yourself to the codecd ~/repos  # or wherever you keep your repos
git clone https://github.com/htem/FANC_auto_recon.git
cd FANC_auto_recon
pip install -e .TroubleshootingDepending on your Python 3 version and your operating system, you may need to battle some bugs in order to get thepip installcommands 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, installbrew(https://brew.sh) if you haven't yet, then usebrewto install HDF5 withbrew install hdf5, then putHDF5_DIR=/opt/homebrew/opt/hdf5in front of yourpip installcommand (e.g.HDF5_DIR=/opt/homebrew/opt/hdf5 pip install fanc-fly).If you get an error that containsError compiling Cython file:
...
Cython.Compiler.Errors.CompileError: tables/utilsextension.pyxtry topip installthe latest version oftablesfrom GitHub by runningHDF5_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 installingfanc-flyagain.Provide credentialsAccess to the latest reconstruction of FANC is restricted to authorized users. If you are a member of the FANC community (seeCollaborative communityon this repo's wiki) and have been granted access, you can generate an API key by visitinghttps://global.daf-apis.com/auth/api/v1/create_tokenand logging in with your FANC-authorized google account. Copy the key that is displayed, then run the following commands in python to save your key to the appropriate file:importfancfanc.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.jsonwith these contents:{
  "token": "THE API KEY YOU COPIED",
  "fanc_production_mar2021": "THE API KEY YOU COPIED"
}You can verify that your API key has been saved successfully by running:importfancclient=fanc.get_caveclient()Optional installation steps for additional functionalityInstall Elastix to transform neurons into alignment with the VNC templateThe mesh manipulation and coordinate transform code requirespytransformix, which is itself a Python wrapper for Elastix. Therefore, Elastix must be installed and its lib and bin paths must be appended to theLD_LIBRARY_PATHandPATHenvironment variables. Seepytransformixdocumentationfor specific instructions.Provide CATMAID credentials to pull data from CATMAIDYou can get your CATMAID API key by logging intohttps://radagast.hms.harvard.edu/catmaidvncthen hovering over "You are [Your Name]" in the top-right corner, then clicking "Get API token".Save your CATMAID API key by running:importfancfanc.catmaid.save_catmaid_credentials("YOUR CATMAID API KEY")You can verify that your API key has been saved successfully by running:importfancfanc.catmaid.connect()DocumentationFirst go throughfanc_python_package_examples.ipynbThen check out other notebooks inexample_notebooks/Finally you canbrowse the code, check out modules that have names that interest you, and read the docstrings.