get_count_matrix: Generate the count matrix

Description Usage Arguments Value Examples

View source: R/get_count_matrix.R

Description

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

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
megadepth::install_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
)
example_cm

eolagbaju/ODER documentation built on Dec. 20, 2021, 5:21 a.m.