Skip to contents

Plot multiple coverage plots

Usage

MultiCoveragePlot(
  object,
  regions,
  region_names = NULL,
  extend.upstream = NULL,
  extend.downstream = NULL,
  region.highlight = NULL,
  assay = "peaks",
  assay.scale = "common",
  annotation = TRUE,
  peaks = TRUE,
  group.by = NULL,
  idents = NULL,
  split.by = NULL,
  cells = NULL,
  show.bulk = FALSE,
  ranges_list = NULL,
  ranges.title = "Ranges",
  max.downsample = 3000,
  downsample.rate = 0.1,
  scale.factor = NULL,
  ymax = NULL,
  window = 100,
  bigwig = NULL,
  bigwig.type = "coverage",
  bigwig.scale = "common",
  title_size = 6,
  subtitle_size = 5,
  coords_size = 6
)

Arguments

object

A SeuratObject::Seurat object

regions

List of genes or a GenomicRanges::GRanges() object to plot

region_names

List of plot titles for each region. If NULL, no title is added.

extend.upstream

Number of bases to extend the region upstream. Default is 0. Can be a vector the same length as regions, or a single integer. If supplied with a single integer, extend upstream the same number of bases for every region in regions.

extend.downstream

Number of bases to extend the region downstream. Follows the same logic as extend.upstream, but applying to downstream bases.

region.highlight

List of regions to highlight for each plotted region, should be the same length as regions. Each item should be a GenomicRanges::GRanges object containing the coordinates to highlight, or NULL if no highlight is needed for that particular region. By default, regions will be highlighted in grey. To change the color of the highlighting, include a metadata column in the GRanges object named "color" containing the color to use for each region.

assay

Name of the assay to plot.

assay.scale

Scaling to apply to data from different assays. Can be:

  • common: plot all assays on a common scale (default)

  • separate: plot each assay on a separate scale ranging from zero to the maximum value for that assay within the plotted region

annotation

Display gene annotations. Set to TRUE or FALSE to control whether genes models are displayed, or choose "transcript" to display all transcript isoforms, or "gene" to display gene models only (same as setting TRUE).

peaks

Display peaks

group.by

Name of one or more metadata columns to group (color) the cells by. Default is the current cell identities

idents

Which identities to include in the plot. Default is all identities.

split.by

A metadata variable to split the tracks by. For example, grouping by "celltype" and splitting by "batch" will create separate tracks for each combination of celltype and batch.

cells

Which cells to plot. Default all cells

show.bulk

Include coverage track for all cells combined (pseudo-bulk). Note that this will plot the combined accessibility for all cells included in the plot (rather than all cells in the object).

ranges_list

List of additional genomic ranges to plot for each region, should be the same length as regions. Each item should be a GenomicRanges::GRanges object or NULL if no additional ranges is needed for a region. Can also be a single GRanges object to be plotted for every region.

ranges.title

Y-axis title for ranges track. Only relevant if ranges_list parameter is set.

max.downsample

Minimum number of positions kept when downsampling. Downsampling rate is adaptive to the window size, but this parameter will set the minimum possible number of positions to include so that plots do not become too sparse when the window size is small.

downsample.rate

Fraction of positions to retain when downsampling. Retaining more positions can give a higher-resolution plot but can make the number of points large, resulting in larger file sizes when saving the plot and a longer period of time needed to draw the plot.

scale.factor

Scaling factor for track height. If NULL (default), use the median group scaling factor determined by total number of fragments sequences in each group.

ymax

Maximum value for Y axis. Can be one of:

  • NULL: set to the highest value among all the tracks (default)

  • qXX: clip the maximum value to the XX quantile (for example, q95 will set the maximum value to 95% of the maximum value in the data). This can help remove the effect of extreme values that may otherwise distort the scale.

  • numeric: manually define a Y-axis limit

window

Smoothing window size

bigwig

List of bigWig file paths to plot data from. Files can be remotely hosted. The name of each element in the list will determine the y-axis label given to the track.

bigwig.type

Type of track to use for bigWig files ("line" or "coverage"). Should either be a single value, or a list of values giving the type for each individual track in the provided list of bigwig files.

bigwig.scale

Same as assay.scale parameter, except for bigWig files when plotted with bigwig.type="coverage"

title_size

Size of plot title, only applicable if region_names is not NULL. Default is 6

subtitle_size

Size of plot subtitle (coverage plot range). Default is 5

coords_size

Size of plot coordinate text. Default is 6

Value

Returns a ggplot object