test_cov_gr | R Documentation |
Sample exon coverage data GRanges
test_cov_gr
An object of class GRanges
of length 4.
This dataset represents exon GRanges with an additional column with NumericList values representing RNA-seq read coverage across these exons.
Other splicejam data:
test_cov_wide_gr
,
test_exon_gr
,
test_exon_wide_gr
,
test_junc_gr
,
test_junc_wide_gr
suppressPackageStartupMessages(library(GenomicRanges));
suppressPackageStartupMessages(library(ggplot2));
data(test_exon_gr);
# The steps below demonstrate how to create coverage data manually
test_cov_gr <- test_exon_gr;
set.seed(123);
cov_values <- c(250, 200, 180, 250);
values(test_cov_gr)[,"sample_A"] <- NumericList(
lapply(seq_along(test_exon_gr), function(i){
cov_values[i] +
round(rnorm(GenomicRanges::width(test_exon_gr)[i])*7)
}));
test_cov_gr;
# You can plot coverage using exoncov2polygon()
exondf <- exoncov2polygon(test_cov_gr, covNames="sample_A");
gg3 <- ggplot(exondf,
aes(x=x, y=y, group=gr, fill=gr, color=gr)) +
ggforce::geom_shape(alpha=0.8) +
colorjam::theme_jam() +
colorjam::scale_fill_jam() +
colorjam::scale_color_jam();
print(gg3);
# you can add junctions to exons in one plot
junc_df <- grl2df(test_junc_gr, shape="junction")
gg3 +
ggforce::geom_diagonal_wide(data=junc_df,
inherit.aes=FALSE,
show.legend=FALSE,
fill="orange",
aes(x=x, y=y, group=id),
alpha=0.6)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.