signalAlongPC {COCOA} | R Documentation

## Visualize how genomic signal in a region set changes along principal component axis

### Description

Look at genomic signal (eg, DNA methylation values) in regions of interest across samples, with samples ordered according to score for PC of interest. The ComplexHeatmap package is used and additional parameters for the ComplexHeatmap::Heatmap function may be passed to this function to modify the heatmap.

### Usage

    signalAlongPC(genomicSignal, signalCoord, regionSet, pcScores,
      orderByPC = "PC1", cluster_columns = FALSE, cluster_rows = FALSE,
      row_title = "Sample", column_title = "Genomic Signal",
      column_title_side = "bottom", name = "Genomic Signal Value",
      col = c("blue", "#EEEEEE", "red"), ...)

### Arguments

`genomicSignal` | The genomic signal (eg DNA methylation levels) in matrix or data.frame. Rows are individual signal/feature values. Columns are samples. Must have sample names/IDs as column names, These same sample names must be row names of pcScores.
`signalCoord` | a GRanges object or data frame with coordinates for the genomic signal/original data (eg DNA methylation) included in the PCA. Coordinates should be in the same order as the original data and the loadings (each item/row in signalCoord corresponds to a row in loadingMat). If a data.frame, must have chr and start columns. If end is included, start and end should be the same. Start coordinate will be used for calculations.
`regionSet` | A genomic ranges object with regions corresponding to the same biological annotation. The regions where you will visualize the genomic signal. Must be from the same reference genome as the coordinates for the actual data (signalCoord).
`pcScores` | A matrix. The principal component scores for the samples (ie transformed methylation data). Must have sample names/IDs as row names, These same sample names must be column names of genomicSignal
`orderByPC` | a character object. PC to order samples by (order rows of heatmap by PC score, from high to low score). Must be the name of a column in pcScores.
`cluster_columns` | "logical" object, whether to cluster columns (the genomic signal, eg DNA methylation values for each CpG).
`cluster_rows` | "logical" object, whether rows should be clustered. This should be kept as FALSE to keep the correct ranking of samples/observations according to their PC score.
`row_title` | character object, row title
`column_title` | character object, column title
`column_title_side` | character object, where to put the column title: "top" or "bottom"
`name` | character object, legend title
`col` | a vector of colors or a color mapping function which will be passed to the ComplexHeatmap::Heatmap() function. See ?Heatmap (the "col" parameter) for more details. "#EEEEEE" is the code for a color similar to white.
`...` | optional parameters for ComplexHeatmap::Heatmap()

### Value

A heatmap of genomic signal values (eg DNA methylation levels) in regions of interest (regionSet), with rows ordered by PC score. Each row is a patient/sample and each column is an individual genomic signal value. Rows are ordered by PC score for 'orderByPC', high scores at top and low at the bottom.

### Examples

    data("brcaMethylData1")
    data("brcaMCoord1")
    data("esr1_chr1")
    data("brcaPCScores")
    signalHM <- signalAlongPC(genomicSignal=brcaMethylData1,
                                 signalCoord=brcaMCoord1,
                                 regionSet=esr1_chr1,
                                 pcScores=brcaPCScores,
                                 orderByPC="PC1", cluster_columns=TRUE)

[Package COCOA version 1.2.0 Index]