@hechth - absolutely could be done. A few items to consider:
are there enough samples in each group for correlation-based clustering to be meaningful? If not, it would be best to develop a peak shape based clustering as well. i had actually started down this path and lost steam and ultimately abandoned it, for lack of time to validate it. There is a clear path forward for it though. You can simultaneously use all the similarity metrics, retention time of the feature, correlation, and peak shape by expanding the existing similarity product score. In theory IMS data could also be incorporated, if available.
if you perform RAMClustR by sample groups then cluster spectra, how do you deal with feature assignments which are in conflict?
How do you deal with missing spectra in the blanks (NA values are a bit of a nuisance...).
If you are going to be performing clustering by sample type, would be be best to perform XCMS by sample type as well?
If two spectra from two groups align pretty well but imperfectly, what set of features should be used in the quantitative assignments - only the overlapping features or all features?
Originally posted by @cbroeckl in https://github.com/cbroeckl/RAMClustR/issues/31#issuecomment-1402196834