collapse.by.scores {ORFik} | R Documentation

## Merge reads by sum of existing scores

### Description

If you have multiple reads a same location but different read lengths, specified in meta column "size", it will sum up the scores (number of replicates) for all reads at that position

### Usage

    collapse.by.scores(x)

### Arguments

`x` | a GRanges object

### Value

merged GRanges object

### Examples

    gr_s1 <- rep(GRanges("chr1", 1:10,"+"), 2)
    gr_s2 <- GRanges("chr1", 1:12,"+")
    gr2 <- GRanges("chr1", 21:40,"+")
    gr <- c(gr_s1, gr_s2, gr2)
    res <- convertToOneBasedRanges(gr,
       addScoreColumn = TRUE, addSizeColumn = TRUE)
    ORFik:::collapse.by.scores(res)

[Package ORFik version 1.10.13 Index]