Checks the subject table, the sample map, and the link between them.
cohort_new() calls this function after it builds the object. Call it
directly to check a cohort that was built or changed by other means.
Arguments
- x
A Cohort object.
Details
The checks are:
xis a Cohort object.subject_tblandsample_mapare data frames.subject_tblhas the columnssubject_idandspecies, both character, with no missing value. An empty string counts as missing.speciesis a free-form value; any organism is allowed.subject_tbl$subject_idhas no duplicate.sample_maphas the columnssubject_id,assay,sample_id, androle, all character. The first three have no missing value.Every
sample_map$subject_idexists insubject_tbl.
See also
cohort_new() for Cohort construction,
validate_manifest() for manifest validation
Examples
subjects <- data.frame(
subject_id = "RAT001",
species = "rat",
sex = "M"
)
samples <- data.frame(
subject_id = "RAT001",
assay = "wes",
sample_id = "WES_R001",
role = "tumor"
)
cohort <- cohort_new(
subject_tbl = subjects,
sample_map = samples
)
# cohort_new() already ran the checks. Run them again by hand.
validate_cohort(cohort)