trackBalance {CAGEfightR} | R Documentation

## Create Genome Browser Track of bidirectional balance scores

### Description

Visualize balance scores used for detectiong of bidirectional sites. Mainly intended as diagnostic tools for expert user.

### Usage

    trackBalance(object, ...)

    ## S4 method for signature 'GRanges'
    trackBalance(
      object,
      window = 199,
      plusColor = "cornflowerblue",
      minusColor = "tomato",
      balanceColor = "forestgreen",
      ...
    )

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

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

### Arguments

`object` | GenomicRanges or RangedSummarizedExperiment: Ranges with CTSSs in the score column.
`...` | additional arguments passed to DataTrack.
`window` | integer: Width of sliding window used for calculating windowed sums.
`plusColor` | character: Color for plus-strand coverage.
`minusColor` | character: Color for minus-strand coverage.
`balanceColor` | character: Color for bidirectional balance.

### Value

list of 3 DataTracks for upstream, downstream and balance.

### Note

Potentially consumes a large amount of memory!

### See Also

Other Genome Browser functions: `trackCTSS()`, `trackClusters()`, `trackLinks()`

### Examples

    ## Not run:
    library(Gviz)
    data(exampleCTSSs)
    data(exampleBidirectional)

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

    # Find a bidirectional cluster to plot:
    BC <- rowRanges(exampleBidirectional[10,])
    start(BC) <- start(BC) - 250
    end(BC) <- end(BC) + 250
    subsetOfCTSSs <- subsetByOverlaps(exampleCTSSs, BC)

    # Build balance track
    balance_track <- trackBalance(subsetOfCTSSs)

    # Plot
    plotTracks(balance_track, from=start(BC), to=end(BC),
               chromosome=seqnames(BC))

    ## End(Not run)

[Package CAGEfightR version 1.10.0 Index]