scan_metadata_plot: Make a Scatter Plot of Scan Metadata

View source: R/scan_metadata_plot.R

scan_metadata_plotR Documentation

Make a Scatter Plot of Scan Metadata

Description

Generate an interactive or static plot of a scan metadata variable versus a second metadata variable, with possible coloring of points by a third.

Usage

scan_metadata_plot(
  ScanMetadata,
  XVar = "Precursor M/Z",
  YVar = "Retention Time",
  LabVar = "MS Level",
  Interactive = TRUE,
  MSFilter = NULL,
  ScanNumFilter = NULL
)

Arguments

ScanMetadata

Object of the scan_metadata class from get_scan_metadata

XVar

X variable of the plot. Accepted values are: Scan Number, Retention Time, Precursor M/Z, Precursor Scan, Calculated Mass, and Experimental Mass. The mass variables can only be used if ID data is provided. Default is Precursor M/Z.

YVar

Y variable of the plot. Accepted values are the same as XVar. Default is Retention Time.

LabVar

Variable to label the points. More options available if ID data is provided. Accepted values are: MS Level, Precursor Charge, Score, and Q Value. Default is MS Level.

Interactive

If True, an interactive plotly graphic will be returned. If False, a static ggplot graphic will be returned. Default is TRUE.

MSFilter

A vector containing the MS Levels to filter by. Acceptable options are NULL, 1, 2, or c(1,2). Default is NULL.

ScanNumFilter

A vector of length 2 containing the minimum and maximum Scan Numbers to filter by. Default is NULL.

Examples

## Not run: 

# Build scan_metadata object with bottom_up example
scan_metadata_plot(BU_ScanMetadata, XVar = "Calculated Mass", YVar = "Retention Time",
                   LabVar = "Precursor Charge", Interactive = FALSE)
scan_metadata_plot(BU_ScanMetadata, XVar = "Precursor M/Z", YVar = "Retention Time",
                   LabVar = "Score", Interactive = TRUE, MSFilter = 2, ScanNumFilter = c(32000, 34500))


## End(Not run)

EMSL-Computing/pspecterlib documentation built on Jan. 28, 2024, 8:13 p.m.