Ganglion cell layer (GCL) response classifier
Project description
GCL Classifier
A ganglion cell layer (GCL) classifier trained on functional two-photon calcium imaging recordings of mouse retinas in response to chirp and moving bar stimuli. The labels and classification are based on Baden, Franke, Berens et al. (2016) "The functional diversity of retinal ganglion cells in the mouse." Nature 529.7586 (2016): 345-350. The classifier was already used in two publictions:
- Qiu, et al. "Efficient coding of natural scenes improves neural system identification." PLoS computational biology 19.4 (2023): e1011037.
- Gonschorek, et al. "Nitric oxide modulates contrast suppression in a subset of mouse retinal ganglion cells." Elife 13 (2025): RP98742.
Installation
Quick Start
pip install gcl_classifier
If you additonally want to run the attached notebooks, install the extra dependencies using:
pip install "gcl_classifier[notebook]"
First Time Setup
On first use, the model will be downloaded from Hugging Face Hub. This happens automatically and only needs to be done once.
from gcl_classifier import get_model
# Downloads model to ~/.cache/gcl_classifier/
model = get_model()
Let's use this model for celltype classification:
import numpy as np
from gcl_classifier.data import get_data
from gcl_classifier.classifier import extract_features
# "Fake" preprocessed data for two cells
bar_ds_pvalues = np.array([0.04, 0.20])
roi_sizes_um2 = np.array([43.0, 56.5])
chirp_traces = np.random.random((2, 249))
bar_traces = np.random.random((2, 32))
# Load feat matrix to transform data into feature space
data = get_data()
chirp_features = data["chirp_feats"]
bar_features = data["bar_feats"]
# Extract the features for classifier
X, feature_names = extract_features(
preproc_chirps=chirp_traces,
preproc_bars=bar_traces,
bar_ds_pvalues=bar_ds_pvalues,
roi_size_um2s=roi_sizes_um2,
chirp_features=chirp_features,
bar_features=bar_features,
)
# Get predictions and probabilities
predictions = model.predict(X)
predictions_probs = model.predict_proba(X)
Cache Location
Models (and training data) are cached at:
- Linux/Mac:
~/.cache/gcl_classifier/ - Windows:
C:\Users\<username>\.cache\gcl_classifier\
To clear cache and re-download the model:
from gcl_classifier.model import load_model
model, model_dict = load_model(force_download=True)
You can do the same for the training data, but you only need to do this if you want to re-train the model.
from gcl_classifier.data import load_data
data = load_data(force_download=True)
Offline Usage
After initial download, the package works offline using the cached model.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gcl_classifier-0.1.0.tar.gz.
File metadata
- Download URL: gcl_classifier-0.1.0.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5776f57500c22cb2bf1b14a13ebfbdca8ac918fc73195e8cc2cdacb23e7beb4
|
|
| MD5 |
36da91fdd267b02e0c9a9a72a2fbc09e
|
|
| BLAKE2b-256 |
fcc4ba609a00be51e6a7c5e5a3643decc7b655fd60d58b22f8aa2a3e4884ec2b
|
Provenance
The following attestation bundles were made for gcl_classifier-0.1.0.tar.gz:
Publisher:
publish-to-pypi.yml on eulerlab/gcl_classifier
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gcl_classifier-0.1.0.tar.gz -
Subject digest:
d5776f57500c22cb2bf1b14a13ebfbdca8ac918fc73195e8cc2cdacb23e7beb4 - Sigstore transparency entry: 731044441
- Sigstore integration time:
-
Permalink:
eulerlab/gcl_classifier@a7fdc8dbcdd990f8b3d33518cecfb7c8dfed2bcf -
Branch / Tag:
refs/tags/release-version-0.1.0 - Owner: https://github.com/eulerlab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@a7fdc8dbcdd990f8b3d33518cecfb7c8dfed2bcf -
Trigger Event:
push
-
Statement type:
File details
Details for the file gcl_classifier-0.1.0-py3-none-any.whl.
File metadata
- Download URL: gcl_classifier-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e9922342c82b90bab0838891cfd20be961599961626e175ed0928316f519326
|
|
| MD5 |
147cb13ad5121291359bd49f654e01fe
|
|
| BLAKE2b-256 |
eee2a9c4b2b2ad0400c6c34154e99f922edb60f13020b78509ea66234c93d126
|
Provenance
The following attestation bundles were made for gcl_classifier-0.1.0-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on eulerlab/gcl_classifier
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gcl_classifier-0.1.0-py3-none-any.whl -
Subject digest:
5e9922342c82b90bab0838891cfd20be961599961626e175ed0928316f519326 - Sigstore transparency entry: 731044443
- Sigstore integration time:
-
Permalink:
eulerlab/gcl_classifier@a7fdc8dbcdd990f8b3d33518cecfb7c8dfed2bcf -
Branch / Tag:
refs/tags/release-version-0.1.0 - Owner: https://github.com/eulerlab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@a7fdc8dbcdd990f8b3d33518cecfb7c8dfed2bcf -
Trigger Event:
push
-
Statement type: