Skip to contents

Retrieves metadata describing the attributes available for a specified VEuPathDB record type. The returned attribute names can be supplied to the customFields argument of getTable().

Usage

getTableAttributes(
  db = "plasmodb",
  record_type = "transcript",
  api_key = Sys.getenv("VEUPATHDB_API_KEY")
)

Arguments

db

Character. Name of the VEuPathDB database, such as "plasmodb", "toxodb", "fungidb" etc.

record_type

Character. VEuPathDB record type for which attributes should be retrieved. Defaults to "transcript".

api_key

Character. VEuPathDB API key used for authentication. By default, the value is obtained from the VEUPATHDB_API_KEY environment variable.

Value

A data frame containing metadata for the available attributes, including the internal attribute name, display name, data type, reporting availability, and help text where available.

Details

With release 71 of VEuPathDB, only users with subscription and API key can access the database programmatically. Use usethis::edit_r_environ(scope = "user") to add VEuPathDB API using VEUPATHDB_API_KEY variable.

VEuPathDB record types can contain many reportable attributes. getAttributes() provides a convenient way to browse these attributes without manually consulting the VEuPathDB web service.

The name column contains the attribute identifiers expected by the customFields argument of getTable(), while displayName provides human-readable labels.

See also

getTable() for retrieving data using selected attributes.

Examples

if (FALSE) { # \dontrun{
# Browse transcript attributes available in PlasmoDB
attrs <- getTableAttributes(
  db = "plasmodb",
  record_type = "transcript", api_key=Sys.getenv("VEUPATHDB_API_KEY")
)

head(attrs)

# Search for protein-related attributes
subset(
  attrs,
  grepl("protein", displayName, ignore.case = TRUE)
)

# Use selected attribute names with getTable()
genes <- getTableAttributes(
  org = "Plasmodium falciparum 3D7",
  db = "plasmodb",
  customFields = c(
    "primary_key",
    "gene_product",
    "protein_length"
  )
)
} # }