Skip to content
Back to skills

Genomic Llm Embeddings

ASecurity

DNA tokenization strategies, k-mer baselines, and pretrained sequence embeddings for genomic ML.

  • 4 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 27, 2026
data-aipythongoperformance

Security analysis

A100/100

Scanned May 27, 2026

npx -y skills add Pavel-Kravchenko/Bioinformatics --skill genomic-llm-embeddings --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Genomic Llm Embeddings?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Genomic Llm Embeddings
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/pavel-kravchenko-genomic-llm-embeddings/badge)](https://www.skillsdirectory.com/skills/pavel-kravchenko-genomic-llm-embeddings)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: genomic-llm-embeddings
description: DNA tokenization strategies, k-mer baselines, and pretrained sequence embeddings for genomic ML.
tool_type: python
primary_tool: NumPy
---

# genomic-llm-embeddings

## Tokenization Strategy Selection

| Strategy | Context | Strength | Limitation |
|---|---:|---|---|
| Character (A/C/G/T/N) | Long | Max resolution | Long token sequences |
| k-mer (k=3..6) | Short/medium | Fast baseline | Loses positional nuance |
| DNABERT-2 (BPE) | ~512 bp windows | Strong short-window tasks | Limited context |
| Nucleotide Transformer (6-mer) | kb-scale | Good transfer embeddings | Higher memory |
| HyenaDNA | up to 1M bp | Long-range signals | Heavier training/inference |

## Key Patterns

**k-mer embedding baseline**
```python
from collections import Counter
import numpy as np

def kmer_embedding(seq, vocab, k=3):
    tokens = [seq[i:i+k] for i in range(len(seq)-k+1)]
    cnt = Counter(tokens)
    vec = np.array([cnt[v] for v in vocab], dtype=float)
    return vec / (vec.sum() + 1e-9)
```

**Nearest centroid probe (sanity check before deep models)**
```python
def nearest_centroid_predict(X_train, y_train, X_test):
    c0 = X_train[y_train == 0].mean(axis=0)
    c1 = X_train[y_train == 1].mean(axis=0)
    d0 = ((X_test - c0) ** 2).sum(axis=1)
    d1 = ((X_test - c1) ** 2).sum(axis=1)
    return (d1 < d0).astype(int)
```

## Pitfalls

- Mixing tokenization schemes between train and inference silently destroys performance
- Always compare against a simple k-mer baseline -- hard to detect overfitting/bugs without one
- Match sequence window lengths when comparing models

## Related Skills

- `genomic-foundation-models` -- pretrained model details and fine-tuning
- `protein-language-models` -- ESM2 embeddings for protein sequences

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.