make_feature_as_signal_dt: make_feature_as_signal_dt

View source: R/functions_make.R

make_feature_as_signal_dtR Documentation

make_feature_as_signal_dt

Description

Create a data.table of overlaps between query_gr and anno_grs (from make_anno_grs )

Usage

make_feature_as_signal_dt(anno_grs, query_gr)

Arguments

anno_grs

named list of GRanges objects where each is an annotation class. Use make_anno_grs to generate.

query_gr

GRanges of regions to characterize via anno_grs.

Value

a data.table of counts for each annotation class.

Examples

gtf_file = system.file(package = "seqqc", "extdata/gencode.v35.annotation.at_peaks.gtf")
anno_grs = make_anno_grs(gtf_file)

peak_files = dir(system.file("extdata", package = "seqqc"), pattern = "Peak$", full.names = TRUE)
peak_grs = seqsetvis::easyLoad_narrowPeak(peak_files)
query_gr = resize(seqsetvis::ssvOverlapIntervalSets(peak_grs), 2e4, fix = "center")
anno_dt = make_feature_as_signal_dt(anno_grs, query_gr)
anno_dt$id = factor(anno_dt$id, levels = rev(unique(anno_dt$id)))
ggplot(anno_dt, aes(x = x, fill = y, y = id)) + geom_tile() + facet_wrap(~feature_type)

FrietzeLabUVM/ssvQC documentation built on March 25, 2024, 12:24 a.m.