# NOT RUN {
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(assay = "not a valid assay")
dat2 <- data.frame(assay = "rnaSeq")
check_annotation_values(dat1, annots)
check_annotation_values(dat2, annots)
# }
# NOT RUN {
syn <- synapse$Synapse()
syn$login()
annots <- get_synapse_annotations(syn = syn)
my_file <- syn$get("syn11931757", downloadFile = FALSE)
check_annotation_values(my_file, annots)
dat <- data.frame(
non_annotation = 5:7,
assay = c("rnaSeq", "foo", "bar"),
stringsAsFactors = FALSE
)
check_annotation_values(dat, annots)
fv <- synTableQuery("SELECT * FROM syn17020234")
check_annotation_values(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_values(my_file, syn = syn)
# It is possible to whitelist certain certain values, or all values for
# certain keys:
check_annotation_values(dat, whitelist_keys = "assay", syn = syn)
check_annotation_values(
dat,
whitelist_values = list(assay = c("foo")),
syn = syn
)
# }
Run the code above in your browser using DataLab