Repository navigation
data_integration_and_stats: per-attribute validation (ADR 0006) - #5
Conversation
Reads validation_attributes.tsv instead of a removed bugphyzz internal, counts attributes by the per-attribute rule, and reports the kappa lower bound and decision in the supplementary table. Co-authored-by: Claude Code <noreply@anthropic.com>
| numeric_attrs <- c("coding genes", "genome size", "growth temperature", | ||
| "length", "optimal ph", "width", "gc content") | ||
| validation_attr <- validation_attr |> | ||
| filter(rank == "all") |> | ||
| mutate( | ||
| threshold = ifelse(tolower(physiology) %in% numeric_attrs, 0.5, 0.7), | ||
| imputed = score_lcb >= threshold |
There was a problem hiding this comment.
The numeric/discrete split is a hand-typed list of attribute names. An attribute that is missing from it, such as a new numeric attribute or a renamed one, gets the 0.7 threshold instead of 0.5. Its "imputed / not imputed" label in Supplementary Table 1 is then wrong, and nothing warns you. The table you just read already has a metric column (it is used in the sprintf below), so derive the threshold from that, e.g. threshold = ifelse(grepl("r2", metric, ignore.case = TRUE), 0.5, 0.7). Also, imputed only models the attribute-level rule. The export also requires row Score >= 0.5, which is not reflected here. The label is therefore "attribute passes", not necessarily "has imputed rows". Either say so or cross-check against attr_asr_default_names from bp.
| ) | ||
| } | ||
| ## Per-attribute scores (ADR 0006): these decide which attributes are imputed | ||
| validation_attr <- if (nzchar(params$validation_attributes_tsv)) { |
There was a problem hiding this comment.
When bugphyzz_version pins a release, the per-attribute table still comes from the installed bugphyzz, unless validation_attributes_tsv is set. The existing validation_tsv branch warns about this mismatch, but this one doesn't. The "imputed / not imputed" column and the "cross-validated attributes" count can then disagree with the pinned bp data. Also, system.file() returns "" if the installed bugphyzz lacks the file (pre-1.7.15), and read_tsv("") fails with an unhelpful error. Add the same warning here, and stopifnot(nzchar(path)) with a message that asks for bugphyzz >= 1.7.15.
|
Two issues, both in
I found nothing else. This PR changes no exported functions or package code, so there are no Bioconductor documentation concerns. |
…tion table Co-authored-by: Claude Code <noreply@anthropic.com>
Re-rendered against the 2026-11-10 export. Drafted with Claude Code. |
The article called
bugphyzz:::.validationData(), which bugphyzz 1.7.15 removed, so it no longer renders. It also described imputation as a per-value MCC rule, which bugphyzzExports ADR 0006 replaced.validation_summary.tsvfrom the installed package directly, with no internal call, and addsvalidation_attributes.tsv(per-attribute kappa and R2 with their lower bounds) behind a newvalidation_attributes_tsvparameter.slice_max(with_ties = FALSE)when ordering the validation figures: two values of one attribute can share the top score (COGEM ratings 1 and 2 in v1.0.7), which duplicated a factor level and stopped the render.Figures 2a and 2b still show per-value MCC and R2 from
validation_summary.tsv. Whether the manuscript's Figure 2 should instead show the per-attribute score that now decides imputation is a manuscript question, tracked in waldronlab/bugphyzz-manuscript#17.Rendered against the 2026-11-10 export (the first under ADR 0006): 466,663 annotations, 93,838 taxa, 33 attributes, 18 sources, 59,521 imputed.
Drafted with Claude Code.