assignGeneID: Annotate ranges with gene ID.

Description Usage Arguments Value See Also Examples

Description

Annotate a set of ranges in a GRanges object with gene IDs (i.e. Entrez Gene Identifiers) based on their genic context. Features overlapping multiple genes are resolved by distance to the nearest TSS. Genes are obtained from a TxDb object, or can manually supplied as a GRanges.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
assignGeneID(object, geneModels, ...)

## S4 method for signature 'GenomicRanges,GenomicRanges'
assignGeneID(
  object,
  geneModels,
  outputColumn = "geneID",
  swap = NULL,
  upstream = 1000,
  downstream = 100
)

## S4 method for signature 'RangedSummarizedExperiment,GenomicRanges'
assignGeneID(object, geneModels, ...)

## S4 method for signature 'GenomicRanges,TxDb'
assignGeneID(
  object,
  geneModels,
  outputColumn = "geneID",
  swap = NULL,
  upstream = 1000,
  downstream = 100
)

## S4 method for signature 'RangedSummarizedExperiment,TxDb'
assignGeneID(object, geneModels, ...)

Arguments

object

GRanges or RangedSummarizedExperiment: Ranges to be annotated.

geneModels

TxDb or GRanges: Gene models via a TxDb, or manually specified as a GRangesList.

...

additional arguments passed to methods.

outputColumn

character: Name of column to hold geneID values.

swap

character or NULL: If not NULL, use another set of ranges contained in object to calculate overlaps, for example peaks in the thick column.

upstream

integer: Distance to extend annotated promoter upstream.

downstream

integer: Distance to extend annotated promoter downstream.

Value

object with geneID added as a column in rowData (or mcols).

See Also

Other Annotation functions: assignMissingID(), assignTxID(), assignTxType()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
data(exampleUnidirectional)

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

# Assign geneIDs
assignGeneID(exampleUnidirectional,
             geneModels=txdb,
             outputColumn='geneID')

# Assign geneIDs using only TC peaks:
assignGeneID(exampleUnidirectional,
             geneModels=txdb,
             outputColumn='geneID',
             swap='thick')

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