Executes BV-BRC CLI queries in Docker and writes the results to a DuckDB at: <base_dir>/data/<bug_dir>/.duckdb where <bug_dir> derives from full user_bacs, and from .generateDBname(). BV-BRC column names are preserved.

.getGenomeIDs(
  base_dir = ".",
  query_type = c("genome_name", "species", "taxon_id"),
  query_value = NULL,
  user_bacs,
  overwrite = FALSE,
  image = "danylmb/bvbrc:5.3",
  verbose = TRUE
)

Arguments

base_dir

Character. Project root directory.

query_type

Character. One of "genome_name", "species", or "taxon_id".

query_value

Character or NULL. If NULL, it will be inferred from user_bacs based on query_type (first element for species/genome_name, first numeric for taxon_id).

user_bacs

Character vector. Used to construct database location/name and, if needed, to infer query_value when not supplied.

overwrite

Logical. If FALSE and the DuckDB file already exists, abort. Default: FALSE.

image

Character. Docker image containing BV-BRC CLI. Default: "danylmb/bvbrc:5.3".

verbose

Logical. If TRUE, prints messages. Default: TRUE.

Value

A list with:

  • count_result: Integer (count query result)

  • duckdbConnection: DBI connection to the DuckDB file

  • table_name: "bac_data"