covRleFromGR: Convert GRanges to covRle

View source: R/covRLE_class.R

covRleFromGRR Documentation

Convert GRanges to covRle

Description

Convert GRanges to covRle

Usage

covRleFromGR(x, weight = "AUTO", ignore.strand = FALSE)

Arguments

x

a GRanges, GAlignment or GAlignmentPairs object. Note that coverage calculation for GAlignment is slower, so usually best to call convertToOneBasedRanges on GAlignment object to speed it up.

weight

default "AUTO", pick 'score' column if exist, else all are 1L. Can also be a manually assigned meta column like 'score2' etc.

ignore.strand

logical, default FALSE.

Value

covRle object

See Also

Other covRLE: covRle, covRle-class, covRleList, covRleList-class

Examples

seqlengths <- as.integer(c(200, 300))
names(seqlengths) <- c("chr1", "chr2")
gr <- GRanges(seqnames = c("chr1", "chr1", "chr2", "chr2"),
               ranges = IRanges(start = c(10, 50, 100, 150), end = c(40, 80, 129, 179)),
               strand = c("+", "+", "-", "-"), seqlengths = seqlengths)
cov_both_strands <- covRleFromGR(gr)
cov_both_strands
cov_ignore_strand <- covRleFromGR(gr, ignore.strand = TRUE)
cov_ignore_strand
strandMode(cov_both_strands)
strandMode(cov_ignore_strand)

Roleren/ORFik documentation built on April 25, 2024, 8:41 p.m.