collapseDuplicatedReads-GRanges-method: Collapse duplicated reads

Description Usage Arguments Value Examples

Description

For every GRanges, GAlignments read, with the same: seqname, start, (cigar) / width and strand, collapse and give a new meta column called "score", which contains the number of duplicates of that read. If score column already exists, will return input object!

Usage

1
2
3
4
5
6
7
## S4 method for signature 'GRanges'
collapseDuplicatedReads(
  x,
  addScoreColumn = TRUE,
  addSizeColumn = FALSE,
  reuse.score.column = TRUE
)

Arguments

x

a GRanges, GAlignments or GAlignmentPairs object

addScoreColumn

= TRUE, if FALSE, only collapse and not keep score column.

addSizeColumn

logical (FALSE), if TRUE, add a size column that for each read, that gives original width of read. Useful if you need original read lengths. This takes care of soft clips etc. If collapsing reads, each unique range will be grouped also by size.

reuse.score.column

logical (TRUE), if addScoreColumn is TRUE, and a score column exists, will sum up the scores to create a new score. If FALSE, will skip old score column and create new according to number of replicated reads after conversion. If addScoreColumn is FALSE, this argument is ignored.

Value

a GRanges, GAlignments or GAlignmentPairs object, same as input

Examples

1
2
gr <- rep(GRanges("chr1", 1:10,"+"), 2)
collapseDuplicatedReads(gr)

ORFik documentation built on March 27, 2021, 6 p.m.