Several samples are plotted side by side, on the same intensity color scale, so they are visually comparable. Paginated: only one page's worth of samples is ever loaded into memory at a time for rendering.

# S4 method for class 'GCIMSDataset,ANY'
plot(
  x,
  sample = NULL,
  dt_range = NULL,
  rt_range = NULL,
  ...,
  remove_baseline = FALSE,
  trans = "cubic_root",
  intensity_range = "global",
  nrow = NULL,
  ncol = NULL,
  page = 1
)

Arguments

x

A GCIMSDataset object

sample

A number, a string, or a vector of numbers/strings with the sample index(es) or name(s) to plot. If NULL (the default), all samples are plotted (across as many pages as needed).

dt_range

The minimum and maximum drift times to extract (length 2 vector)

rt_range

The minimum and maximum retention times to extract (length 2 vector)

...

Ignored

remove_baseline

Set to TRUE to subtract each sample's estimated baseline first

trans

The transformation to the intensity values, see plot,GCIMSSample-method

intensity_range

Controls the shared color scale across all plotted samples (all pages, not just the current one). One of:

  • "global" (the default): each sample's full, uncropped intensity range, regardless of sample/dt_range/rt_range. With remove_baseline = FALSE, this comes from a cache computed once, alongside TIS/RIC, so it's free. With remove_baseline = TRUE, the cache (raw intensities) doesn't apply, so each selected sample's full, uncropped, baseline-removed range is computed instead (loading every selected sample's data an extra time).

  • "ranged": the range of exactly what's plotted (respecting dt_range, rt_range and remove_baseline), across every selected sample, not just the current page – so the scale is still comparable page to page. This is deliberately not page-scoped: a cheaper, page-local range would make pages incomparable to each other, defeating the purpose of paging through a dataset to compare samples. Costs loading every selected sample's data twice (once to compute the range, once to plot).

  • A numeric vector of length 2, c(min, max): fixed limits.

  • A length-2 vector/list whose elements are independently a number, "global" or "ranged", e.g. list(min = 0, max = "global").

nrow, ncol

Page grid shape, forwarded to cowplot::plot_grid(). Page capacity is nrow * ncol. If both are NULL (the default), they're picked from the number of selected samples: an exact fit for 1-6 samples (e.g. 5 or 6 samples -> 2x3), otherwise 3x3 (so page capacity maxes out at 9, and more than 9 selected samples span multiple pages). If only one of nrow/ncol is given, the other becomes 3 when there are more than 9 selected samples, or just enough to fit them all on one page otherwise.

page

Which page to plot, 1-based. Errors if out of bounds.

Value

A combined plot with one panel per sample, for the requested page