Question 4 of 6 Intermediate Scenario
How would you design validation checks for biological metadata?
Short answer
Validate structure and types, then verify biological identities, plausible units, controlled vocabularies, cross-field consistency and sample lineage.
Why
A sample metadata table needs more than a non-null sample_id. Enforce uniqueness in the correct scope, allowed specimen types, collection dates with sensible order, experimental conditions drawn from a controlled vocabulary, and required links to donor, batch and assay. Check that replicate IDs reference existing samples, that counts reconcile with raw files, and that concentration values have explicit units and plausible ranges.
Flag impossible combinations, such as a sequencing run date preceding sample collection, while allowing documented exceptions rather than automatically deleting unusual observations. Version the validation rules and log exceptions with reviewer decisions. Human-readable error messages should identify the violated rule without exposing protected participant information.
Completeness and consistency checks cannot alone establish label accuracy.
Common mistakes
- Dropping every outlier as if biological unusualness automatically proves a metadata mistake
The interviewer might ask next
What would you validate before joining an expression matrix to a clinical metadata table?