VariantPlot: Plots variants

View source: R/VariantPlot.R

VariantPlotR Documentation

Plots variants

Description

Plots variants as dot color on top of a dimensionality reduction used as x-y coordinates. By default, reference allele is blue, alternate allele is red, and heterozygous is purple.

Usage

VariantPlot(
  object,
  variants,
  reduction = NA,
  dims = c(1, 2),
  pt.size = 1,
  n.rows = NA,
  assay = "VAR",
  colors = c("lightgrey", "blue", "red", "purple"),
  order = T
)

Arguments

object

Seurat object.

variants

character(n). The name of the variant(s) to plot (as point color)

reduction

character(1). The name of the dimensionality reduction that should be used as xy axis. If NA, will use umap, or tsne, or pca, in this order. Default: NA.

dims

numeric(2). The dimensions within the dimensionality reduction that should be used as xy axis. Default: c(1,2).

pt.size

numeric(1).The point size. Default: 1.

n.rows

numeric(1).The number of rows in the plot grid. NA for automatic smart choice. Default: NA.

assay

numeric(1). The assay from which the variant calls (in vartrix conventions) should be pulled. Default: "VAR".

colors

character(n). Four colors, that will be used respectively for: no call, ref/ref, alt/alt, ref/alt calls.

order

logical(1). Should the cells be ordered, with no call at the bottom and heterozygous on top, before plotting. Default: T.

Value

Returns a cowplot grid of plots

Examples

VariantPlot(MySeuratObject, "KRAS-12-G/D-MODERATE-chr12-25245350-C-T")
VariantPlot(MySeuratObject, VariableFeatures(MySeuratObject[["VAR"]])[1:9], reduction="mds", dims=c(1,3))

nbroguiere/burgertools documentation built on Jan. 30, 2024, 3:48 a.m.