K-Dense-AI/scientific-agent-skills/skills/gtars/SKILL.md
gtars
Use Gtars for local genomic interval models and set algebra, overlaps and counts, consensus and coverage, tokenization, fragment processing, and refget/BEDbase planning across Python, Rust, and the CLI.
- Source repository stars
- 31,966
- Declared platforms
- 0
- Static risk flags
- 1
- Last source update
- 2026-07-28
- Source checked
- 2026-07-28
Decision brief
What it does—and where it fits
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…
Not for
- Tasks that require unconfirmed production actions or broad system permissions.
- Environments where the pinned source and install steps cannot be inspected.
Compatibility matrix
Platform support, with evidence labels
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
Inspect first. Install second.
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/K-Dense-AI/scientific-agent-skills --skill "skills/gtars"Inspect the Agent Skill "gtars" from https://github.com/K-Dense-AI/scientific-agent-skills/blob/e7ac42510774624f327003c95b6650e2883bc01d/skills/gtars/SKILL.md at commit e7ac42510774624f327003c95b6650e2883bc01d. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
What the source asks the agent to do
- 01
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 surfa…
Inventory local files, checksums, assembly, contig dictionary, coordinateValidate BED/fragments and estimate work. Pilot a small synthetic file.Choose Python, CLI, or Rust from the documented surface; do not translate API - 02
Verified snapshot (2026-07-23)
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.
Python: gtars==0.9.2, releasedRust meta-crate: gtars=0.9.0, releasedCLI crate/binary: gtars-cli=0.9.0; - 03
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:
Confirm the official PyPI/crates.io/GitHub owner and immutable version.Review filenames, platform tags, release provenance, license, and SHA-256.Never run an untrusted prebuilt binary, wheel, source tree, Cargo build script, - 04
Genomic data contract
Apply this contract before every operation:
Coordinates: BED intervals are 0-based and half-open: [start, end).Assembly: record an assembly accession/version and the SHA-256 of the exactContigs: compare names exactly. 1 and chr1, alternate loci, decoys, and - 05
Current Python core
Imports are from submodules, not the gtars top level:
Imports are from submodules, not the gtars top level:RegionSet.sort() mutates and returns None. Set algebra includes reduce, setdiff, pintersect (pairs by index), concat, union, jaccard, coverage, overlapcoefficient, intersectall, closest, cluster, and gaps. Read referenc…Consensus is a Python binding in a different module:
Permission review
Static risk signals and limitations
Runs scripts
The documentation asks the agent to run terminal commands or scripts.
cargo install gtars-cli --version 0.9.0 --lockedRuns scripts
The documentation asks the agent to run terminal commands or scripts.
python3 -B scripts/bed_validator.py \Evidence record
Why each signal appears
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 91/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 31,966 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Provenance and original SKILL.md
- Repository
- K-Dense-AI/scientific-agent-skills
- Skill path
- skills/gtars/SKILL.md
- Commit
- e7ac42510774624f327003c95b6650e2883bc01d
- License
- MIT
- Collected
- 2026-07-28
- Default branch
- main
View the original SKILL.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, released 2026-06-17,Requires-Python >=3.10. - Rust meta-crate:
gtars=0.9.0, released 2026-06-15. Its default feature set is empty. - CLI crate/binary:
gtars-cli=0.9.0; the installed binary is namedgtars. - Direct refget crate:
gtars-refget=0.9.1, released 2026-06-17.gtars=0.9.0itself 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.0CLI/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:
- Confirm the official PyPI/crates.io/GitHub owner and immutable version.
- Review filenames, platform tags, release provenance, license, and SHA-256.
GitHub's v0.9.0 binary release includes per-archive
.sha256sidecars. - Never run an untrusted prebuilt binary, wheel, source tree, Cargo build script, or archive installer. Use isolation and CPU/RAM/disk/time limits.
- Keep a lockfile and artifact hashes with the analysis manifest.
After that review, create an isolated Python environment:
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:
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:
[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:
- Coordinates: BED intervals are 0-based and half-open:
[start, end). Require0 <= start < end <= contig_length. Gtars coordinates areu32, so reject values above4,294,967,295. - 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
chrprefixes. - Contigs: compare names exactly.
1andchr1, alternate loci, decoys, and mitochondrial aliases are not interchangeable. Rename or liftover only as a separately reviewed transformation. - 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. - Strand: BED6 uses
+,-, or..Region.restretains trailing BED fields, but a file-backed PythonRegionSetcurrently initializes its separatestrandsvector to*. Several set operations drop strand. Preserve and validate strand externally when it is scientifically meaningful. - 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:
python3 -B scripts/bed_validator.py \
--input data.bed.gz \
--assembly GRCh38.p14 \
--chrom-sizes GRCh38.p14.chrom.sizes \
--require-sorted
Safe local workflow
- Inventory local files, checksums, assembly, contig dictionary, coordinate system, strand policy, patient/replicate groups, and intended outputs.
- Validate BED/fragments and estimate work. Pilot a small synthetic file.
- Choose Python, CLI, or Rust from the documented surface; do not translate API names by guesswork.
- Set hard limits for input bytes/records/files, threads/jobs, memory, temporary disk, output size, and wall time.
- Run in a dedicated output directory. Refuse collisions unless overwrite was explicitly approved.
- Revalidate output sorting, bounds, row counts, checksums, and provenance.
Current Python core
Imports are from submodules, not the gtars top level:
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 intersection fragments
fraction = query.coverage(universe) # fraction of query bp covered
RegionSet.sort() mutates and returns None. Set algebra includes reduce,
setdiff, pintersect (pairs by index), concat, union, jaccard,
coverage, overlap_coefficient, intersect_all, closest, cluster, and
gaps. Read references/python-api.md before relying on ordering or strand.
Consensus is a Python binding in a different module:
from gtars.genomic_distributions import consensus
rows = consensus([query, universe])
# rows: [{"chr": ..., "start": ..., "end": ..., "count": ...}, ...]
Signal-track generation is not exposed as gtars.uniwig in Python 0.9.2;
use the reviewed CLI or Rust API. RegionSet.coverage() is a base-pair set metric,
not a WIG/bigWig generator.
Tokenizers, fragments, and reference stores
Use only local constructors by default:
from gtars.models import RegionSet
from gtars.tokenizers import Tokenizer
tokenizer = Tokenizer.from_bed("reviewed-universe.bed")
regions = RegionSet("local-query.bed")
tokens = tokenizer.tokenize(regions)
encoding = tokenizer(regions)
ids = encoding["input_ids"]
Tokenizer.from_pretrained(name) contacts Hugging Face and writes its cache when
the argument is not an existing local directory; it exposes no revision or cache
argument. Obtain explicit approval, fetch an immutable revision through a reviewed
mechanism, verify checksums, then pass the local snapshot directory. See
references/tokenizers.md.
For refget, prefer RefgetStore.in_memory() or RefgetStore.open_local(path).
open_remote(cache_path, remote_url) contacts a remote service, creates/uses a
local cache, and performs on-demand range reads. See references/refget.md.
Network and cache gate
No download or cache write is implicit in this skill. Before any network-capable upstream call:
- obtain explicit user approval for the exact host, endpoint, data, and cache;
- allowlist HTTPS hosts and reject unreviewed redirects;
- record immutable revision/identifier, retrieval time, expected SHA-256 and domain digest, assembly accession, size quota, and provenance;
- disclose sensitive BED coordinates, barcodes, sample labels, and reference choices that could leave the approved environment;
- validate downloaded content as untrusted before using it.
Important side effects:
RegionSet(path)has HTTP support; a nonexistent local string may be treated as a URL. Check that the local path exists before construction.Tokenizer.from_pretrainedmay downloaduniverse.bed.gzinto the Hugging Face cache.RefgetStore.on_diskcreates/writes a store.open_remoteloads remote metadata and enables persistence by default.gtars bbcachecreates cache directories even when constructing the client. Cache/download commands useBBCLIENT_CACHE(default~/.bbcache) andBEDBASE_API(defaulthttps://api.bedbase.org).
Sensitive metadata and leakage
Genomic intervals, rare loci, barcodes, sample names, phenotypes, and assembly choices can be identifying. Keep full paths and raw coordinates out of logs; default bundled reports redact paths and emit only counts/checksums.
Freeze splits by patient/donor first, then keep all technical and biological replicates in the same split. Fit consensus sets, universes, tokenizers, scaling, thresholds, and QC rules on training data only. Do not create a universe from all samples and then split: that leaks validation/test locus support. Record excluded samples and replicate aggregation separately.
Bundled deterministic CLIs
All six helpers reject URLs, traversal, symlinks, and special files; apply byte, record, file, coordinate, and worker caps; use no network or gtars import; and write no output files. Plans contain fixed argv templates and never launch them.
python3 -B scripts/bed_validator.py --help
python3 -B scripts/execution_plan.py --help
python3 -B scripts/tokenizer_manifest.py --help
python3 -B scripts/refget_digest_plan.py --help
python3 -B scripts/coverage_preflight.py --help
python3 -B scripts/artifact_inspector.py --help
Run synthetic tests without bytecode:
PYTHONDONTWRITEBYTECODE=1 python3 -B -m unittest discover \
-s tests/gtars -p 'test_*.py' -v
Migration traps removed in 1.1
Do not use stale examples containing gtars.RegionSet,
RegionSet.from_bed, TreeTokenizer, gtars.igd.build_index,
gtars.uniwig.coverage_from_bed, gtars.RefgetStore, global
set_option/set_log_level, parallel_apply, or invented exception classes.
CLI forms such as uniwig generate, igd build, scoring score, and
fragsplit cluster-split are also stale for 0.9.0.
Upstream's published docs and stubs have some drift (for example the older
GlobalRefgetStore tutorial and incomplete 0.9.2 stubs). Prefer installed
signature smoke tests plus immutable tagged source when they conflict.
Bundled references
These are the only six bundled references; all links are local and present:
references/python-api.md— exact Python 0.9.2 imports and behaviorreferences/overlap.md— overlap/count/set algebra and consensus semanticsreferences/coverage.md— uniwig, bigWig, coverage, sorting, and resourcesreferences/tokenizers.md— tokenizer/universe and fragment compatibilityreferences/refget.md— digests, stores, BEDbase, network/cache controlsreferences/cli.md— CLI 0.9.0 commands, features, and migrations
Alternatives
Compare before choosing
K-Dense-AI/scientific-agent-skills
dask
Distributed computing for larger-than-RAM pandas/NumPy workflows. Use when you need to scale existing pandas/NumPy code beyond memory or across clusters. Best for parallel file processing, distributed ML, integration with existing pandas code. For out-of-core analytics on single machine use vaex; for in-memory speed use polars.
K-Dense-AI/scientific-agent-skills
medchem
Medicinal chemistry filters for compound triage. Apply drug-likeness rules (Lipinski, Veber, CNS), structural alert catalogs (PAINS, NIBR, ChEMBL), complexity metrics, and the medchem query language for library filtering.
K-Dense-AI/scientific-agent-skills
neurokit2
Use NeuroKit2 to build or audit reproducible research workflows for physiological time-series preprocessing, event/interval analysis, multimodal alignment, variability, and complexity. Trigger when code imports neurokit2 or needs its current APIs, schemas, and method-aware validation—not for diagnosis or device validation.
github/awesome-copilot
flowstudio-power-automate-mcp
Foundation skill for Power Automate via FlowStudio MCP — auth setup, the reusable MCP helper (Python + Node.js), tool discovery via `list_skills` / `tool_search`, and oversized-response handling. Load this skill first when connecting an agent to Power Automate. For specialized workflows, load `flowstudio-power-automate-build`, `flowstudio-power-automate-debug`, `flowstudio-power-automate-monitoring` (Pro+), or `flowstudio-power-automate-governance` (Pro+) — each contains the workflow narrative,