calcShape {CAGEfightR} | R Documentation

## Calculate Tag Cluster shapes

### Description

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

### Usage

    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()`, `shapeMean()`

### Examples

    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!

[Package CAGEfightR version 1.7.5 Index]