scientific-skills/Data Analysis/geniml/SKILL.md
Machine learning toolkit for genomic interval (BED) data; use it when you need to tokenize BED collections and train embeddings for regions/cells/labels, build consensus peak universes, or run similarity search and downstream ML on chromatin accessibility datasets.
npx skillsauth add aipoch/medical-research-skills genimlInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
4 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Additional details are commonly documented in:
references/region2vec.md,references/bedspace.md,references/scembed.md,references/consensus_peaks.md,references/utilities.md.
geniml[ml] (typically pulls PyTorch and related ML dependencies)scanpy (plus anndata, numpy, scipy)uniwig (used to generate coverage tracks in universe workflows)# Base install
uv pip install geniml
# With ML extras (e.g., PyTorch and related dependencies)
uv pip install "geniml[ml]"
# Development version
uv pip install git+https://github.com/databio/geniml.git
# (A) Build coverage tracks (example pattern)
cat bed_files/*.bed > combined.bed
uniwig -m 25 combined.bed chrom.sizes coverage/
# (B) Build a universe (coverage cutoff method)
geniml universe build cc \
--coverage-folder coverage/ \
--output-file universe.bed \
--cutoff 5 \
--merge 100 \
--filter-size 50
# (C) Tokenize BED files, train Region2Vec, and evaluate embeddings
from geniml.tokenization import hard_tokenization
from geniml.region2vec import region2vec
from geniml.evaluation import evaluate_embeddings
# 1) Tokenize BED files against the universe
hard_tokenization(
src_folder="bed_files/",
dst_folder="tokens/",
universe_file="universe.bed",
p_value_threshold=1e-9,
)
# 2) Train Region2Vec
region2vec(
token_folder="tokens/",
save_dir="model/",
num_shufflings=1000,
embedding_dim=100,
)
# 3) Evaluate (requires labels/metadata aligned to embeddings)
metrics = evaluate_embeddings(
embeddings_file="model/embeddings.npy",
labels_file="metadata.csv",
)
print(metrics)
import scanpy as sc
from geniml.scembed import ScEmbed
from geniml.io import tokenize_cells
# 1) Load AnnData
adata = sc.read_h5ad("scatac_data.h5ad")
# 2) Tokenize cells using a universe
tokenize_cells(
adata="scatac_data.h5ad",
universe_file="universe.bed",
output="tokens.parquet",
)
# 3) Train scEmbed
model = ScEmbed(embedding_dim=100)
model.train(dataset="tokens.parquet", epochs=100)
# 4) Encode cells and attach embeddings to AnnData
embeddings = model.encode(adata)
adata.obsm["scembed_X"] = embeddings
# 5) Standard Scanpy neighborhood graph + clustering + UMAP
sc.pp.neighbors(adata, use_rep="scembed_X")
sc.tl.leiden(adata)
sc.tl.umap(adata)
p_value_threshold controls stringency of mapping/overlap significance (lower is stricter; overly strict thresholds can reduce coverage).embedding_dim: dimensionality of learned vectors (e.g., 50–300).num_shufflings: increases training signal by shuffling/co-occurrence augmentation; higher values increase runtime.adata.obsm[...] and run standard Scanpy steps (neighbors, Leiden, UMAP).--cutoff: minimum coverage to call peaks (CC/CCF).--merge: merge distance for nearby peaks.--filter-size: minimum peak length to keep.tools
Generates complete conventional oncology bulk-transcriptome biomarker and hub-gene research designs from a user-provided cancer type and study direction. Always use this skill whenever a user wants to design, plan, or build a tumor bioinformatics study centered on differential expression, prognostic filtering or risk modeling, PPI-based hub-gene prioritization, diagnostic/prognostic evaluation, clinical association, immune infiltration context, methylation context, and optional tissue or cell validation. Covers five study patterns (signature-first prognostic workflow, hub-gene-first biomarker workflow, hybrid signature-to-hub workflow, immune-context biomarker workflow, translational validation workflow) and always outputs four workload configs (Lite / Standard / Advanced / Publication+) with recommended primary plan, step-by-step workflow, figure plan, validation strategy, minimal executable version, publication upgrade path...
development
Generates complete conventional non-oncology bioinformatics research designs from a user-provided disease context, process-related gene family or biological theme, and validation direction. Use when a study centers on multi-dataset bulk transcriptome integration, DEG analysis, process-gene intersection, enrichment analysis, GSEA, PPI hub-gene prioritization, TF/miRNA regulatory networks, ROC-based biomarker evaluation, and immune infiltration analysis. Covers five study patterns (process-DEG discovery, enrichment/GSEA interpretation, hub-gene prioritization, regulatory-network and immune interpretation, multi-layer public validation) and always outputs Lite / Standard / Advanced / Publication+ with a recommended primary plan, stepwise workflow, figure plan, validation hierarchy, minimal executable version, publication upgrade path, and strictly verified literature retrieval.
tools
Plans confounder control, variable adjustment logic, and bias mitigation strategies at the protocol stage for clinical, epidemiologic, translational, observational, and biomarker studies. Always use this skill when a user needs to identify major confounders, decide which variables should or should not be adjusted for, compare matching/stratification/weighting approaches, anticipate selection or measurement bias, or pressure-test a study design before execution. Focus on bias sensing, causal structure awareness, variable-role classification, and critical design review rather than generic statistical advice.
testing
Generates complete comparative network-toxicology research designs from a user-provided exposure pair, shared toxic phenotype, and validation direction. Use when a study centers on two related exposures under one outcome and needs target collection, shared-vs-specific target decomposition, enrichment, PPI hub prioritization, docking, optional transcriptomic cross-checks, and conservative mechanistic synthesis. Covers five study patterns and always outputs Lite / Standard / Advanced / Publication+ with a recommended primary plan, stepwise workflow, figure plan, validation hierarchy, minimal executable version, publication upgrade path, and strictly verified literature retrieval.