# FANC_auto_recon
FANC (pronounced "fancy") is the Female Adult Nerve Cord, a GridTape-TEM dataset of an adult _Drosophila melanogaster_'s ventral nerve cord. The dataset was first published in [Phelps, Hildebrand, Graham et al. 2021 _Cell_](https://www.lee.hms.harvard.edu/phelps-hildebrand-graham-et-al-2021), after which we applied automated methods for reconstructing neurons, synapses, and nuclei to accelerate reconstruction of the ventral nerve cord connectome, as described in [Azevedo, Lesser, Mark, Phelps et al. 2022 _bioRxiv_](https://www.biorxiv.org/content/10.1101/2022.12.15.520299).
This repository contains:
- A python package for interacting with the connectome data (see the folder [`fanc/`](fanc), and installation instructions below)
- Other files and information related to the automated reconstructions (e.g. [`nuclei_prediction/`](nuclei_prediction), [`synapse_prediction/`](synapse_prediction))
- Information for the collaborative proofreading community (see the [wiki](https://github.com/htem/FANC_auto_recon/wiki)).
Have any questions? Please [open an issue](https://github.com/htem/FANC_auto_recon/issues/new) or contact [Jasper Phelps (jasper.s.phelps@gmail.com)](https://github.com/jasper-tms).
## Installing and configuring the `fanc` 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 fanc-fly
### 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/htem/FANC_auto_recon.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/htem/FANC_auto_recon.git
cd FANC_auto_recon
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 fanc-fly`).
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 `fanc-fly` again.
### Provide credentials
Access to the latest reconstruction of FANC is restricted to authorized users. If you are a member of the FANC community (see [Collaborative community](../../wiki#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](https://global.daf-apis.com/auth/api/v1/create_token) and 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:
```python
import fanc
fanc.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",
"fanc_production_mar2021": "THE API KEY YOU COPIED"
}
You can verify that your API key has been saved successfully by running:
```python
import fanc
client = fanc.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](https://github.com/jasper-tms/pytransformix#installation) for specific instructions.
#### Provide CATMAID credentials to pull data from CATMAID
You can get your CATMAID API key by logging into https://radagast.hms.harvard.edu/catmaidvnc then hovering over "You are [Your Name]" in the top-right corner, then clicking "Get API token".
Save your CATMAID API key by running:
```python
import fanc
fanc.catmaid.save_catmaid_credentials("YOUR CATMAID API KEY")
```
You can verify that your API key has been saved successfully by running:
```python
import fanc
fanc.catmaid.connect()
```
## Documentation
- First go through [`fanc_python_package_examples.ipynb`](https://github.com/htem/FANC_auto_recon/blob/main/example_notebooks/fanc_python_package_examples.ipynb)
- Then check out other notebooks in [`example_notebooks/`](https://github.com/htem/FANC_auto_recon/tree/main/example_notebooks)
- Finally you can [browse the code](https://github.com/htem/FANC_auto_recon/tree/main/fanc), check out modules that have names that interest you, and read the docstrings.
Raw data
{
"_id": null,
"home_page": "https://github.com/htem/FANC_auto_recon",
"name": "fanc-fly",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": null,
"author": "Jasper Phelps",
"author_email": "jasper.s.phelps@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/9b/71/ce4166d40e3753b9b3576fb7bddb358772a0a06500363750bbc0b5862e16/fanc_fly-3.2.1.tar.gz",
"platform": null,
"description": "# FANC_auto_recon\n\nFANC (pronounced \"fancy\") is the Female Adult Nerve Cord, a GridTape-TEM dataset of an adult _Drosophila melanogaster_'s ventral nerve cord. The dataset was first published in [Phelps, Hildebrand, Graham et al. 2021 _Cell_](https://www.lee.hms.harvard.edu/phelps-hildebrand-graham-et-al-2021), after which we applied automated methods for reconstructing neurons, synapses, and nuclei to accelerate reconstruction of the ventral nerve cord connectome, as described in [Azevedo, Lesser, Mark, Phelps et al. 2022 _bioRxiv_](https://www.biorxiv.org/content/10.1101/2022.12.15.520299).\n\nThis repository contains:\n- A python package for interacting with the connectome data (see the folder [`fanc/`](fanc), and installation instructions below)\n- Other files and information related to the automated reconstructions (e.g. [`nuclei_prediction/`](nuclei_prediction), [`synapse_prediction/`](synapse_prediction))\n- Information for the collaborative proofreading community (see the [wiki](https://github.com/htem/FANC_auto_recon/wiki)). \n\nHave any questions? Please [open an issue](https://github.com/htem/FANC_auto_recon/issues/new) or contact [Jasper Phelps (jasper.s.phelps@gmail.com)](https://github.com/jasper-tms).\n\n## Installing and configuring the `fanc` python package\n\n### Before you start\n\nAs is always the case in python, consider making a virtual environment (using your preference of virtualenv/virtualenvwrapper or conda) before installing.\n\n### Installation option 1: pip install from PyPI\n\n pip install fanc-fly\n\n### Installation option 2: pip install directly from GitHub\nThe code on GitHub will sometimes be slightly more up to date than the version on PyPI\n\n pip install git+https://github.com/htem/FANC_auto_recon.git\n\n### Installation option 3: Clone then install\nThis is the best option if you want to make changes yourself to the code\n\n cd ~/repos # or wherever you keep your repos\n git clone https://github.com/htem/FANC_auto_recon.git\n cd FANC_auto_recon\n pip install -e .\n\n### Troubleshooting\nDepending 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.\n\nIf you get something that looks like\n\n .. ERROR:: Could not find a local HDF5 installation.\n You may need to explicitly state where your local HDF5 headers and\n library can be found by setting the ``HDF5_DIR`` environment\n variable or by using the ``--hdf5`` command-line option.\n\nand 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 fanc-fly`).\n\nIf you get an error that contains\n\n Error compiling Cython file:\n ...\n Cython.Compiler.Errors.CompileError: tables/utilsextension.pyx\n\ntry 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 `fanc-fly` again.\n\n### Provide credentials\n\nAccess to the latest reconstruction of FANC is restricted to authorized users. If you are a member of the FANC community (see [Collaborative community](../../wiki#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](https://global.daf-apis.com/auth/api/v1/create_token) and 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:\n```python\nimport fanc\nfanc.save_cave_credentials(\"THE API KEY YOU COPIED\")\n```\n\nAlternatively, 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:\n\n {\n \"token\": \"THE API KEY YOU COPIED\",\n \"fanc_production_mar2021\": \"THE API KEY YOU COPIED\"\n }\n\nYou can verify that your API key has been saved successfully by running:\n```python\nimport fanc\nclient = fanc.get_caveclient()\n```\n\n### Optional installation steps for additional functionality\n\n#### Install Elastix to transform neurons into alignment with the VNC template\nThe 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](https://github.com/jasper-tms/pytransformix#installation) for specific instructions.\n\n#### Provide CATMAID credentials to pull data from CATMAID\nYou can get your CATMAID API key by logging into https://radagast.hms.harvard.edu/catmaidvnc then hovering over \"You are [Your Name]\" in the top-right corner, then clicking \"Get API token\".\n\nSave your CATMAID API key by running:\n```python\nimport fanc\nfanc.catmaid.save_catmaid_credentials(\"YOUR CATMAID API KEY\")\n```\n\nYou can verify that your API key has been saved successfully by running:\n```python\nimport fanc\nfanc.catmaid.connect()\n```\n\n## Documentation\n- First go through [`fanc_python_package_examples.ipynb`](https://github.com/htem/FANC_auto_recon/blob/main/example_notebooks/fanc_python_package_examples.ipynb)\n- Then check out other notebooks in [`example_notebooks/`](https://github.com/htem/FANC_auto_recon/tree/main/example_notebooks)\n- Finally you can [browse the code](https://github.com/htem/FANC_auto_recon/tree/main/fanc), check out modules that have names that interest you, and read the docstrings.\n",
"bugtrack_url": null,
"license": null,
"summary": "Tools for the Female Adult Nerve Cord Drosophila EM dataset",
"version": "3.2.1",
"project_urls": {
"Homepage": "https://github.com/htem/FANC_auto_recon"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5d76471f6e495eeb6050a447110ba9345425dbe0db012bba708f2fc76dd758a7",
"md5": "a640671902bdfeff7920ba6001ba283f",
"sha256": "3589aeb2d6ceec3c0d30cbcc1f2c74e6bbbca9a120544c53697e32b21f43eee8"
},
"downloads": -1,
"filename": "fanc_fly-3.2.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a640671902bdfeff7920ba6001ba283f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 4015774,
"upload_time": "2024-11-04T23:09:57",
"upload_time_iso_8601": "2024-11-04T23:09:57.881155Z",
"url": "https://files.pythonhosted.org/packages/5d/76/471f6e495eeb6050a447110ba9345425dbe0db012bba708f2fc76dd758a7/fanc_fly-3.2.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9b71ce4166d40e3753b9b3576fb7bddb358772a0a06500363750bbc0b5862e16",
"md5": "06807565a8a24370c84b1681f42827ae",
"sha256": "34765e46ab44dadfaa930941d133fdd4688ab9a49fbb1130a33db6f2a2c82680"
},
"downloads": -1,
"filename": "fanc_fly-3.2.1.tar.gz",
"has_sig": false,
"md5_digest": "06807565a8a24370c84b1681f42827ae",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 3998554,
"upload_time": "2024-11-04T23:09:59",
"upload_time_iso_8601": "2024-11-04T23:09:59.958070Z",
"url": "https://files.pythonhosted.org/packages/9b/71/ce4166d40e3753b9b3576fb7bddb358772a0a06500363750bbc0b5862e16/fanc_fly-3.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-04 23:09:59",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "htem",
"github_project": "FANC_auto_recon",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "numpy",
"specs": []
},
{
"name": "matplotlib",
"specs": []
},
{
"name": "cloud-volume",
"specs": []
},
{
"name": "python-catmaid",
"specs": []
},
{
"name": "meshparty",
"specs": []
},
{
"name": "navis",
"specs": []
},
{
"name": "flybrains",
"specs": []
},
{
"name": "transformix",
"specs": []
},
{
"name": "nglui",
"specs": []
},
{
"name": "pyperclip",
"specs": []
},
{
"name": "numpyimage",
"specs": []
},
{
"name": "pandas",
"specs": []
},
{
"name": "connected-components-3d",
"specs": []
},
{
"name": "fill_voids",
"specs": []
},
{
"name": "task-queue",
"specs": []
},
{
"name": "caveclient",
"specs": []
},
{
"name": "cloud-files",
"specs": []
},
{
"name": "urllib3",
"specs": []
},
{
"name": "trimesh",
"specs": []
},
{
"name": "pcg_skel",
"specs": []
},
{
"name": "anytree",
"specs": []
}
],
"lcname": "fanc-fly"
}