getChromatogram.Rd
Get the extracted ion chromatogram
getChromatogram(
object,
dt_range = NULL,
rt_range = NULL,
dt_idx = NULL,
rt_idx = NULL,
aggregate = colSums
)
A GCIMSSample object
The minimum and maximum drift times to extract (length 2 vector)
The minimum and maximum retention times to extract (length 2 vector)
A numeric vector with the drift time indices to extract (or a logical vector of the length of drift time)
A numeric vector with the retention time indices to extract (or a logical vector of the length of retention time)
Function that takes the subsetted intensity matrix according to the region of interest
and aggregates the drift times, returning a vector representing the chromatogram intensity. colSums
by default.
A GCIMSChromatogram object
x <- GCIMSSample(
drift_time = 1:2,
retention_time = 1:3,
data = matrix(1:6, nrow = 2, ncol = 3)
)
getChromatogram(x)
#> An object of class "GCIMSChromatogram"
#> Slot "retention_time":
#> [1] 1 2 3
#>
#> Slot "intensity":
#> 1 2 3
#> 3 7 11
#>
#> Slot "baseline":
#> NULL
#>
#> Slot "drift_time_idx":
#> [1] 1 2
#>
#> Slot "drift_time_ms":
#> [1] 1 2
#>
#> Slot "description":
#> character(0)
#>
#> Slot "peaks":
#> NULL
#>
#> Slot "peaks_debug_info":
#> NULL
#>
# Take the maximum intensity in the region for each retention time:
sp1 <- getChromatogram(x, aggregate = function(x) apply(x, 2, max))