Title: | Access MyGene.Info_ services |
---|---|
Description: | MyGene.Info_ provides simple-to-use REST web services to query/retrieve gene annotation data. It's designed with simplicity and performance emphasized. *mygene*, is an easy-to-use R wrapper to access MyGene.Info_ services. |
Authors: | Adam Mark, Ryan Thompson, Cyrus Afrasiabi, Chunlei Wu |
Maintainer: | Adam Mark, Cyrus Afrasiabi, Chunlei Wu <[email protected]> |
License: | Artistic-2.0 |
Version: | 1.43.0 |
Built: | 2024-11-29 08:28:55 UTC |
Source: | https://github.com/bioc/mygene |
This is a wrapper for GET query of "/gene/<geneid>" service.
getGene(geneid, fields = c("symbol", "name", "taxid", "entrezgene"), ..., return.as=c("records", "text"), mygene)
getGene(geneid, fields = c("symbol", "name", "taxid", "entrezgene"), ..., return.as=c("records", "text"), mygene)
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 |
return.as |
"records"" (list), "text" (JSON). |
mygene |
A MyGene object that describes how to connect to data resources. See |
returns a gene object containing the queried annotations
Ref: http://docs.mygene.info/en/latest/doc/annotation_service.html
## 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")
## 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")
This is a wrapper for POST query of "/gene" service.
getGenes(geneids, fields = c("symbol", "name", "taxid", "entrezgene"), ..., return.as=c("DataFrame", "records", "text"), mygene)
getGenes(geneids, fields = c("symbol", "name", "taxid", "entrezgene"), ..., return.as=c("DataFrame", "records", "text"), mygene)
geneids |
A vector, list, or comm-sep string entrez/ensembl gene ids |
fields |
A vector of fields to return. If fields=="all", all available fields are returned. |
... |
Includes |
return.as |
"DataFrame" (default), "records" (list), "text" (JSON). |
mygene |
A MyGene object that describes how to connect to data resources. See |
returns a gene object (DataFrame, list, or JSON text) containing the queried annotations
Ref: http://docs.mygene.info/en/latest/doc/annotation_service.html
## Return the list of gene object for the given list of gene ids. getGenes(c(1017,1018)) ## mix types of gene ids getGenes(c(1017,1018,"ENSG00000148795"))
## Return the list of gene object for the given list of gene ids. getGenes(c(1017,1018)) ## mix types of gene ids getGenes(c(1017,1018,"ENSG00000148795"))
makeTxDbFromMyGene allows the user to make a TxDb object in the Genomic Features package from a mygene "exons" query using a default MyGene object.
makeTxDbFromMyGene(gene.list, scopes, species, returnall=FALSE)
makeTxDbFromMyGene(gene.list, scopes, species, returnall=FALSE)
gene.list |
A list, vector, or comma-separated string of query terms. |
scopes |
Type of types of identifiers, either a list, vector, or a comma-separated fields to specify type of input qterms, e.g. c("reporter", "ensembl.gene", "symbol") refer to "http://docs.mygene.info/en/latest/doc/data.html#available-fields" for full list of fields. |
species |
Names or taxonomy ids |
returnall |
Logical, if TRUE, return list of genes without exons annotations. False by Default. |
makeTxDbFromMyGene invokes either the query or queryMany method and passes the response to construct a TxDb
object. See ?TxDb
for utilizing transcript annotations.
returns TxDb object
xli <- c('DDX26B','CCDC83','MAST3', 'RPL11') txdb <- makeTxDbFromMyGene(xli, scopes="symbol", species="human")
xli <- c('DDX26B','CCDC83','MAST3', 'RPL11') txdb <- makeTxDbFromMyGene(xli, scopes="symbol", species="human")
Get metadata for MyGene.info services.
metadata(x, ...)
metadata(x, ...)
x |
MyGene object |
... |
MyGene object slot parameters |
returns the metadata including available fields, genome assemblies, sources, statistics, taxonomy, and timestamp
http://mygene.info/v2/metadata
## Get metadata mygene<-MyGene() metadata(mygene) ## get available fields to return metadata(mygene)$available_fields
## Get metadata mygene<-MyGene() metadata(mygene) ## get available fields to return metadata(mygene)$available_fields
MyGene.Info_ provides simple-to-use REST web services to query/retrieve gene annotation data. It's designed with simplicity and performance emphasized. *mygene* is an easy-to-use R wrapper to access MyGene.info services.
Package: | mygene |
Type: | Package |
Version: | 0.99.0 |
Date: | 2014-04-18 |
License: | BSD |
Depends: | httr jsonlite Hmisc |
Adam Mark, Chunlei Wu
Maintainer: Chunlei Wu <[email protected]>
Wu C, MacLeod I, Su AI (2013) BioGPS and MyGene.info: organizing online, gene-centric information. Nucl. Acids Res. 41(D1): D561-D565. http://mygene.info/doc/annotation_service.html http://mygene.info/doc/query_service.html
Construct a MyGene object.
MyGene(...)
MyGene(...)
... |
See help page for MyGene-class |
MyGene object
MyGene()
MyGene()
"MyGene"
R Client to access MyGene.Info annotation services
Objects can be created by calls of the form MyGene(base.url="http://mygene.info/v2", delay=1, step=1000, version=version, verbose=TRUE, debug=FALSE)
.
base.url
:"http://mygene.info/v2". Object of class "character"
delay
:Sleep time between batch retrieval. Object of class "numeric"
step
:Batch limit. Object of class "numeric"
version
:httr package version. Object of class "character"
verbose
:Object of class "logical"
debug
:Object of class "logical"
getGene(geneid, fields = c("symbol", "name", "taxid", "entrezgene"),
..., return.as=c("records", "text"))
:Return the gene object for the given geneid
getGenes(geneids, fields = c("symbol", "name", "taxid", "entrezgene"), ...,
return.as=c("DataFrame", "records", "text"))
:Return the list of gene object for the given list of geneids.
query(q, fields=c("name", "symbol", "taxid", "entrezgene"),
..., return.as=c("DataFrame", "records", "text"))
:Return the query result.
queryMany(qterms, scopes=NULL, fields=c("name", "symbol", "taxid", "entrezgene"),
..., return.as=c("DataFrame", "records", "text"), returnall=FALSE)
:Return the batch query result.
metadata(x, ...)
:Get metadata for MyGene.info services.
makeTxDbFromMyGene(gene.list, scopes, species, returnall=FALSE)
:Make a TxDb object from transcript annotations
Adam Mark, Chunlei Wu, Ryan Thompson
Wu C, MacLeod I, Su AI (2013) BioGPS and MyGene.info: organizing online, gene-centric information. Nucl. Acids Res. 41(D1): D561-D565.
showClass("MyGene")
showClass("MyGene")
This is a wrapper for GET query of "/query?q=<query>" service.
query(q, ..., return.as=c("DataFrame", "records", "text"), mygene)
query(q, ..., return.as=c("DataFrame", "records", "text"), mygene)
q |
query term(s), see query syntax at http://mygene.info/doc/query_service.html#query-syntax |
... |
Commonly queried fields include |
return.as |
"DataFrame" (default), "records" (list), or "text" (JSON). |
mygene |
A MyGene object that describes how to connect to data resources. See |
returns a gene object (DataFrame, list, or JSON text) containing the queried annotations
Ref: http://docs.mygene.info/en/latest/doc/query_service.html
## return the query result query("cdk2", size=5) query("reporter:1000_at") query("symbol:cdk2", return.as="text") query(q="cyclin-dependent kinase", fields="uniprot")
## return the query result query("cdk2", size=5) query("reporter:1000_at") query("symbol:cdk2", return.as="text") query(q="cyclin-dependent kinase", fields="uniprot")
This is a wrapper for POST query of "/query" service.
queryMany(qterms, scopes=NULL, ..., return.as=c("DataFrame", "records", "text"), mygene)
queryMany(qterms, scopes=NULL, ..., return.as=c("DataFrame", "records", "text"), mygene)
qterms |
A vector or list, or string of comma-separated query terms |
scopes |
Type of types of identifiers, either a list or a comma-separated fields to specify type of input qterms, e.g. c("reporter", "ensembl.gene", "symbol") refer to "http://mygene.info/doc/query_service.html#available_fields" for full list of fields. |
... |
Commonly queried fields include |
return.as |
"DataFrame" (default), "records" (list), "text" (JSON). |
mygene |
A MyGene object that describes how to connect to data resources. See |
returns a gene object (DataFrame, list, or JSON text) containing the queried annotations
Ref: http://docs.mygene.info/en/latest/doc/query_service.html
## return the batch query result queryMany(c('1053_at', '117_at', '121_at'), scopes="reporter", fields="ensembl.gene", species="human", return.as="records") queryMany(c('1053_at', '117_at', '121_at'), scopes="reporter", species=9606) queryMany(c('DDX26B', 'CCDC83', 'MAST3', 'FLOT1'), scopes="symbol", fields="entrezgene", species="human")
## return the batch query result queryMany(c('1053_at', '117_at', '121_at'), scopes="reporter", fields="ensembl.gene", species="human", return.as="records") queryMany(c('1053_at', '117_at', '121_at'), scopes="reporter", species=9606) queryMany(c('DDX26B', 'CCDC83', 'MAST3', 'FLOT1'), scopes="symbol", fields="entrezgene", species="human")