Logotipo de Alterlab Gtars

Alterlab Gtars

Organización
NVlabs
alterlab-gtars

Runs high-performance genomic interval analysis with gtars (databio), a Rust toolkit with Python bindings — the performance-critical backend for the geniml ML library. Use when computing overlaps/jaccard/coverage between BED region sets, indexing intervals with IGD, generating uniwig accumulation/coverage tracks, tokenizing genomic regions for ML, splitting single-cell fragments into pseudobulks, or computing GA4GH refget sequence digests. NOT for training region embeddings (use alterlab-geniml) or non-genomic spatial joins (use alterlab-geopandas). Part of the AlterLab Academic Skills suite.

Descripción general

EditorNVlabs
RepositorioSkill2Env
Nombre de la habilidadalterlab-gtars
Estrellas
189
Forks
18
Archivos incluidos
7
LicenciaMIT
Enlaces
  • Instrucciones en Markdown

    Un archivo SKILL.md que el modelo carga cuando lo necesita, de modo que solo consume tokens cuando la petición encaja con la habilidad.

  • Funciona con cualquier LLM

    Las habilidades de IA están en Markdown, no en código específico de un proveedor, por lo que funcionan con GPT, Claude, Gemini, Grok o un modelo local.

  • Archivos incluidos: 7

    Scripts, plantillas y referencias que el modelo puede leer mientras trabaja. Los archivos son de solo lectura y nunca se ejecutan.

  • Código abierto

    Publicada por NVlabs en GitHub. Revisa el contenido original antes de instalarla.

Instalación

Instala la habilidad de IA Alterlab Gtars en TypingMind para usarla con cualquier LLM, o añádela a otro agente que lea SKILL.md.

1

Instalar en TypingMind

TypingMind instala una habilidad directamente desde su carpeta de GitHub: lee SKILL.md, empaqueta los archivos de recursos y guarda el resultado localmente.

  1. Abre la aplicación y ve a Plugins → Habilidades.
  2. Elige «Instalar desde GitHub».
  3. Pega la URL de la carpeta de la habilidad que se muestra a continuación y confirma.
    https://github.com/NVlabs/Skill2Env/tree/main/SkillHub/skills/alterlab-gtars
  4. Activa la habilidad en cada chat en el que quieras tenerla disponible.
Plugins → Habilidades → Añadir habilidad → URL de GitHub; después, pega la URL de la carpeta y pulsa Continuar.
2

Instalar en otro agente

Cualquier agente que lea el formato Agent Skills puede usar esta habilidad: copia la carpeta en el directorio de habilidades de ese agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/NVlabs/Skill2Env.git /tmp/Skill2Env
mkdir -p .claude/skills
cp -r /tmp/Skill2Env/SkillHub/skills/alterlab-gtars .claude/skills/alterlab-gtars
Reinicia Claude Code después de copiarla para que detecte la nueva habilidad.

Úsala en TypingMind

Activa Alterlab Gtars en cualquier chat de TypingMind y el modelo se encargará del resto. Su nombre y descripción se incluyen en el prompt del sistema y, en cuanto una petición encaja con la habilidad, el modelo carga las instrucciones completas por sí solo. No tienes que invocarla manualmente y no consume tokens hasta que se utiliza.

El modelo carga Alterlab Gtars automáticamente en cuanto una petición es relevante para esa habilidad.

Funciona con cualquier modelo de IA

Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que Alterlab Gtars no está vinculada al modelo para el que se creó. Instálala una sola vez en TypingMind y úsala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modelo local que ejecutes tú, todo con tus propias claves API.

  • Se carga solo cuando se necesita

    El prompt del sistema solo incluye el nombre y la descripción. Las instrucciones se cargan con la primera petición que encaja con la habilidad, por lo que una habilidad que no se usa no supone ningún coste.

  • Cambia de modelo durante el chat

    Como la habilidad contiene instrucciones y no código, cambiar de modelo no impide que funcione: el nuevo modelo lee el mismo archivo SKILL.md.

Instrucciones de la habilidad

Este es el contenido de SKILL.md que carga el modelo. Léelo antes de instalar la habilidad: contiene instrucciones que tu modelo seguirá.

Gtars: Genomic Tools and Algorithms in Rust

Overview

Gtars (from databio, the lab behind geniml) is a high-performance Rust toolkit for manipulating, analyzing, and processing genomic interval data. Its primary purpose is to be the performance-critical backend for geniml, a Python library for machine learning on genomic intervals. It provides overlap/set operations, IGD overlap indexing, coverage (uniwig) tracks, region tokenization for ML, single-cell fragment pseudobulking, and GA4GH refget sequence-collection management.

Use this skill when working with:

  • Genomic interval files (BED) — overlaps, jaccard, set ops, coverage
  • IGD indexing for fast overlap queries over large interval databases
  • Coverage / accumulation tracks via uniwig
  • Genomic ML preprocessing and region tokenization
  • Single-cell fragment files (split into pseudobulks by cluster)
  • Reference sequence digests and retrieval (refget)

Version note: examples are verified against the gtars Python package v0.8 (PyPI). The Python API is exposed through submodules — gtars.models, gtars.tokenizers, gtars.refget, gtars.utils — NOT as flat top-level functions. There is no gtars.igd or gtars.uniwig Python submodule; IGD building and uniwig track generation are CLI-only.

Installation

Python package

bash
uv pip install gtars   # or: uv add gtars

Import surface (verified, v0.8):

python
from gtars.models import RegionSet, Region, RegionSetList
from gtars.tokenizers import Tokenizer, tokenize_fragment_file
from gtars import refget          # RefgetStore, digest_fasta, sha512t24u_digest, ...
from gtars import utils           # read/write .gtok token files

CLI (separate Rust binary)

The CLI ships as the gtars-cli crate (binary name gtars) and is installed with Cargo. Most subcommands are behind feature flags:

bash
# All commonly used commands
cargo install gtars-cli --features "uniwig overlaprs igd bbcache scoring fragsplit genomicdist"

# Or a subset
cargo install gtars-cli --features "uniwig igd"

Available CLI subcommands: igd, overlaprs, uniwig, bbcache, pb (fragment pseudobulking), scoring, genomicdist, ranges, consensus, prep. Flag sets differ per subcommand and evolve across versions — always confirm with gtars <command> --help.

Core Capabilities

Gtars is organized into specialized modules, each focused on specific genomic analysis tasks:

1. Overlap Detection and Set Operations

Detect overlaps and compute set operations / similarity between region sets with RegionSet (Python), or index a large interval database with IGD (CLI).

When to use:

  • Finding overlapping regulatory elements, comparing ChIP-seq peaks
  • Variant annotation; identifying shared genomic features
  • Jaccard / overlap-coefficient similarity between BED files

Quick example (Python):

python
from gtars.models import RegionSet

peaks = RegionSet("chip_peaks.bed")
promoters = RegionSet("promoters.bed")

# Regions in peaks that overlap a promoter (the real method is subset_by_overlaps)
in_promoters = peaks.subset_by_overlaps(promoters)
in_promoters.to_bed("peaks_in_promoters.bed")

print(peaks.count_overlaps(promoters))  # per-region overlap counts
print(peaks.jaccard(promoters))         # similarity score

For querying a large reference database many times, build an IGD index once via the CLI (gtars igd create ...) and search it (gtars igd search ...). See references/overlap.md.

2. Coverage / Accumulation Tracks (uniwig, CLI)

Generate coverage / accumulation tracks from a BED or BAM file with the uniwig CLI subcommand.

When to use:

  • ATAC-seq accessibility profiles, ChIP-seq coverage, RNA-seq read coverage

Quick example (CLI):

bash
# uniwig reads a sorted BED/BAM and writes accumulation tracks.
# Flags differ by version; confirm with `gtars uniwig --help`.
gtars uniwig --file fragments.bed --filetype bed \
             --fileheader coverage --outputtype bw

See references/coverage.md for verified flags and RegionSet.coverage() for an in-memory alternative.

3. Genomic Tokenization

Convert genomic regions into discrete tokens for ML (the preprocessing layer geniml builds on).

When to use:

  • Preprocessing peaks/regions into a fixed vocabulary for genomic ML models
  • Feeding token IDs to geniml or custom transformer models

Quick example (Python):

python
from gtars.tokenizers import Tokenizer
from gtars.models import Region

tokenizer = Tokenizer.from_bed("universe.bed")   # vocab = the universe BED
tokens = tokenizer.tokenize([Region("chr1", 1000, 2000, None)])  # -> ['chr1:1000-2000']
ids = tokenizer.convert_tokens_to_ids(tokens)                     # -> [<int>]

See references/tokenizers.md. Note: the class is Tokenizer (there is no TreeTokenizer).

4. Reference Sequence Management (refget)

Compute GA4GH refget digests and manage/retrieve reference sequences.

When to use:

  • Validating reference genome integrity via sequence digests
  • Building a local sequence-collection store and extracting subsequences

Quick example (Python):

python
from gtars import refget

# Digest a FASTA into a GA4GH SequenceCollection (no sequence data loaded)
collection = refget.digest_fasta("hg38.fa")

# Or a one-off sequence digest
d = refget.sha512t24u_digest("ACGTACGT")   # 'GS_...'-style truncated SHA-512/24

See references/refget.md for RefgetStore (load, store, and get_substring).

5. Fragment Pseudobulking (pb, CLI)

Split a single-cell fragment file into pseudobulks based on a cluster/cell-group mapping.

When to use:

  • Processing single-cell ATAC-seq; cluster-based fragment aggregation

Quick example (CLI):

bash
# The fragsplit feature exposes the `pb` (pseudobulk) subcommand.
gtars pb --fragments fragments.bed.gz --mapping cluster_mapping.tsv

The Python side also offers gtars.tokenizers.tokenize_fragment_file(...) for tokenizing fragments directly. See references/cli.md.

6. Fragment / Region Scoring

Score region/fragment files against reference datasets with the scoring CLI subcommand.

When to use:

  • Evaluating enrichment of regions against a reference universe
  • Batch quality-metric computation across samples
bash
gtars scoring --help   # confirm subcommands and flags for your installed version

Common Workflows

Workflow 1: Peak Overlap Analysis

Identify peaks overlapping promoters (Python):

python
from gtars.models import RegionSet

peaks = RegionSet("chip_peaks.bed")
promoters = RegionSet("promoters.bed")

overlapping_peaks = peaks.subset_by_overlaps(promoters)
overlapping_peaks.to_bed("peaks_in_promoters.bed")

# Iterate results (regions expose .chr/.start/.end)
for r in overlapping_peaks:
    print(r.chr, r.start, r.end)

Workflow 2: IGD index + repeated overlap queries (CLI)

Index a large reference database once, then search it many times:

bash
# Build the IGD database from a directory or list of BED files
gtars igd create --help     # confirm the exact input/output flags for your version

# Search the database with query regions
gtars igd search --help

Workflow 3: ML Preprocessing (tokenization)

Prepare genomic regions for an ML model:

python
from gtars.tokenizers import Tokenizer
from gtars.models import RegionSet

# Step 1: Build a tokenizer from the universe BED (defines the vocabulary)
tokenizer = Tokenizer.from_bed("universe.bed")

# Step 2: Tokenize a region set (tokenize accepts a RegionSet or a list of Region)
regions = RegionSet("training_peaks.bed")
tokens = tokenizer.tokenize(regions)                      # list of 'chr:start-end' strings
ids = tokenizer.convert_tokens_to_ids(tokens)             # integer IDs for the model

# Step 3: feed `ids` to geniml or a custom model (see alterlab-geniml for training)

Python vs CLI Usage

Use Python API when:

  • Integrating with analysis pipelines
  • Need programmatic control
  • Working with NumPy/Pandas
  • Building custom workflows

Use CLI when:

  • Quick one-off analyses
  • Shell scripting
  • Batch processing files
  • Prototyping workflows

Reference Documentation

  • references/python-api.md — RegionSet / Region operations, set ops, overlaps, export
  • references/overlap.md — overlap detection and IGD indexing
  • references/coverage.md — uniwig coverage tracks
  • references/tokenizers.md — region tokenization for ML
  • references/refget.md — refget digests and RefgetStore
  • references/cli.md — CLI subcommand overview

Relationship to geniml

gtars is the Rust performance backend for geniml (databio's ML-on-genomic-intervals library). Use gtars for the heavy interval ops and tokenization; use geniml (skill alterlab-geniml) for embedding/model training built on top of those tokens.

Data Formats

  • BED: genomic intervals (3-column or extended) — the core input
  • BigWig / WIG: coverage / accumulation tracks (uniwig output)
  • FASTA: reference sequences (refget)
  • Fragment files: single-cell fragments (often .bed.gz), with a separate cluster-mapping file for pb

Verifying the API

This package's surface differs between releases and the Python and CLI APIs are NOT mirror images. Before relying on an unfamiliar method or flag, confirm against the installed version:

bash
uv run python -c "from gtars import models, tokenizers, refget; print(dir(models), dir(tokenizers), dir(refget))"
gtars <command> --help

Archivos incluidos

El modelo los lee según los necesita mientras la habilidad está cargada. Son archivos de solo lectura y nunca se ejecutan.

Preguntas frecuentes

¿Qué hace la habilidad de IA Alterlab Gtars?

Runs high-performance genomic interval analysis with gtars (databio), a Rust toolkit with Python bindings — the performance-critical backend for the geniml ML library. Use when computing overlaps/jaccard/coverage between BED region sets, indexing intervals with IGD, generating uniwig accumulation/coverage tracks, tokenizing genomic regions for ML, splitting single-cell fragments into pseudobulks, or computing GA4GH refget sequence digests. NOT for training region embeddings (use alterlab-geniml) or non-genomic spatial joins (use alterlab-geopandas). Part of the AlterLab Academic Skills suite.

¿Por qué usar Alterlab Gtars en TypingMind?

Porque la instalas una vez y la usas con cualquier modelo. Alterlab Gtars está escrita en Markdown, no en código específico de un proveedor, por lo que la misma habilidad funciona con GPT-5, Claude, Gemini, Grok o un modelo local, y puedes cambiar de modelo en mitad del chat sin que deje de funcionar. TypingMind utiliza tus propias claves API, de modo que pagas directamente a los proveedores en lugar de pagar una suscripción por puesto, y tus habilidades y chats permanecen en tu propio almacenamiento.

¿Cómo instalo Alterlab Gtars en TypingMind?

Abre Plugins → Habilidades → Instalar desde GitHub en TypingMind y pega https://github.com/NVlabs/Skill2Env/tree/main/SkillHub/skills/alterlab-gtars. TypingMind lee el archivo SKILL.md de esa carpeta, empaqueta los archivos de la carpeta e instala el conjunto como una habilidad que puedes activar en cada chat.

¿Qué modelos de IA pueden usar Alterlab Gtars?

Cualquier modelo que conectes en TypingMind. Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que GPT, Claude, Gemini, Grok y los modelos locales pueden cargar esta habilidad cuando una solicitud se corresponda con ella.

¿Con cuántos modelos de IA puedo usar Alterlab Gtars?

Con tantos como quieras. Siempre que un modelo admita habilidades, puedes usar Alterlab Gtars con él: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama y muchos más, todos en TypingMind con tus propias claves API.

¿Es gratuita la habilidad de IA Alterlab Gtars?

Sí. NVlabs la ha publicado en GitHub bajo la licencia MIT. Solo pagas a tu proveedor de IA por los tokens que utilizas.

¿Qué son las habilidades de IA?

Una habilidad de IA es un conjunto de instrucciones reutilizables que enseña a un modelo de IA a realizar una tarea concreta. Sigue el formato abierto Agent Skills: un archivo SKILL.md con un nombre y una descripción, además de los scripts, plantillas o archivos de referencia que pueda necesitar el modelo. El modelo solo lee las instrucciones cuando tu solicitud se corresponde con la habilidad, por lo que una habilidad instalada no supone ningún coste hasta que se utiliza.

¿En qué se diferencian las habilidades de IA de los plugins o los servidores MCP?

Un plugin o un servidor MCP proporciona al modelo nuevas herramientas que puede invocar: código que se ejecuta en algún lugar y devuelve un resultado. En cambio, una habilidad de IA aporta conocimientos y procedimientos al modelo: cómo abordar una tarea, qué pasos seguir y qué se considera un buen resultado. Las habilidades son instrucciones en Markdown, por lo que no necesitan servidor, clave API ni entorno de ejecución, y funcionan con cualquier modelo.

Ver el directorio

Crea ya tu propio espacio de trabajo con IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇