check_col_names: Check column names against their corresponding template

Description Usage Arguments Value See Also Examples

View source: R/check-col-names.R

Description

Check column names against their corresponding template

Usage

 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
31
32
33
34
35
36
37
38
39
check_col_names(
  data,
  template,
  success_msg = NULL,
  fail_msg = NULL,
  behavior = NULL
)

check_cols_manifest(
  data,
  id,
  success_msg = "All manifest columns present",
  fail_msg = "Missing columns in the manifest",
  ...
)

check_cols_individual(
  data,
  id,
  success_msg = "All individual metadata columns present",
  fail_msg = "Missing columns in the individual metadata file",
  ...
)

check_cols_assay(
  data,
  id,
  success_msg = "All assay metadata columns present",
  fail_msg = "Missing columns in the assay metadata file",
  ...
)

check_cols_biospecimen(
  data,
  id,
  success_msg = "All biospecimen columns present",
  fail_msg = "Missing columns in the biospecimen metadata file",
  ...
)

Arguments

data

Data frame to check against template (manifest, individual metadata, or assay metadata)

template

Character vector of column names from the template to check against

success_msg

Message indicating the check succeeded.

fail_msg

Message indicating the check failed.

behavior

The intended behavior of the test

id

Synapse ID of the template to check against

...

Additional arguments passed to syn$get()

Value

A condition object indicating whether the required columns were present ("check_pass") or absent ("check_fail").

See Also

dccvalidator::get_template()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
template <- c("individualID", "specimenID", "assay")
dat <- data.frame(individualID = c("a", "b"), specimenID = c("a1", "b1"))
check_col_names(dat, template)
## Not run: 
syn <- synapse$Synapse()
syn$login()

a <- data.frame(path = "/path/file.txt", parent = "syn123", assay = "rnaSeq")
check_cols_manifest(a, syn)

b <- data.frame(assay = "rnaSeq")
check_cols_manifest(b, syn)

## End(Not run)

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