Title: | Accesses MyVariant.info variant query and annotation services |
---|---|
Description: | MyVariant.info is a comprehensive aggregation of variant annotation resources. myvariant is a wrapper for querying MyVariant.info services |
Authors: | Adam Mark |
Maintainer: | Adam Mark, Chunlei Wu <[email protected]> |
License: | Artistic-2.0 |
Version: | 1.37.0 |
Built: | 2024-11-29 08:29:13 UTC |
Source: | https://github.com/bioc/myvariant |
Read in a Vcf object created by readVcf
to extract all HGVS IDs for querying MyVariant.info.
formatHgvs(vcf, variant_type = c("snp", "insertion", "deletion"))
formatHgvs(vcf, variant_type = c("snp", "insertion", "deletion"))
vcf |
Vcf object created by |
variant_type |
Type of variant HGVS IDs to retrieve from Vcf object. Default c("snp", "insertion", "deletion") |
vector
https://myvariant.info http://www.hgvs.org/mutnomen/recs-DNA.html
## return HGVS IDs for all snps in a Vcf file.path <- system.file("extdata", "dbsnp_mini.vcf", package="myvariant") vcf <- readVcf(file.path, genome="hg19") hgvs <- formatHgvs(vcf, variant_type="snp")
## return HGVS IDs for all snps in a Vcf file.path <- system.file("extdata", "dbsnp_mini.vcf", package="myvariant") vcf <- readVcf(file.path, genome="hg19") hgvs <- formatHgvs(vcf, variant_type="snp")
Create a single HGVS ID for a variant from chromosome, position, reference and alternate alleles.
formatSingleHgvs(chrom, pos, ref, alt, mutant_type=FALSE)
formatSingleHgvs(chrom, pos, ref, alt, mutant_type=FALSE)
chrom |
Chromosome. |
pos |
Position of the variant on the reference genome (hg19). |
ref |
Reference allele. |
alt |
Alternate allele. |
mutant_type |
Logical indicating whether to return the type of mutation along with the HGVS ID. |
returns a string
https://myvariant.info http://www.hgvs.org/mutnomen/recs-DNA.html
## return HGVS ID for a variant formatSingleHgvs(1, 35367, "G", "A")
## return HGVS ID for a variant formatSingleHgvs(1, 35367, "G", "A")
This is a wrapper for GET query of "/variant/<hgvsid>" service.
getVariant(hgvsid, fields=NULL, ..., return.as=c("records", "text"), myvariant)
getVariant(hgvsid, fields=NULL, ..., return.as=c("records", "text"), myvariant)
hgvsid |
HGVS id |
fields |
Fields to return, a list of a comma-sep string. If fields=="all", all available fields are returned. |
... |
|
return.as |
"records"" (list), "text" (JSON). |
myvariant |
A MyVariant object that describes how to connect to data resources. See |
returns a variant object containing the queried annotations
http://docs.myvariant.info/en/latest/doc/variant_annotation_service.html#get-request http://docs.myvariant.info/en/latest/doc/variant_annotation_service.html#query-parameters
getVariants
queryVariant
queryVariants
## return the variant object for the given HGVS id getVariant("chr7:g.55241707G>T") ## customize fields getVariant("chr7:g.55241707G>T", fields=c("dbnsfp.cadd.phred", "dbnsfp.polyphen2"), return.as="text")
## return the variant object for the given HGVS id getVariant("chr7:g.55241707G>T") ## customize fields getVariant("chr7:g.55241707G>T", fields=c("dbnsfp.cadd.phred", "dbnsfp.polyphen2"), return.as="text")
This is a wrapper for POST query of "/variant" service.
getVariants(hgvsids, fields=NULL, verbose=NULL, ..., return.as=c("DataFrame", "records", "text"), myvariant)
getVariants(hgvsids, fields=NULL, verbose=NULL, ..., return.as=c("DataFrame", "records", "text"), myvariant)
hgvsids |
A vector, list, or comm-sep string HGVS ids |
fields |
A vector of fields to return. If fields=="all", all available fields are returned. |
verbose |
A logical turning on or off process status messages. Default = TRUE. |
... |
|
return.as |
"DataFrame" (default), "records" (list), "text" (JSON). |
myvariant |
A MyVariant object that describes how to connect to data resources. See |
returns a variant object (DataFrame, list, or JSON text) containing the queried annotations
http://docs.myvariant.info/en/latest/doc/variant_annotation_service.html#batch-queries-via-post http://docs.myvariant.info/en/latest/doc/variant_annotation_service.html#id2
getVariants
queryVariant
queryVariants
## given a list of HGVS ids vars <- c('chr1:g.866422C>T', 'chr1:g.876664G>A', 'chr1:g.69635G>C', 'chr1:g.69869T>A', 'chr1:g.881918G>A', 'chr1:g.865625G>A', 'chr1:g.879368C>A', 'chr1:g.889226C>T', 'chr1:g.879492C>G', 'chr1:g.879423T>G', 'chr1:g.881602C>T', 'chr1:g.879115C>G', 'chr1:g.69892T>C', 'chr1:g.879381C>T', 'chr1:g.878330C>G') ## Return the list of variant object for the given list of HGVS ids. df <- getVariants(vars, fields="dbsnp, wellderly")
## given a list of HGVS ids vars <- c('chr1:g.866422C>T', 'chr1:g.876664G>A', 'chr1:g.69635G>C', 'chr1:g.69869T>A', 'chr1:g.881918G>A', 'chr1:g.865625G>A', 'chr1:g.879368C>A', 'chr1:g.889226C>T', 'chr1:g.879492C>G', 'chr1:g.879423T>G', 'chr1:g.881602C>T', 'chr1:g.879115C>G', 'chr1:g.69892T>C', 'chr1:g.879381C>T', 'chr1:g.878330C>G') ## Return the list of variant object for the given list of HGVS ids. df <- getVariants(vars, fields="dbsnp, wellderly")
Get metadata for MyVariant.info services.
metadata(x, ...)
metadata(x, ...)
x |
MyVariant object |
... |
MyVariant object slot parameters |
returns the metadata including available databases and number of documents.
http://myvariant.info/v1/metadata
## Get metadata myvariant<-MyVariant() metadata(myvariant)
## Get metadata myvariant<-MyVariant() metadata(myvariant)
MyVariant.Info provides REST web services to query/retrieve variant annotations. myvariant is an easy-to-use R wrapper to access MyVariant.info services.
Package: | myvariant |
Type: | Package |
Version: | 0.99.0 |
Date: | 2014-12-18 |
License: | Artistic-2.0 |
Depends: | httr jsonlite Hmisc |
Adam Mark
Maintainer: Adam Mark <[email protected]>
https://github.com/Network-of-BioThings/myvariant.info/wiki
Construct a MyVariant object.
MyVariant(...)
MyVariant(...)
... |
See help page for MyVariant-class |
MyVariant object
MyVariant()
MyVariant()
"MyVariant"
R Client to access MyVariant.Info annotation services
Objects can be created by calls of the form MyVariant(base.url="http://myvariant.info/v1", delay=1, step=1000, version=version, verbose=TRUE, debug=FALSE)
.
base.url
:"http://myvariant.info/v1". 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"
getVariant(hgvsid, fields=NULL,
..., return.as=c("records", "text"))
:Return the variant object for the given hgvsid
getVariants(hgvsids, fields=NULL, ...,
return.as=c("DataFrame", "records", "text"))
:Return the list of variant object for the given list of hgvsids.
queryVariant(q, fields=NULL,
..., return.as=c("DataFrame", "records", "text"))
:Return the query result.
queryVariants(qterms, scopes=NULL, fields=NULL,
..., return.as=c("DataFrame", "records", "text"), returnall=FALSE)
:Return the batch query result.
Adam Mark
https://github.com/Network-of-BioThings/myvariant.info/wiki
showClass("MyVariant")
showClass("MyVariant")
This is a wrapper for GET query of "/query?q=<query>" service.
queryVariant(q, ..., return.as=c("DataFrame", "records", "text"), myvariant)
queryVariant(q, ..., return.as=c("DataFrame", "records", "text"), myvariant)
q |
query term(s). |
... |
Commonly queried fields include |
return.as |
"DataFrame" (default), "records" (list), or "text" (JSON). |
myvariant |
A MyVariant object that describes how to connect to data resources. See |
returns a variant object (DataFrame, list, or JSON text) containing the queried annotations
http://docs.myvariant.info/en/latest/doc/variant_query_service.html#get-request http://docs.myvariant.info/en/latest/doc/variant_query_service.html#query-syntax
queryVariants
getVariant
getVariants
## return the query result queryVariant("dbnsfp.variantname:BRCA2") queryVariant("chr1:1-1000000")
## return the query result queryVariant("dbnsfp.variantname:BRCA2") queryVariant("chr1:1-1000000")
This is a wrapper for POST query of "/query" service.
queryVariants(qterms, scopes=NULL, ..., return.as=c("DataFrame", "records", "text"), myvariant)
queryVariants(qterms, scopes=NULL, ..., return.as=c("DataFrame", "records", "text"), myvariant)
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. |
... |
Commonly queried fields include |
return.as |
"DataFrame" (default), "records" (list), "text" (JSON). |
myvariant |
A MyVariant object that describes how to connect to data resources. See |
returns a variant object (DataFrame, list, or JSON text) containing the queried annotations
http://docs.myvariant.info/en/latest/doc/variant_query_service.html#batch-queries-via-post http://docs.myvariant.info/en/latest/doc/variant_query_service.html#id3
queryVariant
getVariant
getVariants
## return the batch query result
## return the batch query result