utilsSimplifyTxDb: Utility: Extract annotation hierachy from a TxDb.

Description Usage Arguments Value See Also Examples

View source: R/utils.R

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

1
2
3
4
5
6
7
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## 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)

MalteThodberg/CAGEfightR documentation built on Sept. 11, 2021, 4:42 a.m.