This function will plot the coverage at an input region in the style of a browser track. It allows for normalization of the signal which enables direct comparison across samples. Note that the genes displayed in these plots are derived from your geneAnnotation (i.e. the BSgenome object you used) so they may not match other online genome browsers that use different gene annotations.

plotBrowserTrack(
  ArchRProj = NULL,
  region = NULL,
  groupBy = "Clusters",
  useGroups = NULL,
  plotSummary = c("bulkTrack", "featureTrack", "loopTrack", "geneTrack"),
  sizes = c(10, 1.5, 3, 4),
  features = getPeakSet(ArchRProj),
  loops = getCoAccessibility(ArchRProj),
  geneSymbol = NULL,
  useMatrix = NULL,
  log2Norm = TRUE,
  upstream = 50000,
  downstream = 50000,
  tileSize = 250,
  maxCells = 500,
  minCells = 25,
  normMethod = "ReadsInTSS",
  highlight = NULL,
  highlightFill = "firebrick3",
  threads = getArchRThreads(),
  ylim = NULL,
  pal = NULL,
  baseSize = 7,
  scTileSize = 0.5,
  scCellsMax = 100,
  borderWidth = 0.4,
  tickWidth = 0.4,
  facetbaseSize = 7,
  geneAnnotation = getGeneAnnotation(ArchRProj),
  title = "",
  verbose = TRUE,
  logFile = createLogFile("plotBrowserTrack")
)

Arguments

ArchRProj

An ArchRProject object.

region

A GRanges region that indicates the region to be plotted. If more than one region exists in the GRanges object, all will be plotted. If no region is supplied, then the geneSymbol argument can be used to center the plot window at the transcription start site of the supplied gene.

groupBy

A string that indicates how cells should be grouped. This string corresponds to one of the standard or user-supplied cellColData metadata columns (for example, "Clusters"). Cells with the same value annotated in this metadata column will be grouped together and the average signal will be plotted.

useGroups

A character vector that is used to select a subset of groups by name from the designated groupBy column in cellColData. This limits the groups to be plotted.

plotSummary

A character vector containing the features to be potted. Possible values include "bulkTrack" (the ATAC-seq signal), "scTrack" (scATAC-seq signal), "featureTrack" (i.e. the peak regions), "geneTrack" (line diagrams of genes with introns and exons shown. Blue-colored genes are on the minus strand and red-colored genes are on the plus strand), and "loopTrack" (links between a peak and a gene).

sizes

A numeric vector containing up to 3 values that indicate the sizes of the individual components passed to plotSummary. The order must be the same as plotSummary.

features

A GRanges (for a single feature track) or GRangesList (for multiple feature tracks) object containing the "features" to be plotted via the "featureTrack". This should be thought of as a bed track. i.e. the set of peaks obtained using getPeakSet(ArchRProj)). If you provide a GRangesList, then each element of that object must be named and this name will be used on the plot. For example - GRangesList("peaks" = peak_gr, "other" = other_gr).

loops

A GRanges object containing the "loops" to be plotted via the "loopTrack". This GRanges object start represents the center position of one loop anchor and the end represents the center position of another loop anchor. A "loopTrack" draws an arc between two genomic regions that show some type of interaction. This type of track can be used to display chromosome conformation capture data or co-accessibility links obtained using getCoAccessibility().

geneSymbol

If region is not supplied, plotting can be centered at the transcription start site corresponding to the gene symbol(s) passed here.

useMatrix

If supplied geneSymbol, one can plot the corresponding GeneScores/GeneExpression within this matrix. I.E. "GeneScoreMatrix"

log2Norm

If supplied geneSymbol, Log2 normalize the corresponding GeneScores/GeneExpression matrix before plotting.

upstream

The number of basepairs upstream of the transcription start site of geneSymbol to extend the plotting window. If region is supplied, this argument is ignored.

downstream

The number of basepairs downstream of the transcription start site of geneSymbol to extend the plotting window. If region is supplied, this argument is ignored.

tileSize

The numeric width of the tile/bin in basepairs for plotting ATAC-seq signal tracks. All insertions in a single bin will be summed.

maxCells

The maximum number of cells to use for obtaining data to plot as a bulk track. Using more cells can increase the resolution of your plots at the expense of increased processing time.

minCells

The minimum number of cells contained within a cell group to allow for this cell group to be plotted. This argument can be used to exclude pseudo-bulk replicates generated from low numbers of cells.

normMethod

The name of the column in cellColData by which normalization should be performed. The recommended and default value is "ReadsInTSS" which simultaneously normalizes tracks based on sequencing depth and sample data quality.

highlight

A GRanges object containing a region or regions on the plot to highlight. Multiple highlighted regions within the GRanges object are allowed Any highlight region that does not overlap the displayed region will be ignored.

highlightFill

The color to be used for the highlighted region designated by highlight. This can be a valid R color (i.e. "lightblue1") or a hex color (i.e. "#bfefff")

threads

The number of threads to use for parallel execution.

ylim

The numeric quantile y-axis limit to be used for for "bulkTrack" plotting. This should be expressed as c(lower limit, upper limit) such as c(0,0.99). If not provided, the y-axis limit will be c(0, 0.999).

pal

A custom palette (see paletteDiscrete or ArchRPalettes) used to override coloring for groups.

baseSize

The numeric font size to be used in the plot. This applies to all plot labels.

scTileSize

The width of the tiles in scTracks. Larger numbers may make cells overlap more. Default is 0.5 for about 100 cells.

scCellsMax

The maximum number of cells for scTracks.

borderWidth

The numeric line width to be used for plot borders.

tickWidth

The numeric line width to be used for axis tick marks.

facetbaseSize

The numeric font size to be used in the facets (gray boxes used to provide track labels) of the plot.

geneAnnotation

The geneAnnotation object to be used for plotting the "geneTrack" object. See createGeneAnnotation() for more info.

title

The title to add at the top of the plot next to the plot's genomic coordinates.

verbose

A boolean value that determines whether standard output should be printed.

logFile

The path to a file to be used for logging ArchR output.

Examples


#Get Test ArchR Project
proj <- getTestProject()

#Highlight
genes <- getGenes()
genes <- genes[which(genes$symbol %in% c("CD3D", "MS4A1"))]

#Plot Track
p <- plotBrowserTrack(proj, geneSymbol = c("CD3D", "MS4A1"), groupBy = "CellType", highlight = genes, highlightFill = "dodgerblue3")

#Plot PDF
plotPDF(p, name = "Track-CD3D-MS4A1", ArchRProj = proj)