Skip to content

Database Management

gside reference databases are managed via the gside db subcommand with tiered installation.

Database Tiers

Tier Contents Size Purpose
mini marker_rules.yaml + markers.fasta + BLAST db ~1MB Target gene identification (L1)
panel D2_ani (291 genomes, skani sketch) ~130MB ANI identification (L2)
mash D3_mash (RefSeq MinHash sketch) ~179MB Distance identification (L2)
sourmash D4_sourmash (GTDB reps k=31 + lineages) ~3.9GB Gather classification (sourmash)
all panel + mash ~310MB Full capability (excludes sourmash)

Directory naming

data/db/ directories are named per identification layer:

Old name New name Method
refseq_panel D2_ani panel (skani ANI)
mash_refseq D3_mash mash_refseq (MinHash)
sourmash_gtdb D4_sourmash sourmash (GTDB gather)

Migrate an existing checkout with:

mv data/db/refseq_panel data/db/D2_ani
mv data/db/mash_refseq data/db/D3_mash
mkdir -p data/db/D4_sourmash

Note: the prebuilt GitHub Release archive still contains the inner panel.sketch/ directory unchanged, so download-and-extract works as before.

Commands

Check status

gside db status
Database root: ~/.local/share/gside/db (source: xdg)

                gside databases                 
┌──────────┬──────────┬──────────┬─────────────┬────────────────────────────────┐
│ MODE     │ DATABASE │ READY    │ INPUTS      │ PATH                           │
├──────────┼──────────┼──────────┼─────────────┼────────────────────────────────┤
│ marker   │ default  │ ready    │ FASTA/FASTQ │ …/data/db/D1_marker/default    │
│ marker   │ cpin     │ ready    │ FASTA/FASTQ │ …/data/db/D1_marker/cpin       │
│ ani      │ default  │ missing  │ FASTA       │ …/data/db/D2_ani/default       │
│ mash     │ default  │ missing  │ FASTA/FASTQ │ …/data/db/D3_mash/default      │
│ sourmash │ default  │ missing  │ FASTA/FASTQ │ …/data/db/D4_sourmash/default  │
└──────────┴──────────┴──────────┴─────────────┴────────────────────────────────┘

db status prepends the effective database root and its source (env/repo/xdg); gside db list prints the same table without the root line. --format json adds root/root_source keys to the payload.

Install / update

gside db setup --tier panel          # Panel only (ANI), the default tier
gside db setup --tier mash           # MinHash only
gside db setup --tier sourmash       # GTDB gather db (~3.9GB)
gside db setup --tier all            # panel + mash (excludes sourmash)

With no --tier given, setup defaults to panel. Panel tries a pre-built sketch from the GitHub release first and falls back to building from the bundled manifest (downloading genomes from NCBI). The mash sketch is downloaded from Zenodo and MD5-verified. Setup returns a non-zero exit code if any step reports an error.

--tier all installs panel + mash only. The sourmash GTDB database (~3.9GB) is never included in all; run gside db setup --tier sourmash separately to provision it.

Metagenomic databases are no longer gside tiers — community profiling moved to the gmeta tool. --source still copies an existing local database directory instead of downloading.

Integrity checks

gside db setup verifies digests for everything it can pin:

Tier Digest Notes
panel SHA256 (PANEL_SHA256) GitHub release asset
mash MD5 (MASH_MD5) Zenodo publishes MD5 only
sourmash SHA256 for lineages + signature (SOURMASH_SIG_SHA256) signature pinned from a verified download

The sourmash signature zip (~3.9GB) has no upstream digest. gside pins one recorded after a locally verified download (complete size, zip integrity, 143,385 k=31 DNA signatures, CC0):

SOURMASH_SIG_SHA256 = 6f3cc74f0bdcf6f84466ba91f87d6f2bf30081d5814bdf006cafd1e9cbbeada9

Override it at setup time if you mirror a different build:

export GSIDE_SOURMASH_SIG_SHA256=<sha256-of-your-zip>
gside db setup --tier sourmash

Copy from an existing local database directory

If you already have the databases on disk (for example from another machine or a previous checkout), skip the download and copy them directly:

gside db setup --tier all --source /path/to/existing/data/db

List available tiers

gside db list

Genome quality databases

gside validate needs two external databases that are not db setup tiers: CheckM2 (completeness/contamination) and GTDB-Tk (classification). They are large, version-coupled and GTDB-Tk is memory-hungry, so gside deliberately leaves them to the official installers.

Database Download On disk Runtime Env var
CheckM2 (v1.1.0) ~1.7GB ~3GB modest (DIAMOND) CHECKM2DB → .../uniref100.KO.1.dmnd
GTDB-Tk R232 ~57GB ~98GB ~140GB RAM (bacteria) GTDBTK_DATA_PATH → DB directory

CheckM2

pixi add checkm2          # or: conda install -c bioconda checkm2
checkm2 database --download --path /path/to/D7_checkm2
export CHECKM2DB=$(find /path/to/D7_checkm2 -name uniref100.KO.1.dmnd | head -1)

Manual fallback (no CheckM2 binary needed):

mkdir -p /path/to/D7_checkm2
wget -c https://zenodo.org/records/14897628/files/checkm2_database.tar.gz
md5sum checkm2_database.tar.gz    # 07c10655620843b517d0df0c160d911f
tar xzf checkm2_database.tar.gz -C /path/to/D7_checkm2
export CHECKM2DB=$(find /path/to/D7_checkm2 -name uniref100.KO.1.dmnd | head -1)

The database must be compatible with the installed CheckM2 version; prefer checkm2 database --download, which selects the matching release.

GTDB-Tk

pixi add gtdbtk
download-db.sh /path/to/D8_gtdbtk    # official script; target dir must be empty
export GTDBTK_DATA_PATH=/path/to/D8_gtdbtk

Manual fallback:

mkdir -p /path/to/D8_gtdbtk
wget -c https://data.gtdb.ecogenomic.org/releases/latest/auxillary_files/gtdbtk_package/full_package/gtdbtk_data.tar.gz
md5sum gtdbtk_data.tar.gz            # R232: 25a59e0352b1fd150c589f56559767d4
tar xvzf gtdbtk_data.tar.gz -C /path/to/D8_gtdbtk --strip 1
export GTDBTK_DATA_PATH=/path/to/D8_gtdbtk
Release GTDB-Tk version MD5
R232 ≥ 2.7.0 25a59e0352b1fd150c589f56559767d4
R226 2.4.1 – 2.6.1 24b476ea5a4ef30519d461e56cc4a27f

Hardware: ~140GB RAM for bacteria (~100GB archaea) and ~98GB disk for R232. On smaller machines validate records GTDB-Tk as missing, writes the CheckM2 results anyway and reports status: partial (exit 1).

What gside reports

gside db status covers the db setup tiers only. gside validate reads the two environment variables above and records per-tool status in validation.json (tools.checkm2, tools.gtdbtk, errors). Exit code is 0 only when both tools ran.

Database Paths

The database root resolves in this order (first hit wins):

Priority Source Path
1 GSIDE_DB_DIR the value itself
2 GSIDE_DATA_DIR $GSIDE_DATA_DIR/db
3 Source checkout <repo>/data/db
4 XDG data home $XDG_DATA_HOME/gside/db, else ~/.local/share/gside/db

This follows the gspec datadir convention: pip-installed users get databases under their XDG data home (created automatically by gside db setup, mode 0o700), while a source checkout keeps using the repo's data/db so development workflows and already-provisioned large databases keep working. A relative or empty $XDG_DATA_HOME is ignored per the XDG Base Directory specification.

The wheel bundles the marker tier (D1_marker/default + D1_marker/cpin) as a seed: on a fresh install it is copied into the database root on first use, so gside scan -m marker works before any gside db setup.

gside db status reports the effective root and where it came from (env/repo/xdg/custom) — JSON as root/root_source, table as a Database root: line; gside db list keeps the plain database view.

Variable Default Description
GSIDE_DB_DIR (see order above) Database root override (wins over everything)
GSIDE_DATA_DIR (see order above) Data dir override; root becomes <value>/db
XDG_DATA_HOME ~/.local/share XDG base dir for installed-package databases
GSIDE_PIXI_BIN Auto-detected Bioinformatics binary directory

Custom Marker Rules

Edit data/db/D1_marker/marker_rules.yaml:

- species: Mycobacterium_tuberculosis
  genes:
  - mpb64
  - is6110
  min_hits: 2
  min_identity: 90
  exclude_genes: [some_cross_reactive_gene]

Then rebuild the BLAST database:

cd data/db/D1_marker
makeblastdb -in markers.fasta -dbtype nucl -out markers_blastdb

No code changes required — rules are data.