Add chemical similarity matrices to the mmo
AddChemSim.RdThis function reads cosine, DREAMS, and MS2DeepScore molecular networking outputs from MZmine
and stores the raw pairwise similarity matrices (values 0–1, higher = more similar)
in the mmo. For datasets with more than 10,000 features a sparse Matrix is used
to avoid allocating a full dense matrix; unobserved feature pairs carry implicit similarity 0
(equivalent to dissimilarity 1, maximally different).
Value
The mmo with similarity matrices stored in mmo$cos.sim,
mmo$dreams.sim, and/or mmo$m2ds.sim. Large datasets (n > 10,000)
use sparse dgCMatrix format; smaller datasets use a dense numeric matrix.
Note
Tree-based downstream functions (GetFaithPD, FeatureDendrogram,
GetBetaDiversity with method = "Gen.Uni") require a full n x n distance
matrix and will fail at large scale regardless of sparse storage. Use filter_mmo()
to reduce feature count before calling those functions.