Channelpedia API
Version 1.6
NEW Version 1.6 released on 6st December 2021
Versioning
- Version 1.6: added matlab functions to retrieve and plot stimulus traces
- Version 1.5: whole review of python api
- Version 1.4: fixed axis labels; added get_stimulus in python/api.py
- Version 1.3: fix for compatibility with Python 3.7 (before only 3.6 was working)
- Version 1.2: bug fixes in matlab functions
- Version 1.1: added plot_features function for matlab
General Instructions
- Download and unzip the Channelpedia API.
- Place raw data downloaded from Channelpedia (e.g.
rCell19521.nwb
) in theCells/
directory, and any downloaded analysis files (e.g.aCell19521.mat
) in theAnalysis/
directory. - You can find the Python API scripts in the
python/
directory, and the Matlab API scripts in thematlab/
directory.
Matlab API
Pre-requisites
- You need to have a valid Matlab installation. Please refer to the Mathworks support page for help.
Usage
- Start Matlab.
- In Matlab, make sure you're in the directory where the Channelpedia
Matlab API script files are (
matlab/
). You can do so using thecd
command, for example:>> cd 'C:\Users\Me\Download\channelpedia-api\matlab\'
- You can now use the provided functions to easily access or plot trace data. Available APIs are described in README.rst
Python API
Pre-requisites
Python 3.5.x (or later) is required. If you have Python 2 installed (check running python -V in a terminal) your operative system likely needs it, and you should not upgrade it: it is recommended instead to install Anaconda with Python 3, https://www.anaconda.com/distribution/, through which you can open a special terminal with Python 3, when needed.
The Channelpedia Python API requires a few Python modules to be installed; the easiest way to install them is using pip. If you've installed Python from the official website, you probably already have pip installed. To verify, run pip -V in a terminal. If not, to install pip run the following commands in a terminal:
Note: on certain Linux distributions, the pip version found in the distro's repositories may be outdated. In case of any errors when installing dependencies, it is recommended to install pip from the official source as shown above.$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py $ python get-pip.py --user
- Once pip is installed, you can have it fetch and install the required
dependencies for the Channelpedia Python API.
- Open a terminal inside the
python/
directory. - Run the following command to have pip fetch and install the
required dependencies:
Note: on some systems (e.g. Ubuntu), you may need to use
$ pip install -r requirements.txt --user
pip3
instead ofpip
, as the latter may default to the Python 2.x version.
- Open a terminal inside the
- (Optional) If you want to analyze raw data cells yourself, you'll also
need to install the scipy Python module. For Linux/macOS users, simply
run
pip install scipy --user
in a terminal to do so.
For Windows users, download and install the following pre-built packages:- Note: download the appropriate package
versions depending on the Python version you have installed
("cp35" if you have Python 3.5, "cp36" if you have Python 3.6)
and architecture ("win32" for 32-bit Python, "win_amd64" for
64-bit Python).
To find out your Python version, run the following command in a terminal:To verify the architecture version, run the following command in a terminal:$ python -V
$ python -c "import platform; print(platform.architecture())"
- Numpy+MKL: download the appropriate package
then install it using pip. You can do so by opening a terminal in
the directory where you downloaded the
.whl
file, then running the following command (modify the file name to point to the version you downloaded):$ pip install "numpy‑1.13.1+mkl‑cp35‑cp35m‑win32.whl" --user
- SciPy: download the appropriate package
then install it using pip as above, for example:
$ pip install "scipy‑0.19.1‑cp35‑cp35m‑win32.whl" --user
- Note: download the appropriate package
versions depending on the Python version you have installed
("cp35" if you have Python 3.5, "cp36" if you have Python 3.6)
and architecture ("win32" for 32-bit Python, "win_amd64" for
64-bit Python).
Usage
- Open a terminal in the
python/
directory and start the Python interpreter:$ python
- Import the Channelpedia Python API:
>>> import channelpedia_api as api
- You can now use all the functions the API provides.
Print the api documentation from the Python interpreter:>>> import channelpedia_api as api
>>> help(api)