Brick_vizart_plot_heatmap {HiCBricks} | R Documentation

## Create the entire HDF5 structure and load the bintable

### Description

`Brick_vizart_plot_heatmap` creates various heatmaps and plots TADs.

### Usage

    Brick_vizart_plot_heatmap(File, Bricks, x.coords, y.coords, FUN = NULL,
        value.cap = NULL, distance = NULL, rotate = FALSE, x.axis = TRUE,
        x.axis.title = NULL, y.axis = TRUE, y.axis.title = NULL,
        title = NULL, legend.title = NULL, return.object = FALSE,
        x.axis.num.breaks = 5, y.axis.num.breaks = 5, palette,
        col.direction = 1, extrapolate.on = NULL, x.axis.text.size = 10,
        y.axis.text.size = 10, text.size = 10, legend.title.text.size = 8,
        legend.text.size = 8, title.size = 10, tad.ranges = NULL,
        group.col = NULL, tad.colour.col = NULL, colours = NULL,
        colours.names = NULL, cut.corners = FALSE, highlight.points = NULL,
        width = 10, height = 6, line.width = 0.5, units = "cm",
        legend.key.width = unit(3, "cm"), legend.key.height = unit(0.5,
        "cm"))

### Arguments

`File` | Required A character vector containing the output filename to write.
`Bricks` | Required A character vector of length 1 (in case of one sample heatmaps) or 2 (in case of two sample heatmaps) specifying the names of the Brick stores from where to fetch the data.
`x.coords` | Required A character vector of length 1 specifying the coordinates from where to fetch the data.
`y.coords` | Required A character vector of length 1 specifying the coordinates from where to fetch the data.
`FUN` | Optional. Default NULL If any sort of transformations should be applied to the data before plotting. Such as, log10 or log2 transformations.
`value.cap` | Optional. Default NULL If present, values beyond a certain quantile will be capped to that quantile. In Hi-C this helps to emphasize structural information. Please note, if this parameter is present the greatest value will have a greater than sign append- -ed to them.
`distance` | Optional. Default NULL If present, values beyond this distance will be filtered out. Please note, that if a Brick store matrix was loaded until a certain distance, this parameter will result in an error if it is greater than the loaded distance.
`rotate` | Optional. Default FALSE If TRUE, will rotate the heatmap by 90 degrees.
`x.axis` | Optional. Default TRUE If FALSE, the x-axis will be removed (ticks, x-axis labels and title).
`x.axis.title` | Optional. Default NULL If present, will be the x-axis title. Else defaults to the provided x.coords
`y.axis` | Optional. Default TRUE If FALSE, the y-axis will be removed (ticks, y-axis labels and title).
`y.axis.title` | Optional. Default NULL If present, will be the y-axis title. Else defaults to the provided y.coords
`title` | Optional. Default NULL If present, will be the plot title. Else defaults to the provided x.coords vs y.coords
`legend.title` | Optional. Default NULL If present will be the title of the legend. Else defaults to "Signal".
`return.object` | Optional. Default FALSE If present the ggplot object will be returned
`x.axis.num.breaks` | Optional. Default 5 Number of ticks on the x axis
`y.axis.num.breaks` | Optional. Default 5 Number of ticks on the y axis
`palette` | Required. Default NULL One of the RColorbrewer or viridis colour palettes
`col.direction` | Optional. Default 1 If -1, the colour scale will be reversed.
`extrapolate.on` | Optional. Default NULL If present, colours from the palette will be extrapolated between lightest and darkest to create the gradient. This value cannot be more than 100.
`x.axis.text.size` | Optional. Default 10 x-axis text size
`y.axis.text.size` | Optional. Default 10 y-axis text size
`text.size` | Optional. Default 10 text size of text elements in the plot.
`legend.title.text.size` | Optional. Default 8 text size of the legend title
`legend.text.size` | Optional. Default 8 text size of the legend text
`title.size` | Optional. Default 10 text size of the title
`tad.ranges` | Optional. Default NULL A GenomicRanges object specifying the start and end coordinates of TADs to be plotted on the heatmap.
`group.col` | Optional. Default NULL Name of the column which will be used to categorize TADs as belonging to either the first or the second Brick stores. This must be a numeric value ranging from 1 to 2. If NULL, TADs will be plotted on both Hi-C maps.
`tad.colour.col` | Optional. Default NULL tad.colour.col takes as value the column name in the tad.ranges object corresponding to the column which should be used to define different TAD categories.
`colours` | Optional. Default NULL If tad.ranges is present, colours expects a hexcode value of length 1. But, if tad.colour.col is specified, it expects colours of the same length as unique tad.ranges$tad.colour.col.
`colours.names` | Optional. Default NULL If present, will be assigned to colours. Else, will inherit unique tad.colour.col. If tad.colour.col is also absent, will revert to a placehold column name.
`cut.corners` | Optional. Default FALSE if cut.corners is TRUE, TAD borders will not be truncated, and they will span until the end of visible heatmap.
`highlight.points` | Optional. Not yet implemented.
`width` | Optional. Default 10cm Width of the output file units.
`height` | Optional. Default 6cm Height of the output file in units.
`line.width` | Optional. Default 0.5 When plotting TADs set the width of the plotted lines
`units` | Optional. Default cm Defines the units of the output file width and height.
`legend.key.width` | Optional. Default unit(3,"cm") Defines the legend key width.
`legend.key.height` | Optional. Default unit(0.5,"cm") Defines the legend key height.

### Details

This function provides the capability to plot various types of heatmaps from Hi-C data.

- One sample heatmap.

- Two sample heatmap (One sample on upper and other on lower).

- All of the above with 90 degree rotation.

- All of the above but with signal capped at a certain value.

- All of the above but filtered by distance.

- All of the above with TADs/TAD borders plotted on top.

### Value

If return.object is set to TRUE, the constructed ggplot2 object will be returned. Else TRUE.

### Examples

    FailSafe_log10 <- function(x){
         x[is.na(x) | is.nan(x) | is.infinite(x)] <- 0
         return(log10(x+1))
    }

    Brick.file <- system.file("extdata", "test.hdf", package = "HiCBricks")
    Brick_vizart_plot_heatmap(File = "./chr19-5000000-10000000.pdf",
    Bricks = Brick.file, x.coords = "chr19:5000000:10000000", palette = "Reds",
    y.coords = "chr19:5000000:10000000", FUN = FailSafe_log10,
    value.cap = 0.99, width = 10, height = 11, legend.key.width = unit(3,"mm"),
    legend.key.height = unit(0.3,"cm"))

[Package HiCBricks version 1.2.0 Index]