geniml
What it does
This skill gives your agent geniml, a Python package for machine learning on genomic regions. It handles BED file collections and chromatin accessibility data. It is for computational biologists and genomics researchers.
When to use it
- ✓When you want to create numerical embeddings for genomic regions in BED files.
- ✓When you need to analyze single-cell ATAC-seq data with embeddings.
- ✓When you want to build a consensus set of peaks from several BED files.
Skill link
https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/scientific/geniml/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Train region embeddings on my collection of BED files and find the regions most similar to this one.”
5 new skills a week. 1 minute to read.
How it works
The agent tokenizes the BED files against a reference universe, trains an unsupervised model, and produces embeddings. These embeddings can then be searched or clustered.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Geniml: Genomic Interval Machine Learning
Overview
Geniml is a Python package for building machine learning models on genomic interval data from BED files. It provides unsupervised methods for learning embeddings of genomic regions, single cells, and metadata labels, enabling similarity searches, clustering, and downstream ML tasks.
Installation
Install geniml using uv:
uv uv pip install geniml
For ML dependencies (PyTorch, etc.):
uv uv pip install 'geniml[ml]'
Development version from GitHub:
uv uv pip install git+https://github.com/databio/geniml.git
Core Capabilities
Geniml provides five primary capabilities, each detailed in dedicated reference files:
1. Region2Vec: Genomic Region Embeddings
Train unsupervised embeddings of genomic regions using word2vec-style learning.
Use for: Dimensionality reduction of BED files, region similarity analysis, feature vectors for downstream ML.
Workflow:
- Tokenize BED files using a universe reference
- Train Region2Vec model on tokens
- Generate embeddings for regions
Reference: See references/region2vec.md for detailed workflow, parameters, and examples.
2. BEDspace: Joint Region and Metadata Embeddings
Train shared embeddings for region sets and metadata labels using StarSpace.
Use for: Metadata-aware searches, cross-modal queries (region→label or label→region), joint analysis of genomic content and experimental conditions.
Workflow:
- Preprocess regions and metadata
- Train BEDspace model
- Compute distances
- Query across regions and labels
Reference: See references/bedspace.md for detailed workflow, search types, and examples.
3. scEmbed: Single-Cell Chromatin Accessibility Embeddings
Train Region2Vec models on single-cell ATAC-seq data for cell-level embeddings.
Use for: scATAC-seq clustering, cell-type annotation, dimensionality reduction of single cells, integration with scanpy workflows.
Workflow:
- Prepare AnnData with peak coordinates
- Pre-tokenize cells
- Train scEmbed model
- Generate cell embeddings
- Cluster and visualize with scanpy
Reference: See references/scembed.md for detailed workflow, parameters, and examples.
4. Consensus Peaks: Universe Building
Build reference peak sets (universes) from BED file collections using multiple statistical methods.
Use for: Creating tokenization references, standardizing regions across datasets, defining consensus features with statistical rigor.
Workflow:
- Combine BED files
- Generate coverage tracks
- Build universe using CC, CCF, ML, or HMM method
Methods:
- CC (Coverage Cutoff): Simple threshold-based
- CCF (Coverage Cutoff Flexible): Confidence intervals for boundaries
- ML (Maximum Likelihood): Probabilistic modeling of positions
- HMM (Hidden Markov Model): Complex state modeling
Reference: See references/consensus_peaks.md for method comparison, parameters, and examples.
5. Utilities: Supporting Tools
Additional tools for caching, randomization, evaluation, and search.
Available utilities:
- BBClient: BED file caching for repeated access
- BEDshift: Randomization preserving genomic context
- Evaluation: Metrics for embedding quality (silhouette, Davies-Bouldin, etc.)
- Tokenization: Region tokenization utilities (hard, soft, universe-based)
- Text2BedNN: Neural search backends for genomic queries
Reference: See references/utilities.md for detailed usage of each utility.
Common Workflows
Basic Region Embedding Pipeline
from geniml.tokenization import hard_tokenization
from geniml.region2vec import region2vec
from geniml.evaluation import evaluate_embeddings
# Step 1: Tokenize BED files
hard_tokenization(
src_folder='bed_files/',
dst_folder='tokens/',
universe_file='universe.bed',
p_value_threshold=1e-9
)
# Step 2: Train Region2Vec
region2vec(
token_folder='tokens/',
save_dir='model/',
num_shufflings=1000,
embedding_dim=100
)
# Step 3: Evaluate
metrics = evaluate_embeddings(
embeddings_file='model/embeddings.npy',
labels_file='metadata.csv'
)
scATAC-seq Analysis Pipeline
import scanpy as sc
from geniml.scembed import ScEmbed
from geniml.io import tokenize_cells
# Step 1: Load data
adata = sc.read_h5ad('scatac_data.h5ad')
# Step 2: Tokenize cells
tokenize_cells(
adata='scatac_data.h5ad',
universe_file='univ
FAQ
Is training supervised?
No. The skill describes unsupervised methods that learn embeddings without labels.
What is a universe in this context?
It is a reference set of regions used to tokenize the BED files before training.
Does it need extra packages?
The skill describes an optional ML install that adds PyTorch and related dependencies.
Details
Original description by the author
This skill should be used when working with genomic interval data (BED files) for machine learning tasks. Use for training region embeddings (Region2Vec, BEDspace), single-cell ATAC-seq analysis (scEmbed), building consensus peaks (universes), or any ML-based analysis of genomic regions. Applies to BED file collections, scATAC-seq data, chromatin accessibility datasets, and region-based genomic feature learning.
Popularity
- GitHub stars
- 33k
- Ranking position
- #8958
- License
- MIT
- Updated
- 11/2/2026
Comments
- …
More skills from this repository
owasp-security
33kTeaches your agent OWASP security guidance for web apps, APIs, mobile, containers and AI agents, so it can spot common weaknesses and suggest fixes.
agent-management
33kLets your agent create, list, hibernate, wake, rename and delete AI agents using the AI Maestro command line, managing each agent's lifecycle.
agent-messaging
33kLets your agent send, receive and reply to signed messages between AI agents, using the Agent Messaging Protocol, mostly on your own machine.
docs-search
33kLets your agent search auto-generated code documentation for function signatures, class definitions and comments, so it checks the real API before changing code.
Similar skills
pytorch-patterns
280kHelps your agent use PyTorch for machine learning models. It applies best practices for efficient model training and ensures reproducible results.
evm-token-decimals
280kHelps your agent avoid errors with decimal numbers across different blockchain networks. It ensures token values are accurate in transactions and calculations.
ito-inference
280kLets your agent check the availability of AI models for use. It connects the compute request with the ready model service.