Skip to content

Samovar database

Daniil Smutin edited this page Aug 26, 2026 · 2 revisions

SAMOVAR database

Install-level processed genome library plus the catalog in the main config (build/config_path). Btw, annotator indexes (Kaiju, Kraken2, …) live under databases and are a different thing.

Default after ./install.sh: {repo}/genomes. Override:

SAMOVAR_DATABASE=/mnt/tank/scratch/partition-metagenomics/databases/samovar/genomes ./install.sh

Layout:

$SAMOVAR_DATABASE/
  processed/   # what SamovaR uses  ({accession}.fa.gz)
  raw/         # only if --raw-genomes 1

On-disk names after NCBI parse: {GCF_… or GCA_…}.fa.gz. ISS generate, tables→ISS, and metagenome generate look up that name (plus legacy *-processed.fasta.gz).

Catalog (genomes.data):

"taxID": ["species_level_taxID", "genome_ID", "database", "file_name"]

database is a folder id (samovar_database, test, …) pointing at genomes.processed.

Download / reuse

Before NCBI, generate/fetch checks the catalog, then {accession}.fa.gz already on disk (store or $out/.genomes/processed). Hit → no download; file is hardlinked/copied into the run folder.

--raw-genomes default 0: genomic .fna.gz is deleted after parse.

samovar generate --reindex New files Catalog
0 (default) $out/.genomes/processed not updated
1 $SAMOVAR_DATABASE/processed + staged into $out/.genomes updated
2 $out/.genomes/processed updated in place

Already-indexed accessions are not re-fetched; they are reused from the store.

Index / reindex

Config is always the file in build/config_path. Only processed/ trees are moved (genomes/processed, .genomes/processed). Raw, reports, DBs are untouched. Empty processed/ → error.

samovar reindex                         # indexed files not yet in the default store
samovar reindex RUN_DIR [RUN_DIR ...]   # harvest processed/ under each dir
samovar reindex --dest /other/processed
samovar prepare --index DIR [DIR ...]   # index in place (no move to the store)
samovar build --type kaiju --index NAME --flags "..."   # annotator DB row, not genomes

prepare --index records FASTAs under those folders. build --index writes databases.<tool> = [name, path, flags] for later samovar prepare --kaiju-test "kaiju NAME".

Conflicts

Case What happens
reindex / index: same genome_ID (same {accession}.fa.gz) already in dest Destination file is replaced; catalog row for that accession is replaced. Identical inode (hardlink already in the store) is skipped.
Two assemblies, one taxID Disk keeps both {acc}.fa.gz. The catalog is one row per taxID: the last indexed assembly wins (previous taxID row dropped). Lookup by the other accession still finds a file only if a row still points at it.
Same accession already in the catalog Download is skipped; run uses the indexed path.
Generate --reindex 0 after --reindex 1 Indexes are not rewritten; only missing accessions are downloaded into $out/.genomes.

Clone this wiki locally