Learn R Programming

dccvalidator (version 0.3.0)

check_keys: Check that a given set of keys are all present in an annotations dictionary

Description

Check that a given set of keys are all present in an annotations dictionary

Usage

check_keys(
  x,
  annotations,
  whitelist_keys = NULL,
  success_msg = "All annotation keys are valid",
  fail_msg = "Some annotation keys are invalid",
  annots_link = "https://shinypro.synapse.org/users/nsanati/annotationUI/",
  return_valid = FALSE,
  syn
)

Arguments

x

A data frame of annotation data

annotations

A data frame of annotations to check against

whitelist_keys

A character vector of annotation keys to whitelist. If provided, all values for the given keys will be treated as valid.

success_msg

Message indicating the check succeeded.

fail_msg

Message indicating the check failed.

annots_link

Link to a definition of the annotations being used in the project

return_valid

Should the function return valid values? Defaults to FALSE (i.e. the function will return invalid values).

syn

Synapse client object

Value

A condition object indicating whether keys match the given annotation dictionary. Erroneous keys are included as data within the object.

Examples

Run this code
# NOT RUN {
annots <- data.frame(
  key = c("fileFormat", "fileFormat"),
  value = c("txt", "csv"),
  columnType = c("STRING", "STRING"),
  stringsAsFactors = FALSE
)
check_keys("fileFormat", annots)
check_keys("x", annots)
# }

Run the code above in your browser using DataLab