Description Usage Arguments See Also Examples
View source: R/plotting_functions.R
Plots simple contact map or fold-change contact map with log2 scale.
1 2 3 4 5 6 7 8 9 |
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 |
image_plot_na
for function handling heatmap plotting
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"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.