trimToPeak {CAGEfightR} | R Documentation

## Trim width of TCs by distance from TC peak

### Description

Trim the width of TCs by distance from the TC peaks.

### Usage

    trimToPeak(object, pooled, ...)

    ## S4 method for signature 'GRanges,GRanges'
    trimToPeak(object, pooled, upstream,
      downstream)

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

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

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

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

### Arguments

`object` | GenomicRanges or RangedSummarizedExperiment: Tag clusters.
`pooled` | GenomicRanges or RangedSummarizedExperiment: Basepair-wise pooled CTSS (stored in the score column).
`...` | additional arguments passed to methods.
`upstream` | integer: Maximum upstream distance from TC peak.
`downstream` | integer: Maximum downstream distance from TC peak.

### Value

data.frame with two columns: threshold and nTCs (number of Tag Clusters)

### See Also

Other Clustering functions: `clusterBidirectionally`, `clusterUnidirectionally`, `trimToPercentiles`, `tuneTagClustering`

Other Trimming functions: `trimToPercentiles`

### Examples

    data(exampleCTSSs)
    data(exampleBidirectional)

    # Calculate pooled CTSSs
    exampleCTSSs <- calcTPM(exampleCTSSs, totalTags='totalTags')
    exampleCTSSs <- calcPooled(exampleCTSSs)

    # Choose a few wide clusters:
    TCs <- subset(exampleUnidirectional, width >= 100)

    # Trim to +/- 10 bp of TC peak
    trimToPeak(TCs, pooled=exampleCTSSs, upstream=10, downstream=10)

[Package CAGEfightR version 1.2.0 Index]