plot_contact_map: Plots simple contact map or fold-change contact map with log2...

Description Usage Arguments See Also Examples

View source: R/plotting_functions.R

Description

Plots simple contact map or fold-change contact map with log2 scale.

Usage

1
2
3
4
5
6
7
8
9
plot_contact_map(
  contact.map,
  fc = FALSE,
  breaks = 100,
  zeros.na = TRUE,
  colors.pal = c("white", "red"),
  useRaster = TRUE,
  ...
)

Arguments

contact.map

numeric matrix (with non-negative entries) to be plotted

fc

logical whether given matrix is fold change

breaks

numeric number of breaks on color scale

colors.pal

colors for pallette

useRaster

logical if TRUE (default) lower quality image is produced, but the process is much faster and resulting file uses little space

title

character plot title

See Also

image_plot_na for function handling heatmap plotting

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# get sample contact map (MSC replicate 1) for chromosome 18
mtx1.sparse <- DIADEM::sample_hic_maps[["MSC-HindIII-1_40kb-raw"]][["18"]]
# convert to dense
mtx1 <- sparse2dense(mtx1.sparse[c("i","j","val")], N = 1952)
plot_contact_map(mtx1)
# now make fold-change matrix
# get another sample contact map (MSC replicate 2) for chromosome 18
mtx2.sparse <- DIADEM::sample_hic_maps[["MSC-HindIII-2_40kb-raw"]][["18"]]
merged <- base::merge(mtx1.sparse, mtx2.sparse, by = c("i", "j"))
merged$fc <- merged$val.x / merged$val.y
fc.mtx <- sparse2dense(merged[c("i","j","fc")], N = 1952)
plot_contact_map(fc.mtx, fc = TRUE, colors.pal = c("blue","white","red"))

rz6/CopulaHiC documentation built on Dec. 31, 2019, 9:19 a.m.