Skip to content

Commit

Permalink
Merge pull request #207 from nextstrain/feat/warn-dataset-ref-mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-aksamentov authored Jun 4, 2024
2 parents 138c448 + 2e7628a commit 135cd16
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/rebuild
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def index_one_dataset(args, pathogen_json_path: str, dataset: object, tag: str,
path = relpath(dataset_dir, args.input_dir)

ref = get_ref_seq(pathogen_json, dataset_dir)
check_ref_seq_mismatch(ref, pathogen_json, dataset_dir)
check_ref_seq_mismatch(path, ref, pathogen_json, dataset_dir)

versions, last_version = dataset_get_versions(dataset)

Expand Down Expand Up @@ -164,17 +164,17 @@ def get_ref_seq(pathogen_json, dataset_dir):
raise ValueError(f"When reading reference sequence") from e


def check_ref_seq_mismatch(standalone_ref, pathogen_json, dataset_dir):
def check_ref_seq_mismatch(path, standalone_ref, pathogen_json, dataset_dir):
tree_filename = dict_get(pathogen_json, ["files", "treeJson"])
tree_json_path = join(dataset_dir, tree_filename) if tree_filename else None
if tree_json_path is not None and isfile(tree_json_path):
tree_json = json_read(tree_json_path)
tree_ref = dict_get(tree_json, ["root_sequence", "nuc"])
if tree_ref is not None:
if standalone_ref.seq != tree_ref:
l.warn(
"Reference sequence provided does not exactly match reference (root) sequence in Auspice JSON. This warning "
"signals that there is a potential for failures if the mismatch is not intended."
l.warning(
f"{path}: Reference sequence provided does not exactly match reference (root) sequence in Auspice JSON. "
f"This warning signals that there is a potential for failures if the mismatch is not intended."
)


Expand Down

0 comments on commit 135cd16

Please sign in to comment.