If data is an addition to an existing study, check the specimen and individual IDs against the master table of existing IDs. Contributors should upload the complete metadata files, so all IDs in the master table should be present in the uploaded data.
check_complete_ids( data, samples_table, study, id_type = c("individualID", "specimenID"), assay = NULL, success_msg = "Data includes a complete set of IDs", fail_msg = "Some IDs are missing from the data" )
data | Data frame of data to be checked |
---|---|
samples_table | Data frame containing master table of all individual and specimen IDs per study |
study | Name of the study |
id_type |
|
assay | String naming the assay. If provided, will filter |
success_msg | Message indicating the check succeeded. |
fail_msg | Message indicating the check failed. |
A condition object indicating whether the required columns were
present ("check_pass"
) or absent ("check_fail"
)
samples_table <- tibble::tribble( ~individualID, ~specimenID, ~study, ~assay, "A", "a1", "study1", "rnaSeq", "A", "a2", "study1", "rnaSeq", "B", "b1", "study1", "rnaSeq", "B", "b2", "study1", "rnaSeq", "B", "b1", "study1", "rnaSeq", "B", "b1", "study1", "rnaSeq", "C", "c1", "study1", "LC-MS", "D", "d1", "study2", "rnaSeq", "D", "d2", "study2", "rnaSeq" ) dat <- tibble::tribble( ~individualID, ~specimenID, "A", "a1", "A", "a2" ) check_complete_ids( data = dat, samples_table = samples_table, id_type = "individualID", study = "study1" )#> <error/check_fail> #> Some IDs are missing from the data