e.g.
chromPeaks(peaks.obj, mz = c(335.0541, 335.1077), rt = c(285, 310))
isn't the same as
chromPeaks(peaks.obj |> filterRt(c(285, 310)) |> filterMz(c(335.0541, 335.1077)))
chromPeaks will return peaks outside of the RT range at least, resulting in extra peaks. If you use this to color peak backgrounds, you'll
end up with miscolored peaks because the indices won't match up
plot(chromatogram(peaks.obj,
mz = c(335.0541, 335.1077), rt = c(285, 310)),
col = sample.colors,
peakBg = paste0(peaks.obj[chromPeaks(
peaks.obj, mz = c(335.0541, 335.1077), rt = c(285, 310)
)[,'sample']], '30'))
mz mzmin mzmax rt rtmin rtmax into intb maxo sn sample
CP0355 335.0791 335.0786 335.0793 298.913 293.9430 306.8650 1650613 1631942 332368.6 97 1
CP0356 335.0791 335.0789 335.0793 283.009 281.0220 285.9910 1953385 1945384 419471.7 122 1
CP0814 335.0810 335.0804 335.0813 298.621 293.6510 306.5730 1806863 1777626 358880.1 85 2
CP0815 335.0810 335.0808 335.0811 283.712 280.7300 293.6510 3224918 3195682 457536.1 108 2
CP1463 335.0806 335.0801 335.0820 298.178 294.2020 308.1180 6749476 6660470 1526633.2 236 3
CP1976 335.0813 335.0806 335.0816 298.796 293.8260 306.7480 1866801 1830464 380826.7 86 4
CP1977 335.0816 335.0811 335.0820 283.886 280.9050 293.8260 3245603 3209269 464069.1 105 4
CP2486 335.0812 335.0805 335.0824 298.264 293.2940 307.2100 6500536 6393328 1442304.0 242 5
CP2967 335.0808 335.0801 335.0822 298.126 294.1500 307.0710 6412876 6329408 1453793.6 235 6
CP3518 335.0812 335.0799 335.0815 284.263 280.8175 293.7385 2556486 NA 487242.3 NA 3
CP3840 335.0811 335.0799 335.0815 284.348 280.8175 293.7385 2504703 NA 475024.7 NA 5
CP4014 335.0812 335.0799 335.0815 284.210 280.8175 293.7385 2558104 NA 499975.2 NA 6
vs
plot(chromatogram(peaks.obj,
mz = c(335.0541, 335.1077), rt = c(285, 310)),
col = sample.colors,
peakBg = paste0(peaks.obj[chromPeaks(
peaks.obj |>
filterRt(c(285, 310)) |>
filterMz(c(335.0541, 335.1077))
)[,'sample']], '30'))
mz mzmin mzmax rt rtmin rtmax into intb maxo sn sample
CP0355 335.0791 335.0786 335.0793 298.913 293.943 306.865 1650613 1631942 332368.6 97 1
CP0814 335.0810 335.0804 335.0813 298.621 293.651 306.573 1806863 1777626 358880.1 85 2
CP1463 335.0806 335.0801 335.0820 298.178 294.202 308.118 6749476 6660470 1526633.2 236 3
CP1976 335.0813 335.0806 335.0816 298.796 293.826 306.748 1866801 1830464 380826.7 86 4
CP2486 335.0812 335.0805 335.0824 298.264 293.294 307.210 6500536 6393328 1442304.0 242 5
CP2967 335.0808 335.0801 335.0822 298.126 294.150 307.071 6412876 6329408 1453793.6 235 6
e.g.
chromPeaks(peaks.obj, mz = c(335.0541, 335.1077), rt = c(285, 310))isn't the same as
chromPeaks(peaks.obj |> filterRt(c(285, 310)) |> filterMz(c(335.0541, 335.1077)))chromPeaks will return peaks outside of the RT range at least, resulting in extra peaks. If you use this to color peak backgrounds, you'll
end up with miscolored peaks because the indices won't match up
vs