Skip to content

Removed unused DuckDB code path, dead helpers, and 16 MB unused data#25

Open
eboyer221 wants to merge 1 commit into
mainfrom
dev-remove-dead-code
Open

Removed unused DuckDB code path, dead helpers, and 16 MB unused data#25
eboyer221 wants to merge 1 commit into
mainfrom
dev-remove-dead-code

Conversation

@eboyer221
Copy link
Copy Markdown
Contributor

Description

PR removes unused data files and dead code that is no longer necessary for amRviz functionality.

The dashboard no longer uses inst/extdata/amr_filtered_tbls.db (16MB), it was superseded by the parquet-based loading path that landed in previous PRs. This PR removes that file as well as functions that are no longer needed in order to free up space and clean the codebase.

Removed

Functions (all in R/utils.R, all with zero references outside their own definition — verified by grep across R/, inst/, tests/):

  • getAllFilteredData — old DuckDB writer; populated the .db from per-species DuckDBs.
  • loadAMRMetadata — old DuckDB reader; the dashboard now uses loadMLResults / loadTopFeat / get_metadata_path reading parquet files instead.
  • getTopFeatures — pre-parquet loader for top-features TSVs that wrote into a shinyapp/data/ path that doesn't exist in the package.
  • combinePerformanceMetrics — same pre-parquet pipeline; wrote to the same non-existent shinyapp/data/ paths.
  • getAmrDrugs
  • bug_choices - hardcoded ESKAPE lookup. The dashboard now derives bug choices dynamically from loaded data (this was finalized in PR Fix install + dashboard rendering with bundled demo data #18).

Data: inst/extdata/amr_filtered_tbls.db (16MB). Only the deleted functions touched it.

Imports: DBI and duckdb removed from DESCRIPTION and the matching @importFrom roxygen tags in R/utils.R. The only callers of DBI::* and duckdb::* were inside the deleted functions, so the package no longer depends on either.

README: removed the amr_filtered_tbls.db bullet under "Data requirements" - that line was already inaccurate since the dashboard hasn't read from the DB in some time.

  • inst/extdata/ now contains only the per-species parquet files and the small TSV/CSV lookups (≪1MB total).

Test plan

  1. devtools::load_all() then launchAMRDashboard() - dashboard builds and every tab loads with no missing-function errors.
  2. devtools::check() - no errors and no test failures introduced.
  3. Verification grep: `grep -rn "DBI|duckdb|amr_filtered_tbls|bug_choices|getTopFeatur

Comment thread R/utils.R
drug_class_map_df <- readr::read_tsv(
here(drug_class_map_fp),
show_col_types = FALSE
) %>%
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a suggestion, we can switch to the base R pipe (|>) throughout, and only retain %>% where it's explicitly required.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point @AbhirupaGhosh. I could get rid of magrittr from our Imports if that switches. I assume that would be better for Bioconductor, since they don't want unnecessary dependencies?

@amcim @jananiravi - Should I do a separate follow-up PR that migrates the package to |> and drops magrittr from Imports?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it would definitely be worth making that conversion to |> and it will be a quick PR to review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants