check_annotation_keys: Check annotation keys

Description Usage Arguments Value Methods (by class) See Also Examples

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

Description

Checks that all annotation keys on a file, in a file view, or in a data frame are valid annotations. check_annotation_keys() returns any invalid annotation keys; valid_annotation_keys() returns valid annotation keys.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
check_annotation_keys(x, annotations, ...)

## S3 method for class ''NULL''
check_annotation_keys(x, annotations, ...)

## S3 method for class 'synapseclient.entity.File'
check_annotation_keys(x, annotations, syn, ...)

## S3 method for class 'data.frame'
check_annotation_keys(x, annotations, ...)

## S3 method for class 'synapseclient.table.CsvFileTable'
check_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 condition object indicating whether keys match the given annotation dictionary. Erroneous keys are included as data within the object.

Methods (by class)

See Also

valid_annotation_keys()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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")
check_annotation_keys(dat1, annots)
check_annotation_keys(dat2, annots)

## Not run: 
syn <- synapse$Synapse()
syn$login()
annots <- get_synapse_annotations(syn = syn)
my_file <- syn$get("syn11931757", downloadFile = FALSE)
check_annotation_keys(my_file, annots, syn)

dat <- data.frame(non_annotation = 5, assay = "rnaSeq")
check_annotation_keys(dat, annots)

fv <- syn$tableQuery("SELECT * FROM syn17020234")
check_annotation_keys(fv, annots)

# If you don't specify an annotations data frame, these functions will
# download annotations automatically using `get_synapse_annotations()` (must
# be logged in to Synapse)
my_file <- syn$get("syn11931757", downloadFile = FALSE)
check_annotation_keys(my_file, syn = syn)

## End(Not run)

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