Description Usage Arguments Details Value Author(s) Examples
Get signals from a list
1 | getSignalsFromList(lt, fun = function(x) mean(x, na.rm = TRUE))
|
lt |
a list of normalized matrices which are returned by |
fun |
a user-defined function to summarize signals. If we assume elements in |
Let's assume you have a list of histone modification signals for different samples and you want
to visualize the mean pattern across samples. You can first normalize histone mark signals for each sample and then
calculate means values across all samples. In following example code, hm_gr_list is a list of GRanges objects
which contain positions of histone modifications, tss is a GRanges object containing positions of gene TSS.
1 2 3 4 |
Applying getSignalsFromList() to mat_list, it gives a new normalized matrix which contains mean signals and can
be directly used in EnrichedHeatmap().
1 2 | mat = getSignalsFromList(mat_list)
EnrichedHeatmap(mat)
|
Next let's consider a second scenario: we want to see the correlation between histone modification and gene expression.
In this case, fun can have a second argument so that users can correspond histone signals to the expression of the
associated gene. In following code, expr is a matrix of expression, columns in expr correspond to elements in hm_gr_list,
rows in expr are same as tss.
1 2 | mat = getSignalsFromList(mat_list,
fun = function(x, i) cor(x, expr[i, ], method = "spearman"))
|
Then mat here can be used to visualize how gene expression is correlated to histone modification around TSS.
1 | EnrichedHeatmap(mat)
|
A normalizeToMatrix object which can be directly used for EnrichedHeatmap.
Zuguang Gu <z.gu@dkfz.de>
1 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.