R: Retrieves gene annotation information given a vector of...
getGene
R Documentation
Retrieves gene annotation information given a vector of identifiers
Description
This function retrieves gene annotations from Ensembl given a vector of identifiers. Annotation includes chromsome name, band, start position, end position, gene description and gene symbol. A wide variety of identifiers is available in Ensembl, these can be found with the listFilters function.
Usage
getGene( id, type, mart)
Arguments
id
vector of gene identifiers one wants to annotate
type
type of identifier, possible values can be obtained by the listFilters function. Examples are entrezgene, hgnc_symbol (for hugo gene symbol), ensembl_gene_id, unigene, agilentprobe, affy_hg_u133_plus_2, refseq_dna, etc.
mart
object of class Mart, containing connections to the BioMart databases. You can create such an object using the function useMart.
Author(s)
Steffen Durinck
Examples
if(interactive()){
mart = useMart("ensembl", dataset="hsapiens_gene_ensembl")
#example using affy id
g = getGene( id = "1939_at", type = "affy_hg_u95av2", mart = mart)
show(g)
#example using Entrez Gene id
g = getGene( id = "100", type = "entrezgene", mart = mart)
show(g)
}
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(biomaRt)
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/biomaRt/getGene.Rd_%03d_medium.png", width=480, height=480)
> ### Name: getGene
> ### Title: Retrieves gene annotation information given a vector of
> ### identifiers
> ### Aliases: getGene
> ### Keywords: methods
>
> ### ** Examples
>
>
> #if(interactive()){
>
> mart = useMart("ensembl", dataset="hsapiens_gene_ensembl")
>
> #example using affy id
>
> g = getGene( id = "1939_at", type = "affy_hg_u95av2", mart = mart)
Error in martCheck(mart, "ensembl") :
This function only works when used with the ensembl BioMart.
Calls: getGene -> martCheck
Execution halted