Different results with spectra and summarizeFeatures

23 views
Skip to first unread message

Marco Fidaleo

unread,
Aug 28, 2024, 10:10:18 AM8/28/24
to Cardinal MSI Help

Dear All,

In addition to cluster formation, I'm interested in quantifying a specific ion in two different clusters. Therefore, after performing a clustering analysis, I used the following command:

 

segments <- MyFile$`r=2,k=10,s=64`$class 

levels(segments) <- paste0("C",levels(segments))


MyFile_means <- summarizeFeatures(MyFile _peaks, stat="mean", groups=segments)

featureData(MyFile_means)


Then, I make 2 files resulting from these commands, and manually merge them in a table. I focused on the m/z values that were most likely to define a specific cluster and then examined the same ion in another cluster. I immediately noticed that the intensity values of the centroids were an order of magnitude different from the scale I see in the images—about 20 times higher.

 

So, for a specific ion of interest, I ran this other command:

cols <- paste0(levels(segments), ".mean")

write.csv(pData(MyFile_means), file="C:/MyFile_means_pData.csv")

 

intensity <-spectra(MyFile)[features(MyFile, mz=XXX),]

Then I marged the 2 file tables obtained. 

Using the values obtained, I calculate the average, expecting results similar to the centroid values. However, the values produced by the spectra command differ from those generated by summarizeFeatures, though they seem more accurate compared to what I observe in the images. In some cases, I even noticed a difference with spectra command for a specific ion in two clusters, while summarizeFeatures showed no difference in average. I'm wondering why these differences occur and which value should be considered.

Thank you for your help. 

M

kbemis

unread,
Aug 29, 2024, 4:52:33 PM8/29/24
to Cardinal MSI Help
Considering we are talking about (1) an average of intensities versus (2) a distribution of intensities as displayed on the ion image, I am still not sure why you would expect them to be similar? It is expected that the maximum intensity of a whole image may be an order of magnitude larger than its average. The range displayed for an image colormap is linear while the distribution of intensities is typically very skewed. The mean may be much smaller than even the "middle" value in the colormap.

If I am misunderstanding, can you please provide a reproducible example using a simulated image or an example dataset from CardinalWorkflows?

-Kylie

Reply all
Reply to author
Forward
0 new messages