Checks for and returns the valid annotation keys in a data framae, Synapse file, or Synapse file view.

valid_annotation_keys(x, annotations, ...)

# S3 method for `NULL`
valid_annotation_keys(x, annotations, ...)

# S3 method for synapseclient.entity.File
valid_annotation_keys(x, annotations, syn, ...)

# S3 method for data.frame
valid_annotation_keys(x, annotations, ...)

# S3 method for synapseclient.table.CsvFileTable
valid_annotation_keys(x, annotations, ...)

Arguments

x

An object to check.

annotations

A data frame of annotation definitions. Must contain at least three columns: key, value, and columnType.

...

Additional parameters passed to check_keys()

syn

Synapse client object

Value

A vector of valid annotation keys present in x.

Methods (by class)

  • NULL: Return NULL

  • synapseclient.entity.File: Valid annotation keys on a Synapse file

  • data.frame: Valid annotation keys in a data frame

  • synapseclient.table.CsvFileTable: Valid annotation keys in a Synapse table

Examples

annots <- data.frame( key = c("assay", "fileFormat", "fileFormat", "fileFormat", "species"), value = c("rnaSeq", "fastq", "txt", "csv", "Human"), columnType = c("STRING", "STRING", "STRING", "STRING", "STRING") ) dat1 <- data.frame(x = 1) dat2 <- data.frame(assay = "rnaSeq") valid_annotation_keys(dat1, annots)
#> character(0)
valid_annotation_keys(dat2, annots)
#> [1] "assay"