Skip to content

Memory consumption in writeMSIData #66

Description

@pakiessling

Hi,
I am trying to process an MSImagingExperiment 355700 features and 396117 spectra. 500 GB on disk.
I am suppliyng 400 GB of RAM to Cardinal.

I have the following script:

library(Cardinal)
library(BiocParallel)

setCardinalBPPARAM(MulticoreParam(workers = 4))

obj <- readMSIData("125.imzML")

obj <- summarizeFeatures(obj, c(Mean = "mean"))
print("Summarizing features done")
obj <- summarizePixels(obj, c(TIC = "sum"))
print("Summarizing pixel done")

obj_peaks <- obj |>
    normalize(method="tic") |>
    peakProcess(snr=7, noise="diff")

print("Normalization and peak processing done")

rm(obj)
gc()


setCardinalBPPARAM(MulticoreParam(workers = 1))
writeMSIData(
    obj_peaks,
    "125_peaks_centroided_final.imzML",
    bundle = TRUE
)

CardinalIO_1.4.0 matter_2.8.0 Cardinal_3.8.0

I keep crashing during the writing step.
Is there anything I can do to consume less memory in the writing step?
Write in chunks or something?

Thank you!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions