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

Description Usage Arguments Value Examples

View source: R/check-annotation-keys.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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

1
2
3
4
5
6
7
8
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)

dccvalidator documentation built on July 2, 2020, 4:05 a.m.