Takes a GRanges object, then assigns each element to a partition from the provided partitionList, and then tallies the number of regions assigned to each partition. A typical example of partitions is promoter, exon, intron, etc; this function will yield the number of each for a query GRanges object There will be a priority order to these, to account for regions that may overlap multiple genomic partitions.

calcCumulativePartitions(query, partitionList, remainder = "intergenic")

Arguments

query

GRanges or GRangesList with regions to classify.

partitionList

An ORDERED and NAMED list of genomic partitions GRanges. This list must be in priority order; the input will be assigned to the first partition it overlaps.

remainder

Which partition do you want to account for 'everything else'?

Value

A data.frame assigning each element of a GRanges object to a partition from a previously provided partitionList.

Examples

partitionList = genomePartitionList(geneModels_hg19$genesGR,
                                    geneModels_hg19$exonsGR,
                                    geneModels_hg19$threeUTRGR,
                                    geneModels_hg19$fiveUTRGR)
calcCumulativePartitions(vistaEnhancers, partitionList)
#>          partition size count  cumsum cumsize         frif         ffir
#>    1: promoterCore  100   100     100     100 4.909580e-05 5.325664e-05
#>    2: promoterCore  100   100     200     200 9.819161e-05 1.065133e-04
#>    3: promoterCore  100   100     300     300 1.472874e-04 1.597699e-04
#>    4: promoterCore  100   100     400     400 1.963832e-04 2.130266e-04
#>    5: promoterCore  100   100     500     500 2.454790e-04 2.662832e-04
#>   ---                                                                  
#> 1274:   intergenic  512   512 1251145 1251145 6.142597e-01 1.045544e-03
#> 1275:   intergenic  503   503 1251648 1251648 6.145066e-01 1.045964e-03
#> 1276:   intergenic  503   503 1252151 1252151 6.147536e-01 1.046385e-03
#> 1277:   intergenic  484   484 1252635 1252635 6.149912e-01 1.046789e-03
#> 1278:   intergenic  349   349 1252984 1252984 6.151626e-01 1.047081e-03
#>              score
#>    1: 5.113392e-05
#>    2: 1.022678e-04
#>    3: 1.534018e-04
#>    4: 2.045357e-04
#>    5: 2.556696e-04
#>   ---             
#> 1274: 2.534237e-02
#> 1275: 2.535256e-02
#> 1276: 2.536274e-02
#> 1277: 2.537255e-02
#> 1278: 2.537962e-02