Metadata-Version: 2.1
Name: nwb-datajoint
Version: 0.2.5
Summary: Neuroscience data pipeline for reproducible research used by Loren Frank Lab, UCSF
Home-page: https://github.com/LorenFrankLab/nwb_datajoint
Author: Loren Frank, Eric Denovellis, Kyu Hyun Lee, Ryan Ly
Author-email: loren@phy.ucsf.edu
License: UNKNOWN
Project-URL: Bug Tracker, https://github.com/LorenFrankLab/nwb_datajoint/issues
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: jupyterlab (>=3.0)
Requires-Dist: pydotplus
Requires-Dist: dask
Requires-Dist: labbox-ephys (>=0.5)
Requires-Dist: labbox-ephys-widgets-jp (>=0.1)
Requires-Dist: mountainsort4
Requires-Dist: spikeinterface (>=0.12)
Requires-Dist: pynwb (>=1.4)
Requires-Dist: datajoint (==0.13.*)
Requires-Dist: kachery-p2p (>=0.8)
Requires-Dist: ghostipy
Requires-Dist: pymysql (>=1.0.*)
Requires-Dist: h5py (==2.10.*)

# nwb_datajoint

The Frank lab Datajoint pipeline facilitates the storage, analysis, and sharing of neuroscience data to support reproducible research. It integrates existing open-source projects into a coherent framework so that they can be easily used. 

## Setup

### Installing packages

1. Clone this repository:

   ```bash
   git clone https://github.com/LorenFrankLab/nwb_datajoint.git
   ```

2. Set up and activate a conda environment from `environment.yml`:

   ```bash
   cd nwb_datajoint
   conda env create -f environment.yml
   conda activate nwb_datajoint
   ```

3. Install this repository:

   ```bash
   # to use the package
   pip install nwb_datajoint
   # if you're a developer:
   pip install -e .
   ```

### Setting up database access

1. Ask Loren or Eric to set up an account for you on the Frank lab database (`lmf-db.cin.ucsf.edu`). Note that you have to be connected to UCSF LAN to access this server.

2. Add the following environment variables (e.g. in `~/.bashrc`). This example assumes that you are interacting with the database on a computer that has mounted `stelmo` at `/stelmo`.

     ```bash
     export NWB_DATAJOINT_BASE_DIR="/stelmo/nwb/" 
     export SPIKE_SORTING_STORAGE_DIR="/stelmo/nwb/spikesorting" # where output of spike sorting will be sorted
     export DJ_SUPPORT_FILEPATH_MANAGEMENT="TRUE"
     export KACHERY_P2P_API_HOST="typhoon"
     export KACHERY_P2P_API_PORT="14747"
     export KACHERY_TEMP_DIR="/stelmo/nwb/tmp"
     ```

3. Configure DataJoint. When your account is created, you will be given a temporary password. You can [change your password](https://github.com/LorenFrankLab/nwb_datajoint/blob/master/franklab_scripts/franklab_dj_initial_setup.py) and [set up external stores](https://github.com/LorenFrankLab/nwb_datajoint/blob/master/franklab_scripts/franklab_dj_stores_setup.py). You should need to run these only once.

Finally, open up a python console and import `nwb_datajoint` to check that the setup has worked.

### Tutorials

The tutorials are in the form of Jupyter Notebooks and can be found in the `notebooks` directory. We strongly recommend opening them in the context of `jupyterlab`. Start with these tutorials:

* `0_intro.ipynb`: general introduction to the database
* `1_spikesorting.ipynb`: how to run spike sorting


