addGeneIDs: Add common IDs to annotated peaks such as gene symbol, entrez...

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/addGeneIDs.R

Description

Add common IDs to annotated peaks such as gene symbol, entrez ID, ensemble gene id and refseq id leveraging organism annotation dataset. For example, org.Hs.eg.db is the dataset from orgs.Hs.eg.db package for human, while org.Mm.eg.db is the dataset from the org.Mm.eg.db package for mouse.

Usage

1
2
3
4
5
6
7
8
addGeneIDs(
  annotatedPeak,
  orgAnn,
  IDs2Add = c("symbol"),
  feature_id_type = "ensembl_gene_id",
  silence = TRUE,
  mart
)

Arguments

annotatedPeak

GRanges or a vector of feature IDs.

orgAnn

organism annotation dataset such as org.Hs.eg.db.

IDs2Add

a vector of annotation identifiers to be added

feature_id_type

type of ID to be annotated, default is ensembl_gene_id

silence

TRUE or FALSE. If TRUE, will not show unmapped entrez id for feature ids.

mart

mart object, see useMart of biomaRt package for details

Details

One of orgAnn and mart should be assigned.

Value

GRanges if the input is a GRanges or dataframe if input is a vector.

Author(s)

Jianhong Ou, Lihua Julie Zhu

References

http://www.bioconductor.org/packages/release/data/annotation/

See Also

getBM, AnnotationDb

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(annotatedPeak)
library(org.Hs.eg.db)
addGeneIDs(annotatedPeak[1:6,],orgAnn="org.Hs.eg.db",
           IDs2Add=c("symbol","omim"))
##addGeneIDs(annotatedPeak$feature[1:6],orgAnn="org.Hs.eg.db",
##           IDs2Add=c("symbol","genename"))
if(interactive()){
  mart <- useMart("ENSEMBL_MART_ENSEMBL",host="www.ensembl.org",
                  dataset="hsapiens_gene_ensembl")
  ##mart <- useMart(biomart="ensembl",dataset="hsapiens_gene_ensembl")
  addGeneIDs(annotatedPeak[1:6,], mart=mart,
             IDs2Add=c("hgnc_symbol","entrezgene"))
}

LihuaJulieZhu/ChIPpeakAnno documentation built on Aug. 5, 2020, 12:02 a.m.