clusterBidirectionally {CAGEfightR} | R Documentation

## Bidirectional clustering of pooled CTSSs.

### Description

Finds sites with (balanced and divergent) bidirectional transcription using sliding windows of summed coverage: The Bhattacharyya coefficient (BC) is used to quantify depature from a perfectly balanced site, and a slice-reduce is used to identify sites.

### Usage

    clusterBidirectionally(object, ...)

    ## S4 method for signature 'GRanges'
    clusterBidirectionally(
      object,
      window = 201,
      balanceThreshold = 0.95,
      balanceFun = balanceBC
    )

    ## S4 method for signature 'GPos'
    clusterBidirectionally(object, ...)

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

### Arguments

`object` | GenomicRanges or RangedSummarizedExperiment: Pooled CTSSs stored in the score column.
`...` | additional arguments passed to methods.
`window` | integer: Width of sliding window used for calculating window sums.
`balanceThreshold` | numeric: Minimum value of the BC to use for slice-reduce, a value of 1 corresponds to perfectly balanced sites.
`balanceFun` | function: Advanced users may supply their own function for calculating the balance score instead of the the default balanceBC. See details for instructions.

### Value

GRanges with bidirectional sites: Minimum width is 1 + 2*window, TPM sum (on both strands) in the score column, maximal bidirectional site in the thick column and maximum balance in the balance column.

### See Also

Other Clustering functions: `clusterUnidirectionally()`, `trimToPeak()`, `trimToPercentiles()`, `tuneTagClustering()`

### Examples

    ## Not run:
    data(exampleCTSSs)

    # Calculate pooledTPM, using supplied number of total tags
    exampleCTSSs <- calcTPM(exampleCTSSs,
                            inputAssay='counts',
                            outputAssay='TPM',
                            totalTags='totalTags')
    exampleCTSSs <- calcPooled(exampleCTSSs, inputAssay='TPM')

    # Cluster using defaults: balance-treshold of 199 and window of 199 bp:
    clusterBidirectionally(exampleCTSSs)

    # Use custom thresholds:
    clusterBidirectionally(exampleCTSSs, balanceThreshold=0.99, window=101)

    ## End(Not run)

[Package CAGEfightR version 1.10.0 Index]