Derive a Condition-filtered copy of a sample annotation file
Source:R/run-report.R
derive_filtered_annotation.RdReads annotation_file from folder, keeps only rows whose Condition
matches pattern (via grepl()), and writes the result alongside it as
<stem>_<suffix>.csv — the preprocessing step 00_knit_reports.R ran once
to derive the _jy/_plasma annotation subsets from _all before
batch-rendering per-subset reports.
Usage
derive_filtered_annotation(
annotation_file,
folder,
pattern,
suffix = tolower(pattern)
)Arguments
- annotation_file
Name of the source annotation csv (in
folder), e.g."sample_annotation_dda_all.csv".- folder
Directory containing
annotation_file(and where the filtered copy is written), e.g."1_documentation".- pattern
Regular expression matched against
Conditionviagrepl()to select rows, e.g."JY"or"Plasma".- suffix
Suffix appended to the filename stem to name the filtered copy (defaults to
tolower(pattern)).