Skip to content

Data Fetch

Wenyu (Eddy) Huang edited this page Jun 1, 2026 · 3 revisions

Data Fetch

The Zenodo record hosts the reference databases that the pipeline reads β€” the unified RefSeq-228 family plus the Ganon2 default index. Read datasets (mock + simulated reads) are not on Zenodo; fetch those from their original SRA accessions or upstream URLs (see Datasets). The other per-tool default databases are also not bundled β€” install each from the tool's own published index (default DBs (not bundled) below).

Prerequisite: curl, zstd β‰₯ 1.4, tar. See Installation.

What's on Zenodo

Bundle Contents Approx. size (compressed)
bakeoff_refdb_shared_metadata taxdump + ete3 sqlite + lineage / accession-to-taxid tables + audit lists. Required alongside any unified bundle. ~5 GB
bakeoff_refdb_unified_kraken2 Kraken2 unified index ~121 GB
bakeoff_refdb_unified_centrifuge Centrifuge unified index ~58 GB
bakeoff_refdb_unified_centrifuger Centrifuger unified index ~57 GB
bakeoff_refdb_unified_ganon2 Ganon2 unified index ~32 GB
bakeoff_refdb_unified_sourmash Sourmash unified sketches ~2 GB
bakeoff_refdb_unified_sylph Sylph unified sketches ~5 GB
bakeoff_refdb_default_ganon2 Ganon2 default index (the only default DB redistributed; sized + licence allow it) ~95 GB
bakeoff_refdb_default_metadata Taxonomy snapshots + sylph-tax metadata that the default-DB pipeline runs need but upstream default indexes don't include. Required alongside any --db default workflow that touches Centrifuge, Sourmash, or Sylph. ~500 MB

Each large bundle is split into 45 GB parts named <bundle>.tar.zst.part01, .part02, … and shipped with a <bundle>.manifest.txt listing the archive contents.

Pick a download set

You almost never need all of it. Pair the right bundles for what you want to do:

Goal Bundles to download
Reproduce unified-DB results for one tool T shared_metadata + unified_<T>
Reproduce default-DB Ganon2 results default_ganon2
Reproduce default-DB results for any other tool self-install the tool's index (Default DBs (not bundled)) + default_metadata for the matching taxonomy snapshot
Rebuild a unified index from scratch shared_metadata β€” then follow Database Build

shared_metadata is mandatory for every unified bundle; the unified indexes reference its taxdump and ete3 snapshot.

Reassemble and extract a bundle

The Zenodo files for one bundle (e.g. bakeoff_refdb_unified_kraken2) look like:

bakeoff_refdb_unified_kraken2.tar.zst.part01
bakeoff_refdb_unified_kraken2.tar.zst.part02
bakeoff_refdb_unified_kraken2.tar.zst.part03
bakeoff_refdb_unified_kraken2.manifest.txt        # inventory; optional

Concatenate the parts and pipe straight through zstd | tar into your bakeoff project root β€” no intermediate .tar.zst is materialised, so disk usage during extraction is just the unpacked DB:

PROJECT_ROOT=/path/to/bakeoff       # the dir containing data/ , scripts/ , …
cd "$PROJECT_ROOT"

cat bakeoff_refdb_unified_kraken2.tar.zst.part?? \
    | zstd -dc --long=27 \
    | tar -xf -

The leading cat *.part?? glob expands in lexicographic order, which matches the numeric partNN naming. Run from inside the project root so the relative archive paths (data/ref_db/…) land at the right place.

The archive paths are stored relative (data/ref_db/…), so a single pass restores the canonical layout the pipeline expects β€” no mv or symlinks needed.

For the smaller, un-split bundles (sourmash, sylph, shared_metadata), the .partNN glob still works because cat <onefile>.tar.zst just emits that one file:

cat bakeoff_refdb_unified_sourmash.tar.zst \
    | zstd -dc --long=27 \
    | tar -xf -

Integrity of each downloaded part is already covered by the MD5 Zenodo computes for every file on the record page β€” compare it against md5sum <part> if you want a per-part check before extraction. The pipe-through form above is enough for everyday use; nothing further is needed once tar -xf returns 0.

One post-extract step: expand the taxdump

shared_metadata ships the NCBI taxdump as a compressed tarball; the tools want it expanded into a taxdump/ subdir next to it:

mkdir -p data/ref_db/refseq03032025/taxdump
tar -C data/ref_db/refseq03032025/taxdump \
    -xzf data/ref_db/refseq03032025/taxdump0303.tar.gz

That's the only manual post-fetch step. Everything else is already in place.

Resulting file layout

After extracting all unified bundles plus shared_metadata, default_ganon2, and default_metadata, your tree under <PROJECT_ROOT>/data/ref_db/ looks like:

data/ref_db/
β”œβ”€β”€ database_build.md                                # ← shared_metadata
β”œβ”€β”€ RefSeq-release228.catalog.gz                     # ← shared_metadata
β”‚
β”œβ”€β”€ refseq03032025/                                  # the unified DB family
β”‚   β”œβ”€β”€ assembly_summary_refseq_augmented.txt        # ← shared_metadata
β”‚   β”œβ”€β”€ ete3_taxa/                                   # ← shared_metadata
β”‚   β”œβ”€β”€ file.list                                    # ← shared_metadata
β”‚   β”œβ”€β”€ nucl_gb.accession2taxid.gz                   # ← shared_metadata
β”‚   β”œβ”€β”€ nucl_wgs.accession2taxid.gz                  # ← shared_metadata
β”‚   β”œβ”€β”€ refseq03032025_dict.txt                      # ← shared_metadata
β”‚   β”œβ”€β”€ refseq_030325_lineage.tsv                    # ← shared_metadata
β”‚   β”œβ”€β”€ refseq_accessions_taxonomy.csv               # ← shared_metadata
β”‚   β”œβ”€β”€ seqid2taxid.map                              # ← shared_metadata
β”‚   β”œβ”€β”€ taxdump0303.tar.gz                           # ← shared_metadata (expand to taxdump/)
β”‚   β”œβ”€β”€ taxdump/                                     # ← created by the post-fetch tar -xzf above
β”‚   β”‚
β”‚   β”œβ”€β”€ k2_abfv_030325/                              # ← unified_kraken2
β”‚   β”œβ”€β”€ centrifuge_abv_030325/                       # ← unified_centrifuge
β”‚   β”œβ”€β”€ centrifuger_abv_030325/                      # ← unified_centrifuger
β”‚   β”œβ”€β”€ ganon2_abvf_030325/                          # ← unified_ganon2
β”‚   β”œβ”€β”€ sourmash_abvf_030325/                        # ← unified_sourmash
β”‚   └── sylph_abf_030325/                            # ← unified_sylph
β”‚
└── default_db/                                      # per-tool default DBs
    β”œβ”€β”€ ganon2_default/                              # ← default_ganon2 (only one bundled)
    β”‚
    β”œβ”€β”€ cf_default/
    β”‚   β”œβ”€β”€ ete3_taxa/                               # ← default_metadata (taxa122016 snapshot)
    β”‚   └── …index files…                            # ← self-install (Centrifuge)
    β”œβ”€β”€ sm_default/
    β”‚   β”œβ”€β”€ ete3_taxa/                               # ← default_metadata (taxa032022 snapshot)
    β”‚   └── …zip files…                              # ← self-install (Sourmash)
    β”œβ”€β”€ sylph_default/
    β”‚   β”œβ”€β”€ ete3_taxa/                               # ← default_metadata (taxaGTDB-r220 snapshot)
    β”‚   β”œβ”€β”€ taxa042024.sqlite{,.traverse.pkl}        # ← default_metadata
    β”‚   └── …syldb files…                            # ← self-install (Sylph)
    β”œβ”€β”€ sylph_tax/                                   # ← default_metadata (sylph-tax lineage metadata)
    β”‚
    β”œβ”€β”€ k2_default/                                  # ← self-install (Kraken2 default)
    └── cfer_default/                                # ← self-install (Centrifuger default)

Path-by-path mapping from bundles is also encoded in each bundle's <bundle>.manifest.txt β€” useful for a quick spot-check that extraction landed everything where it should.

Default DBs (not bundled)

Five of the six tools' default DBs aren't redistributed (size + licence concerns) β€” install each from the tool's own published index. Create the directory shells first; that way an unfinished partial install is obvious, and the pipeline's --db default runs report cleanly "missing index" rather than a confusing parser error:

cd "$PROJECT_ROOT"

mkdir -p data/ref_db/default_db/{k2_default,cf_default,cfer_default,sm_default,sylph_default,sylph_tax}

Then populate each from its upstream source. The version numbers in Tools and Databases are what the manuscript uses; match those if you want bit-for-bit reproducibility.

Tool / dir Source Notes
k2_default/ (Kraken2) https://benlangmead.github.io/aws-indexes/k2 β€” pick the k2_standard_* tarball Untar in place; the *.k2d files go directly under k2_default/.
cf_default/ (Centrifuge) https://benlangmead.github.io/aws-indexes/centrifuge Place the .cf index files directly under cf_default/.
cfer_default/ (Centrifuger) https://github.com/mourisl/centrifuger releases β€” the prebuilt index download Same layout: index files directly under cfer_default/.
sm_default/ (Sourmash) https://sourmash.readthedocs.io/en/latest/databases.html β€” pick the matching zip Drop the .zip files into sm_default/.
sylph_default/ (Sylph) https://github.com/bluenote-1577/sylph/wiki/Pre%E2%80%90built-databases β€” sketch + metadata Sketches (.syldb) into sylph_default/.
sylph_tax/ https://github.com/bluenote-1577/sylph-tax taxonomy bundles This is the sylph-tax lineage-resolution data, not the sketch itself.

After populating, each tool's ete3 snapshot for taxonomy resolution must match the index β€” see Tools and Databases for the snapshot-to-default-DB mapping. For the default DBs, those snapshots ship in bakeoff_refdb_default_metadata, not shared_metadata (which only carries the unified-DB snapshot, refseq03032025/ete3_taxa/taxa032025.sqlite). Extracting default_metadata drops the right snapshot into each <tool>_default/ete3_taxa/ automatically, and also populates sylph_default/taxa042024.sqlite and the sylph_tax/ metadata directory. Run it once alongside any of the self-installed default indexes:

cat bakeoff_refdb_default_metadata.tar.zst \
    | zstd -dc --long=27 \
    | tar -xf -

Verification

Two sanity checks once a download finishes:

# 1. inventory the extracted files against the bundle's manifest
diff <(cd $PROJECT_ROOT && tar -tvf <unused>.tar.zst | sort) <(sort bakeoff_refdb_<bundle>.manifest.txt)
# (only meaningful if you kept the joined .tar.zst; otherwise rely on a quick file count)

# 2. point-check one expected file per bundle
ls $PROJECT_ROOT/data/ref_db/refseq03032025/k2_abfv_030325/hash.k2d            # kraken2
ls $PROJECT_ROOT/data/ref_db/refseq03032025/centrifuge_abv_030325/*.cf         # centrifuge
ls $PROJECT_ROOT/data/ref_db/refseq03032025/sylph_abf_030325/*.syldb           # sylph
ls $PROJECT_ROOT/data/ref_db/refseq03032025/ete3_taxa/taxa032025.sqlite        # ete3 snapshot

If a file is missing from default_db/<tool>_default/, that's almost always an incomplete download from the upstream source rather than a bundling problem on our side β€” re-fetch from the URL above.

Troubleshooting

  • zstd: error 70 : Frame requires too much memory for decoding β€” pass --long=27 (as shown in every recipe above); the bundles use a 27-bit window.
  • tar: data/ref_db: Cannot mkdir: Permission denied β€” you're not in the project root, or you don't own <PROJECT_ROOT>/data/. cd "$PROJECT_ROOT" before the cat | zstd | tar line, and check the directory's permissions.
  • Index works for one tool but not another β€” the unified indexes reference the taxdump and ete3 snapshot from shared_metadata; the most common cause is forgetting that bundle.
  • Downloads stall β€” Zenodo serves through CDN, but for the 121 GB Kraken2 bundle parts you may want curl -C - (continue) so an interrupted part resumes cleanly.

Next steps

  • Database Build β€” optionally rebuild a unified index from scratch instead of downloading it
  • Reproduction β€” regenerate the manuscript figures and tables once the data is in place

Clone this wiki locally