Install any skill in seconds. Free to start, no credit card required.
Get Started Free →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.
.claude/skills/lingxling-geniml/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 13% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 2% | 0% |
| case-04 | ✗→✓ | ▲ Improved | -32% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 15% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 55% | 0% |
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:
bashuv pip install geniml
For ML dependencies (PyTorch, etc.):
bashuv pip install 'geniml[ml]'
Development version from GitHub:
bashuv 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.
pythonfrom 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' )
pythonimport 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)
bash# 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:
bash# 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.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 21,570 | 16,574 | -23% | 1 | 1 | 0% | 4,302 | 4,861 | +13% | 0 | 0 | — |
case-02 | fail→fail | 29,267 | 19,586 | -33% | 1 | 1 | 0% | 4,562 | 5,307 | +16% | 0 | 0 | — |
case-03 | fail→pass | 22,542 | 10,912 | -52% | 1 | 1 | 0% | 4,323 | 4,406 | +2% | 0 | 0 | — |
case-04 | fail→pass | 25,869 | 2,732 | -89% | 1 | 1 | 0% | 3,905 | 2,671 | -32% | 0 | 0 | — |
case-05 | fail→pass | 18,734 | 4,839 | -74% | 1 | 1 | 0% | 2,765 | 3,189 | +15% | 0 | 0 | — |
case-06 | fail→pass | 12,171 | 3,229 | -73% | 1 | 1 | 0% | 1,874 | 2,898 | +55% | 0 | 0 | — |
case-07 | fail→pass | 11,854 | 5,324 | -55% | 1 | 1 | 0% | 1,822 | 3,160 | +73% | 0 | 0 | — |
case-08 | fail→pass | 11,440 | 4,292 | -62% | 1 | 1 | 0% | 1,878 | 3,010 | +60% | 0 | 0 | — |
case-09 | fail→pass | 10,775 | 6,242 | -42% | 1 | 1 | 0% | 1,798 | 3,576 | +99% | 0 | 0 | — |
case-10 | fail→pass | 20,497 | 10,969 | -46% | 1 | 1 | 0% | 2,862 | 4,244 | +48% | 0 | 0 | — |
case-11 | fail→pass | 17,008 | 4,288 | -75% | 1 | 1 | 0% | 2,569 | 3,043 | +18% | 0 | 0 | — |
case-12 | fail→pass | 31,015 | 4,415 | -86% | 1 | 1 | 0% | 2,944 | 3,028 | +3% | 0 | 0 | — |
case-13 | fail→pass | 18,922 | 5,374 | -72% | 1 | 1 | 0% | 2,854 | 3,169 | +11% | 0 | 0 | — |
case-14 | pass→pass | 11,478 | 9,828 | -14% | 1 | 1 | 0% | 1,847 | 3,585 | +94% | 0 | 0 | — |
case-15 | pass→pass | 18,062 | 4,567 | -75% | 1 | 1 | 0% | 3,260 | 3,153 | -3% | 0 | 0 | — |
case-16 | fail→pass | 8,847 | 3,252 | -63% | 1 | 1 | 0% | 1,451 | 2,845 | +96% | 0 | 0 | — |
case-17 | fail→pass | 14,828 | 6,729 | -55% | 1 | 1 | 0% | 2,074 | 3,128 | +51% | 0 | 0 | — |
case-18 | fail→pass | 18,751 | 3,896 | -79% | 1 | 1 | 0% | 2,668 | 3,083 | +16% | 0 | 0 | — |
case-19 | fail→fail | 20,297 | 2,731 | -87% | 1 | 1 | 0% | 3,388 | 2,772 | -18% | 0 | 0 | — |
case-20 | pass→pass | 13,092 | 11,302 | -14% | 1 | 1 | 0% | 2,472 | 4,453 | +80% | 0 | 0 | — |
case-21 | pass→pass | 16,617 | 13,297 | -20% | 1 | 1 | 0% | 2,374 | 4,342 | +83% | 0 | 0 | — |
case-22 | pass→pass | 12,288 | 9,251 | -25% | 1 | 1 | 0% | 2,289 | 3,937 | +72% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +68 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.