R/ChromBackendMemory.R
ChromBackendMemory.Rd
ChromBackendMemory
: This backend stores chromatographic data directly
in memory, making it ideal for small datasets or testing. It can be
initialized with a data.frame
of chromatographic data via the chromData
parameter and a list
of data.frame
entries for peaks data using the
peaksData
parameter. These data can be accessed with the chromData()
and
peaksData()
functions.
ChromBackendMemory()
# S4 method for class 'ChromBackendMemory'
backendInitialize(
object,
chromData = fillCoreChromVariables(data.frame()),
peaksData = list(.EMPTY_PEAKS_DATA),
...
)
A ChromBackendMemory
object.
For backendInitialize()
of a ChromBackendMemory
backend, a data.frame
with the chromatographic data. If not
provided (or if empty), a default data.frame
with the core
chromatographicvariables will be created.
For backendInitialize()
of a ChromBackendMemory
backend, a list
of data.frame
with the peaks data. If not
provided (or if empty), a default list
of empty data.frame
with
the core peaks variables will be created. The length of the list
should match the number of chromatograms in the chromData
parameter.
Additional parameters to be passed.
## Create a ChromBackendMemory object
cbm <- ChromBackendMemory()
## Initialize the ChromBackendMemory object with a data.frame of
## chromatographic data and a list of data.frame of peaks data
cdata <- data.frame(
msLevel = c(1L, 1L, 1L),
mz = c(112.2, 123.3, 134.4),
chromIndex = c(1L, 2L, 3L)
)
pdata <- list(
data.frame(
rtime = c(12.4, 12.8, 13.2, 14.6),
intensity = c(123.3, 153.6, 2354.3, 243.4)
),
data.frame(
rtime = c(45.1, 46.2),
intensity = c(100, 80.1)
),
data.frame(
rtime = c(12.4, 12.8, 13.2, 14.6),
intensity = c(123.3, 153.6, 2354.3, 243.4)
)
)
cbm <- backendInitialize(cbm, chromData = cdata, peaksData = pdata)
cbm
#> ChromBackendMemory with 3 chromatograms
#> chromIndex msLevel mz
#> 1 1 1 112.2
#> 2 2 1 123.3
#> 3 3 1 134.4
#> ... 0 more chromatogram variables/columns
#> ... 2 peaksData variables