An immutable S7 class for storing individual-level metadata in cross-species genomics studies. Subject objects represent individual animals or biological samples and are grouped into Cohort objects for collective analysis.
Arguments
- subject_id
Character scalar for unique subject identifier.
- species
Character scalar naming the species. Any value is allowed;
subject_new()stores it lower-cased.- sex
Character scalar for biological sex (e.g., "M", "F"). Optional.
- strain
Character scalar for strain or breed designation. Optional.
- genotype
Character scalar for genetic background or modification (e.g., "WT", "KO"). Optional.
- cohort
Character scalar for cohort membership or treatment group. Optional.
- timepoint
Character scalar for study timepoint or collection date. Optional.
- notes
Character scalar for free-form annotations. Optional.
Details
Use subject_new() to construct Subject objects; it lower-cases species.
Construction also validates that subject_id and species are present, so
building a Subject any other way still enforces the two required fields.
Individual subjects are typically read from a Cohort with subject().
Access properties via the @ operator:
subject@subject_id
subject@species
subject@sex
subject@strain
subject@genotype
subject@cohort
subject@timepoint
subject@notesSee also
subject_new() for object construction,
Cohort for managing groups of subjects