13.2 Plotting Marker Peaks in ArchR
ArchR provides multiple plotting functions to interact with the SummarizedExperiment
objects returned by getMarkerFeatures()
.
13.2.1 Marker Peak Heatmaps
We can visualize these marker peaks (or any features output by getMarkerFeatures()
) as a heatmap using the markerHeatmap()
function.
heatmapPeaks <- markerHeatmap(
seMarker = markerPeaks,
cutOff = "FDR <= 0.1 & Log2FC >= 0.5",
transpose = TRUE
)
## Warning in markerHeatmap(seMarker = markerPeaks, cutOff = "FDR <= 0.1 & Log2FC >= 0.5", : 'markerHeatmap' is deprecated.
## Use 'plotMarkerHeatmap' instead.
## See help("Deprecated")
## ArchR logging to : ArchRLogs/ArchR-plotMarkerHeatmap-94919e099-Date-2025-02-06_Time-02-05-58.302956.log
## If there is an issue, please report to github with logFile!
## Identified 39750 markers!
## [1] "chr1:801002-801502" "chr1:3582765-3583265"
## [3] "chr1:4067046-4067546" "chr1:4067547-4068047"
## [5] "chr1:4087539-4088039" "chr1:8484558-8485058"
## [7] "chr1:8689823-8690323" "chr1:8703539-8704039"
## [9] "chr1:10555108-10555608" "chr1:15898189-15898689"
## [11] "chr1:16023323-16023823" "chr1:21619451-21619951"
## [13] "chr1:25068767-25069267" "chr1:25075151-25075651"
## [15] "chr1:31226442-31226942" "chr1:894948-895448"
## [17] "chr1:1003989-1004489" "chr1:1004514-1005014"
## [19] "chr1:1186236-1186736" "chr1:1307365-1307865"
## [21] "chr1:1564144-1564644" "chr1:1624355-1624855"
## [23] "chr1:1709691-1710191" "chr1:1850076-1850576"
## [25] "chr1:2125990-2126490" "chr1:2163258-2163758"
## [27] "chr1:2190376-2190876" "chr1:2219656-2220156"
## [29] "chr1:2456986-2457486" "chr1:2478190-2478690"
## [31] "chr1:1034082-1034582" "chr1:2084331-2084831"
## [33] "chr1:3541219-3541719" "chr1:6425064-6425564"
## [35] "chr1:9353416-9353916" "chr1:9777575-9778075"
## [37] "chr1:24741889-24742389" "chr1:24862920-24863420"
## [39] "chr1:25256670-25257170" "chr1:26453043-26453543"
## [41] "chr1:26560290-26560790" "chr1:26560899-26561399"
## [43] "chr1:26644119-26644619" "chr1:28157016-28157516"
## [45] "chr1:29241862-29242362" "chr1:1114597-1115097"
## [47] "chr1:1827293-1827793" "chr1:5777263-5777763"
## [49] "chr1:6640958-6641458" "chr1:8908019-8908519"
## [51] "chr1:9483076-9483576" "chr1:11435901-11436401"
## [53] "chr1:11467280-11467780" "chr1:11741206-11741706"
## [55] "chr1:15033099-15033599" "chr1:20539344-20539844"
## [57] "chr1:21840612-21841112" "chr1:23242764-23243264"
## [59] "chr1:23938407-23938907" "chr1:25983661-25984161"
## [61] "chr1:901237-901737" "chr1:940307-940807"
## [63] "chr1:1343009-1343509" "chr1:1790050-1790550"
## [65] "chr1:2253303-2253803" "chr1:3087565-3088065"
## [67] "chr1:3244618-3245118" "chr1:3309996-3310496"
## [69] "chr1:3458494-3458994" "chr1:3535461-3535961"
## [71] "chr1:3691326-3691826" "chr1:3709928-3710428"
## [73] "chr1:3797614-3798114" "chr1:3827259-3827759"
## [75] "chr1:4388440-4388940" "chr1:974855-975355"
## [77] "chr1:2718089-2718589" "chr1:6230804-6231304"
## [79] "chr1:9256149-9256649" "chr1:33001674-33002174"
## [81] "chr1:41326368-41326868" "chr1:41740351-41740851"
## [83] "chr1:46879252-46879752" "chr1:55012580-55013080"
## [85] "chr1:58717033-58717533" "chr1:65211889-65212389"
## [87] "chr1:95007225-95007725" "chr1:153463131-153463631"
## [89] "chr1:154164635-154165135" "chr1:164629628-164630128"
## [91] "chr1:752503-753003" "chr1:1695617-1696117"
## [93] "chr1:2082662-2083162" "chr1:2177471-2177971"
## [95] "chr1:3594066-3594566" "chr1:3817707-3818207"
## [97] "chr1:6116567-6117067" "chr1:6461667-6462167"
## [99] "chr1:6662810-6663310" "chr1:7812853-7813353"
## [101] "chr1:7830467-7830967" "chr1:8157406-8157906"
## [103] "chr1:8166808-8167308" "chr1:8187085-8187585"
## [105] "chr1:8264317-8264817" "chr1:762688-763188"
## [107] "chr1:936020-936520" "chr1:937143-937643"
## [109] "chr1:975963-976463" "chr1:1151699-1152199"
## [111] "chr1:1152426-1152926" "chr1:1154919-1155419"
## [113] "chr1:1157229-1157729" "chr1:1550542-1551042"
## [115] "chr1:1564670-1565170" "chr1:1566009-1566509"
## [117] "chr1:1566556-1567056" "chr1:1623712-1624212"
## [119] "chr1:2130583-2131083" "chr1:2159937-2160437"
## [121] "chr1:1144252-1144752" "chr1:1148692-1149192"
## [123] "chr1:1779297-1779797" "chr1:8030215-8030715"
## [125] "chr1:8487539-8488039" "chr1:12270564-12271064"
## [127] "chr1:13820452-13820952" "chr1:16416449-16416949"
## [129] "chr1:17340271-17340771" "chr1:17349561-17350061"
## [131] "chr1:19732550-19733050" "chr1:20404699-20405199"
## [133] "chr1:22198382-22198882" "chr1:24515858-24516358"
## [135] "chr1:24884301-24884801" "chr1:1710193-1710693"
## [137] "chr1:1774220-1774720" "chr1:2431340-2431840"
## [139] "chr1:6550424-6550924" "chr1:6647419-6647919"
## [141] "chr1:9473097-9473597" "chr1:9909588-9910088"
## [143] "chr1:11751400-11751900" "chr1:21620771-21621271"
## [145] "chr1:25876088-25876588" "chr1:26614813-26615313"
## [147] "chr1:26867944-26868444" "chr1:31228531-31229031"
## [149] "chr1:31949772-31950272" "chr1:33523825-33524325"
## [151] "chr1:845326-845826" "chr1:856366-856866"
## [153] "chr1:1079376-1079876" "chr1:1831052-1831552"
## [155] "chr1:2058527-2059027" "chr1:2210498-2210998"
## [157] "chr1:2221973-2222473" "chr1:2225956-2226456"
## [159] "chr1:2487416-2487916" "chr1:2762418-2762918"
## [161] "chr1:2804983-2805483" "chr1:2829132-2829632"
## [163] "chr1:3010359-3010859" "chr1:3098465-3098965"
## [165] "chr1:3138712-3139212"
## Adding Annotations..
## Preparing Main Heatmap..
## 'magick' package is suggested to install to give better rasterization.
##
## Set `ht_opt$message = FALSE` to turn off this message.
## ArchR logging successful to : ArchRLogs/ArchR-plotMarkerHeatmap-94919e099-Date-2025-02-06_Time-02-05-58.302956.log
We can plot this heatmap using draw()
.
To save an editable vectorized version of this plot, we use the plotPDF()
function.
13.2.2 Marker Peak MA and Volcano Plots
Instead of plotting a heatmap, we can also plot an MA or Volcano plot for any individual cell group. To do this, we use the plotMarkers()
function. For an MA plot we specify plotAs = "MA"
. Here we specify the “Erythroid” cell group via the name
parameter.
pma <- plotMarkers(seMarker = markerPeaks, name = "Erythroid", cutOff = "FDR <= 0.1 & Log2FC >= 1", plotAs = "MA")
pma
## Warning: Removed 48 rows containing missing values or values outside the scale
## range (`geom_point_rast()`).
Similarly, for a Volcano plot, we specify plotAs = "Volcano"
.
pv <- plotMarkers(seMarker = markerPeaks, name = "Erythroid", cutOff = "FDR <= 0.1 & Log2FC >= 1", plotAs = "Volcano")
pv
## Warning: Removed 48 rows containing missing values or values outside the scale
## range (`geom_point_rast()`).
To save an editable vectorized version of these plots, we use the plotPDF()
function.
13.2.3 Marker Peaks in Browser Tracks
Additionally we can see these peak regions overlayed on our browser tracks by passing the relevant peak regions to the features
parameterin the plotBrowserTrack()
function. This will add an additional BED-style track of marker peak regions to the bottom of our ArchR track plot. Here we specify plotting the GATA1 gene via the geneSymbol
parameter.
p <- plotBrowserTrack(
ArchRProj = projHeme5,
groupBy = "Clusters2",
geneSymbol = c("GATA1"),
features = getMarkers(markerPeaks, cutOff = "FDR <= 0.1 & Log2FC >= 1", returnGR = TRUE)["Erythroid"],
upstream = 50000,
downstream = 50000
)
## ArchR logging to : ArchRLogs/ArchR-plotBrowserTrack-976def688-Date-2025-02-06_Time-02-06-34.627336.log
## If there is an issue, please report to github with logFile!
## 2025-02-06 02:06:35.265565 : Validating Region, 0.011 mins elapsed.
## GRanges object with 1 range and 2 metadata columns:
## seqnames ranges strand | gene_id symbol
## <Rle> <IRanges> <Rle> | <character> <character>
## [1] chrX 48644982-48652717 + | 2623 GATA1
## -------
## seqinfo: 24 sequences from hg19 genome
## 2025-02-06 02:06:35.32695 : Adding Bulk Tracks (1 of 1), 0.012 mins elapsed.
## 2025-02-06 02:06:37.026374 : Adding Feature Tracks (1 of 1), 0.04 mins elapsed.
## 2025-02-06 02:06:37.106577 : Adding Gene Tracks (1 of 1), 0.041 mins elapsed.
## 2025-02-06 02:06:37.432544 : Plotting, 0.047 mins elapsed.
## ArchR logging successful to : ArchRLogs/ArchR-plotBrowserTrack-976def688-Date-2025-02-06_Time-02-06-34.627336.log
We can plot this using grid::grid.draw()
.
To save an editable vectorized version of this plot, we use the plotPDF()
function.