I'm new to MSnbase package and am trying to plot MS2 spectra with each peaks annotated with their m/z values.
I followed the examples from the MSnbase document as below.
rawdata <- readMSData("filename", msLevel = 2) sp <- rawdata[which.max(peaksCount(rawdata))] plot(sp, full = TRUE)
This gives me a plot of intensity vs. M/Z. I read in the documentation that plot function can annotate fragment ions by matching it to a peptide sequence, but I'm wondering if I can annotate each of these peaks with their M/Z values instead of their IDs, to make sure all peaks that weren't matched to some reference still show their M/Z values. In addition, it would also be useful if I can annotate M/Z values of ten peaks that have highest intensities. I'm aware that I can use
mz(rawdata) to get a list of M/Zs but just wondering if there are ways to plot them using functions supported in the MSnbase package. Any advice would be greatly appreciated!