CNNAMON
Convolutional Neural Network Analysis & Motif Discovery
A modular, interpretability-first framework for deep learning in genomics.
🧠 Overview
CNNAMON is a Python framework designed to bridge the gap between training high-performance
1D Convolutional Neural Networks (CNNs) on DNA sequences and understanding what they learn.
It provides an end-to-end ecosystem for:
- Dataset Preparation – Converting genomic intervals (BED3 + labels) to one-hot tensors
- Modeling – Building complex Keras models via simple JSON configuration files
- Explainability – Extracting learned motifs, clustering filters by activation profiles, assessing filter importance, and associating filters with prediction classes
⚡ Key Features
| Module | Functionality |
|---|---|
| 🧬 PrepareData | Extract sequences from FASTA/BED files. Supports random, chromosome, or custom splits, and reverse-complement augmentation. |
| 🏗 KerasBuilder | Define model architectures, optimizers, and callbacks using JSON for reproducible experiments. |
| 🎨 FilterVisualize | Extract learned motifs using Top-Activating, Consensus, or Significant (permutation-based) strategies. Export to MEME for TOMTOM validation. |
| 📉 FilterImportance | Rank filters by their contribution to model loss using perturbation analysis. |
| 🌳 FilterClustering | Group redundant or co-activated filters with hierarchical clustering and visualize relationships using circular dendrograms. |
| 🧪 Enrichment | Identify filters statistically enriched for prediction classes (e.g., Enhancer vs. Silencer). |
📦 Installation
We recommend installing CNNAMON in a fresh environment to manage dependencies (TensorFlow, BedTools).
# 1. Create environment
conda create -n cnnamon_env python=3.10
conda activate cnnamon_env
# 2. Install CNNAMON
pip install cnnamon
# 3. Install BedTools (required for sequence extraction)
conda install -c bioconda bedtools
🚀 Quick Start
Train a model and visualize motifs in four steps:
import cnnamon as cn
# 1. Prepare data
preparer = cn.utility.PrepareData(
intervalfile="peaks.bed",
genomefasta="hg38.fa",
outdir="data/",
split_segmentation="random"
)
train, test, val = preparer.run()
# 2. Train model (from JSON config)
model = cn.utility.KerasModelBuilder.from_json("model_config.json")
model.train(train['x'], train['y'], val['x'], val['y'])
# 3. Extract significant motifs
motifs = cn.CNN1D.FilterVisualize.significant_activating(
model,
data=test,
n_perturbations=1000,
q_value_cutoff=0.05,
n_cores=10
)
# 4. Plot sequence logos
motifs.to_motifs(savefig="learned_motifs.png")
📖 Documentation
Full documentation is available here:
👉 https://georgakilaslab.github.io/CNNAMON/
📚 Citation
If you use CNNAMON in your research, please cite:
(Add paper reference / DOI here when available)
Built by the Georgakilas Lab.
Metadata
Release files for cnnamon 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cnnamon-0.2.2.tar.gz | 26.8 kB | With provenance | Details for cnnamon-0.2.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cnnamon-0.2.2-py3-none-any.whl | Python 3 | none | any | Details for cnnamon-0.2.2-py3-none-any.whl |
Total release size: 55.0 kB
Release files / cnnamon-0.2.2.tar.gz
| Download URL | cnnamon-0.2.2.tar.gz |
|---|---|
| Size | 26.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
815148d662d5de77098652afa1be0b862981c57fe420198434257875dbfb7ef1
|
|
BLAKE2b-256 checksum How to use checksums |
0dbc7556314d4526e349d73e24488788c097425e3ae0cf50513935374a474015
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 13, 2026.
Transparency logRelease files / cnnamon-0.2.2-py3-none-any.whl
| Download URL | cnnamon-0.2.2-py3-none-any.whl |
|---|---|
| Size | 28.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ee8d4c57114859fc44ebb13e1e7946645efe59fb4ac96fd19dbc0593a96d1781
|
|
BLAKE2b-256 checksum How to use checksums |
4fdf0cf5db2a5e5f2da233e20f374efa6b0bf679904e0595205e12fd6466d4b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 13, 2026.
Transparency logSecurity for cnnamon 0.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for cnnamon-0.2.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 13, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.