R/partition-plots.R
calcExpectedPartitionsRef.RdThis function is a wrapper for calcExpectedPartitions that uses
built-in partitions for a given reference genome assembly.
calcExpectedPartitionsRef(query, refAssembly, bpProportion = FALSE)A GenomicRanges or GenomicRangesList object with query regions
A character vector specifying the reference genome
assembly (*e.g.* 'hg19'). This will be used to grab annotation
models with getGeneModels, and chromosome sizes withgetChromSizes
logical indicating if overlaps should be calculated based on number of base pairs overlapping with each partition. bpProportion=FALSE does overlaps in priority order, bpProportion=TRUE counts number of overlapping base pairs between query and each partition.
A data.frame indicating the number of query region overlaps in several genomic partitions.
calcExpectedPartitionsRef(vistaEnhancers, "hg19")
#> Warning: Chi-squared approximation may be incorrect
#> partition observed expected log10OE Chi.square.pval
#> <char> <int> <num> <num> <num>
#> 1: promoterCore 5 0.801438 0.79510006 0.18400
#> 2: promoterProx 12 15.218192 -0.10318181 0.66900
#> 3: threeUTR 12 16.693035 -0.14335406 0.48800
#> 4: fiveUTR 11 4.461866 0.39187614 0.15800
#> 5: exon 30 18.931636 0.19993312 0.14600
#> 6: intron 441 510.750772 -0.06377044 0.00551
#> 7: intergenic 828 772.143061 0.03033256 0.03060
#> method
#> <char>
#> 1: Pearson's Chi-squared test with Yates' continuity correction
#> 2: Pearson's Chi-squared test with Yates' continuity correction
#> 3: Pearson's Chi-squared test with Yates' continuity correction
#> 4: Pearson's Chi-squared test with Yates' continuity correction
#> 5: Pearson's Chi-squared test with Yates' continuity correction
#> 6: Pearson's Chi-squared test with Yates' continuity correction
#> 7: Pearson's Chi-squared test with Yates' continuity correction