Description Usage Arguments Details Value Author(s) Examples
View source: R/genomic_region_stat.R
Visualize basic statistics on genomic regions
1 2 3 4 |
gr_list |
a list of |
subgroup |
a vector which contains groups of samples. If it has names which correspond to |
subgroup_color |
colors corresponding to subgroups |
title |
title of the plot |
species |
species, necessary if |
type |
type of statistics |
chromosome |
subset of chromosomes |
by_chr |
take all chromosomes as a whole or calculate statistics for every chromosome |
The function makes barplot to visualize different statistics in all samples.
For type
settings:
proportion of total length of regions in the whole genome.
number of regions. Sometimes only looking at the number of regions gives biased estimation of amount of regions if the width of regions are very viarable.
median width of regions
A data frame which contains statistics for each chromosome in each sample.
Zuguang Gu <z.gu@dkfz.de>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | require(circlize)
set.seed(123)
gr_list = lapply(1:10, function(i) {
df = generateRandomBed(1000)[1:sample(100:1000, 1), ]
GRanges(df[[1]], ranges = IRanges(df[[2]], df[[3]]))
})
names(gr_list) = paste0("sample_", 1:10)
genomic_regions_basic_stat(gr_list)
genomic_regions_basic_stat(gr_list, subgroup = rep(letters[1:2], each = 5),
subgroup_color = c("a" = "red", "b" = "blue"))
genomic_regions_basic_stat(gr_list, subgroup = rep(letters[1:2], each = 5),
subgroup_color = c("a" = "red", "b" = "blue"), type = "number")
genomic_regions_basic_stat(gr_list, subgroup = rep(letters[1:2], each = 5),
subgroup_color = c("a" = "red", "b" = "blue"), type = "median_width")
genomic_regions_basic_stat(gr_list, subgroup = rep(letters[1:2], each = 5),
subgroup_color = c("a" = "red", "b" = "blue"), by_chr = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.