annotateRanges: Annotates the given FraserDataSet with the HGNC symbol with...

View source: R/annotationOfRanges.R

annotateRangesR Documentation

Annotates the given FraserDataSet with the HGNC symbol with biomaRt

Description

Annotates the given FraserDataSet with the HGNC symbol with biomaRt

Usage

annotateRanges(
  fds,
  feature = "hgnc_symbol",
  featureName = feature,
  biotype = list("protein_coding"),
  ensembl = NULL,
  GRCh = 37
)

annotateRangesWithTxDb(
  fds,
  feature = "SYMBOL",
  featureName = "hgnc_symbol",
  keytype = "ENTREZID",
  txdb = NULL,
  orgDb = NULL,
  filter = list()
)

Arguments

fds

FraserDataSet

feature

Defines which feature (default is HGNC symbol) should be annotated. Has to be the biomaRt feature name or a column name in orgDb.

featureName

The column name of the feature in the FraserDataSet mcols.

biotype

The biotype for biomaRt.

ensembl

The ensembl that should be used. If NULL, the default one is used (hsapiens_gene_ensembl, GRCh37).

GRCh

GRCh version to connect to. If this is NULL, then the current GRCh38 is used. Otherwise, this can only be 37 (default) at the moment (see useEnsembl).

keytype

The keytype or column name of gene IDs in the TxDb object (see keytypes for a list of available ID types).

txdb

A TxDb object. If this is NULL, then the default one is used, currently this is TxDb.Hsapiens.UCSC.hg19.knownGene.

orgDb

An orgDb object or a data table to map the feature names. If this is NULL, then org.Hs.eg.db is used as the default.

filter

A named list specifying the filters which should be applied to subset to e.g. only protein-coding genes for annotation. names(filter) needs to be column names in the given orgDb object (default: no filtering).

Value

FraserDataSet

Examples


fds <- createTestFraserDataSet()

### Two ways to annotage ranges with gene names: 
# either using biomart with GRCh38
try({
  fds <- annotateRanges(fds, GRCh=38)
  rowRanges(fds, type="j")[,c("hgnc_symbol")]
})

# either using biomart with GRCh37
try({
  fds <- annotateRanges(fds, featureName="hgnc_symbol_37", GRCh=37)
  rowRanges(fds, type="j")[,c("hgnc_symbol_37")]
})
 
# or with a provided TxDb object
require(TxDb.Hsapiens.UCSC.hg19.knownGene)
txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene
require(org.Hs.eg.db)
orgDb <- org.Hs.eg.db
fds <- annotateRangesWithTxDb(fds, txdb=txdb, orgDb=orgDb)
rowRanges(fds, type="j")[,"hgnc_symbol"]


c-mertes/FraseR documentation built on April 21, 2024, 1:22 a.m.