basic_genomic_regions_stat: Basic statistics on genomic regions

Description Usage Arguments Details Value Author(s) Examples

Description

Basic statistics on genomic regions

Usage

1
2
3
basic_genomic_regions_stat(gr_list, annotation = NULL, annotation_color = NULL,
    main = NULL, species = "hg19", type = c("proportion", "number", "median_width"),
    by_chr = FALSE)

Arguments

gr_list

a list of GRanges.

annotation

a vector which contains class of samples. If it has names which correspond to gr_list, the order of this vector is automatically adjusted.

annotation_color

colors corresponding to classes of annotations

main

title of the plot

species

species, necessary if type is set to proportion.

type

type of statistics

by_chr

take all chromosomes as a whole or calculate statistics for every chromosome

Details

The function makes barplot to visualize different statistics in all samples.

For type settings:

proportion

proportion of total length of regions compared to the whole genome. It is more unbiased.

number

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

median width of regions

Value

A data frame which contains statistics for each chromosome in each sample.

Author(s)

Zuguang Gu <z.gu@dkfz.de>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
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]]))
})
basic_genomic_regions_stat(gr_list)
basic_genomic_regions_stat(gr_list, annotation = rep(letters[1:2], each = 5), 
    annotation_color = c("a" = "red", "b" = "blue"))
basic_genomic_regions_stat(gr_list, annotation = rep(letters[1:2], each = 5), 
    annotation_color = c("a" = "red", "b" = "blue"), type = "number")
basic_genomic_regions_stat(gr_list, annotation = rep(letters[1:2], each = 5), 
    annotation_color = c("a" = "red", "b" = "blue"), type = "median_width")
basic_genomic_regions_stat(gr_list, annotation = rep(letters[1:2], each = 5), 
    annotation_color = c("a" = "red", "b" = "blue"), by_chr = TRUE)

eilslabs/epic documentation built on May 16, 2019, 1:24 a.m.