Learn R Programming

PubChemR (version 3.0.0)

get_biological_test_results: Retrieve "Biological Test Results" Section from PubChem Contents

Description

This helper fetches a PUG View record and extracts section(s) with heading `"Biological Test Results"` (or a custom heading) from the PubChem `CONTENTS` structure.

Usage

get_biological_test_results(
  identifier,
  domain = "compound",
  heading = "Biological Test Results",
  .match_type = c("match", "contain"),
  .all = FALSE,
  .verbose = FALSE,
  ...
)

Value

A PugViewSection object (default) or PugViewSectionList

when .all = TRUE. If no section is found, a failed

PugViewSection object is returned with error details.

Arguments

identifier

A single identifier for a PUG View request.

domain

A domain value accepted by get_pug_view.

heading

Section heading to search for. Defaults to "Biological Test Results".

.match_type

Matching strategy for heading; one of "match" (exact, case-insensitive) or "contain".

.all

Logical. If TRUE, returns all matching sections as a PugViewSectionList object. If FALSE, returns the first matching section as a PugViewSection object.

.verbose

Logical. If TRUE, prints the returned section object and returns it invisibly.

...

Additional arguments passed to get_pug_view.

Details

This is a targeted utility built on top of get_pug_view, retrieve, and sectionList to simplify extraction of deeply nested biological testing sections from PUG View records.

Examples

Run this code
# \donttest{
bio <- get_biological_test_results(identifier = "2244", domain = "compound")
bio

# Return all matching sections (if multiple are present)
bio_all <- get_biological_test_results(
  identifier = "2244",
  domain = "compound",
  .all = TRUE
)
bio_all
# }

Run the code above in your browser using DataLab