Cardinal icon indicating copy to clipboard operation
Cardinal copied to clipboard

mzBin error: when binned mz list range greater than image data mz range

Open MASHUOA opened this issue 4 years ago • 0 comments

Target mz list: m.z intensities 1 100.0728 1.000000e+02 2 100.3728 6.850653e-03 3 100.4121 1.080176e-05 4 100.6063 1.259239e-04

imdata mz range

imdata An object of class 'MSContinuousImagingExperiment' <28936 feature, 6618 pixel> imaging dataset imageData(1): intensity featureData(0): pixelData(3): 3DPositionX 3DPositionY 3DPositionZ metadata(11): ibd binary type universally unique identifier ... files name processing complete(1): mzBin processing pending(0): run(1): 72hr_01_210408_trim raster dimensions: 82 x 106 x 1 coord(3): x = 1..82, y = 1..106, z = 0..0 mass range: 100.3728 to 997.7062 centroided: NA

if we run:

imdata <- imdata %>%
       mzBin(Target_mz_list$m.z, resolution=10, units="ppm") %>% process()

then error message: processing [mzBin] ... first error: bin limits must be positive

It seems like the bin limits were calculated from the other adjacent mz features surrounding the target mz. and even if the mz tolerance is within the reasonable range, it still gives a c(-inf, mz+tolerance) limits.

MASHUOA avatar May 18 '21 00:05 MASHUOA