collapseDuplicatedReads,GAlignments-method {ORFik} | R Documentation

## Collapse duplicated reads

### 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

    ## S4 method for signature 'GAlignments'
    collapseDuplicatedReads(x, addScoreColumn = TRUE)

### Arguments

`x` | a GRanges, GAlignments or GAlignmentPairs object
`addScoreColumn` | = TRUE, if FALSE, only collapse and not add score column.

### Value

a GRanges, GAlignments or GAlignmentPairs object, same as input

### Examples

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

[Package ORFik version 1.8.6 Index]