Skip to content

gside documentation

gside is a Python library and CLI for multi-layer microbial species identification from assemblies and sequencing reads. This documentation covers the public Python API, the gside command line, reference databases, identification modes, and the JSON contract. Metagenomic community profiling lives in the gmeta tool.

Start here

I want to… Read
Install gside and run a first sample Quick start
Call identification engines from Python Python API
Learn every CLI flag CLI reference
Understand marker/ANI/sketch/GTDB modes Identification modes
Prepare databases Databases
Use my own marker database Custom marker databases
Consume JSON output safely JSON output contract
Migrate an engine to gseek gseek migration

What gside does

assembled contigs ── marker / panel / mash / sourmash / GTDB-Tk ── verdict
FASTQ reads ──────── marker screening / mash / sourmash ───── species call
assembled contigs ── CheckM2 + GTDB-Tk ─────────────────────────── assembly QC

Two interfaces share the same engines:

  • Python library — gside.api exposes individual identification functions and typed results for notebooks, pipelines, and tests.
  • CLI — gside scan adds layered arbitration, database provisioning, batch execution, table/JSON output, and an MCP server.

Installation at a glance

pip install gside          # Python 3.12; bundled marker DB
pixi install               # dev environment with all external tools

External tools such as blastn, skani, mash, sourmash, and GTDB-Tk are installed separately. Community (metagenomic) profiling lives in the gmeta tool. See Quick start and Databases.

Library example

from gside.api import identify_by_ani, identify_multigene

marker = identify_multigene("contigs.fna", threads=4)
panel = identify_by_ani("contigs.fna", mode="panel", threads=8)

print(marker.species, marker.confidence)
print(panel.to_dict()["result"]["species"])

The full function/result table is in the Python API.

CLI example

gside -V
gside scan contigs.fna -m all --auto-setup
gmeta run reads_R1.fq reads_R2.fq --samples manifest.tsv -m kraken2
gside validate contigs.fna -o qc/
gside db status
gside db list

gside db status and gside db list render bordered Rich tables in a terminal. Use -f json, -f tsv, or -f csv when another program will read them.

Design principles

  • Rules over ad-hoc thresholds. Marker combinations, ANI confidence bands, and layer arbitration are data-driven and testable.
  • One structured result. Every method emits a JSON envelope; the CLI adds consensus without discarding per-method evidence.
  • Fail clearly. Missing tools/databases produce actionable errors, including a suggested setup command and estimated download size.
  • Reproducible by default. Database versions, tool versions, and method parameters are recorded in results.
  • gseek by default. Marker BLAST, read screening, mash, sourmash, and panel/skani run through gseek; GSIDE_ENGINE=legacy|shadow is kept for debugging and parity checks.

Project layout

src/gside/
  api.py                 public Python facade
  cli.py                 Click CLI
  analysis/              identification engines
  engine/                backends + gseek bridge
  db.py                  database tiers and downloads
  mcp.py                 MCP server
docs/                    English/Chinese documentation
data/db/D1_marker/       bundled marker database
tests/                   unit and parity tests

License

MIT. See README for the project overview and ecosystem links.