Skip to content

Commit 9fc7f3e

Browse files
refactor: read minimizerReferences from buildFiles instead of files
Current Nextclade versions reject array values in the `files` section of `pathogen.json` with `invalid type: sequence, expected a string`. The `DatasetFiles` struct catches unknown keys with `rest_files: BTreeMap<String, String>` (https://github.com/nextstrain/nextclade/blob/f7db57f31/packages/nextclade/src/io/dataset.rs#L567-L569), which only accepts string values. An array like `minimizerReferences` fails deserialization before reaching the `other: serde_json::Value` catch-all. Move the lookup to `.buildFiles`, a top-level key absorbed by `VirusProperties`'s `other: serde_json::Value` (https://github.com/nextstrain/nextclade/blob/1400012f7/packages/nextclade/src/analyze/virus_properties.rs#L137-L138), which accepts any JSON type. This makes datasets with multiple minimizer reference files loadable by both old and new Nextclade versions.
1 parent abc65e8 commit 9fc7f3e

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

scripts/rebuild

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,11 @@ def get_minimizer_refs(pathogen_json, dataset_dir):
177177
"""
178178
Get reference sequences for minimizer index.
179179
180-
If minimizerReferences is specified (array of file paths), returns sequences
181-
from all files combined. Otherwise, returns the main reference sequence.
180+
If buildFiles.minimizerReferences is specified (array of file paths), returns
181+
sequences from all files combined. Otherwise, returns the main reference sequence.
182182
"""
183-
files = dict_get(pathogen_json, ["files"]) or {}
184-
minimizer_refs_filenames = dict_get(files, ["minimizerReferences"]) or []
183+
build_files = dict_get(pathogen_json, ["buildFiles"]) or {}
184+
minimizer_refs_filenames = dict_get(build_files, ["minimizerReferences"]) or []
185185

186186
if len(minimizer_refs_filenames) > 0:
187187
all_refs = []

0 commit comments

Comments
 (0)