Closed Adafede closed 1 year ago
The compareChromatograms
function has different parameters than the correlate
function, thus, you can not use it in exactly the same way. To get the same results you need to call:
compareChromatograms(fenamiphos_ms2_chr[1, 1],
fenamiphos_ms1_chr[1, 1], ALIGNFUNARGS = list(method = "approx"))
So, compareChromatograms
performs first a alignment of the chromatograms using the function alignRt
and then calculates the similarity. The alignment function can be specified with parameter ALIGNFUN
(defaults to alignRt
, see ?alignRt
for details), parameters to this function can be passed with parameter ALIGNFUNARGS
. The similarity calculation function can be defined with parameter FUN
(defaults to cor
), parameters to this function can be defined with parameter FUNARGS
.
This might seem more complicated but it is also more flexible, because (similar to the compareSpectra
function) it allows you now to define different ways to align/match the chromatograms and to calculate the similarity.
Hi,
For some context, I am trying to compare peak shapes coming from different detectors in order to group them.
I started with https://bioconductor.org/packages/3.15/bioc/vignettes/xcms/inst/doc/xcms-lcms-ms.html#32_Reconstruction_of_MS2_spectra, which offers the nice
correlate
function. It is what I am looking for. As I ran it, it suggested using the newcompareChromatograms
function, I did it but found some discrepancies without really understanding where they come from. I looked at the related work done on EIC grouping by @jorainer but still have no idea where the origin of the problem is, probably a slight difference inXChromatograms
andMChromatograms
I do not get.For reproducing what I am talking about:
I am happy to help further in case!
Best holiday wishes,