countSignal: Count the Sites Carrying an Arbitrary Signal Inside Genomic...

View source: R/countSignal.R

countSignalR Documentation

Count the Sites Carrying an Arbitrary Signal Inside Genomic Regions

Description

A simple function to count the number of sites carrying an arbitrary signal, which are inside given genomic regions.

Usage

countSignal(signal, gr, maxDist = NULL, ignore.strand = TRUE, verbose = FALSE)

Arguments

signal

A GRange object carrying the sites of interest.

gr

A GRange object carrying the regions of interest.

ignore.strand

When set to TRUE, the strand information is ignored in the overlap calculations.

verbose

Logical. Default is TRUE. If TRUE, then the progress of the computational tasks is given.

Details

Given a GRanges object 'signal' carrying an arbitrary signal on each range, this function counts the number of sites inside the the given genomic regions 'gr'.

Value

A GRanges object with the genomic regions that carry signals and the number of sites on them.

Author(s)

Robersy Sanchez. https://genomaths.com

See Also

getGRegionsStat

Examples

library(GenomicRanges)
some.signal <- makeGRangesFromDataFrame(data.frame(chr = 'chr1', 
                                                   start = 1:15,
                                                   end = 1:15,
                                                   strand = '*'))

some.regions <- makeGRangesFromDataFrame(data.frame(chr = 'chr1', 
                                                    start = c(2, 8),
                                                    end = c(7, 14),
                                                    strand = '*'))

countSignal(signal = some.signal, gr = some.regions)


genomaths/MethylIT.utils documentation built on July 4, 2023, 12:05 a.m.