calcShape: Calculate Tag Cluster shapes

Description Usage Arguments Value See Also Examples

Description

Apply a shape-function to the pooled CTSS signal of every Tag Cluster (TC).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
calcShape(object, pooled, ...)

## S4 method for signature 'GRanges,GRanges'
calcShape(object, pooled,
  outputColumn = "IQR", shapeFunction = shapeIQR, ...)

## S4 method for signature 'RangedSummarizedExperiment,GRanges'
calcShape(object, pooled,
  ...)

## S4 method for signature 'GRanges,RangedSummarizedExperiment'
calcShape(object, pooled,
  ...)

## S4 method for signature 'GRanges,GPos'
calcShape(object, pooled, ...)


  ## S4 method for signature 
## 'RangedSummarizedExperiment,RangedSummarizedExperiment'
calcShape(object,
  pooled, ...)

Arguments

object

GenomicRanges or RangedSummarizedExperiment: TCs.

pooled

GenomicRanges or RangedSummarizedExperiment: Pooled CTSS as the score column.

...

additional arguments passed to shapeFunction.

outputColumn

character: Name of column to hold shape statistics.

shapeFunction

function: Function to apply to each TC (See details).

Value

object with calculated shape statistics added as a column in rowData (or mcols).

See Also

Other Calculation functions: calcBidirectionality, calcComposition, calcPooled, calcSupport, calcTPM, calcTotalTags, subsetByBidirectionality, subsetByComposition, subsetBySupport

Other Shape functions: shapeEntropy, shapeIQR, shapeMultimodality

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
data(exampleCTSSs)
data(exampleUnidirectional)

# Calculate pooled CTSSs using pre-calculated number of total tags:
exampleCTSSs <- calcTPM(exampleCTSSs, totalTags='totalTags')
exampleCTSSs <- calcPooled(exampleCTSSs)

# Calculate shape statistics
calcShape(exampleUnidirectional, pooled=exampleCTSSs,
    outputColumn='entropy', shapeFunction=shapeEntropy)
calcShape(exampleUnidirectional, pooled=exampleCTSSs, outputColumn='IQR',
    shapeFunction=shapeIQR, lower=0.2, upper=0.8)

# See the vignette for how to implement custom shape functions!

MalteThodberg/CAGEfightR documentation built on Oct. 24, 2018, 12:10 p.m.