gtars
Gtars is a high-performance Rust toolkit with Python bindings for genomic interval analysis, offering specialized functionality for overlap detection, coverage track generation, tokenization for machine learning models, and reference sequence management. Use it when processing BED files, analyzing genomic regions, detecting overlaps between intervals, generating coverage tracks from sequencing data, or preparing genomic data for computational analysis and machine learning applications.
git clone --depth 1 https://github.com/K-Dense-AI/scientific-agent-skills /tmp/gtars && cp -r /tmp/gtars/skills/gtars ~/.claude/skills/gtarsSKILL.md
# Gtars
Gtars provides native Rust implementations, Python bindings, and a feature-gated
`gtars` binary for genomic interval and reference-sequence work. Start with the
bundled local inspectors; call upstream code only after the data contract,
provenance, resource bounds, and side effects are explicit.
## Verified snapshot (2026-07-23)
- Python: [`gtars==0.9.2`](https://pypi.org/project/gtars/), released
2026-06-17, `Requires-Python >=3.10`.
- Rust meta-crate: [`gtars=0.9.0`](https://crates.io/crates/gtars), released
2026-06-15. Its default feature set is empty.
- CLI crate/binary: [`gtars-cli=0.9.0`](https://crates.io/crates/gtars-cli);
the installed binary is named `gtars`.
- Direct refget crate: [`gtars-refget=0.9.1`](https://crates.io/crates/gtars-refget),
released 2026-06-17. `gtars=0.9.0` itself pins its component release set, which
includes refget 0.9.0.
- Upstream intentionally versions workspace crates, Python bindings, and CLI
independently. Do not assume matching numbers mean matching artifacts.
- The published docs changelog stops at 0.5.1. API examples here were checked
against the 0.9.2 Python stubs/runtime and the `v0.9.0` CLI/Rust source.
The `license: MIT` field covers this skill. Published `gtars` crates declare MIT,
while the GitHub repository currently displays BSD-2-Clause at the root; verify
the exact artifact's license before redistribution.
## Native-code trust gate and exact pins
The Python wheel contains a PyO3 native extension. Cargo installation compiles a
native binary and can run dependency build scripts. Treat either path as code
execution:
1. Confirm the official PyPI/crates.io/GitHub owner and immutable version.
2. Review filenames, platform tags, release provenance, license, and SHA-256.
GitHub's v0.9.0 binary release includes per-archive `.sha256` sidecars.
3. Never run an untrusted prebuilt binary, wheel, source tree, Cargo build script,
or archive installer. Use isolation and CPU/RAM/disk/time limits.
4. Keep a lockfile and artifact hashes with the analysis manifest.
After that review, create an isolated Python environment:
```bash
uv venv --python 3.11 .venv-gtars
uv pip install --dry-run --python .venv-gtars/bin/python "gtars==0.9.2"
uv pip install --python .venv-gtars/bin/python "gtars==0.9.2"
.venv-gtars/bin/python -c \
"import gtars; assert gtars.__version__ == '0.9.2'; print(gtars.__version__)"
```
For the reviewed CLI source release:
```bash
cargo install gtars-cli --version 0.9.0 --locked
gtars --version
gtars --help
```
For a Rust project, pin the wrapper exactly and enable only required features:
```toml
[dependencies]
gtars = { version = "=0.9.0", default-features = false, features = [
"core", "overlaprs", "uniwig", "tokenizers", "refget"
] }
```
Use `gtars-refget = "=0.9.1"` directly only when the newer direct component API is
required and compatibility has been tested. Do not replace these pins with a Git
branch or an unreviewed release.
## Genomic data contract
Apply this contract before every operation:
1. **Coordinates:** BED intervals are 0-based and half-open: `[start, end)`.
Require `0 <= start < end <= contig_length`. Gtars coordinates are `u32`, so
reject values above `4,294,967,295`.
2. **Assembly:** record an assembly accession/version and the SHA-256 of the exact
chromosome-sizes or refget sequence-collection metadata. Never infer assembly
from filenames or `chr` prefixes.
3. **Contigs:** compare names exactly. `1` and `chr1`, alternate loci, decoys, and
mitochondrial aliases are not interchangeable. Rename or liftover only as a
separately reviewed transformation.
4. **Sorting:** preserve the original file, then sort a copy by chromosome-sizes
order and numeric start/end when the operation requires it. Python
`RegionSet(path)` currently sorts lexicographically by contig and start while
loading; do not rely on original row order afterward.
5. **Strand:** BED6 uses `+`, `-`, or `.`. `Region.rest` retains trailing BED
fields, but a file-backed Python `RegionSet` currently initializes its separate
`strands` vector to `*`. Several set operations drop strand. Preserve and
validate strand externally when it is scientifically meaningful.
6. **Duplicates/adjacency:** choose policies explicitly. `reduce()` and consensus
merge overlapping **and adjacent** intervals; ordinary half-open overlap does
not treat `[0,10)` and `[10,20)` as overlapping.
Run the local validator first:
```bash
python3 -B scripts/bed_validator.py \
--input data.bed.gz \
--assembly GRCh38.p14 \
--chrom-sizes GRCh38.p14.chrom.sizes \
--require-sorted
```
## Safe local workflow
1. Inventory local files, checksums, assembly, contig dictionary, coordinate
system, strand policy, patient/replicate groups, and intended outputs.
2. Validate BED/fragments and estimate work. Pilot a small synthetic file.
3. Choose Python, CLI, or Rust from the documented surface; do not translate API
names by guesswork.
4. Set hard limits for input bytes/records/files, threads/jobs, memory, temporary
disk, output size, and wall time.
5. Run in a dedicated output directory. Refuse collisions unless overwrite was
explicitly approved.
6. Revalidate output sorting, bounds, row counts, checksums, and provenance.
## Current Python core
Imports are from submodules, not the `gtars` top level:
```python
from gtars.models import Region, RegionSet
query = RegionSet.from_regions(
[
Region(chr="chr1", start=100, end=200, rest=None),
Region(chr="chr1", start=300, end=400, rest=None),
],
strands=["+", "-"],
)
universe = RegionSet.from_vectors(
["chr1", "chr1"],
[150, 500],
[350, 600],
)
counts = query.count_overlaps(universe) # one count per query region
flags = query.any_overlaps(universe) # one bool per query region
indices = query.find_overlaps(universe) # indices into universe
pieces = query.intersect_all(universe) # all interHow to use the Adaptyv Bio Foundry API and Python SDK for protein experiment design, submission, and results retrieval. Use this skill whenever the user mentions Adaptyv, Foundry API, protein binding assays, protein screening experiments, BLI/SPR assays, thermostability assays, or wants to submit protein sequences for experimental characterization. Also trigger when code imports `adaptyv`, `adaptyv_sdk`, or `FoundryClient`, or references `foundry-api-public.adaptyvbio.com`.
This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations requiring specialized algorithms beyond standard ML approaches. Particularly suited for univariate and multivariate time series analysis with scikit-learn compatible APIs.
Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.
Infer gene regulatory networks (GRNs) from gene expression data using scalable algorithms (GRNBoost2, GENIE3). Use when analyzing transcriptomics data (bulk RNA-seq, single-cell RNA-seq) to identify transcription factor-target gene relationships and regulatory interactions. Supports distributed computation for large-scale datasets.
Core Python library for astronomy and astrophysics workflows that need Astropy APIs, including units/quantities, coordinates, FITS I/O, tables, time systems, WCS, and cosmology. Use when implementing or debugging astronomical data analysis code with Astropy.
Observe the user's screen via screenpipe, detect repeated research workflows, match them against existing scientific-agent-skills, and draft new skills (or composition recipes that chain existing ones) for the patterns not yet covered. Use when the user asks to analyze their recent work and propose skills based on what they actually do. Requires the screenpipe daemon (https://github.com/screenpipe/screenpipe) running locally on port 3030 — the skill has no other data source and will refuse to run if screenpipe is unreachable. All detection runs locally; only redacted cluster summaries reach the LLM.
Benchling Python SDK and REST API integration for registry entities, inventory, ELN entries, workflows, Benchling Apps, and Data Warehouse queries. Use when automating lab data with benchling-sdk or the v2 API.
Search scientific papers and retrieve structured experimental data extracted from full-text studies via the BGPT MCP server. Returns 25+ fields per paper including methods, results, sample sizes, quality scores, and conclusions. Use for literature reviews, evidence synthesis, and finding experimental details not available in abstracts alone.