coverage-functions: Private functions behind 'cumulativeCTSSdistribution'

Description Usage Arguments Details Value Examples

Description

.getCumsum calculates cumulative sums of tpm along the clusters.

Usage

1
2
3
4
5
.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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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(exampleCAGEset, "sample1")
ctss      <- ctss[ctss$filteredCTSSidx]
clusters  <- tagClustersGR(exampleCAGEset, "sample1")
clusters.cumsum <- RleList(CAGEr:::.getCumsum(ctss, clusters))
identical( lapply(exampleCAGEset@CTSScumulativesTagClusters[[1]],decode)
         , lapply(clusters.cumsum, decode))
# Not identical if not decoded because Rle method is attached to S4Vectors in one case
# and to IRanges in the other case.
decode(clusters.cumsum[[1]])
ctss[queryHits(findOverlaps(ctss, clusters[1]))]
clusters[1]

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]

CAGEr documentation built on Jan. 17, 2021, 2 a.m.