coverage-functions {CAGEr} | R Documentation

## Private functions behind `cumulativeCTSSdistribution`

### Description

`.getCumsum` calculates cumulative sums of tpm along the clusters.

### Usage

    .getCAGEsignalCoverage(ctss.chr, clusters)

    .getCumsumChr2(clusters, ctss, chrom, str)

    .getCumsum(ctss, clusters, useMulticore = FALSE, nrCores = NULL)

### Arguments

`ctss.chr` | A 'CTSS.chr“ object (guaranteed to have only one chromosome).
`clusters` | GRanges as per `tagClustersGR()`.
`ctss` | GRanges as per `CTSScoordinatesGR`, with the score of one sample.
`chrom` | a chromosome name
`str` | a strand name
`useMulticore, nrCores` | See clusterCTSS.

### Details

'.getCAGEsignalCoverage“ does... Note that strand is not taken into account.

`.getCumsumChr2`

### Value

`.getCumsum` returns a list of `Rle` vectors (IRanges package) containing cumulative sum for each cluster (length of list is equal to number of clusters and names of the list components corespond to the name of the corresponding cluster) v.

### Examples

    library(GenomicRanges)
    library(IRanges)
    ctss <- CTSS( seqnames = "chr1"
                , IRanges(c(1,3,4,12,14,25,28,31,35), w=1)
                , strand = "+")
    score(ctss) <- 1
    ctss.chr <- as(ctss, "CTSS.chr")
    clusters <- GRanges( seqnames = Rle("chr1")
                       , ranges = IRanges(c(1,12,25,31,32), c(4,14,28,31,33))
                       , strand = "+")
    chrom <- "chr1"
    str <- "+"
    CAGEr:::.getCAGEsignalCoverage(ctss.chr, clusters)
    CAGEr:::.getCumsumChr2(clusters, ctss, chrom, str)

    ctss      <- CTSSnormalizedTpmGR(exampleCAGEexp, "Zf.30p.dome")
    ctss      <- ctss[ctss$filteredCTSSidx]
    clusters  <- tagClustersGR(exampleCAGEexp, "Zf.30p.dome")
    clusters.cumsum <- CAGEr:::.getCumsum(ctss, head(clusters))
    decode(clusters.cumsum[[3]])
    ctss[queryHits(findOverlaps(ctss, clusters[3]))]
    clusters[3]

[Package CAGEr version 2.0.2 Index]