Scores the mean coverage of the expressed regions as a count matrix

get_count_matrix(bw_paths, annot_ers, cols = NULL)

Arguments

bw_paths

Vector containing the bigwig file paths to read in

annot_ers

GRangesList containing the annotated ERs (product of annotatERs)

cols

A dataframe containing the information to be used as colData for the output. If NULL then the bw_paths will be used for the colData

Value

A Ranged Summarized Experiment containing the gene counts as an assay

Examples

megadepth::install_megadepth()
#> The latest megadepth version is 1.1.1
#> This is not an interactive session, therefore megadepth has been installed temporarily to 
#> /tmp/Rtmp8R75GU/megadepth

rec_url <- recount::download_study(
    project = "SRP012682",
    type = "samples",
    download = FALSE
)
# file_cache is an internal function to download a bigwig file from a link
# if the file has been downloaded recently, it will be retrieved from a cache
bw_path <- file_cache(rec_url[1])

ex_opt_ers <- GenomicRanges::GRanges(
    seqnames = S4Vectors::Rle(c("chr1", "chr2"), c(4, 1)),
    ranges = IRanges::IRanges(
        start = c(1:5),
        end = seq(100, 500, 100)
    )
)

example_cm <- get_count_matrix(
    bw_paths = c(bw_path, bw_path),
    annot_ers = ex_opt_ers
)
#> Warning: is.na() applied to non-(list or vector) of type 'S4'
#> Warning: is.na() applied to non-(list or vector) of type 'S4'
example_cm
#> class: RangedSummarizedExperiment 
#> dim: 5 2 
#> metadata(0):
#> assays(1): ''
#> rownames: NULL
#> rowData names(0):
#> colnames: NULL
#> colData names(1): BigWig_paths