Batch-read PEAKS export folders and merge them into raw long format
Source:R/loaders-peaks.R
read_peaks_batch.RdIndexes the PEAKS export subfolders (via
get_dirs_index_peaks()), selects which to read, then reads and row-binds
each one with read_peaks(). Three input modes are supported (checked in
priority order):
Arguments
- folder
Top-level directory containing the PEAKS export subfolders. Required when using
annotationor scan-all modes; may beNULLwhenfilesis supplied.- annotation
Optional annotation data frame (output of
read_annot()). When provided withoutfiles, only subfolders whosebasenameis inannotation$Sample_folderare read (Sample_peaksis used instead when the table predates that column, which is the one-folder-per-sample layout where the two keys coincide).- files
Optional character vector of PEAKS export folder paths to read directly, bypassing the directory index.
- instrument
Passed to
read_peaks(); one of"tims_tof","faims_orbi","orbi".
Value
The raw long-format PEAKS data frame across every matched subfolder,
with Sample_peaks identifying the source subfolder of each row.
Details
files— character vector of PEAKS export folder paths; uses those directly, bypassing the directory index.annotation— filters the directory index to subfolders whosebasenameis listed inannotation$Sample_folder(falling back toSample_peakswhen the table has noSample_folder).neither — all non-QC PEAKS subfolders under
folderare read.
The folder key and the sample key are not the same thing for PEAKS. One
export folder normally holds several samples, as one Area#<sample> column
each inside its peptide.csv, and read_peaks() turns those suffixes into
Sample_peaks. So Sample_folder selects the folders here, while
Sample_peaks is what annotate_peaks() later joins the metadata on. Keying
the folder filter on Sample_peaks (as this did before v0.22.0) matched no
folder at all whenever the two differed, and the empty read then died inside
parse_peaks() with object 'Accession' not found.
The metadata join (adding Condition, BioReplicate, Sample, etc.)
happens in annotate_peaks(), not here. This function returns the raw
long-format PEAKS data only.