heatmapPatternMarkers: Create Heatmap of PatternMarker Peaks

View source: R/heatmap_pattern_marker_regions.R

heatmapPatternMarkersR Documentation

Create Heatmap of PatternMarker Peaks

Description

Function to make a heatmap of the accessibility of the most differentially accessible regions as discovered by CoGAPS.

Usage

heatmapPatternMarkers(
  cgaps_result,
  atac_data,
  celltypes,
  numregions = 50,
  colColors = NULL,
  rowColors = NULL,
  patterns = NULL,
  order = TRUE,
  ...
)

Arguments

cgaps_result

CogapsResult object from CoGAPS run

atac_data

a numeric matrix of the ATAC data input to CoGAPS

celltypes

a list or factor of celltypes corresponding to the positions of those cells in the atac_data matrix

numregions

number of chromosomal regions/peaks to plot for each CoGAPS pattern. Default is 50. Plotting very large numbers of regions can cause significant slowdown in runtime

colColors

column-wise colors for distinguishing celltypes. If NULL, will be generated randomly

rowColors

row-wise colors for distinguishing patterns. If NULL will be generated randomly

patterns

which patterns should be plotted, if NULL all will be plotted

order

option whether to sort the data by celltype before plotting, TRUE by default

...

additional arguments to the heatmap.2 function

Value

heatmap of the accessibility for numregions for each pattern

Note

If you get the error: "Error in plot.new() : figure margins too large" while using this function in RStudio just make the plotting pane in Rstudio larger and run the code again; this error only means the legend is being cut off in any case, the main plot will still appear correctly

Examples

data("schepCogapsResult")
data(schepCellTypes)
data("subsetSchepData")

heatmapPatternMarkers(schepCogapsResult, atac_data = subsetSchepData,
                      celltypes = schepCellTypes, numregions = 50)

FertigLab/ATACCoGAPS documentation built on Oct. 24, 2024, 9:31 a.m.