This function annotates the provided TSS bed file to provide the number of TSS falling within the genomic features from a given TxDB object. In order to break ties between overlapping features, the function ranks the features by preference. By default, the following order is used: fiveUTR > promoter > intron > coding > spliceSite > threeUTR > intergenic. A custom order of feature ranks can also be provided.

annotateTSS(tssBED, txdb, featureRank = c("fiveUTR", "promoter", "intron",
  "coding", "spliceSite", "threeUTR", "intergenic"), plotValue = "number",
  outFile = NULL)

Arguments

tssBED

A bed file with detected TSS/differential TSS coordinates

txdb

A txdb object.

featureRank

A vector with features to use for breaking ties, in decending order of preference (highest to lowest),

plotValue

What values to plot (choose from "number", "percent" or NULL for no plot)

outFile

Output file name. (filename extention would be used to determine type). If outfile not specified, the plot would be retured on the screen

Value

A data.frame with number of TSS falling into each feature

Examples

# load a txdb object library("TxDb.Dmelanogaster.UCSC.dm6.ensGene")
#> Loading required package: GenomicFeatures
#> Loading required package: AnnotationDbi
seqlevelsStyle(TxDb.Dmelanogaster.UCSC.dm6.ensGene) <- "ENSEMBL" # limiting the annotation to X chromosome seqlevels(TxDb.Dmelanogaster.UCSC.dm6.ensGene) <- "X" # annotate a given TSS bed file dir <- system.file("extdata", package = "icetea") tss <- file.path(dir, "testTSS_merged.bed") annotations <- annotateTSS(tssBED = tss, TxDb.Dmelanogaster.UCSC.dm6.ensGene, plotValue = "number", outFile = "TSS_annot.pdf")
#> 'select()' returned 1:1 mapping between keys and columns
#> 'select()' returned many:1 mapping between keys and columns
#> 'select()' returned 1:1 mapping between keys and columns
#> 'select()' returned many:1 mapping between keys and columns
#> 'select()' returned many:1 mapping between keys and columns
#> 'select()' returned 1:1 mapping between keys and columns
#> Saving 10.1 x 5.6 in image