Pairwise EIC similarity for xcms features
get_xcms_feature_EIC_similarity.RdCompute per-sample feature-by-feature EIC similarity matrices
for pairs with |rtmed_i - rtmed_j| < rt_tol. Used by
MSdev_group_feature_EIC. Results are stored as symmetric
Matrix sparse matrices; absent entries are non-neighbor pairs
(filled when densified for grouping; see absent_sim in
xcms_group_feature_EIC). Pairwise scores are pooled across
selected samples and split into n_chunks BiocParallel jobs (each
chunk ships only the chromatogram columns it needs). EICs are expected to
be zero-filled over their windows on the shared sample RT grid (via
XChromatograms_subset_feature), so correlation reflects the
full peak window rather than only the non-NA overlap.
Usage
get_xcms_feature_EIC_similarity(
xcms.xcms,
chroms,
rt_tol = 5,
expandRt = 2,
min_width = 20,
selected_sample = NULL,
n_chunks = NULL,
BPPARAM = BiocParallel::SerialParam()
)Arguments
- xcms.xcms
XCMSnExp / XcmsExperiment with feature definitions.
- chroms
Chromatograms (e.g. from
get_xcms_feature_chromatogram) with feature rownames matchingfeatureDefinitions.- rt_tol
numeric(1). Maximum absolute RT difference (seconds) for which EIC similarity is computed. Default 5.
- expandRt
numeric(1). Seconds added on each side of each feature's
peakRtMin/peakRtMaxwindow when cropping EICs viaXChromatograms_subset_featurebefore correlation (requirespeakRtMin/peakRtMaxinchroms@featureDefinitions). Default2.- min_width
numeric(1). Minimum RT window width (seconds) after
expandRt; shorter windows are padded equally on both sides. Default20.- selected_sample
NULL, integer index/indices, or sample name(s) (
sample.name/ chromatogram colnames). NULL uses all samples.- n_chunks
NULL or positive integer. Number of BiocParallel chunks into which
n_samples * n_rt_pairssimilarity jobs are split. WhenNULL(default), usesmin(bpnworkers(BPPARAM), n_jobs)for backward compatibility. Set explicitly (e.g.200L) on large batch projects to keep Snow payloads small;BPPARAMworkers then control parallelism only.- BPPARAM
BiocParallel backend. Default
SerialParam().