Learn R Programming

Signac (version 1.1.0)

CoveragePlot: Plot Tn5 insertion frequency over a region

Description

Plot frequency of Tn5 insertion events for different groups of cells within given regions of the genome.

Usage

CoveragePlot(
  object,
  region,
  features = NULL,
  assay = NULL,
  show.bulk = FALSE,
  expression.assay = "RNA",
  expression.slot = "data",
  annotation = TRUE,
  peaks = TRUE,
  ranges = NULL,
  ranges.title = "Ranges",
  links = TRUE,
  tile = FALSE,
  tile.size = 100,
  tile.cells = 100,
  heights = NULL,
  group.by = NULL,
  window = 100,
  extend.upstream = 0,
  extend.downstream = 0,
  scale.factor = NULL,
  ymax = NULL,
  cells = NULL,
  idents = NULL,
  sep = c("-", "-"),
  max.downsample = 3000,
  downsample.rate = 0.1,
  ...
)

Arguments

object

A Seurat object

region

A set of genomic coordinates to show. Can be a GRanges object, a string encoding a genomic position, a gene name, or a vector of strings describing the genomic coordinates or gene names to plot. If a gene name is supplied, annotations must be present in the assay.

features

A vector of features present in another assay to plot alongside accessibility tracks (for example, gene names).

assay

Name of the assay to plot

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).

expression.assay

Name of the assay containing expression data to plot alongside accessibility tracks. Only needed if supplying features argument.

expression.slot

Name of slot to pull expression data from. Only needed if supplying the features argument.

annotation

Display gene annotations

peaks

Display peaks

ranges

Additional genomic ranges to plot

ranges.title

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

links

Display links

tile

Display per-cell fragment information in sliding windows.

tile.size

Size of the sliding window for per-cell fragment tile plot

tile.cells

Number of cells to display fragment information for in tile plot.

heights

Relative heights for each track (accessibility, gene annotations, peaks, links).

group.by

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

window

Smoothing window size

extend.upstream

Number of bases to extend the region upstream.

extend.downstream

Number of bases to extend the region downstream.

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. If NULL (default) set to the highest value among all the tracks.

cells

Which cells to plot. Default all cells

idents

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

sep

Separators to use for strings encoding genomic coordinates. First element is used to separate the chromosome from the coordinates, second element is used to separate the start from end coordinate.

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.

...

Additional arguments passed to wrap_plots

Value

Returns a ggplot object

Details

Thanks to Andrew Hill for providing an early version of this function.

Examples

Run this code
# NOT RUN {
fpath <- system.file("extdata", "fragments.tsv.gz", package="Signac")
fragments <- CreateFragmentObject(
  path = fpath,
  cells = colnames(atac_small),
  validate.fragments = FALSE
)
Fragments(atac_small) <- fragments
CoveragePlot(object = atac_small, region = c("chr1-713500-714500"))
# }

Run the code above in your browser using DataLab