Description Usage Arguments Value See Also Examples
View source: R/makeMetageneDataFrame.R
This function takes a list of data sets stratified by samples and gene sets.
It computes the metagene for each gene set in each sample, and returns
a data.frame
suitable for ggplot2::ggplot()
.
1 | makeMetageneDataFrame(list, assay.type = "matrix")
|
list |
A named list of lists of SummarizedExperiment objects.
Each item in the top-most list is a named sample (e.g. "replicate1").
Each item within each sublist is a named gene set (e.g. "upregulated").
Each SummarizedExperiment object stores matrix of histone modification enrichment,
with |
assay.type |
Name the assay to average between all samples. |
A data.frame
with columns named:
"sample"
"geneset"
"position"
importDeeptoolsExperiment
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | # Set the plotting environment ----
library(ggplot2)
library(cowplot)
theme_set(theme_cowplot())
# Prepare example data ----
sample_names <- c("A", "B", "C")
se_list <- generateDeeptoolsExperiments(20, 10, sample_names)
se_list
# Split each sample into gene subsets ----
range_sets <- list(set1=c("GR_1"), set2=c("GR_2", "GR_3"))
se_list_list <- lapply(se_list, splitByGeneSet, range_sets)
# Usage ----
x <- makeMetageneDataFrame(se_list_list)
ggplot(x, aes(position, metagene, color=geneset)) +
geom_line(aes(group=interaction(geneset, sample))) +
geom_point() +
facet_wrap(~sample, ncol=1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.