plot_diff_map: Plots differential map.

Description Usage Arguments See Also Examples

View source: R/plotting_functions.R

Description

Draws differential map (i.e. one with positive and negative entries).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
plot_diff_map(
  mtx.dense,
  zeros.na = TRUE,
  breaks = 10,
  colors.pal = c("blue", "white", "red"),
  color.range = NULL,
  sqrt.transform = FALSE,
  na.color = "black",
  neg.inf.color = "gold",
  pos.inf.color = "darkgreen",
  useRaster = TRUE,
  ...
)

Arguments

mtx.dense

numeric matrix with positive and negative entries; if matrix does not contain any negative values use plot_contact_map function

zeros.na

logical if TRUE convert zero cells to NA

breaks

numeric number of breaks on color scale

colors.pal

colors for pallette

color.range

numeric vector of length 2 or NULL; if specified gives minimum and maximum values for color scale; this is manual adjustment of scale

sqrt.transform

logical if TRUE apply sqrt transformation: sqrt(pos) to positive elements of matrix and -sqrt(abs(neg)) to negative elements of matrix

useRaster

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

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"]]
# get another sample contact map (MSC replicate 2) for chromosome 18
mtx2.sparse <- DIADEM::sample_hic_maps[["MSC-HindIII-2_40kb-raw"]][["18"]]
# make differential map
merged <- base::merge(mtx1.sparse, mtx2.sparse, by = c("i", "j"))
merged$difference <- merged$val.x - merged$val.y
dense <- sparse2dense(merged[c("i","j","difference")], N = 1952)
# plot
plot_diff_map(dense)
# plot with sqrt transformation of data
plot_diff_map(dense, sqrt.transform = TRUE)

rz6/DIADEM documentation built on Dec. 31, 2019, 3:51 a.m.