This function generates and retrieves AMR data for a batch of genome IDs. It uses BV-BRC tools within a Docker container to fetch and process the data based on the input parameters.

.extractAMRtable(
  base_dir,
  batch_genome_IDs,
  abx_filter,
  drug_fields,
  image = "danylmb/bvbrc:5.3",
  verbose = TRUE
)

Arguments

batch_genome_IDs

A character vector containing genome IDs to query.

abx_filter

A string specifying the antibiotic filter criteria. This can be in the form "--required antibiotic" or "--in antibiotic,drug1,drug2".

drug_fields

A string specifying the drug fields (attributes) to include in the output. This corresponds to the attributes retrieved by the p3-get-genome-drugs tool.

image

Character. Docker image. Default "danylmb/bvbrc:5.3".

verbose

Logical. If TRUE, prints concise messages.

path

A string representing the file path to a directory where temporary files and data will be stored.

Value

A character vector with the output data from p3-get-genome-drugs, typically in tabular format.

Details

The function performs the following steps:

  1. Ensures the required Docker image (danylmb/bvbrc:5.3) is pulled.

  2. Creates a genome ID table using p3-echo and writes it to a temporary file.

  3. Processes the generated file with the p3-get-genome-drugs tool to query the AMR data.

Note

The BV-BRC Docker image (danylmb/bvbrc:5.3) must be installed and available on the system.

Examples

if (FALSE) { # \dontrun{
batch_ids <- c("genome1", "genome2", "genome3")
abx_filter <- "--required antibiotic"
drug_attrs <- "antibiotic,resistance"
temp_path <- "/tmp"

result <- extractAMRtable(batch_ids, abx_filter, drug_attrs, temp_path)
print(result)
} # }