Normalizes specimen/sample type names and adds sample_category and a collapsed sterile_classification from the reference CSV file. Includes rule-based text cleaning and fuzzy matching for common shorthand and minor misspellings.
Arguments
- data
Data frame with specimen column.
- specimen_col
Character. Specimen column name. Default "specimen_type".
- add_categories
Logical. Add sample_category and sterile_classification. sterile_classification is collapsed to Sterile, Non-Sterile, or Others/Ambiguous using specimen-specific rules for body-fluid, drain/device-associated, and unspecified samples. Default TRUE.