Learn R Programming

mygene (version 1.8.0)

getGene: Return the gene object for the given geneid.

Description

This is a wrapper for GET query of "/gene/" service.

Usage

getGene(geneid, fields = c("symbol", "name", "taxid", "entrezgene"), ..., return.as=c("records", "text"), mygene)

Arguments

geneid
Entrez/ensembl gene id
fields
Fields to return, a list of a comma-sep string. If fields=="all", all available fields are returned.
...
Includes species as well as several other fields. View available fields by calling ?metadata. Also, see http://docs.mygene.info/en/latest/doc/annotation_service.html for complete argument details and syntax.
return.as
"records"" (list), "text" (JSON).
mygene
A MyGene object that describes how to connect to data resources. See MyGene-class. If missing, default object will be used that accesses the main MyGene.info portal. Default is recommended.

Value

References

Ref: http://docs.mygene.info/en/latest/doc/annotation_service.html

See Also

getGenes query queryMany

Examples

Run this code
## return the gene object for the given gene id
getGene(1017)

## customize fields
getGene(1017, fields=c("name", "symbol", "refseq"), return.as="text")

## all fields
getGene(1017, fields="all")

Run the code above in your browser using DataLab