utilsSimplifyTxDb {CAGEfightR} | R Documentation

## Utility: Extract annotation hierachy from a TxDb.

### Description

Used by assignTxType. This function extracts the hierachical annotations used by assignTxType from a TxDb object. If you are annotating many ranges, it can be time saving to built the hierachy first, to avoid processing the TxDb for every assignTxDb call.

### Usage

    utilsSimplifyTxDb(
      object,
      tssUpstream = 100,
      tssDownstream = 100,
      proximalUpstream = 1000,
      detailedAntisense = FALSE
    )

### Arguments

`object` | TxDb: Transcript database
`tssUpstream` | integer: Distance to extend annotated promoter upstream.
`tssDownstream` | integer: Distance to extend annotated promoter downstream.
`proximalUpstream` | integer: Maximum distance upstream of promoter to be considered proximal.
`detailedAntisense` | logical: Wether to mirror all txType categories in the antisense direction (TRUE) or lump them all together (FALSE).

### Value

GRangesList of annotation hierachy

### See Also

assignTxType

Other Utility functions: `utilsAggregateRows()`, `utilsDeStrand()`, `utilsScoreOverlaps()`

### Examples

    ## Not run:
    data(exampleUnidirectional)

    # Obtain transcript models from a TxDb-object:
    library(TxDb.Mmusculus.UCSC.mm9.knownGene)
    txdb <- TxDb.Mmusculus.UCSC.mm9.knownGene

    # Simplify txdb
    hierachy <- utilsSimplifyTxDb(txdb)

    # Standard way of calling
    x <- assignTxType(exampleUnidirectional,
                      txModels=txdb)

    # Calling with premade hierachy
    y <- assignTxType(exampleUnidirectional, txModels=hierachy)

    # These are identical
    stopifnot(all(rowRanges(x)$txType == rowRanges(y)$txType))

    ## End(Not run)

[Package CAGEfightR version 1.12.0 Index]