skills/davila7/geniml/SKILL.md
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.
npx skillsauth add aiskillstore/marketplace genimlInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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.
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
Geniml provides five primary capabilities, each detailed in dedicated reference files:
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:
Reference: See references/region2vec.md for detailed workflow, parameters, and examples.
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:
Reference: See references/bedspace.md for detailed workflow, search types, and examples.
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:
Reference: See references/scembed.md for detailed workflow, parameters, and examples.
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:
Methods:
Reference: See references/consensus_peaks.md for method comparison, parameters, and examples.
Additional tools for caching, randomization, evaluation, and search.
Available utilities:
Reference: See references/utilities.md for detailed usage of each utility.
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'
)
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='universe.bed',
output='tokens.parquet'
)
# Step 3: Train scEmbed
model = ScEmbed(embedding_dim=100)
model.train(dataset='tokens.parquet', epochs=100)
# Step 4: Generate embeddings
embeddings = model.encode(adata)
adata.obsm['scembed_X'] = embeddings
# Step 5: Cluster with scanpy
sc.pp.neighbors(adata, use_rep='scembed_X')
sc.tl.leiden(adata)
sc.tl.umap(adata)
# Generate coverage
cat bed_files/*.bed > combined.bed
uniwig -m 25 combined.bed chrom.sizes coverage/
# Build universe with coverage cutoff
geniml universe build cc \
--coverage-folder coverage/ \
--output-file universe.bed \
--cutoff 5 \
--merge 100 \
--filter-size 50
# Evaluate universe quality
geniml universe evaluate \
--universe universe.bed \
--coverage-folder coverage/ \
--bed-folder bed_files/
Geniml provides command-line interfaces for major operations:
# Region2Vec training
geniml region2vec --token-folder tokens/ --save-dir model/ --num-shuffle 1000
# BEDspace preprocessing
geniml bedspace preprocess --input regions/ --metadata labels.csv --universe universe.bed
# BEDspace training
geniml bedspace train --input preprocessed.txt --output model/ --dim 100
# BEDspace search
geniml bedspace search -t r2l -d distances.pkl -q query.bed -n 10
# Universe building
geniml universe build cc --coverage-folder coverage/ --output universe.bed --cutoff 5
# BEDshift randomization
geniml bedshift --input peaks.bed --genome hg38 --preserve-chrom --iterations 100
Use Region2Vec when:
Use BEDspace when:
Use scEmbed when:
Use Universe Building when:
Use Utilities when:
adata.obsm entriesGeniml is part of the BEDbase ecosystem:
"Tokenization coverage too low":
"Training not converging":
"Out of memory errors":
"StarSpace not found" (BEDspace):
--path-to-starspace parameter correctlyFor detailed troubleshooting and method-specific issues, consult the appropriate reference file.
development
Apple Human Interface Guidelines for content display components. Use this skill when the user asks about charts component, collection view, image view, web view, color well, image well, activity view, lockup, data visualization, content display, displaying images, rendering web content, color pickers, or presenting collections of items in Apple apps. Also use when the user says how should I display charts, what's the best way to show images, should I use a web view, how do I build a grid of items, what component shows media, or how do I present a share sheet. Cross-references: hig-foundations for color/typography/accessibility, hig-patterns for data visualization patterns, hig-components-layout for structural containers, hig-platforms for platform-specific component behavior.
tools
Automate HelpDesk tasks via Rube MCP (Composio): list tickets, manage views, use canned responses, and configure custom fields. Always search tools first for current schemas.
testing
Expert Haskell engineer specializing in advanced type systems, pure functional design, and high-reliability software. Use PROACTIVELY for type-level programming, concurrency, and architecture guidance.
tools
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.