Batch-read FragPipe psm.tsv files and merge them
Source: R/loaders-fragpipe.R
read_fragpipe_batch.RdReads all FragPipe psm.tsv files and row-binds the result. Three input
modes are supported (checked in priority order):
Arguments
- folder
Top-level directory. Required when using the
annotationor scan-all modes; unused whenfilesis supplied.- annotation
Optional annotation data frame (output of
read_annot()). When provided withoutfiles, onlySample_fpentries present inannotationare read.- files
Optional character vector of
psm.tsvfile paths or parent folder paths to read directly.- testmode
Logical; passed through to
read_fragpipe()(keeps only the first ~100 rows per run whenTRUE, for fast iteration).
Value
The merged raw PSM data frame across every file found, with
Sample_fp identifying the source subfolder of each row.
Details
files— character vector ofpsm.tsvfile paths or their parent folder paths; sample names are taken from the immediate parent folder.annotation— only theSample_fpentries listed in the annotation table are read fromfolder; warns about any annotated samples not found on disk.neither —
folderis scanned recursively for everypsm.tsv(original default behaviour).
Examples
if (FALSE) { # \dontrun{
# scan entire folder
read_fragpipe_batch(file.path("2_data", "fragpipe_dda_combined"), testmode = FALSE)
# restrict to annotated samples only
read_fragpipe_batch(folder = "2_data", annotation = annot)
# provide paths explicitly
read_fragpipe_batch(files = c("2_data/fragpipe/JY_1/psm.tsv", "2_data/fragpipe/JY_2"))
} # }