Filter an MGF file to keep only spectra for features present in mmo$feature_data$id
filter_mgf_to_mmo.RdCreate a new .mgf file that contains only spectra (ION blocks) whose
FEATURE_ID occurs in mmo$feature_data$id. This is useful for keeping
your spectral library in sync with the features currently stored in an mmo
object (e.g., after subsetting, filtering, or rebuilding an mmo).
Arguments
- mmo
An ecomet
mmoobject containing a requiredfeature_datatable with anidcolumn (mmo$feature_data$id).- mgf_path
Character. Path to the input
.mgffile.- output_path
Character or NULL. Path to write the filtered
.mgf. IfNULL(default), the output name is derived frommgf_pathby appending_filteredbefore the.mgfextension (or adding_filtered.mgfif no extension is present).- chunk_lines
Integer. Number of lines read per iteration. Larger values are typically faster but use more memory. Default is
100000L.- verbose
Logical. If
TRUE(default), prints a short progress summary and final counts.
Value
Invisibly returns a list with:
output_path: path to the filtered MGFblocks_total: totalBEGIN IONSblocks encounteredblocks_kept: number of blocks written tooutput_pathlines_read: total lines read frommgf_path