Phenomics, repeated records and decision-time alignment
Practical 28: Genomics, systems biology and multi-omics
Learning objectives
Define a time-window phenotype; calculate animal-level summaries and coverage; avoid future-information leakage and pseudoreplication.
Biological question and data
How should repeated sensor records be summarized for a molecular sample collected on day 3?
Sensor values are fictional measurements in arbitrary units. Six animals have five daily records. One value is missing by construction. Diet or treatment allocation is animal-level, so daily rows are not independent treatment replicates.
No biological download is required. Numerical inputs are hypothetical, not observed animal data. The runnable examples use base R. Count and abundance units are specified where used.
1. Create and inspect the repeated data
Keep animal and day as separate keys; define a missing value rather than silently replacing it.
Counting thirty rows as thirty independently allocated animals would overstate replication.
4. Compare observed and target-window means
Missing high-value days can shift a recorded mean. Use a small constructed time window to expose the issue.
Show R code
period <-c(8,9,12,13,8)recorded <- period;recorded[c(3,4)] <-NAc(full_window_mean=mean(period),observed_mean=mean(recorded,na.rm=TRUE),fraction_observed=mean(!is.na(recorded)))
Collection date and result availability are different. A baseline specimen processed after the decision cannot supply a real-time feature for that decision. Record assay turnaround as well as sensor windows.
Repeated measurements can improve an animal summary while retaining animal-level dependence. For irregular intervals, a simple arithmetic mean may weight densely sampled periods more heavily. Document the summary and coverage policy and examine whether missingness depends on illness or device behavior. Future-window observations belong to the outcome or a different task, not a retrospective predictor at an earlier time.
Interpretation challenge
Could a day-20 sample with a day-40 result be used for a day-30 management prediction?
Suggested reasoning
Only if that information would actually be available by day 30. Collection before the decision alone is insufficient; redefine the task or use eligible information.
Interpretation and limits
Actual sensor pipelines need calibration, physical units, time zones/time stamps, unequal observation windows, serial dependence and missingness investigation. Repeated records may need mixed or longitudinal models; this practical illustrates grouping and timing rather than fitting such a model.
Exercises
Why report coverage with the mean?
Can future records be included to improve a day3 prediction?
What changes when animals share a pen-level intervention?
Suggested answers
Animals with different observation windows may have non-comparable summaries.
Not if they were unavailable at day3; that would change the prediction task or leak information.
The intervention unit is the pen, requiring pen-level replication/dependence handling.