Repository navigation
Parameterize the articles on data version; add the attributes supplementary table - #4
Conversation
…entary table importBugphyzz(version = params$bugphyzz_version) replaces the stale v = 0.5 call and the in-article threshold filters, which the export now applies. data_integration_and_stats also takes validation_tsv, writes Supplementary Tables 1 and 2 as TSVs, and gains a per-attribute table with counts and validation scores. Uberon is pinned to its May 2024 release; BugSigDB v1.2.1 everywhere. Co-authored-by: Claude Code <noreply@anthropic.com>
| readr::read_tsv(params$validation_tsv, show_col_types = FALSE) | ||
| } else { | ||
| bugphyzz:::.validationData() | ||
| } |
There was a problem hiding this comment.
Without validation_tsv, the validation table comes from the installed bugphyzz via the internal bugphyzz:::.validationData(), not from the release named by bugphyzz_version. If you pass a DOI and leave validation_tsv empty, Figure 2 and the new Supplementary Table 2 can show MCC/R2 values from a different version than the annotation counts next to them. Nothing warns about this.
Suggested fixes:
- Make
validation_tsvrequired wheneverbugphyzz_version != "devel", orstop()/warning()when the two are inconsistent. - Replace
:::with an exported accessor. Bioconductor guidelines discourage:::, and an internal rename would silently break the vignette. If no accessor exists, export one in bugphyzz.
| ```{r write supp tables, include = FALSE} | ||
| ## TSV copies next to the rendered article, for the manuscript supplement | ||
| write.table(supp_attr_tbl, "supplementary_table_attributes.tsv", sep = "\t", quote = FALSE, row.names = FALSE) | ||
| write.table(sources, "supplementary_table_sources.tsv", sep = "\t", quote = FALSE, row.names = FALSE) | ||
| ``` |
There was a problem hiding this comment.
This chunk writes TSVs to the knit working directory. That is a side effect on the source tree when built with R CMD build/BiocCheck, and the location varies with how the article is rendered (rmarkdown::render vs pkgdown). It also uses an unnamed relative path, and supplementary_table_sources.tsv is not mentioned in the PR's table list.
Fix: take an output directory from a param (e.g. params$out_dir, defaulting to tempdir()), build the path with file.path(), and use readr::write_tsv (readr is already in Imports). Also add *.tsv outputs to .gitignore/.Rbuildignore if they can land in the repo.
| summarise( | ||
| Type = unique(Attribute_type)[1], | ||
| Unit = if ("Unit" %in% names(.x)) paste(unique(na.omit(Unit)), collapse = ";") else "", | ||
| Sources = n_distinct(Attribute_source[!is.na(Attribute_source)]), | ||
| Curated = sum(Evidence %in% c("exp", "igc", "tas", "nas")), | ||
| IBD = sum(Evidence == "tax"), | ||
| ASR = sum(Evidence == "asr"), | ||
| Total = n(), | ||
| Taxa = n_distinct(NCBI_ID) |
There was a problem hiding this comment.
The new supplementary table has no test or check. Total is n() while Curated + IBD + ASR counts only specific Evidence codes, so any other or NA Evidence value makes the columns stop summing to Total without notice. The join to validation is by tolower(Attribute), so a mismatch gives silent NA in the validation column.
Suggested fixes:
- Add
stopifnot(with(supp_attr_tbl, all(Curated + IBD + ASR == Total)))after the table is built. - Assert that every row has a validation string, or document which attributes are expected to be
NA. - Note that
Sources/Typeuseunique(...)[1], which hides inconsistent values within an attribute.
|
Main points, most important first:
|
… match the data version Co-authored-by: Claude Code <noreply@anthropic.com>
Drafted with Claude Code. |
Prepares the manuscript figures and tables for re-running on the next bugphyzz release. No rendered output is included; the pkgdown site is rebuilt once the final export and Zenodo deposit exist.
params$bugphyzz_version(a Zenodo DOI ordevel, defaultdevelfor now) and callsimportBugphyzz(version = ...). The oldimportBugphyzz(v = 0.5)no longer matches the function signature, and the in-article MCC/R2 filters are redundant since bugphyzzExports applies them at export (bugphyzzExports#67).data_integration_and_statsalso takesparams$validation_tsv(path or URL of a taxPProValidationvalidation_summary.tsv; empty uses the installed package's copy), so Figure 2 can be rendered for an older validation version. It writes Supplementary Table 1 (sources) and a new Supplementary Table 2 (one row per attribute: type, sources, curated/IBD/ASR counts, taxa, per-value MCC or R2 at rankall) as TSVs next to the output.enrichment_dbbactandinst/rmd/bsdb_signaturesread Uberon from a pinned release (v2024-05-13) with ontologyIndex;bugsigdbr::getOntology()fails on its download step here.nychanespins BugSigDB to v1.2.1 like the other articles.Rendered locally against release v1.0.3 and
devel: Figures 1 and 2, the supplementary counts figure, both supplementary tables, the gingival-plaque and NYC-HANES articles; the dbBact article is running.Drafted with Claude Code.