diff --git a/clients/R/Bioc_Sub.Rproj b/clients/R/Bioc_Sub.Rproj new file mode 100644 index 0000000000..eaa6b8186b --- /dev/null +++ b/clients/R/Bioc_Sub.Rproj @@ -0,0 +1,18 @@ +Version: 1.0 + +RestoreWorkspace: Default +SaveWorkspace: Default +AlwaysSaveHistory: Default + +EnableCodeIndexing: Yes +UseSpacesForTab: Yes +NumSpacesForTab: 2 +Encoding: UTF-8 + +RnwWeave: Sweave +LaTeX: pdfLaTeX + +BuildType: Package +PackageUseDevtools: Yes +PackageInstallArgs: --no-multiarch --with-keep.source +PackageRoxygenize: rd,collate,namespace diff --git a/clients/R/DESCRIPTION b/clients/R/DESCRIPTION index 5967c9344a..0328e38363 100644 --- a/clients/R/DESCRIPTION +++ b/clients/R/DESCRIPTION @@ -2,62 +2,33 @@ Package: cellbaseR Type: Package Date: 2016-04-17 Title: Querying annotation data from the high performance Cellbase web - services -Version: 0.99.0 + services +Version: 0.99.39 Author: Mohammed OE Abdallah Maintainer: Mohammed OE Abdallah -Description: - This R package makes use of the exhaustive RESTful Web service API that has been - implemented for the Cellabase database. It enable researchers to query and - obtain a wealth of biological information from a single database saving a lot - of time. Another benefit is that researchers can easily make queries about - different biological topics and link all this information together as all - information is integrated. +URL: https://github.com/melsiddieg/cellbaseR +Description: This R package makes use of the exhaustive RESTful Web + service API that has been implemented for the Cellabase + database. It enable researchers to query and obtain a wealth of + biological information from a single database saving a lot of + time. Another benefit is that researchers can easily make + queries about different biological topics and link all this + information together as all information is integrated. License: Apache License (== 2.0) -Depends: - R(>= 3.3), - RCurl -Imports: - methods, - jsonlite, - data.table, - pbapply, - tidyr, - R.utils, - Rsamtools, - BiocParallel, - Gviz, - foreach, - utils, - parallel, doMC, doParallel -RoxygenNote: 5.0.1.9000 -biocViews: Annotation +Depends: R(>= 3.4) +Imports: methods, jsonlite, httr, data.table, pbapply, tidyr, R.utils, + Rsamtools, BiocParallel, foreach, utils, parallel, doParallel +Suggests: BiocStyle, knitr, rmarkdown, Gviz, VariantAnnotation +RoxygenNote: 6.0.1 +biocViews: Annotation, VariantAnnotation Lazy: TRUE -Collate: - 'commons.R' - 'AllClasses.R' - 'AllGenerics.R' - 'CellBaseParam-methods.R' - 'CellBaseR-methods.R' - 'cbAnnotateVcf-methods.R' - 'cbChromosomeInfoClient-methods.R' - 'cbClinicalClient-methods.R' - 'cbData-methods.R' - 'cbGeneClient-methods.R' - 'cbGet-methods.R' - 'cbProteinClient-methods.R' - 'cbRegionClient-methods.R' - 'cbSnpClient-methods.R' - 'cbSpeciesClient-methods.R' - 'cbTfbsClient-methods.R' - 'cbTranscriptClient-methods.R' - 'cbVariantClient-methods.R' - 'cbXrefClient-methods.R' - 'cellbase.R' - 'show-methods.R' - 'tools.R' +LazyData: TRUE +Collate: 'commons.R' 'AllClasses.R' 'AllGenerics.R' + 'AnnotateVcf-methods.R' 'CellBaseParam-methods.R' + 'CellBaseR-methods.R' 'cellbase.R' 'getCellbase-methods.R' + 'getChromosomeInfo-methods.R' 'getClinical-methods.R' + 'getGene-methods.R' 'getMeta-methods.R' 'getProtein-methods.R' + 'getRegion-methods.R' 'getSnp-methods.R' 'getTf-methods.R' + 'getTranscript-methods.R' 'getVariant-methods.R' + 'getXref-methods.R' 'show-methods.R' 'tools.R' 'user.R' VignetteBuilder: knitr -Suggests: - BiocStyle, - knitr, - rmarkdown diff --git a/clients/R/NAMESPACE b/clients/R/NAMESPACE index 22c1a93b08..9504529812 100644 --- a/clients/R/NAMESPACE +++ b/clients/R/NAMESPACE @@ -2,36 +2,44 @@ export(CellBaseParam) export(CellBaseR) -export(cbHelp) export(createGeneModel) +export(getCaddScores) +export(getCellBaseResourceHelp) +export(getClinicalByGene) +export(getClinicalByRegion) +export(getConservationByRegion) +export(getGeneInfo) +export(getProteinInfo) +export(getRegulatoryByRegion) +export(getSnpByGene) +export(getTfbsByRegion) +export(getTranscriptByGene) +export(getVariantAnnotation) exportClasses(CellBaseParam) exportClasses(CellBaseR) -exportClasses(CellBaseResponse) -exportMethods(cbAnnotateVcf) -exportMethods(cbChromosomeInfoClient) -exportMethods(cbClinicalClient) -exportMethods(cbData) -exportMethods(cbGeneClient) -exportMethods(cbGet) -exportMethods(cbProteinClient) -exportMethods(cbRegionClient) -exportMethods(cbSnpClient) -exportMethods(cbSpeciesClient) -exportMethods(cbTfbsClient) -exportMethods(cbTranscriptClient) -exportMethods(cbVariantClient) -exportMethods(cbXrefClient) +exportMethods(AnnotateVcf) +exportMethods(getCellBase) +exportMethods(getChromosomeInfo) +exportMethods(getClinical) +exportMethods(getGene) +exportMethods(getMeta) +exportMethods(getProtein) +exportMethods(getRegion) +exportMethods(getSnp) +exportMethods(getTf) +exportMethods(getTranscript) +exportMethods(getVariant) +exportMethods(getXref) import(BiocParallel) -import(RCurl) import(Rsamtools) import(data.table) -import(doMC) import(doParallel) import(foreach) +import(httr) import(jsonlite) import(methods) import(parallel) import(pbapply) -importFrom(Gviz,GeneRegionTrack) +import(utils) importFrom(R.utils,countLines) importFrom(tidyr,unnest) diff --git a/clients/R/R/AllClasses.R b/clients/R/R/AllClasses.R index 3ee7ba4ddf..69e0318568 100644 --- a/clients/R/R/AllClasses.R +++ b/clients/R/R/AllClasses.R @@ -1,13 +1,12 @@ ################################################################################ -#' This class defines the CellBaseR object +#' CellBaseR Class #' @include commons.R -#' This is an S4 class which defines the CellBaseR object +#' +#' @description This is an S4 class which defines the CellBaseR object #' @details This S4 class holds the default configuration required by CellBaseR #' methods to connect to the cellbase web #' services. By default it is configured to query human data based on the GRCh37 -#' genome assembly. Please, visit https://github.com/opencb/cellbase/wiki and -#' http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/ for more details on -#' following parameters. +#' genome assembly. #' @slot host a character specifying the host url. Default #' "http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/rest/" #' @slot version a character specifying the API version. Default "v4" @@ -18,35 +17,27 @@ #' queries will be sent to the server in batches. This slot indicates the size #' of these batches. Default 200 #' @slot num_threads the number of threads. Default 8 +#' @seealso \url{https://github.com/opencb/cellbase/wiki} +#' and the RESTful API documentation +#' \url{http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/} #' @export setClass("CellBaseR", - slots = c(host="character", version="character", species="character", - batch_size="numeric", num_threads="numeric"), - prototype = prototype(host="http://bioinfodev.hpc.cam.ac.uk/cellbase-dev-v4.0/webservices/rest/", - version = "v4/",species="hsapiens/", batch_size=200, num_threads=8) + slots = c(host="character", version="character", species="character", + batch_size="numeric", num_threads="numeric"), + prototype = prototype( + host="http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/webservices/rest/", + version = "v4/",species="hsapiens/", batch_size=200L, num_threads=8L) ) -################################################################################ -#' The CellBaseResponse class defintion -#' -#' This class holds the response data from CellBaseR Methods -#' @details This class stores a response of CellBaseR query methods. An object -#' of class CellBaseResponse is automatically generated when you call any of -#' CellbaseR methods. -#' @slot cbData an R dataframe which contains the result field within the -#' response object returned by CellBase web services. -#' @export -CellBaseResponse <-setClass("CellBaseResponse", slots=c(cbData="data.frame")) ############################################################################### -#' This Class defines a CellBaseParam object +#' CellBaseParam Class #' -#' This class defines a CellBaseParam object to hold filtering parameters -#' @details This class stores filtering parameters to be used by CellBaseR query -#' methods. Not all the slots will be -#' used by all query methods, please have a look at -#' http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/ and the -#' Reference Manual for more information. +#' @description This class defines a CellBaseParam object to hold filtering +#' parameters. +#' @details This class stores parameters used for filtering the CellBaseR query +#' and is avaialable for all query methods. CellBaseParam object is used to +#' control what results are returned from the' CellBaseR methods #' @slot genome A character the genome build to query, e.g.GRCh37(default) #' @slot gene A character vector denoting the gene/s to be queried #' @slot region A character vector denoting the region/s to be queried must be @@ -57,6 +48,9 @@ CellBaseResponse <-setClass("CellBaseResponse", slots=c(cbData="data.frame")) #' @slot include A character vector denoting the fields to be returned #' @slot exclude A character vector denoting the fields to be excluded #' @slot limit A number limiting the number of results to be returned +#' @seealso \url{https://github.com/opencb/cellbase/wiki} +#' and the RESTful API documentation +#' \url{http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/} #' @export setClass("CellBaseParam",slots = c(genome="character", gene="character", region="character", rs="character", diff --git a/clients/R/R/AllGenerics.R b/clients/R/R/AllGenerics.R index f549d60a0c..e0399e573d 100644 --- a/clients/R/R/AllGenerics.R +++ b/clients/R/R/AllGenerics.R @@ -1,91 +1,78 @@ # CellBaseR methods #'@include commons.R -################################################################################ -################################################################################ -setGeneric("cbClinicalClient", function(object, filters,...) -standardGeneric("cbClinicalClient")) +############################################################################### +############################################################################### +setGeneric("getClinical", function(object, param) +standardGeneric("getClinical")) -setGeneric("cbGeneClient", function(object,ids,resource,filters=NULL, ...) -standardGeneric("cbGeneClient")) +setGeneric("getGene", function(object,ids,resource,param=NULL) +standardGeneric("getGene")) -################################################################################ +############################################################################### -################################################################################ -setGeneric("cbRegionClient", function(object,ids,resource,filters, ...) -standardGeneric("cbRegionClient")) +############################################################################### +setGeneric("getRegion", function(object,ids,resource,param=NULL) +standardGeneric("getRegion")) -################################################################################ +############################################################################### -################################################################################ -setGeneric("cbSnpClient", function(object,ids,resource,filters=NULL, ...) -standardGeneric("cbSnpClient")) +############################################################################### +setGeneric("getSnp", function(object,ids,resource,param=NULL) +standardGeneric("getSnp")) -################################################################################ +############################################################################### -######################################################################################################################## -setGeneric("cbVariantClient", function(object,ids,resource,filters=NULL, ...) -standardGeneric("cbVariantClient")) +############################################################################### +setGeneric("getVariant", function(object,ids,resource,param=NULL) +standardGeneric("getVariant")) -######################################################################################################################## +############################################################################### -setGeneric("cbGet", function(object, category, subcategory, ids, resource, filters=NULL,...) -standardGeneric("cbGet")) +setGeneric("getCellBase", function(object, category, subcategory, ids, resource, + param=NULL) +standardGeneric("getCellBase")) -######################################################################################################################## +############################################################################### -######################################################################################################################## -setGeneric("cbTfbsClient", function(object,ids,resource,filters=NULL, ...) -standardGeneric("cbTfbsClient")) +############################################################################### +setGeneric("getTf", function(object,ids,resource,param=NULL) +standardGeneric("getTf")) -######################################################################################################################## +############################################################################### -######################################################################################################################## -setGeneric("cbTranscriptClient", function(object,ids,resource,filters=NULL, ...) -standardGeneric("cbTranscriptClient")) +############################################################################### +setGeneric("getTranscript", function(object,ids,resource,param=NULL) +standardGeneric("getTranscript")) -######################################################################################################################## +############################################################################## -######################################################################################################################## -setGeneric("cbXrefClient", function(object,ids,resource,filters=NULL, ...) -standardGeneric("cbXrefClient")) +############################################################################## +setGeneric("getXref", function(object,ids,resource,param=NULL) +standardGeneric("getXref")) -######################################################################################################################## +############################################################################## -######################################################################################################################## -setGeneric("cbProteinClient", function(object,ids,resource,filters=NULL, ...) -standardGeneric("cbProteinClient")) +############################################################################## +setGeneric("getProtein", function(object,ids,resource,param=NULL) +standardGeneric("getProtein")) -######################################################################################################################## -################################################################################ -setGeneric("cbChromosomeInfoClient", function(object,ids,resource,filters=NULL, ...) -standardGeneric("cbChromosomeInfoClient")) +############################################################################### +############################################################################### +setGeneric("getChromosomeInfo", function(object,ids,resource,param=NULL) +standardGeneric("getChromosomeInfo")) -################################################################################ -#' A method for getting the avaiable species from the cellbase web services -#' -#' This method is for getting species data from the cellbase web services. -#' @details Please, for details on possible values for the -#' parameters and additional filters of this function refer to -#' https://github.com/opencb/cellbase/wiki and the RESTful -#' http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/ -#' @param object an object of class CellBaseR -#' @return an object of class CellBaseResponse which holds a dataframe with the -#' results of the query -#' @examples -#' cb <- CellBaseR() -#' res <- cbSpeciesClient(object=cb) -setGeneric("cbSpeciesClient", function(object) -standardGeneric("cbSpeciesClient")) +############################################################################### -################################################################################ -setGeneric("cbAnnotateVcf", function(object,file, ...) -standardGeneric("cbAnnotateVcf")) +setGeneric("getMeta", function(object, resource) +standardGeneric("getMeta")) + +############################################################################### +setGeneric("AnnotateVcf", function(object, file, batch_size, + num_threads, + BPPARAM=bpparam()) +standardGeneric("AnnotateVcf")) -# CellBaseResponse methods -################################################################################ -setGeneric("cbData", function(object) -standardGeneric("cbData")) diff --git a/clients/R/R/AnnotateVcf-methods.R b/clients/R/R/AnnotateVcf-methods.R new file mode 100644 index 0000000000..36c90fb7ce --- /dev/null +++ b/clients/R/R/AnnotateVcf-methods.R @@ -0,0 +1,34 @@ +################################################################################ +#' AnnotateVcf +#' +#' This method is a convience method to annotate bgzipped tabix-indexed vcf +#' files. It should be ideal for annotating small to medium sized +#' vcf files. +#' @include AllClasses.R AllGenerics.R +#' @aliases AnnotateVcf +#' @param object an object of class CellBaseR +#' @param file Path to a bgzipped and tabix indexed vcf file +#' @param batch_size intger if multiple queries are raised by a single method +#' call, e.g. getting annotation info for several genes, +#' queries will be sent to the server in batches. This slot indicates the size +#' of each batch, e.g. 200 +#' @param num_threads number of asynchronus batches to be sent to the server +#' @param BPPARAM a BiocParallel class object +#' @return a dataframe with the results of the query +#' @examples +#' cb <- CellBaseR() +#' fl <- system.file("extdata", "hapmap_exome_chr22_500.vcf.gz", +#' package = "cellbaseR" ) +#' res <- AnnotateVcf(object=cb, file=fl, BPPARAM = bpparam(workers=2)) +#' @seealso \url{https://github.com/opencb/cellbase/wiki} +#' and the RESTful API documentation +#' \url{http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/} +#' @export +setMethod("AnnotateVcf", "CellBaseR", definition = function(object, file, + batch_size, + num_threads, + BPPARAM=bpparam()){ + result <- Annovcf(object=object, file=file, batch_size, num_threads, + BPPARAM=bpparam()) + return(result) +}) diff --git a/clients/R/R/CellBaseParam-methods.R b/clients/R/R/CellBaseParam-methods.R index dff61870ff..f52d4e84c3 100644 --- a/clients/R/R/CellBaseParam-methods.R +++ b/clients/R/R/CellBaseParam-methods.R @@ -1,6 +1,6 @@ -#' A constructor function for CellBaseParam +#' A Constructor for the CellBaseParam Object #' -#'use the CellBaseParam object to control what results are returned from the +#'CellBaseParam object is used to control what results are returned from the #'CellBaseR methods #' @param genome A character denoting the genome build to query,eg, GRCh37 #' (default),or GRCh38 @@ -13,10 +13,12 @@ #' @param include A character vector denoting the fields to be returned #' @param exclude A character vector denoting the fields to be excluded #' @param limit A number limiting the number of results to be returned +#' @return an object of class CellBaseParam #' @examples #' cbParam <- CellBaseParam(genome="GRCh38",gene=c("TP73","TET1")) #' print(cbParam) -#' @seealso for more information about the cellbase webservices see +#' @seealso \url{https://github.com/opencb/cellbase/wiki} +#' and the RESTful API documentation #' \url{http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/} #' @export CellBaseParam <- function(genome=character(), gene=character(), diff --git a/clients/R/R/CellBaseR-methods.R b/clients/R/R/CellBaseR-methods.R index 104b4328ac..45dfc26974 100644 --- a/clients/R/R/CellBaseR-methods.R +++ b/clients/R/R/CellBaseR-methods.R @@ -1,61 +1,69 @@ -### CellbaseR constructor function +#' CellbaseR constructor function #' @aliases CellBaseR -#' @title A constructor function for CellBaseR object +#' @title CellBaseR #' -#' @description This is a constructor function for CellBaseR object +#' @description This is a constructor function for the CellBaseR object #' @details #' This class defines the CellBaseR object. It holds the default #' configuration required by CellBaseR methods to connect to the #' cellbase web services. By defult it is configured to query human -#' data based on the GRCh37 genome assembly. Please, visit -#' https://github.com/opencb/cellbase/wiki and -#' bioinfodev.hpc.cam.ac.uk/cellbase/webservices/ for more details on -#' following parameters. -#' run cbSpeciesClient to see avaiable species and their corresponding data +#' data based on the GRCh37 genome assembly. #' @import methods #' @param host A character the default host url for cellbase webservices, #' e.g. "http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/rest/" #' @param version A character the cellbae API version, e.g. "V4" -#' @param species a character specifying the species to be queried, e.g. "hsapiens" -#' @param batch_size intger if multiple queries are raised by a single method call, e.g. getting annotation info for several genes, -#' queries will be sent to the server in batches. This slot indicates the size of each batch, e.g. 200 -#' @param num_threads integer number of asynchronus batches to be sent to the server +#' @param species a character specifying the species to be queried, e.g. +#' "hsapiens" +#' @param batch_size intger if multiple queries are raised by a single method +#' call, e.g. getting annotation info for several genes, queries will be sent +#' to the server in batches.This slot indicates the size of each batch,e.g. 200 +#' @param num_threads integer number of batches to be sent to the server #' @return An object of class CellBaseR +#' @seealso \url{https://github.com/opencb/cellbase/wiki} +#' and the RESTful API documentation +#' \url{http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/} #' @examples #' cb <- CellBaseR() #' print(cb) #' @export -CellBaseR <- function(host=NULL, version=NULL, species=NULL, - batch_size=NULL, num_threads=NULL ){ - if(!is.null(host)){ - host <- paste0(host, "/") - }else { - host <-"http://bioinfodev.hpc.cam.ac.uk/cellbase-dev-v4.0/webservices/rest/" - } +CellBaseR <- function(host="http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/rest/" + , version='v4', species='hsapiens', + batch_size=200L, num_threads=8L){ + + available_species=c("hsapiens","mmusculus","drerio","rnorvegicus", + "ptroglodytes","ggorilla","pabelii","mmulatta", + "csabaeus","sscrofa","cfamiliaris","ecaballus", + "ocuniculus","ggallus","btaurus","fcatus", + "cintestinalis","oaries","olatipes","ttruncatus", + "lafricana","cjacchus","nleucogenys","aplatyrhynchos", + "falbicollis","celegans","dmelanogaster","dsimulans", + "dyakuba","agambiae","adarlingi","nvectensis", + "spurpuratus","bmori","aaegypti","apisum","scerevisiae" + ,"spombe","afumigatus","aniger","anidulans","aoryzae", + "foxysporum","pgraminis","ptriticina","moryzae", + "umaydis","ssclerotiorum","cneoformans","ztritici", + "pfalciparum","lmajor","ddiscoideum","glamblia", + "pultimum","alaibachii","athaliana","alyrata", + "bdistachyon","osativa","gmax","vvinifera","zmays", + "hvulgare","macuminata","sbicolor","sitalica", + "taestivum","brapa","ptrichocarpa","slycopersicum", + "stuberosum","smoellendorffii","creinhardtii", + "cmerolae") + if(species%in% available_species){ + species<-species + } else{ + stop("please enter a valid species name\n + see ?getMeta examples to see the aviable species") + } - if(!is.null(species)){ - species<-paste0(species,"/") - }else{ - species <-"hsapiens/" - } - - if(!is.null(version)){ - version <- paste0(version,"/") - }else{ - version <- "v4/" - } - - if(!is.null(batch_size)){ - batch_size <- batch_size - }else{ - batch_size <- 200L - } - - if(!is.null(num_threads)){ - num_threads <- num_threads - }else{ - num_threads <- 8L - } + version <- paste0(version,"/") + + # Get the API list + cbDocsUrl <- paste0(host, "swagger.json") + Datp <- fromJSON(cbDocsUrl) + tags <- Datp$tags + paths <- Datp$paths + api <- lapply(paths, function(x)x$get) new("CellBaseR", host=host, version=version,species=species, batch_size=batch_size, num_threads=num_threads ) diff --git a/clients/R/R/cellbase.R b/clients/R/R/cellbase.R index bfbb85abdc..4ce42a7b18 100644 --- a/clients/R/R/cellbase.R +++ b/clients/R/R/cellbase.R @@ -1,5 +1,5 @@ #' Documentation for the cellbaseR package -#' @title CellbaseR +#' @title cellbaseR #' @description Querying annotation data from the high performance Cellbase web #' services #' @author Mohammed OE Abdallah @@ -15,17 +15,16 @@ #' are parsed into R data.frames and other common R data strctures so users can #' readily get into downstream anaysis. #' @import methods -#' @import jsonlite -#' @import RCurl +#' @import jsonlite #' @import pbapply #' @import data.table #' @import BiocParallel #' @importFrom tidyr unnest #' @importFrom R.utils countLines -#' @importFrom Gviz GeneRegionTrack #' @import Rsamtools #' @import foreach #' @import parallel #' @import doParallel -#' @import doMC +#' @import httr +#' @import utils "_PACKAGE" \ No newline at end of file diff --git a/clients/R/R/commons.R b/clients/R/R/commons.R index 0835d0d17b..7f879c5d1d 100644 --- a/clients/R/R/commons.R +++ b/clients/R/R/commons.R @@ -1,22 +1,31 @@ -utils::globalVariables(c("name", "j")) -################################################################################ +utils::globalVariables(c("name", "j", "registerDoMC")) +############################################################################### # we need to adjust the output for the protein and Genomesequence methods # -fetchCellbase <- function(file=NULL,host=host, version=version, meta=meta, - species=species, categ, subcateg,ids, resource,filters=NULL, - batch_size=NULL,num_threads=NULL,...){ +fetchCellbase <- function(object=object, file=NULL, meta=meta, + species=species, categ, subcateg,ids, resource,param=NULL, + batch_size=NULL, num_threads=NULL){ + host <- object@host + species <- object@species + # Get the parametrs - if(species=="hsapiens/"){ + if(species=="hsapiens"){ batch_size <- batch_size + version <- object@version + }else{ batch_size <- 50 + version <- "latest/" } + num_threads <- num_threads + if(is.null(categ)){ categ <- "" }else{ categ <- paste0(categ,"/",sep="") } + if(is.null(subcateg)){ subcateg <- "" }else{ @@ -35,20 +44,22 @@ fetchCellbase <- function(file=NULL,host=host, version=version, meta=meta, cat("\nreading the file....\n") ids <- readIds(file,batch_size = batch_size,num_threads = num_threads) } + + # in case a vcf file has been specified if(!is.null(file)){ container=list() grls <- createURL(file=file, host=host, version=version, species=species, categ=categ, subcateg=subcateg, - ids=ids, resource=resource,...) + ids=ids, resource=resource) cat("\ngetting the data....\n") - content <- callREST(grls = grls,async=TRUE,num_threads) + content <- callREST2(grls = grls,async=FALSE,num_threads) cat("\nparsing the data....\n") res_list <- parseResponse(content=content,parallel=TRUE, num_threads=num_threads) ds <- res_list$result cat("Done!") - + # in case of all other methods except for annotateVcf }else{ i=1 @@ -56,12 +67,13 @@ fetchCellbase <- function(file=NULL,host=host, version=version, meta=meta, skip=0 num_results=1000 container=list() - while(is.null(file)&all(unlist(num_results)==server_limit)){ + while(is.null(file)&all(unlist(num_results)==server_limit)){ grls <- createURL(file=NULL, host=host, version=version, meta=meta, - species=species, categ=categ, subcateg=subcateg, ids=ids, - resource=resource,filters=filters,skip = skip) + species=species, categ=categ, subcateg=subcateg, + ids=ids, resource=resource,param=param, + skip = skip) skip=skip+1000 - content <- callREST(grls = grls) + content <- callREST2(grls = grls) res_list <- parseResponse(content=content) num_results <- res_list$num_results cell <- res_list$result @@ -71,7 +83,7 @@ fetchCellbase <- function(file=NULL,host=host, version=version, meta=meta, if(class(container[[1]])=="data.frame"){ ds <- rbind.pages(container) }else{ - ds <- as.data.frame(container[[1]], stringsAsFactors=FALSE, names="result") + ds <- as.data.frame(container[[1]], stringsAsFactors=FALSE,names="result") } @@ -114,15 +126,19 @@ readIds <- function(file=file,batch_size,num_threads) ## create a list of character vectors of urls createURL <- function(file=NULL, host=host, version=version, meta=meta, species=species, categ=categ, subcateg=subcateg, ids=ids, - resource=resource, filters=filters,skip=0) + resource=resource, param=param,skip=0) { if(is.null(file)){ skip=paste0("?","skip=",skip) - filters <- paste(skip,filters, sep = "&") - grls <- paste0(host,version, meta, species, categ, subcateg, ids, - resource,filters,collapse = "") - + param <- paste(skip,param, sep = "&") + if(nchar(species)>1){ + grls <- paste0(host,version, meta, species,"/", categ, subcateg, ids, + resource,param,collapse = "") + }else{ + grls <- paste0(host,version, meta, species, categ, subcateg, ids, + resource,param,collapse = "") + } }else{ grls <- list() gcl <- paste0(host,version,species,categ,subcateg,collapse = "") @@ -135,45 +151,26 @@ createURL <- function(file=NULL, host=host, version=version, meta=meta, } return(grls) } -## A function to make the API calls -callREST <- function(grls,async=FALSE,num_threads=num_threads) - { - content <- list() - if(is.null(file)){ - content <- getURI(grls) - } else{ - if (requireNamespace("pbapply", quietly = TRUE)){ - content <- pbapply::pbsapply(grls, function(x)getURI(x)) - - } - } +callREST2 <- function(grls,async=FALSE,num_threads=num_threads) +{ + content <- list() + if(is.null(file)){ + resp <- GET(grls, add_headers(`Accept-Encoding` = "gzip, deflate"), + timeout(2)) + content <- content(resp, as="text", encoding = "utf-8") + }else{ + resp <- GET(grls, add_headers(`Accept-Encoding` = "gzip, deflate")) + content <- content(resp, as="text", encoding = "utf-8") + } return(content) } ## A function to parse the json data into R dataframes -parseResponse <- function(content,parallel=FALSE,num_threads=num_threads){ +parseResponse <- function(content, parallel=FALSE, num_threads=num_threads){ if(parallel==TRUE){ - num_cores <-detectCores()/2 - registerDoMC(num_cores) - - # - # ## Extracting the content in parallel - js <- mclapply(content, function(x)fromJSON(x), mc.cores=num_cores) - res <- mclapply(js, function(x)x$response$result, mc.cores=num_cores) - names(res) <- NULL - ind <- sapply(res, function(x)length(x)!=1) - res <- res[ind] - ds <- mclapply(res, function(x)rbind.pages(x), mc.cores=num_cores) - if(requireNamespace("pbapply", quietly = TRUE)){ - ds <- pbapply::pblapply(res, function(x)rbind.pages(x)) - - } - ## Important to get correct merging of dataframe - names(ds) <- NULL - ds <- rbind.pages(ds) - nums <- NULL - }else{ + + } else{ js <- lapply(content, function(x)fromJSON(x)) ares <- lapply(js, function(x)x$response$result) @@ -196,29 +193,57 @@ parseResponse <- function(content,parallel=FALSE,num_threads=num_threads){ return(list(result=ds,num_results=nums)) } -# consider seperating into two functions ### Docs -#' A function to get help about cellbase queries +#' getCellBaseResourceHelp #' -#' This is a convience function to get help on cellbase methods +#' A function to get help about available cellbase resources +#' @details This function retrieves available resources for each generic method +#' like getGene, getRegion, getprotein, etc. It help the user see all possible +#' resources to use with the getGeneric methods #' @param object a cellBase class object -#' @param category a character the category to be queried #' @param subcategory a character the subcategory to be queried -#' @param resource A charcter when specified will get all the parametrs for -#' that specific resource -#' @return documentation about avaiable resources or required parameters +#' @return character vector of the available resources to that particular +#' subcategory #' @examples #' cb <- CellBaseR() -#' cbHelp(cb, category="feature", subcategory="gene") +#' # Get help about what resources are available to the getGene method +#' getCellBaseResourceHelp(cb, subcategory="gene") +#' # Get help about what resources are available to the getRegion method +#' getCellBaseResourceHelp(cb, subcategory="region") +#' # Get help about what resources are available to the getXref method +#' getCellBaseResourceHelp(cb, subcategory="id") #' @export -cbHelp <- function(object, category, subcategory, resource=NULL){ +getCellBaseResourceHelp <- function(object, subcategory){ host <- object@host - cbDocsUrl <- paste0(host, "swagger.json") - Data <- fromJSON(cbDocsUrl) - tags <- Data$tags - paths <- Data$paths - getList <- lapply(paths, function(x)x$get) + if(exists('.api', .GlobalEnv)&exists('.tags', .GlobalEnv)){ + getList <- get('.api',envir = .GlobalEnv) + tags <- get('.tags',envir = .GlobalEnv) + }else { + cbDocsUrl <- paste0(host, "swagger.json") + Datp <- jsonlite::fromJSON(cbDocsUrl) + tags <- Datp$tags + paths <- Datp$paths + getList<- lapply(paths, function(x)x$get) + assign('.api', getList, .GlobalEnv) + assign('.tags', tags, .GlobalEnv) + } + category <- switch (subcategory, + gene= "feature", + protein= "feature", + tf="regulation", + variation="feature", + variant="genomic", + clinical="feature", + transcript="feature", + id="feature") + ## filtered + SUBCATEGORIES <- c('gene', 'protein', 'tf', 'variation', 'variant', + 'clinical', 'transcript', 'id', 'region') + if(!(subcategory %in% SUBCATEGORIES)){ + cat("Please use one of CellBase Subcategories\n") + cat(SUBCATEGORIES,'\n') + stop("Error unknown subcategory")} parts <- Filter(Negate(function(x) is.null(unlist(x))), getList) cbGetParams <- lapply(parts, function(x)x$parameters) catsub <- paste(category,subcategory, sep = "/") @@ -227,16 +252,23 @@ cbHelp <- function(object, category, subcategory, resource=NULL){ patt1 <- paste0(catsub,"/", ".*?/","(.*)" ) resMatch <- regexec(patt1,narrowed) m <- regmatches(narrowed, resMatch) - if(is.null(resource)){ - res <- sapply(m, function(x)x[2]) - res <- res[!is.na(res)] - }else{ - patt2 <- paste(catsub,"/", ".*?/", resource, sep="") - index <- grep(patt2, names(parts)) - res <- parts[[index]] - res <- res$parameters - res <- subset(res,!(name %in% c("version", "species")), select=c("name", "description","required", "type")) - } + res <- sapply(m, function(x)x[2]) + res <- res[!is.na(res)] + res } -# \ No newline at end of file +# +# cbCheck <- function(object, category, subcategory, resource){ +# CATEGORIES <- c("feature", "genomic", "regulation") +# if(!(category %in% CATEGORIES)){ +# stop("Error Unknown category") +# } +# SUBCATEGORIES <- tolower(unlist(tags[[1]])) +# if(!(subcategory %in% SUBCATEGORIES)){ +# stop("Error Unknown subcategory") +# } +# RESOURCES <- getCellBaseResourceHelp(object, subcategory) +# if(!(resource %in% RESOURCES)){ +# stop("Error Unknown resource") +# } +# } \ No newline at end of file diff --git a/clients/R/R/getCellbase-methods.R b/clients/R/R/getCellbase-methods.R new file mode 100644 index 0000000000..d84b3cbcca --- /dev/null +++ b/clients/R/R/getCellbase-methods.R @@ -0,0 +1,45 @@ +############################################################################### +#' getCellBase +#' +#' The generic method for querying CellBase web services. +#' @details This method allows the user to query the +#' cellbase web services without any predefined categories, subcategries, +#' or resources. +#' @aliases getCellBase +#' @param object an object of class CellBaseR +#' @param category character to specify the category to be queried. +#' @param subcategory character to specify the subcategory to be queried +#' @param ids a character vector of the ids to be queried +#' @param resource a character to specify the resource to be queried +#' @param param an object of class CellBaseParam specifying additional param +#' for the CellBaseR +#' @return a dataframe holding the results of the query +#' @examples +#' cb <- CellBaseR() +#' res <- getCellBase(object=cb, category="feature", subcategory="gene", +#' ids="TET1", resource="info") +#' @seealso \url{https://github.com/opencb/cellbase/wiki} +#' and the RESTful API documentation +#' \url{http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/} +#' @export +setMethod("getCellBase", "CellBaseR", definition = function(object, category, + subcategory, ids, resource + ,param=NULL) { + categ <- category + subcateg<- subcategory + ids <- ids + resource <- resource + if (!is.null(param)) { + param <- c(genome=param@genome, gene=param@gene,region=param@region + , rs=param@rs,so=param@so, phenotype=param@phenotype, + limit=param@limit, include=param@include, + exclude=param@exclude, limit=param@limit) + param <- paste(param, collapse = "&") + } + # TODO: param are not enabled + result <- fetchCellbase(object=object, file=NULL, meta = NULL, categ=categ, + subcateg=subcateg, ids=ids, resource=resource , + param=param) + + return(result) +}) diff --git a/clients/R/R/getChromosomeInfo-methods.R b/clients/R/R/getChromosomeInfo-methods.R new file mode 100644 index 0000000000..5fbae8f2fa --- /dev/null +++ b/clients/R/R/getChromosomeInfo-methods.R @@ -0,0 +1,34 @@ +############################################################################### +#' getChromosomeInfo +#' +#' A method to query sequence data from Cellbase web services. +#' @details A method to query sequence data from Cellbase web services. This +#' method retrieves information about chromosomes, including its size and +#' detailed information about its different cytobands +#' @aliases getChromosomeInfo +#' @param object an object of class CellBaseR +#' @param ids a character vector of chromosome ids to be queried +#' @param resource a character vector to specify the resource to be queried +#' @param param a object of class CellBaseParam specifying additional param for +#' the query +#' @return a dataframe with the results of the query +#' @seealso \url{https://github.com/opencb/cellbase/wiki} +#' and the RESTful API documentation +#' \url{http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/} +#' @examples +#' cb <- CellBaseR() +#' res <- getChromosomeInfo(object=cb, ids="22", resource="info") +#' @export +setMethod("getChromosomeInfo", "CellBaseR", + definition = function(object , ids, resource, param=NULL) { + + categ <- "genomic" + subcateg<- "chromosome" + ids <- ids + resource <- "info" + result <- fetchCellbase(object=object, file=NULL, meta = NULL, + categ=categ, subcateg=subcateg, ids=ids, resource=resource + , param=NULL) + data <- result[[1]][[1]] + return(data) +}) diff --git a/clients/R/R/getClinical-methods.R b/clients/R/R/getClinical-methods.R new file mode 100644 index 0000000000..fcd14aebb3 --- /dev/null +++ b/clients/R/R/getClinical-methods.R @@ -0,0 +1,41 @@ +############################################################################### +#' getClinical +#' +#' A method to query Clinical data from Cellbase web services. +#' @details This method retrieves clinicaly relevant variants annotations from +#' multiple resources including clinvar, cosmic and gwas catalog. Furthermore, +#' the user can filter these data in many ways including phenotype, genes, rs, +#' etc,. +#' @aliases getClinical +#' @param object an object of class CellBaseR +#' @param param a object of class CellBaseParam specifying the parameters +#' limiting the CellBaseR +#' @return a dataframe with the results of the query +#' @examples +#' cb <- CellBaseR() +#' cbParam <- CellBaseParam(gene=c("TP73","TET1")) +#' res <- getClinical(object=cb,param=cbParam) +#' @seealso \url{https://github.com/opencb/cellbase/wiki} +#' and the RESTful API documentation +#' \url{http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/} +#' @export +############################################################################## +setMethod("getClinical", "CellBaseR", definition = function(object, + param=NULL) { + + categ <- "feature" + subcateg<- "clinical" + ids <- NULL + resource <- "search" + + param <- c(genome=param@genome, gene=param@gene, + region=param@region,rs=param@rs,so=param@so, + phenotype=param@phenotype, include=param@include, + exclude=param@exclude, limit=param@limit) + param <- paste(param, collapse = "&") + result <- fetchCellbase(object=object,file=NULL, meta=NULL, categ=categ, + subcateg=subcateg,ids=ids,resource=resource, + param=param) + + return(result) +}) diff --git a/clients/R/R/getGene-methods.R b/clients/R/R/getGene-methods.R new file mode 100644 index 0000000000..d4818298d2 --- /dev/null +++ b/clients/R/R/getGene-methods.R @@ -0,0 +1,44 @@ +################################################################################ +#' getGene +#' +#' A method to query gene data from Cellbase web services. +#' @details This method retrieves various gene annotations including transcripts +#' and exons data as well as gene expression and clinical data +#' @aliases getGene +#' @param object an object of class CellBaseR +#' @param ids a character vector of gene ids to be queried +#' @param resource a character vector to specify the resource to be queried +#' @param param an object of class CellBaseParam specifying additional param +#' for the CellBaseR +#' @return a dataframe with the results of the query +#' @examples +#' cb <- CellBaseR() +#' res <- getGene(object=cb, ids=c("TP73","TET1"), resource="info") +#' @seealso \url{https://github.com/opencb/cellbase/wiki} +#' and the RESTful API documentation +#' \url{http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/} +#' @export +setMethod("getGene", "CellBaseR", definition = function(object, ids, + resource, + param=NULL) + { + + categ <- "feature" + subcateg<- "gene" + ids <- ids + resource <- resource + if (!is.null(param)) { + param <- c(genome=param@genome, gene=param@gene, + region=param@region, rs=param@rs,so=param@so, + phenotype=param@phenotype, limit=param@limit, + include=param@include, exclude=param@exclude, + limit=param@limit) + param <- paste(param, collapse = "&") + } + # TODO: param are not enabled + result <- fetchCellbase(object=object,file=NULL, meta=NULL, + categ=categ, subcateg=subcateg, + ids=ids, resource=resource, + param=param) + return(result) +}) diff --git a/clients/R/R/getMeta-methods.R b/clients/R/R/getMeta-methods.R new file mode 100644 index 0000000000..eaa9f4d259 --- /dev/null +++ b/clients/R/R/getMeta-methods.R @@ -0,0 +1,35 @@ +############################################################################### +#' getMeta +#' +#' A method for getting the available metadata from the cellbase web services +#' +#' @details This method is for getting information about the avaialable species +#' and available annotation, assembly for each species from the cellbase web +#' services. +#' @aliases getMeta +#' @param object an object of class CellBaseR +#' @param resource the resource you want to query it metadata +#' @return a dataframe with the +#' results of the query +#' @examples +#' cb <- CellBaseR() +#' res <- getMeta(object=cb, resource="species") +#' @seealso \url{https://github.com/opencb/cellbase/wiki} +#' and the RESTful API documentation +#' \url{http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/} +#' @export +setMethod("getMeta", "CellBaseR", definition = function(object, resource){ + # host <- object@host + object@species <- "" + meta <- "meta/" + categ <- NULL + subcateg<- NULL + ids <- NULL + resource <- resource + result <- fetchCellbase(object=object, file=NULL, meta=meta, categ=categ, + subcateg=subcateg, + ids=ids, resource=resource, param=NULL) + data <- lapply(result, function(x)as.data.frame(x)) + result <- rbind.pages(data) + return(result) +}) diff --git a/clients/R/R/getProtein-methods.R b/clients/R/R/getProtein-methods.R new file mode 100644 index 0000000000..e9c26cc861 --- /dev/null +++ b/clients/R/R/getProtein-methods.R @@ -0,0 +1,42 @@ +############################################################################## +#' getProtein +#' +#' A method to query protein data from Cellbase web services. +#' @details This method retrieves various protein annotations including +#' protein description, features, sequence, substitution scores, evidence, etc. +#' @aliases getProtein +#' @param object an object of class CellBaseR +#' @param ids a character vector of uniprot ids to be queried, should be one +#' or more of uniprot ids, for example O15350. +#' @param resource a character vector to specify the resource to be queried +#' @param param a object of class CellBaseParam specifying additional param +#' for the query +#' @return an object of class CellBaseResponse which holds a dataframe with th +#' e results of the query +#' @examples +#' cb <- CellBaseR() +#' res <- getProtein(object=cb, ids="O15350", resource="info") +#' @export +setMethod("getProtein", "CellBaseR", definition = function(object, ids, + resource, + param= + NULL) { + + categ <- "feature" + subcateg<- "protein" + ids <- ids + resource <- resource + if (!is.null(param)) { + param <- c(genome=param@genome, gene=param@gene, + region=param@region, rs=param@rs,so=param@so, + phenotype=param@phenotype, limit=param@limit, + include=param@include, exclude=param@exclude, + limit=param@limit) + param <- paste(param, collapse = "&") + } + result <- fetchCellbase(object=object, file=NULL, meta=NULL, categ=categ, + subcateg=subcateg, ids=ids, resource=resource, + param=param) + + return(result) +}) diff --git a/clients/R/R/getRegion-methods.R b/clients/R/R/getRegion-methods.R new file mode 100644 index 0000000000..faedc391e4 --- /dev/null +++ b/clients/R/R/getRegion-methods.R @@ -0,0 +1,43 @@ +############################################################################### +#' getRegion +#' +#' A method to query features within a genomic region from Cellbase web +#' services. +#' @details This method retrieves various genomic features from a given +#' region including genes, snps, clincally relevant variants, proteins, etc. +#' @aliases getRegion +#' @param object an object of class CellBaseR +#' @param ids a character vector of the regions to be queried, for example, +#' "1:1000000-1200000' should always be in the +#' form 'chr:start-end' +#' @param resource a character vector to specify the resource to be queried +#' @param param a object of class CellBaseParam specifying additional param +#' for the query +#' @return a dataframe with the results of the query +#' @examples +#' cb <- CellBaseR() +#' res <- getRegion(object=cb, ids="17:1000000-1200000", resource="gene") +#' @seealso \url{https://github.com/opencb/cellbase/wiki} +#' and the RESTful API documentation +#' \url{http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/} +#' @export +setMethod("getRegion", "CellBaseR", definition = function(object, ids, resource, + param=NULL) { + + categ <- "genomic" + subcateg<- "region" + ids <- ids + resource <- resource + if (!is.null(param)){ + param <- c(genome=param@genome, gene=param@gene, + region=param@region, rs=param@rs,so=param@so, + phenotype=param@phenotype, limit=param@limit, + include=param@include, exclude=param@exclude, + limit=param@limit) + param <- paste(param, collapse = "&") + } + result <- fetchCellbase(object=object, file=NULL, meta=NULL, categ=categ, + subcateg=subcateg, ids=ids, resource=resource, + param=param) + return(result) +}) diff --git a/clients/R/R/getSnp-methods.R b/clients/R/R/getSnp-methods.R new file mode 100644 index 0000000000..4a3fdbad45 --- /dev/null +++ b/clients/R/R/getSnp-methods.R @@ -0,0 +1,42 @@ +############################################################################### +#' getSnp +#' +#' A method to query genomic variation data from Cellbase web services. +#' @details . +#' @details This method retrieves known genomic variants (snps) and their +#' annotations including population frequncies from 1k genomes and Exac projects +#' as well as clinical data and various other annotations +#' @aliases getSnp +#' @param object an object of class CellBaseR +#' @param ids a character vector of the ids to be queried, must be a valid rsid, +#' for example 'rs6025' +#' @param resource a character vector to specify the resource to be queried +#' @param param a object of class CellBaseParam specifying additional param +#' for the query +#' @return a dataframe with the results of the query +#' @examples +#' cb <- CellBaseR() +#' res <- getSnp(object=cb, ids="rs6025", resource="info") +#' @seealso \url{https://github.com/opencb/cellbase/wiki} +#' and the RESTful API documentation +#' \url{http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/} +#' @export +setMethod("getSnp", "CellBaseR", definition = function(object, ids, resource, + param=NULL) { + categ <- "feature" + subcateg<- "variation" + ids <- ids + resource <- resource + if (!is.null(param)) { + param <- c(genome=param@genome, gene=param@gene, + region=param@region, rs=param@rs,so=param@so, + phenotype=param@phenotype, limit=param@limit, + include=param@include, exclude=param@exclude, + limit=param@limit) + param <- paste(param, collapse = "&") + } + result <- fetchCellbase(object=object, file=NULL, meta=NULL, categ=categ, + subcateg=subcateg, ids=ids, resource=resource, + param=param) + return(result) +}) diff --git a/clients/R/R/getTf-methods.R b/clients/R/R/getTf-methods.R new file mode 100644 index 0000000000..e737507acd --- /dev/null +++ b/clients/R/R/getTf-methods.R @@ -0,0 +1,44 @@ +############################################################################### +#' getTf +#' +#' A method to query transcription factors binding sites data from Cellbase web +#' services. +#' @details This method retrieves various transcription factors binding sites +#' data +#' @aliases getTf +#' @param object an object of class CellBaseR +#' @param ids a character vector of the ids to be queried, must be a valid +#' transcription factor name, for example, +#' eg, CTCF +#' @param resource a character vector to specify the resource to be queried +#' @param param a object of class CellBaseParam specifying additional param +#' for the query +#' @return a dataframe with the results of the query +#' @examples +#' cb <- CellBaseR() +#' param <- CellBaseParam(limit = 12) +#' res <- getTf(object=cb, ids="CTCF", resource="tfbs", param=param) +#' @seealso \url{https://github.com/opencb/cellbase/wiki} +#' and the RESTful API documentation +#' \url{http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/} +#' @export +setMethod("getTf", "CellBaseR", definition = function(object, ids, + resource, + param=NULL) { + categ <- "regulation" + subcateg<- "tf" + ids <- ids + resource <- resource + if (!is.null(param)) { + param <- c(genome=param@genome, gene=param@gene, + region=param@region, rs=param@rs,so=param@so, + phenotype=param@phenotype, limit=param@limit, + include=param@include, exclude=param@exclude, + limit=param@limit) + param <- paste(param, collapse = "&") + } + result <- fetchCellbase(object=object, file=NULL, meta=NULL, categ=categ, + subcateg=subcateg, + ids=ids, resource=resource, param=param) + return(result) +}) diff --git a/clients/R/R/getTranscript-methods.R b/clients/R/R/getTranscript-methods.R new file mode 100644 index 0000000000..61633676f1 --- /dev/null +++ b/clients/R/R/getTranscript-methods.R @@ -0,0 +1,34 @@ +############################################################################### +#' getTranscript +#' +#' A method to query transcript data from Cellbase web services. +#' @details This method retrieves various genomic annotations for transcripts +#' including exons, cDNA sequence, annotations flags, and cross references,etc. +#' @aliases getTranscript +#' @param object an object of class CellBaseR +#' @param ids a character vector of the transcript ids to be queried, use +#' ensemble transccript IDs eq, ENST00000380152 +#' @param resource a character vector to specify the resource to be queried +#' @param param an object of class CellBaseParam specifying additional params +#' for the query +#' @return a dataframe with the results of the query +#' @examples +#' cb <- CellBaseR() +#' res <- getTranscript(object=cb, ids="ENST00000373644", resource="info") +#' @seealso \url{https://github.com/opencb/cellbase/wiki} +#' and the RESTful API documentation +#' \url{http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/} +#' @export +setMethod("getTranscript", "CellBaseR", definition = function(object, ids, + resource, + param=NULL) { + + categ <- "feature" + subcateg<- "transcript" + ids <- ids + resource <- resource + result <- fetchCellbase(object=object, file=NULL, meta=NULL, categ=categ, + subcateg=subcateg, + ids=ids, resource=resource, param=NULL) + return(result) +}) diff --git a/clients/R/R/getVariant-methods.R b/clients/R/R/getVariant-methods.R new file mode 100644 index 0000000000..64ae0c750c --- /dev/null +++ b/clients/R/R/getVariant-methods.R @@ -0,0 +1,49 @@ +############################################################################### +#' getVariant +#' +#' A method to query variant annotation data from Cellbase web services from +#' Cellbase web services. +#' @details This method retrieves extensive genomic annotations for variants +#' including consequence types, conservation data, population frequncies from 1k +#' genomes and Exac projects, etc. +#' as well as clinical data and various other annotations +#' @aliases getVariant +#' @param object an object of class CellBaseR +#' @param ids a character vector of the ids to be queried, must be in the +#' following format 'chr:start:ref:alt', for +#' example, '1:128546:A:T' +#' @param resource a character vector to specify the resource to be queried +#' @param param a object of class CellBaseParam specifying additional param +#' for the query +#' @return a dataframe with the results of the query +#' @examples +#' cb <- CellBaseR() +#' res <- getVariant(object=cb, ids="19:45411941:T:C", resource="annotation") +#' @seealso \url{https://github.com/opencb/cellbase/wiki} +#' and the RESTful API documentation +#' \url{http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/} +#' @export +setMethod("getVariant", "CellBaseR", definition = function(object, ids, + resource, + param=NULL) { + categ <- "genomic" + subcateg<- "variant" + ids <- ids + resource <- resource + if(object@species!='hsapiens'&resource=='cadd'){ + stop('cadd scores are only avaialable for hsapiens') + } + if (!is.null(param)) { + param <- c(genome=param@genome, gene=param@gene, + region=param@region, rs=param@rs,so=param@so, + phenotype=param@phenotype, limit=param@limit, + include=param@include, exclude=param@exclude, + limit=param@limit) + param <- paste(param, collapse = "&") + } + result <- fetchCellbase(object=object, file=NULL, meta=NULL, + categ=categ, subcateg=subcateg, + ids=ids, resource=resource, param=param) + + return(result) +}) diff --git a/clients/R/R/getXref-methods.R b/clients/R/R/getXref-methods.R new file mode 100644 index 0000000000..3ba92c0491 --- /dev/null +++ b/clients/R/R/getXref-methods.R @@ -0,0 +1,43 @@ +############################################################################### +#' getXref +#' +#' A method to query cross reference data from Cellbase web services. +#' @details This method retrieves cross references for genomic identifiers, eg +#' ENSEMBL ids, it also provide starts_with service that is useful for +#' autocomplete services. +#' @aliases getXref +#' @param object an object of class CellBaseR +#' @param ids a character vector of the ids to be queried, any crossrefereable +#' ID, gene names, transcript ids, +#' uniprot ids,etc. +#' @param resource a character vector to specify the resource to be queried +#' @param param a object of class CellBaseParam specifying additional param +#' for the query +#' @return a dataframe with the results of the query +#' @examples +#' cb <- CellBaseR() +#' res <- getXref(object=cb, ids="ENST00000373644", resource="xref") +#' @seealso \url{https://github.com/opencb/cellbase/wiki} +#' and the RESTful API documentation +#' \url{http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/} +#' @export +setMethod("getXref", "CellBaseR", definition = function(object, ids, resource, + param=NULL) { + + categ <- "feature" + subcateg<- "id" + ids <- toupper(ids) + resource <- resource + if (!is.null(param)) { + param <- c(genome=param@genome, gene=param@gene, + region=param@region, rs=param@rs,so=param@so, + phenotype=param@phenotype, limit=param@limit, + include=param@include, exclude=param@exclude, + limit=param@limit) + param <- paste(param, collapse = "&") + } + result <- fetchCellbase(object=object, file=NULL, meta=NULL, categ=categ, + subcateg=subcateg, + ids=ids, resource=resource, param=param) + return(result) +}) diff --git a/clients/R/R/show-methods.R b/clients/R/R/show-methods.R index 5c793fff65..087e38e5ef 100644 --- a/clients/R/R/show-methods.R +++ b/clients/R/R/show-methods.R @@ -1,30 +1,21 @@ -######################################################################################################################## -#' The show method for CellBaseR class -#' -#' @param object an object of class CellBaseR +############################################################################### +# The show method for CellBaseR class + +# setMethod("show",signature = "CellBaseR",definition = function(object){ cat("An object of class ", class(object), "\n", sep = "") - cat("| it holds the configuration for querying the Cellbase databases\n") - cat("| to change the default species from human use CellBaseR(species='')") + cat("| it holds the configuration for querying the CellBase databases\n") + cat("| the current species is ",object@species, "\n") }) -######################################################################################################################## -#' The show method for CellBaseParam class -#' -#' @param object an object of class CellBaseParam +############################################################################### +# The show method for CellBaseParam class +# + setMethod("show",signature = "CellBaseParam",definition = function(object){ - cat("An object of class ", class(object), "\n", sep = "") - cat("use this object to control what results are returned from the - CellBaseR methods") + cat("|An object of class ", class(object), "\n", sep = "") + cat("|use this object to control what results are returned from the CellBaseR + methods\n") }) -#' The show method for CellBaseResponse class -#' -#' @param object an object of class CellBaseResponse -setMethod("show",signature = "CellBaseResponse", definition = function(object){ - cat("An object of class ", class(object), "\n", sep = "") - cat(" containing ", nrow(object@cbData), " rows and ", - ncol(object@cbData), " columns.\n", sep = "") - cat(" to get the annotated dataframe use cbData()") -}) diff --git a/clients/R/R/tools.R b/clients/R/R/tools.R index 26110bc8c8..d886dc7ddd 100644 --- a/clients/R/R/tools.R +++ b/clients/R/R/tools.R @@ -1,36 +1,28 @@ utils::globalVariables(c("k", "transcripts", "exons")) -#' A convience fubction to directly annotate variants from a vcf file -#' -#' This is a function to annotate variants from a vcf file -#' @param object an object of class CellBaseR -#' @param file Path to a bgzipped and tabix indexed vcf file -#' @param batch_size intger if multiple queries are raised by a single method -#' call, e.g. getting annotation info for several genes, -#' queries will be sent to the server in batches. This slot indicates the size -#' of each batch, e.g. 200 -#' @param num_threads integer number of asynchronus batches to be sent to the -#' server -#' @param ... any extra arguments -#' @return a dataframe -Annovcf <- function(object, file, batch_size, num_threads){ - num_cores <-parallel::detectCores()-2 +# Annovcf +Annovcf <- function(object, file, batch_size, num_threads, BPPARAM=bpparam()){ + num_cores <-2 + register(BPPARAM, default=TRUE) registerDoParallel(num_cores) - p <- DoparParam() + p <- bpparam() host <- object@host species <- object@species version <- object@version batch_size <- object@batch_size num_threads <- object@num_threads ids <- readIds(file, batch_size, num_threads) + #filter out multiallelic sites + ids2 <- sapply(ids, function(x)sapply(x, function(y)filterMulti(y))) + names(ids2) <- NULL grls <- list() categ <- 'genomic/' subcateg <- "variant/" resource <- "/annotation" # get the IDs - gcl <- paste0(host,version,species,categ,subcateg,collapse = "") - for(i in seq_along(ids)){ - hop <- paste(ids[[i]],collapse = ",") + gcl <- paste0(host,version,species,"/",categ,subcateg,collapse = "") + for(i in seq_along(ids2)){ + hop <- paste(ids2[[i]],collapse = ",") tmp <- paste0(gcl,hop,resource,collapse = ",") grls[[i]] <- gsub("chr","",tmp) } @@ -38,48 +30,56 @@ Annovcf <- function(object, file, batch_size, num_threads){ grp <- foreach(i=1:length(prp))%do%{ paste(prp[[i]]) } - + # get the data and parse in chuncks num <- length(prp) i <- 1 container <- list() while(i<=num){ - content <- getURIAsynchronous(grp[[i]],perform = Inf)# alist of responses + resp <- pblapply(grp[[i]], function(x)GET(x, add_headers(`Accept-Encoding` + = "gzip, deflate"))) + content <- pblapply(resp, function(x) content(x, as="text", + encoding = "utf-8")) js <- bplapply(content, function(x)fromJSON(x),BPPARAM = p) res <- bplapply(js, function(x)x$response$result, BPPARAM = p) names(res) <- NULL ind <- sapply(res, function(x)length(x)!=1) res <- res[ind] ds <- bplapply(res, function(x)rbind.pages(x), BPPARAM = p) - container[[i]] <- ds + container[[i]] <- ds i=i+1 } - - - final <- foreach(k=1:length(container),.options.multicore=list(preschedule=TRUE), - .combine=function(...)rbind.pages(list(...)), - .packages='jsonlite',.multicombine=TRUE) %dopar% { - rbind.pages(container[[k]]) + + + final <-foreach(k=1:length(container), + .options.multicore=list(preschedule=TRUE), + .combine=function(...)rbind.pages(list(...)), + .packages='jsonlite',.multicombine=TRUE) %dopar% { + rbind.pages(container[[k]]) } - + return(final) - + } -# create GeneModel -#' A convience functon to construct a genemodel +#' createGeneModel #' -#' @details This function takes cbResponse object and returns a geneRegionTrack -#' model to be plotted by Gviz +#' A convience functon to construct a genemodel +#' @details This function create a gene model data frame, which can be then +#' turned into a GeneRegionTrack for visualiaztion +#' by \code{\link[Gviz]{GeneRegionTrack}} #' @param object an object of class CellbaseResponse #' @param region a character #' @return A geneModel #' @import data.table -# @examples -# cb <- CellBaseR() -# test <- createGeneModel(object = cb, region = "17:1500000-1550000") +#' @examples +#' cb <- CellBaseR() +#' test <- createGeneModel(object = cb, region = "17:1500000-1550000") +#' @seealso \url{https://github.com/opencb/cellbase/wiki} +#' and the RESTful API documentation +#' \url{http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/} #' @export createGeneModel <- function(object, region=NULL){ if(!is.null(region)){ @@ -90,8 +90,9 @@ createGeneModel <- function(object, region=NULL){ subcateg<- "region" ids <- region resource <- "gene" - data <- fetchCellbase(file=NULL,host=host, version=version, meta=NULL, species=species, categ=categ, subcateg=subcateg, - ids=ids, resource=resource, filters=NULL) + data <- fetchCellbase(object=object, file=NULL, meta=NULL, categ=categ, + subcateg=subcateg, + ids=ids, resource=resource, param=NULL) rt4 <- data[,c(1,2,11)] rt4 <- as.data.table(rt4) #rt4 <- as.data.table(rt4) @@ -104,12 +105,14 @@ createGeneModel <- function(object, region=NULL){ hope <- as.data.frame(hope) hope <- hope[!duplicated(hope),1:9] - chr <- paste0("chr",hope$chromosome[1]) - from <- min(hope$start)-5000 - to <- max(hope$end)+5000 - hope <- Gviz::GeneRegionTrack(hope,from = from, to = to, - transcriptAnnotation='symbol') } hope } + +# Filter multiallelic sites +filterMulti <- function(x){ + res <- strsplit(x, split = ",")[[1]][1] + res +} + diff --git a/clients/R/R/user.R b/clients/R/R/user.R new file mode 100644 index 0000000000..311d52f97b --- /dev/null +++ b/clients/R/R/user.R @@ -0,0 +1,198 @@ +#' getClinicalByGene +#' +#' A convienice method to fetch clinical variants for specific gene/s +#' @param object an object of CellBaseR class +#' @param id a charcter vector of HUGO symbol (gene names) +#' @param param an object of class CellBaseParam +#' @return a dataframe of the query result +#' @examples +#' cb <- CellBaseR() +#' res <- getClinicalByGene(cb, "TET1") +#' @export +getClinicalByGene <- function(object, id, param=NULL){ + + res <- getGene(object = object, ids = id, resource = "clinical", + param = param) + res +} +############################################################################## +#' getTranscriptByGene +#' +#' A convienice method to fetch transcripts for specific gene/s +#' @param object an object of class CellBaseR +#' @param id a charcter vector of HUGO symbol (gene names) +#' @param param an object of class CellBaseParam +#' @return a dataframe of the query result +#' @examples +#' cb <- CellBaseR() +#' res <- getTranscriptByGene(cb, "TET1") +#' @export +getTranscriptByGene <- function(object, id, param=NULL){ + + res <- getGene(object = object, ids = id, resource = "transcript", + param = param) + res +} +############################################################################## +#' getGeneInfo +#' +#' A convienice method to fetch gene annotations specific gene/s +#' @param object an object of class CellBaseR +#' @param id a charcter vector of HUGO symbol (gene names) +#' @param param an object of class CellBaseParam +#' @return a dataframe of the query result +#' @examples +#' cb <- CellBaseR() +#' res <- getGeneInfo(cb, "TET1") +#' @export +getGeneInfo <- function(object, id, param=NULL){ + + res <- getGene(object = object, ids = id, resource = "info", + param = param) + res +} +############################################################################## +#' getSnpByGene +#' +#' A convienice method to fetch known variants (snps) for specific gene/s +#' @param object an object of class CellBaseR +#' @param id a charcter vector of HUGO symbol (gene names) +#' @param param an object of class CellBaseParam +#' @return a dataframe of the query result +#' @examples +#' cb <- CellBaseR() +#' param <- CellBaseParam(limit = 10) +#' res <- getSnpByGene(cb, "TET1", param = param) +#' @export +getSnpByGene <- function(object, id, param=NULL){ + + res <- getGene(object = object, ids = id, resource = "snp", param = param) + res +} +############################################################################## +#' getProteinInfo +#' +#' A convienice method to fetch annotations for specific protein/s +#' @param object an object of class CellBaseR +#' @param id a charcter vector of Uniprot Ids +#' @param param an object of class CellBaseParam +#' @return a dataframe of the query result +#' @examples +#' cb <- CellBaseR() +#' res <- getProteinInfo(cb, "O15350") +#' @export +getProteinInfo <- function(object, id, param=NULL){ + + res <- getProtein(object = object, ids = id, resource = "info", + param = param) + res +} +############################################################################## +#' getClinicalByRegion +#' +#' A convienice method to fetch clinical variants for specific region/s +#' @param object an object of class CellBaseR +#' @param id a charcter vector of genomic regions, eg 17:1000000-1100000 +#' @param param an object of class CellBaseParam +#' @return a dataframe of the query result +#' @examples +#' cb <- CellBaseR() +#' res <- getClinicalByRegion(cb, "17:1000000-1189811") +#' @export +getClinicalByRegion <- function(object, id, param=NULL){ + + res <- getRegion(object = object, ids = id, resource = "clinical", + param = param) + res +} +############################################################################## +#' getConservationByRegion +#' +#' A convienice method to fetch conservation data for specific region/s +#' @param id a charcter vector of genomic regions, eg 17:1000000-1100000 +#' @param object an object of class CellBaseR +#' @param param an object of class CellBaseParam +#' @return a dataframe of the query result +#' @examples +#' cb <- CellBaseR() +#' res <- getConservationByRegion(cb, "17:1000000-1189811") +#' @export +getConservationByRegion <- function(object, id, param=NULL){ + + res <- getRegion(object = object, ids = id, resource = "conservation", + param = param) + res +} +############################################################################## +#' getRegulatoryByRegion +#' +#' A convienice method to fetch regulatory data for specific region/s +#' @param object an object of class CellBaseR +#' @param id a charcter vector of genomic regions, eg 17:1000000-1100000 +#' @param param an object of class CellBaseParam +#' @return a dataframe of the query result +#' @examples +#' cb <- CellBaseR() +#' res <- getRegulatoryByRegion(cb, "17:1000000-1189811") +#' @export +getRegulatoryByRegion <- function(object, id, param=NULL){ + + res <- getRegion(object = object, ids = id, resource = "regulatory", + param = param) + res +} +############################################################################## +#' getTfbsByRegion +#' +#' A convienice method to fetch Transcription facrots data for specific region/s +#' @param id a charcter vector of genomic regions, eg 17:1000000-1100000 +#' @param object an object of class CellBaseR +#' @param param an object of class CellBaseParam +#' @return a dataframe of the query result +#' @examples +#' cb <- CellBaseR() +#' res <- getTfbsByRegion(cb, "17:1000000-1189811") +#' @export +getTfbsByRegion <- function(object, id, param=NULL){ + + res <- getRegion(object = object, ids = id, resource = "tfbs", + param = param) + res +} +############################################################################## +#' getCaddScores +#' +#' A convienice method to fetch Cadd scores for specific variant/s +#' @param object an object of class CellBaseR +#' @param id a charcter vector of genomic variants, eg 19:45411941:T:C +#' @param param an object of class CellBaseParam +#' @return a dataframe of the query result +#' @examples +#' cb <- CellBaseR() +#' res <- getCaddScores(cb, "19:45411941:T:C") +#' @export +getCaddScores <- function(object, id, param=NULL){ + + res <- getVariant(object = object, ids = id, resource = "cadd", + param = param) + res +} +############################################################################## +#' getVariantAnnotation +#' +#' A convienice method to fetch variant annotation for specific variant/s +#' @param object an object of class CellBaseR +#' @param id a charcter vector of length < 200 of genomic variants, +#' eg 19:45411941:T:C +#' @param param an object of class CellBaseParam +#' @return a dataframe of the query result +#' @examples +#' cb <- CellBaseR() +#' res <- getVariantAnnotation(cb, "19:45411941:T:C") +#' @export +getVariantAnnotation <- function(object, id, param=NULL){ + + res <- getVariant(object = object, ids = id, resource = "annotation", + param = param) + res +} \ No newline at end of file diff --git a/clients/R/README.md b/clients/R/README.md index 83a01739de..857f5bc1bd 100644 --- a/clients/R/README.md +++ b/clients/R/README.md @@ -1,4 +1,7 @@ + [![Build Status](https://travis-ci.org/melsiddieg/cellbaseR.svg?branch=master)](https://travis-ci.org/melsiddieg/cellbaseR) + + ### Overview This R package makes use of the exhaustive RESTful Web service API that has been implemented for the Cellabase database. It enable researchers to query and obtain a wealth of biological information from a single database saving a lot of time. Another benefit is that researchers can easily make queries about different biological topics and link all this information together as all information is integrated. diff --git a/clients/R/dbsnp_gene258.txt b/clients/R/dbsnp_gene258.txt new file mode 100644 index 0000000000..382a0a0644 --- /dev/null +++ b/clients/R/dbsnp_gene258.txt @@ -0,0 +1,2322 @@ +rs3924573 +rs3924574 +rs4694075 +rs4694076 +rs5859239 +rs6422713 +rs6605353 +rs6831606 +rs7439186 +rs7439191 +rs7439194 +rs7658448 +rs7674598 +rs7679703 +rs7680880 +rs7694409 +rs10540269 +rs13115627 +rs28377667 +rs28435442 +rs28451259 +rs28459922 +rs28509200 +rs28538959 +rs28548913 +rs28571094 +rs28585617 +rs28589913 +rs28590566 +rs28710288 +rs28723380 +rs28723656 +rs28735772 +rs28744573 +rs33910648 +rs33975031 +rs34032826 +rs34230455 +rs34367704 +rs34480281 +rs34538475 +rs35266919 +rs35287680 +rs35454701 +rs35496203 +rs35575397 +rs35736187 +rs35850072 +rs35859385 +rs35870385 +rs35913040 +rs35936034 +rs36108778 +rs55938049 +rs56877949 +rs57032476 +rs57519313 +rs58537027 +rs59142068 +rs61047303 +rs61455089 +rs61544557 +rs62323386 +rs62323387 +rs62323388 +rs62323389 +rs62323390 +rs62323404 +rs62323405 +rs67400307 +rs67785664 +rs71210192 +rs71210194 +rs71599963 +rs71599964 +rs71604568 +rs71671481 +rs71865638 +rs72652261 +rs72652262 +rs72652263 +rs72654383 +rs72654384 +rs72654385 +rs72654387 +rs72859609 +rs74328499 +rs74863297 +rs74926542 +rs74949118 +rs75018716 +rs75194467 +rs75457045 +rs75728781 +rs75825750 +rs76096306 +rs76503327 +rs76889324 +rs77018163 +rs77185575 +rs77381490 +rs77530417 +rs77969954 +rs78115903 +rs78323483 +rs78367307 +rs79024248 +rs79108066 +rs79122304 +rs79131152 +rs79200974 +rs79736910 +rs79834971 +rs79881380 +rs79970290 +rs111295696 +rs111453594 +rs111586006 +rs111711924 +rs111733033 +rs111863442 +rs111983789 +rs112223321 +rs112432980 +rs112526317 +rs112651555 +rs112697905 +rs113010670 +rs113027837 +rs113107651 +rs113127264 +rs113168982 +rs113344792 +rs113359786 +rs113360877 +rs113506649 +rs113806454 +rs114116379 +rs114352568 +rs114441254 +rs114451220 +rs114744918 +rs114846042 +rs115081332 +rs115176437 +rs115227739 +rs115391384 +rs115538991 +rs115723025 +rs115835101 +rs115893252 +rs116007537 +rs116518439 +rs116601725 +rs117351187 +rs117687487 +rs137900627 +rs138033439 +rs138362289 +rs138423171 +rs138657065 +rs138774045 +rs139104328 +rs139319140 +rs139568664 +rs139684640 +rs139807447 +rs139870016 +rs139975322 +rs140073076 +rs140210365 +rs140331879 +rs140365016 +rs140618698 +rs140816853 +rs140820215 +rs140996175 +rs141168596 +rs141384720 +rs141401324 +rs141521373 +rs141524813 +rs141535122 +rs141615558 +rs141858427 +rs142022847 +rs142254586 +rs142316020 +rs142332144 +rs142373684 +rs142454471 +rs142481454 +rs142563291 +rs142755020 +rs142764944 +rs143004208 +rs143203106 +rs143285488 +rs143597176 +rs143716009 +rs143748901 +rs143795139 +rs143940501 +rs143941749 +rs144031017 +rs144286664 +rs144800041 +rs144829376 +rs144854242 +rs144905737 +rs145058270 +rs145190129 +rs145196562 +rs145240720 +rs145329566 +rs145659003 +rs145723122 +rs145745749 +rs145763811 +rs146025791 +rs146044517 +rs146148316 +rs146167261 +rs146171297 +rs146187098 +rs146205948 +rs146238585 +rs146588857 +rs146725902 +rs146953511 +rs147042417 +rs147852217 +rs147949755 +rs147966778 +rs148041312 +rs148068857 +rs148417782 +rs148944860 +rs149205050 +rs149467865 +rs149521103 +rs149779151 +rs149937358 +rs150017698 +rs150026302 +rs150338030 +rs150547868 +rs150827003 +rs151127788 +rs151283081 +rs180819235 +rs180895165 +rs181057426 +rs181160026 +rs181644387 +rs181822454 +rs182172977 +rs182244473 +rs182511529 +rs182578895 +rs183113225 +rs183137060 +rs183407829 +rs183684131 +rs184092253 +rs184131646 +rs184170430 +rs184384776 +rs184986363 +rs185058170 +rs185154087 +rs185351363 +rs185403461 +rs185626073 +rs186037759 +rs186527935 +rs186736014 +rs187062200 +rs187097254 +rs187338583 +rs187405225 +rs187484386 +rs187612936 +rs187673856 +rs188269687 +rs188275922 +rs188401314 +rs188435519 +rs188549233 +rs188722316 +rs189233519 +rs189438972 +rs189506030 +rs189846864 +rs189892663 +rs190060481 +rs190127198 +rs190311485 +rs190373217 +rs190674911 +rs190944379 +rs191137647 +rs191503725 +rs191765265 +rs191989344 +rs192030042 +rs192077837 +rs192560459 +rs192802012 +rs193002626 +rs193123387 +rs199519886 +rs199531157 +rs199534434 +rs199556863 +rs199582898 +rs199622935 +rs199822777 +rs199886372 +rs200081159 +rs200089358 +rs200183196 +rs200594154 +rs200620822 +rs200708176 +rs200796492 +rs201142712 +rs201190468 +rs201299436 +rs201348905 +rs201496209 +rs201505714 +rs201644638 +rs201976575 +rs202024421 +rs202245589 +rs267600236 +rs367566102 +rs367728696 +rs367866356 +rs367971921 +rs368000869 +rs368325742 +rs368371182 +rs368409993 +rs368599894 +rs368636663 +rs368641147 +rs368655454 +rs368770792 +rs368861309 +rs368927637 +rs369006341 +rs369011183 +rs369098661 +rs369108748 +rs369129669 +rs369135444 +rs369224560 +rs369261041 +rs369331417 +rs369393485 +rs369596506 +rs369661101 +rs369701598 +rs369746513 +rs369762642 +rs369894758 +rs369907660 +rs370393648 +rs370473140 +rs370614344 +rs370678334 +rs370798263 +rs370911623 +rs371026801 +rs371093375 +rs371173790 +rs371199073 +rs371537255 +rs371641899 +rs371732806 +rs371778201 +rs371801125 +rs371948350 +rs371993910 +rs372201499 +rs372243132 +rs372302987 +rs372347148 +rs372563005 +rs372583774 +rs372811383 +rs372935744 +rs373012636 +rs373033705 +rs373117636 +rs373284973 +rs373323752 +rs373422008 +rs373446963 +rs373505344 +rs373577295 +rs373660529 +rs373881695 +rs374087780 +rs374242351 +rs374442005 +rs374646768 +rs374694395 +rs374703849 +rs374733347 +rs374742197 +rs374781399 +rs374816418 +rs374902438 +rs374980119 +rs375075485 +rs375086122 +rs375231405 +rs375335465 +rs375426598 +rs375453085 +rs375496198 +rs375499565 +rs375793904 +rs375943228 +rs375959178 +rs376071193 +rs376075755 +rs376082805 +rs376165259 +rs376197293 +rs376418551 +rs376440889 +rs376539054 +rs376598317 +rs376703369 +rs376746114 +rs376770243 +rs376980666 +rs376992994 +rs377037017 +rs377060218 +rs377158807 +rs377162419 +rs377236269 +rs377247109 +rs377394491 +rs377677437 +rs386675808 +rs386675809 +rs397942821 +rs397975803 +rs527310479 +rs527357261 +rs527512407 +rs527572322 +rs527740107 +rs527781394 +rs528152479 +rs528488360 +rs528719388 +rs529121596 +rs529312358 +rs529364577 +rs529413064 +rs529681144 +rs529804459 +rs529899227 +rs530195571 +rs530338480 +rs530360963 +rs530934998 +rs531330579 +rs531420264 +rs531631680 +rs531706240 +rs531856448 +rs532168563 +rs532230767 +rs532260231 +rs532724029 +rs532755114 +rs532880819 +rs532890418 +rs532996523 +rs533043393 +rs533260858 +rs533617285 +rs533757135 +rs533863329 +rs533913529 +rs534082374 +rs534252995 +rs534618928 +rs534738445 +rs535146873 +rs535667209 +rs535745406 +rs536021304 +rs536197066 +rs536318071 +rs536354762 +rs536508087 +rs536782842 +rs537189924 +rs537308228 +rs537315226 +rs537394074 +rs537558699 +rs537817133 +rs538289084 +rs538374745 +rs538422602 +rs538436788 +rs538513467 +rs538594739 +rs538643551 +rs538877012 +rs538972710 +rs539004255 +rs539114576 +rs539396380 +rs539638557 +rs539727196 +rs539771790 +rs539995074 +rs540001335 +rs540090155 +rs540285832 +rs540287623 +rs540292592 +rs540888139 +rs541199150 +rs541206640 +rs541251018 +rs541282103 +rs541381310 +rs541406442 +rs541599647 +rs541726047 +rs542112970 +rs542167730 +rs542170793 +rs542293507 +rs542436394 +rs542511852 +rs542547942 +rs542712763 +rs542719255 +rs542726419 +rs543064210 +rs543323106 +rs543637559 +rs543838539 +rs543916135 +rs544269602 +rs544334674 +rs544553597 +rs544578996 +rs544588394 +rs544817845 +rs544931617 +rs545208587 +rs545361978 +rs545457617 +rs545603808 +rs545698256 +rs545743366 +rs545835543 +rs546007780 +rs546042929 +rs546183974 +rs546394829 +rs546558306 +rs546600426 +rs546683340 +rs546719907 +rs546778141 +rs546842758 +rs546851902 +rs547160561 +rs547878793 +rs548083930 +rs548085077 +rs548688377 +rs548769495 +rs548992791 +rs549027766 +rs549105163 +rs549158960 +rs549285638 +rs549981692 +rs550039546 +rs550317645 +rs550339358 +rs550893711 +rs551519308 +rs551524128 +rs551865058 +rs552438585 +rs552473293 +rs552641212 +rs552720870 +rs552993582 +rs553040303 +rs553094254 +rs553165288 +rs553176387 +rs553328499 +rs553464684 +rs553845772 +rs554231706 +rs554233924 +rs554335470 +rs554356883 +rs554370118 +rs554401846 +rs554440217 +rs554494179 +rs554658250 +rs554781199 +rs554861742 +rs555392291 +rs555446608 +rs555672812 +rs555715855 +rs555924488 +rs555956094 +rs556403309 +rs556513212 +rs556625869 +rs556750626 +rs556781042 +rs556782400 +rs556921138 +rs557074479 +rs557139317 +rs557513411 +rs557734044 +rs557855881 +rs557885429 +rs557976679 +rs558169730 +rs558376593 +rs558651263 +rs558957844 +rs558971507 +rs559397801 +rs559460134 +rs559502503 +rs559633827 +rs559764125 +rs559870572 +rs559932940 +rs559957759 +rs560047086 +rs560621502 +rs560735479 +rs560914355 +rs560984875 +rs560986989 +rs561446897 +rs561755444 +rs561898654 +rs561980298 +rs562186691 +rs562421222 +rs562460540 +rs562461443 +rs562771968 +rs562777014 +rs562940440 +rs563297639 +rs563299134 +rs563966501 +rs564280422 +rs564565946 +rs564813294 +rs564868779 +rs564905233 +rs565182189 +rs565347250 +rs565669837 +rs566049345 +rs566052665 +rs566076352 +rs566174722 +rs566238707 +rs566255037 +rs566305033 +rs566380661 +rs566988852 +rs567117623 +rs567245133 +rs567483718 +rs567484088 +rs567531034 +rs567550757 +rs567710200 +rs568283274 +rs568466514 +rs568675718 +rs568703630 +rs568713009 +rs568747131 +rs568881578 +rs569308117 +rs569636529 +rs569712208 +rs569816124 +rs569994498 +rs570116933 +rs570234604 +rs570596037 +rs570727742 +rs570793698 +rs570826995 +rs570996891 +rs571270578 +rs571513107 +rs571590922 +rs571819924 +rs571842651 +rs571921337 +rs572136702 +rs572199718 +rs572621110 +rs572713251 +rs572995187 +rs573033853 +rs573178243 +rs573529595 +rs573543784 +rs573981632 +rs574018774 +rs574192895 +rs574230384 +rs574397289 +rs574452222 +rs574741101 +rs575098469 +rs575117056 +rs575174439 +rs575359978 +rs575681057 +rs575990541 +rs576248341 +rs576336383 +rs576415971 +rs576569856 +rs576696208 +rs577246599 +rs577456867 +rs577766915 +rs577773346 +rs577891390 +rs577983012 +rs578017318 +rs578044191 +rs578051558 +rs745371944 +rs745594327 +rs745638949 +rs745654916 +rs745765008 +rs745938371 +rs745981017 +rs746036188 +rs746141544 +rs746159063 +rs746228829 +rs746310972 +rs746356236 +rs746426326 +rs746539334 +rs746624600 +rs746724705 +rs746787053 +rs746813256 +rs746834479 +rs746883901 +rs746885949 +rs746974656 +rs747007114 +rs747014519 +rs747119987 +rs747137893 +rs747166600 +rs747255232 +rs747370717 +rs747383763 +rs747439436 +rs747475472 +rs747565586 +rs747646070 +rs747740833 +rs747766446 +rs747799656 +rs747805519 +rs747854302 +rs747912788 +rs748077119 +rs748229314 +rs748344001 +rs748357992 +rs748365197 +rs748406215 +rs748492024 +rs748519925 +rs748629954 +rs748698157 +rs748714399 +rs748798988 +rs748931327 +rs748995149 +rs749016234 +rs749065689 +rs749196582 +rs749235920 +rs749277134 +rs749376645 +rs749397318 +rs749418617 +rs749558512 +rs749666851 +rs749703387 +rs749828135 +rs749865798 +rs750033625 +rs750168916 +rs750358093 +rs750379334 +rs750413031 +rs750588564 +rs750930274 +rs751027728 +rs751074735 +rs751162767 +rs751307514 +rs751339307 +rs751374782 +rs751432137 +rs751520250 +rs751577588 +rs751608780 +rs751721654 +rs751803066 +rs751811155 +rs751867964 +rs752057018 +rs752108180 +rs752225523 +rs752342150 +rs752348612 +rs752402310 +rs752524524 +rs752528379 +rs752612682 +rs752814924 +rs753006873 +rs753200127 +rs753263140 +rs753314472 +rs753378385 +rs753391808 +rs753435072 +rs753523123 +rs753602612 +rs753659960 +rs753667279 +rs753699796 +rs753805325 +rs753807589 +rs753861074 +rs753981873 +rs754031212 +rs754127370 +rs754166897 +rs754334834 +rs754351034 +rs754440872 +rs754508444 +rs754548772 +rs754569842 +rs754569854 +rs754594272 +rs754629521 +rs754667088 +rs754691173 +rs754791754 +rs754808661 +rs754866209 +rs754932853 +rs755021007 +rs755136801 +rs755186739 +rs755356334 +rs755392251 +rs755400390 +rs755404251 +rs755434940 +rs755494804 +rs755522196 +rs755667673 +rs755715582 +rs755744770 +rs755785755 +rs755836287 +rs755836736 +rs755921012 +rs756017972 +rs756062120 +rs756080244 +rs756094947 +rs756169533 +rs756236756 +rs756553919 +rs756707494 +rs756710235 +rs756726075 +rs756925513 +rs756969935 +rs756987016 +rs756993915 +rs757073352 +rs757198664 +rs757334549 +rs757343797 +rs757438245 +rs757445366 +rs757552249 +rs757573332 +rs757641274 +rs757950890 +rs758011947 +rs758020895 +rs758057577 +rs758133163 +rs758140701 +rs758171789 +rs758335048 +rs758351216 +rs758388637 +rs758509817 +rs758546675 +rs758599357 +rs758687587 +rs758709641 +rs758950730 +rs759085271 +rs759090497 +rs759170710 +rs759337300 +rs759342902 +rs759510590 +rs759559200 +rs759581697 +rs759782328 +rs759807580 +rs759822612 +rs759960410 +rs759994492 +rs760048837 +rs760273996 +rs760302093 +rs760307757 +rs760313097 +rs760362738 +rs760389841 +rs760501686 +rs760558453 +rs760617304 +rs760629885 +rs760724796 +rs760758795 +rs760915331 +rs760923195 +rs760928369 +rs760941532 +rs760956903 +rs761020179 +rs761041082 +rs761122909 +rs761133818 +rs761193651 +rs761521791 +rs761595217 +rs761621695 +rs761701631 +rs761723007 +rs761755537 +rs761801420 +rs761866110 +rs761873084 +rs761891580 +rs761895998 +rs762064429 +rs762075115 +rs762078135 +rs762205073 +rs762271725 +rs762294255 +rs762338094 +rs762471651 +rs762671034 +rs762819032 +rs762829882 +rs762840330 +rs762881888 +rs763013673 +rs763026369 +rs763034932 +rs763139877 +rs763317455 +rs763427554 +rs763484324 +rs763562068 +rs763621098 +rs763622136 +rs763846029 +rs763850112 +rs763929179 +rs763931330 +rs763983609 +rs764018902 +rs764110289 +rs764283468 +rs764306628 +rs764337538 +rs764383206 +rs764459313 +rs764598505 +rs764660387 +rs764685565 +rs764712520 +rs764722872 +rs764935597 +rs764939749 +rs764991108 +rs765011604 +rs765017023 +rs765076338 +rs765093755 +rs765131383 +rs765256208 +rs765340433 +rs765462447 +rs765462707 +rs765655841 +rs765703346 +rs765704979 +rs765921100 +rs766020605 +rs766028049 +rs766044957 +rs766064153 +rs766100077 +rs766147620 +rs766225005 +rs766229520 +rs766257873 +rs766325385 +rs766326078 +rs766460788 +rs766489283 +rs766493438 +rs766526587 +rs766731780 +rs766830942 +rs766865064 +rs766904083 +rs766935881 +rs766963001 +rs766972765 +rs767008720 +rs767182246 +rs767279567 +rs767284722 +rs767464468 +rs767521239 +rs767554152 +rs767693494 +rs767715150 +rs767848385 +rs767882542 +rs767914206 +rs767961230 +rs767972285 +rs767995404 +rs768051738 +rs768228366 +rs768264470 +rs768372497 +rs768378208 +rs768407132 +rs768607147 +rs768613149 +rs768673264 +rs768705381 +rs768760959 +rs768792914 +rs768841395 +rs768972542 +rs769061576 +rs769062573 +rs769094247 +rs769200833 +rs769325843 +rs769371270 +rs769376399 +rs769523083 +rs769559009 +rs769705808 +rs769811556 +rs769911881 +rs770104590 +rs770126037 +rs770127979 +rs770257329 +rs770264296 +rs770298829 +rs770433471 +rs770446858 +rs770460128 +rs770498002 +rs770510857 +rs770515782 +rs770662595 +rs770852229 +rs770954734 +rs771179545 +rs771183034 +rs771217998 +rs771228127 +rs771276958 +rs771316013 +rs771351508 +rs771396982 +rs771414577 +rs771613177 +rs771648844 +rs771701895 +rs771843046 +rs771871364 +rs771915325 +rs772035255 +rs772087403 +rs772124232 +rs772146203 +rs772155667 +rs772247798 +rs772271187 +rs772304269 +rs772307532 +rs772331112 +rs772340921 +rs772360617 +rs772520773 +rs772521362 +rs772566071 +rs772832255 +rs772863243 +rs772951204 +rs773058826 +rs773118004 +rs773146871 +rs773147077 +rs773197079 +rs773236947 +rs773323545 +rs773325113 +rs773345867 +rs773395077 +rs773468518 +rs773514948 +rs773631696 +rs773646817 +rs773734640 +rs773972418 +rs774010923 +rs774062263 +rs774143167 +rs774172380 +rs774262816 +rs774324175 +rs774370036 +rs774386756 +rs774390533 +rs774473809 +rs774477839 +rs774596022 +rs774650612 +rs774653716 +rs774730846 +rs774743870 +rs774799244 +rs774830241 +rs774863048 +rs774984989 +rs775244856 +rs775414238 +rs775494113 +rs775535240 +rs775639547 +rs775667627 +rs775867526 +rs775899514 +rs775941778 +rs776063839 +rs776099092 +rs776174719 +rs776268348 +rs776377225 +rs776389254 +rs776396880 +rs776557419 +rs776565676 +rs776661614 +rs776875648 +rs776928121 +rs776975434 +rs777015829 +rs777127126 +rs777303776 +rs777318415 +rs777368202 +rs777442798 +rs777465699 +rs777675028 +rs777719898 +rs777785704 +rs777817672 +rs777856234 +rs777861387 +rs778067258 +rs778082450 +rs778170186 +rs778278579 +rs778316669 +rs778353419 +rs778527857 +rs778539622 +rs778594228 +rs778627420 +rs778629743 +rs778718391 +rs778731323 +rs778820984 +rs778896618 +rs778923688 +rs778971384 +rs779026885 +rs779083275 +rs779084410 +rs779113083 +rs779268740 +rs779573135 +rs779579689 +rs779605432 +rs779668319 +rs779675904 +rs779676765 +rs779765531 +rs779779400 +rs779781403 +rs779869165 +rs779874002 +rs779975669 +rs780129733 +rs780244963 +rs780300075 +rs780324229 +rs780326419 +rs780349174 +rs780424964 +rs780632317 +rs780715710 +rs780934616 +rs781020845 +rs781041364 +rs781082963 +rs781128848 +rs781187635 +rs781231723 +rs781264832 +rs781315593 +rs781370051 +rs781391187 +rs781478867 +rs781488282 +rs781571269 +rs781578161 +rs781714948 +rs781728949 +rs796231400 +rs796434734 +rs796638835 +rs796800689 +rs865848110 +rs865862482 +rs866183040 +rs866268583 +rs866307016 +rs866318277 +rs866539254 +rs866587144 +rs866630412 +rs866824281 +rs867098230 +rs867141454 +rs867402927 +rs867597552 +rs867658650 +rs867659169 +rs867708157 +rs867821510 +rs867974870 +rs868044717 +rs868168848 +rs868188594 +rs868395641 +rs868420689 +rs868823128 +rs868823352 +rs869056092 +rs869231475 +rs869259128 +rs878919504 +rs878993086 +rs879075404 +rs879266025 +rs879391233 +rs879495884 +rs879503656 +rs879511767 +rs879565060 +rs879596815 +rs886078364 +rs886307293 +rs886738960 +rs886852997 +rs887085938 +rs887113361 +rs887247034 +rs887757170 +rs887855504 +rs887910348 +rs887976448 +rs888010337 +rs888034318 +rs888080677 +rs888187617 +rs888217705 +rs888350331 +rs888936163 +rs889100107 +rs889260843 +rs889323836 +rs889432087 +rs889574372 +rs889585405 +rs890244156 +rs890451722 +rs890611735 +rs891137543 +rs891259305 +rs891261994 +rs891359373 +rs891376570 +rs891401498 +rs891755127 +rs891762915 +rs891835922 +rs891867273 +rs891988663 +rs892064852 +rs892066592 +rs892322538 +rs892390946 +rs892609075 +rs892819067 +rs892929899 +rs892979072 +rs893225054 +rs893589544 +rs894321909 +rs894502263 +rs894566576 +rs894636691 +rs894759023 +rs895209875 +rs895417362 +rs895523884 +rs895554955 +rs895738500 +rs895978869 +rs896089544 +rs896292484 +rs896325750 +rs896897010 +rs896938406 +rs897924181 +rs898110098 +rs898178070 +rs898225708 +rs898255276 +rs898498303 +rs898619863 +rs898749249 +rs898782055 +rs898905781 +rs899469985 +rs899562004 +rs899773232 +rs900167861 +rs900409341 +rs900806229 +rs901108440 +rs901125195 +rs901537272 +rs901613515 +rs901841524 +rs901975707 +rs902049879 +rs902095303 +rs902127904 +rs902479013 +rs902590352 +rs902592642 +rs902783438 +rs902807877 +rs902864027 +rs902922908 +rs903024454 +rs903113041 +rs903251249 +rs903662690 +rs903690036 +rs904271861 +rs904700527 +rs905011514 +rs905066648 +rs905097498 +rs905362786 +rs905831778 +rs905946713 +rs906026746 +rs906059266 +rs906094854 +rs906126893 +rs906156218 +rs906360132 +rs906392176 +rs906687072 +rs906861115 +rs907036359 +rs907113581 +rs907139718 +rs907509728 +rs907556740 +rs907670611 +rs908571877 +rs908672795 +rs908772240 +rs908900427 +rs908974323 +rs909220459 +rs909338728 +rs909342724 +rs909675424 +rs909739917 +rs910274965 +rs910401775 +rs910432211 +rs910484347 +rs910655196 +rs910724531 +rs911171208 +rs911406132 +rs911532703 +rs911911357 +rs912087648 +rs912153579 +rs912186792 +rs912768613 +rs912844526 +rs913262192 +rs913300389 +rs913311923 +rs913430294 +rs913502352 +rs913603149 +rs913625480 +rs913742593 +rs914224871 +rs914409240 +rs914671311 +rs915141733 +rs915262465 +rs915312511 +rs915508602 +rs915537636 +rs915693670 +rs915808913 +rs915877580 +rs915904189 +rs915929198 +rs916008100 +rs916200257 +rs916330408 +rs916659004 +rs916682468 +rs916714805 +rs917065494 +rs917109397 +rs917186082 +rs917347556 +rs917573035 +rs917760161 +rs917876202 +rs918015255 +rs918230611 +rs918261799 +rs918377447 +rs918483682 +rs918502953 +rs918992714 +rs919234050 +rs919249960 +rs919359305 +rs919396887 +rs919527263 +rs919689675 +rs920162596 +rs920171959 +rs920411095 +rs920451759 +rs920493496 +rs920898405 +rs920961820 +rs920994068 +rs921090204 +rs921120661 +rs921121390 +rs921570386 +rs921872062 +rs922102411 +rs922766981 +rs922832614 +rs922956990 +rs923036124 +rs923278577 +rs923430210 +rs923534573 +rs923983028 +rs924100232 +rs924160418 +rs924258337 +rs924262067 +rs924315002 +rs924340205 +rs924416817 +rs924560350 +rs925581393 +rs925722527 +rs925909179 +rs926009404 +rs926113632 +rs926119694 +rs926146146 +rs926250821 +rs926390331 +rs926636193 +rs926709823 +rs926755518 +rs926900585 +rs927043917 +rs927266841 +rs927392491 +rs927414404 +rs927817392 +rs928271896 +rs928347989 +rs928427207 +rs928680567 +rs928793942 +rs928965088 +rs929305172 +rs929722025 +rs929808247 +rs930350294 +rs930406137 +rs930498107 +rs930665275 +rs930743505 +rs931004703 +rs931332585 +rs931433132 +rs931475677 +rs931481378 +rs931536257 +rs931596295 +rs932058505 +rs932105780 +rs932135222 +rs932189724 +rs932191368 +rs932212890 +rs932315158 +rs932415273 +rs932527145 +rs932559688 +rs932821933 +rs933187269 +rs933250805 +rs933746573 +rs933879581 +rs934062403 +rs934554731 +rs934722281 +rs935395377 +rs935502050 +rs935564095 +rs935575639 +rs935595130 +rs935611473 +rs936058566 +rs936106788 +rs936175185 +rs936205883 +rs936508462 +rs936588372 +rs937026125 +rs937089798 +rs937136091 +rs937282409 +rs937716611 +rs938061939 +rs938216382 +rs938231885 +rs938645170 +rs938700889 +rs938758043 +rs938881608 +rs938926655 +rs938929261 +rs938970823 +rs939027999 +rs939138504 +rs939277085 +rs939289963 +rs939703666 +rs940226539 +rs940318692 +rs940322731 +rs940586197 +rs941100601 +rs941247968 +rs941345054 +rs941746911 +rs942086534 +rs942104695 +rs942152271 +rs942273883 +rs942329758 +rs942743456 +rs942775980 +rs942797138 +rs942849177 +rs942886149 +rs942899327 +rs942937525 +rs943008308 +rs943047040 +rs943184823 +rs943987695 +rs944458334 +rs944590146 +rs944694412 +rs944765973 +rs945209953 +rs945490379 +rs946124606 +rs946205870 +rs946279104 +rs946324417 +rs946417518 +rs946517920 +rs947741716 +rs947910527 +rs947984659 +rs948000768 +rs948446836 +rs948459211 +rs948738011 +rs948772042 +rs949374356 +rs949536490 +rs949573272 +rs949591962 +rs949892865 +rs950072276 +rs950122190 +rs950262648 +rs950383836 +rs950442461 +rs950963335 +rs951188823 +rs951199231 +rs951229979 +rs951263170 +rs951552279 +rs951848124 +rs952142351 +rs952397259 +rs952413556 +rs952557709 +rs952811002 +rs952891656 +rs952964547 +rs953149379 +rs953419624 +rs953479833 +rs953512791 +rs953712589 +rs953728720 +rs953804621 +rs953844969 +rs953986717 +rs954088553 +rs954333329 +rs954643293 +rs954809161 +rs955083375 +rs955145257 +rs955358667 +rs955466525 +rs955525988 +rs955532764 +rs955636278 +rs955742747 +rs955805307 +rs955997366 +rs956097847 +rs956105087 +rs956440060 +rs956484086 +rs956605995 +rs957068163 +rs957139772 +rs957409076 +rs957425979 +rs957656044 +rs957769755 +rs958318663 +rs958433562 +rs958613412 +rs958644618 +rs958796286 +rs959325425 +rs959326947 +rs959444027 +rs959600370 +rs959701443 +rs959735031 +rs960265123 +rs960308549 +rs960459078 +rs960500065 +rs960501707 +rs961004673 +rs961035707 +rs961297783 +rs961976577 +rs962001893 +rs962453012 +rs962671711 +rs962704544 +rs962720272 +rs962850031 +rs963043274 +rs963446348 +rs963447049 +rs963587281 +rs963628362 +rs963709014 +rs963858158 +rs963981346 +rs964116505 +rs964251899 +rs964483275 +rs964744196 +rs964924637 +rs964939062 +rs965282340 +rs965602903 +rs965998429 +rs966682293 +rs967102706 +rs967152933 +rs967448188 +rs967593565 +rs967612908 +rs967795539 +rs967856878 +rs967928951 +rs968391285 +rs968524159 +rs968616231 +rs968813851 +rs968869060 +rs969188211 +rs969834862 +rs970009945 +rs970156542 +rs970166618 +rs970315837 +rs970504340 +rs970576434 +rs970652750 +rs970828532 +rs970868415 +rs970877326 +rs970949547 +rs970956955 +rs971101156 +rs971208455 +rs972091929 +rs972112986 +rs972126204 +rs972378635 +rs972444418 +rs972518168 +rs972687404 +rs973088950 +rs973371758 +rs973630434 +rs973704302 +rs973732514 +rs973762255 +rs973765209 +rs973796298 +rs974090121 +rs974117827 +rs974380852 +rs974428865 +rs974829519 +rs975130673 +rs975154979 +rs975343432 +rs975442282 +rs975497998 +rs975656269 +rs975725257 +rs975814406 +rs975830340 +rs975983379 +rs976397396 +rs976441995 +rs976634818 +rs976644418 +rs976679624 +rs977116745 +rs977207845 +rs977275468 +rs977275889 +rs977769813 +rs978152789 +rs978561778 +rs978616645 +rs978695426 +rs979149833 +rs979182548 +rs979205703 +rs979262932 +rs979337125 +rs979452151 +rs979784371 +rs979796755 +rs979861748 +rs979916051 +rs980613732 +rs980616066 +rs980659048 +rs980841513 +rs981615859 +rs981713470 +rs981788528 +rs982050318 +rs982290738 +rs982321892 +rs982329416 +rs982671265 +rs982761389 +rs982792752 +rs982956853 +rs983132671 +rs983414707 +rs983676642 +rs983746978 +rs984497422 +rs984509316 +rs984609978 +rs984673304 +rs984798601 +rs984810702 +rs984959734 +rs985284010 +rs985319021 +rs986088092 +rs986131002 +rs986218581 +rs986274628 +rs986305591 +rs986313540 +rs986771504 +rs987293372 +rs987365223 +rs987394849 +rs987915174 +rs988058446 +rs988200546 +rs988448570 +rs989015368 +rs989039064 +rs989064954 +rs989210871 +rs989240203 +rs989263843 +rs989384883 +rs989559434 +rs989593521 +rs989628531 +rs989659830 +rs989702727 +rs989891401 +rs989946654 +rs989961962 +rs989993109 +rs990051312 +rs990097986 +rs990209740 +rs990775805 +rs990805557 +rs990909680 +rs990988987 +rs991229545 +rs991266750 +rs991332769 +rs991368923 +rs991451374 +rs991664798 +rs991837660 +rs991846892 +rs992185224 +rs992552026 +rs992825778 +rs992919329 +rs992936194 +rs993009843 +rs993045034 +rs993296178 +rs993597295 +rs993679670 +rs993695397 +rs993853724 +rs994079843 +rs994364083 +rs994414684 +rs994950182 +rs994954363 +rs995482536 +rs995665729 +rs995699423 +rs996053259 +rs996107394 +rs996139857 +rs996302074 +rs996328696 +rs996446494 +rs996837892 +rs997028586 +rs997042784 +rs997138823 +rs997168112 +rs997301237 +rs997471134 +rs997770035 +rs998112868 +rs998305673 +rs998521570 +rs998643726 +rs998675047 +rs998961036 +rs999178510 +rs999564940 +rs999578002 +rs999649967 +rs999794232 +rs999825395 +rs999899006 +rs999949299 +rs1000390188 +rs1000520596 +rs1000738119 +rs1001276730 +rs1001452441 +rs1001657845 +rs1001865992 +rs1001897264 +rs1002059383 +rs1002430045 +rs1002530057 +rs1002561301 +rs1002627150 +rs1002921853 +rs1002948638 +rs1003014016 +rs1003092024 +rs1003225682 +rs1003378129 +rs1003537199 +rs1003607895 +rs1003992227 +rs1004215958 +rs1004245415 +rs1004394622 +rs1004572058 +rs1004736548 +rs1004768890 +rs1004801231 +rs1005793065 +rs1005919535 +rs1005968447 +rs1006273639 +rs1006302222 +rs1006486040 +rs1006933180 +rs1006964908 +rs1007105294 +rs1007262314 +rs1007293426 +rs1007622018 +rs1007780243 +rs1007875526 +rs1008077938 +rs1008158763 +rs1008675691 +rs1008957424 +rs1009240638 +rs1009303128 +rs1009354430 +rs1009458161 +rs1009528439 +rs1010237276 +rs1010310957 +rs1010641564 +rs1010874245 +rs1010929658 +rs1010948532 +rs1010979678 +rs1011101687 +rs1011226396 +rs1011233320 +rs1011306760 +rs1011512579 +rs1011550269 +rs1012065625 +rs1012097750 +rs1012153101 +rs1012614630 +rs1012797926 +rs1013122227 +rs1013181196 +rs1013222435 +rs1013310886 +rs1013527324 +rs1013571439 +rs1013585758 +rs1013657961 +rs1013922728 +rs1013991336 +rs1014235714 +rs1014293600 +rs1014438717 +rs1014578410 +rs1014600351 +rs1015035497 +rs1015064878 +rs1015381092 +rs1015717932 +rs1015848239 +rs1015877648 +rs1016018047 +rs1016029292 +rs1016197022 +rs1016371555 +rs1016390133 +rs1016703666 +rs1016734855 +rs1017294806 +rs1017386239 +rs1017405957 +rs1017532875 +rs1017755376 +rs1018075008 +rs1018410128 +rs1018699388 +rs1018775970 +rs1018943717 +rs1019379150 +rs1019380088 +rs1019429775 +rs1019468394 +rs1019727779 +rs1019733120 +rs1020107917 +rs1020250258 +rs1020356035 +rs1020409188 +rs1020620850 +rs1020739868 +rs1020886587 +rs1020974278 +rs1021003876 +rs1021281654 +rs1021615551 +rs1021670277 +rs1021887006 +rs1022104275 +rs1022256060 +rs1022294213 +rs1022412676 +rs1022855801 +rs1022959335 +rs1022985227 +rs1022986201 +rs1023140841 +rs1023192406 +rs1023457021 +rs1023791167 +rs1024127865 +rs1024631315 +rs1024652554 +rs1024961923 +rs1025819309 +rs1025864734 +rs1026222042 +rs1026314448 +rs1026345354 +rs1026592115 +rs1026675450 +rs1027379293 +rs1027425570 +rs1027946219 +rs1027951807 +rs1028026694 +rs1028179665 +rs1028621847 +rs1029098870 +rs1029208939 +rs1029371065 +rs1029821875 +rs1030223897 +rs1030411096 +rs1030466092 +rs1030610207 +rs1030687257 +rs1030718547 +rs1030881726 +rs1030956407 +rs1031324430 +rs1031361990 +rs1031373061 +rs1031378335 +rs1031532261 +rs1032022032 +rs1032046798 +rs1032114471 +rs1032177621 +rs1032367032 +rs1032706904 +rs1033054376 +rs1033281764 +rs1033308392 +rs1033604142 +rs1033620164 +rs1033855203 +rs1033933460 +rs1034110970 +rs1034115409 +rs1034194736 +rs1034241639 +rs1034272534 +rs1034451563 +rs1034512388 +rs1034652442 +rs1034832985 +rs1035377306 +rs1035869239 +rs1035916125 +rs1036192338 +rs1036342331 +rs1036413577 +rs1036521290 +rs1037261177 +rs1037294839 +rs1037525432 +rs1037598592 +rs1037992485 +rs1038129626 +rs1038424764 +rs1038879884 +rs1038890224 +rs1039143225 +rs1039264948 +rs1039860866 +rs1039894418 +rs1040024274 +rs1040093510 +rs1040196226 +rs1040294256 +rs1040423376 +rs1040500132 +rs1040587355 +rs1040642826 +rs1040714511 +rs1040887902 +rs1040959921 +rs1041351841 +rs1041370341 +rs1041427317 +rs1041519657 +rs1041563454 +rs1041587618 +rs1041605412 +rs1041964093 +rs1041990097 +rs1042428114 +rs1042640217 +rs1042788057 +rs1043019468 +rs1043097455 +rs1043240236 +rs1043385924 +rs1043431999 +rs1043791975 +rs1043925190 +rs1044201170 +rs1044401800 +rs1044460920 +rs1044624223 +rs1044914255 +rs1044989063 +rs1045046940 +rs1045324048 +rs1045403022 +rs1045804377 +rs1045881455 +rs1046006965 +rs1046615236 +rs1046766243 +rs1047052614 +rs1047074511 +rs1047088826 +rs1047183573 +rs1047241299 +rs1047749148 +rs1047877065 +rs1048014728 +rs1048314022 +rs1048398927 +rs1048764590 +rs1048892888 +rs1049142028 +rs1049454723 +rs1049565550 +rs1049613050 +rs1049687200 +rs1050020092 +rs1050475687 +rs1050537971 +rs1050567619 +rs1050702026 +rs1050998497 +rs1051120499 +rs1051208919 +rs1051288769 +rs1051289133 +rs1051322968 +rs1051592316 +rs1051627907 +rs1051691919 +rs1052039914 +rs1052343022 +rs1052621887 +rs1052886341 +rs1053235997 +rs1053309830 +rs1053359651 +rs1053560423 +rs1053704129 +rs1053949631 +rs1054339985 +rs1054622654 +rs1054915447 +rs1055280892 +rs1055354799 +rs1055383957 +rs1055455358 +rs1055481171 +rs1055661082 +rs1056057170 +rs1056088739 +rs1056226544 +rs1056594027 +rs1057052679 +rs1057055942 +rs1057281520 +rs1057320372 diff --git a/clients/R/inst/extdata/hapmap_exome_chr22_500.vcf.gz b/clients/R/inst/extdata/hapmap_exome_chr22_500.vcf.gz new file mode 100644 index 0000000000..78cdb61734 Binary files /dev/null and b/clients/R/inst/extdata/hapmap_exome_chr22_500.vcf.gz differ diff --git a/clients/R/inst/extdata/hapmap_exome_chr22_500.vcf.gz.tbi b/clients/R/inst/extdata/hapmap_exome_chr22_500.vcf.gz.tbi new file mode 100644 index 0000000000..56aed8980a Binary files /dev/null and b/clients/R/inst/extdata/hapmap_exome_chr22_500.vcf.gz.tbi differ diff --git a/clients/R/man/AnnotateVcf-CellBaseR-method.Rd b/clients/R/man/AnnotateVcf-CellBaseR-method.Rd new file mode 100644 index 0000000000..29672495a2 --- /dev/null +++ b/clients/R/man/AnnotateVcf-CellBaseR-method.Rd @@ -0,0 +1,44 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/AnnotateVcf-methods.R +\docType{methods} +\name{AnnotateVcf,CellBaseR-method} +\alias{AnnotateVcf,CellBaseR-method} +\alias{AnnotateVcf} +\title{AnnotateVcf} +\usage{ +\S4method{AnnotateVcf}{CellBaseR}(object, file, batch_size, num_threads, + BPPARAM = bpparam()) +} +\arguments{ +\item{object}{an object of class CellBaseR} + +\item{file}{Path to a bgzipped and tabix indexed vcf file} + +\item{batch_size}{intger if multiple queries are raised by a single method +call, e.g. getting annotation info for several genes, +queries will be sent to the server in batches. This slot indicates the size +of each batch, e.g. 200} + +\item{num_threads}{number of asynchronus batches to be sent to the server} + +\item{BPPARAM}{a BiocParallel class object} +} +\value{ +a dataframe with the results of the query +} +\description{ +This method is a convience method to annotate bgzipped tabix-indexed vcf +files. It should be ideal for annotating small to medium sized +vcf files. +} +\examples{ +cb <- CellBaseR() +fl <- system.file("extdata", "hapmap_exome_chr22_500.vcf.gz", + package = "cellbaseR" ) +res <- AnnotateVcf(object=cb, file=fl, BPPARAM = bpparam(workers=2)) +} +\seealso{ +\url{https://github.com/opencb/cellbase/wiki} +and the RESTful API documentation +\url{http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/} +} diff --git a/clients/R/man/CellBaseParam-class.Rd b/clients/R/man/CellBaseParam-class.Rd index 822a365450..f383d395f1 100644 --- a/clients/R/man/CellBaseParam-class.Rd +++ b/clients/R/man/CellBaseParam-class.Rd @@ -3,16 +3,15 @@ \docType{class} \name{CellBaseParam-class} \alias{CellBaseParam-class} -\title{This Class defines a CellBaseParam object} +\title{CellBaseParam Class} \description{ -This class defines a CellBaseParam object to hold filtering parameters +This class defines a CellBaseParam object to hold filtering +parameters. } \details{ -This class stores filtering parameters to be used by CellBaseR query - methods. Not all the slots will be -used by all query methods, please have a look at -http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/ and the -Reference Manual for more information. +This class stores parameters used for filtering the CellBaseR query +and is avaialable for all query methods. CellBaseParam object is used to +control what results are returned from the' CellBaseR methods } \section{Slots}{ @@ -37,3 +36,8 @@ in the form 1:100000-1500000} \item{\code{limit}}{A number limiting the number of results to be returned} }} +\seealso{ +\url{https://github.com/opencb/cellbase/wiki} +and the RESTful API documentation +\url{http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/} +} diff --git a/clients/R/man/CellBaseParam.Rd b/clients/R/man/CellBaseParam.Rd index 339645b5c0..bc8bd910d5 100644 --- a/clients/R/man/CellBaseParam.Rd +++ b/clients/R/man/CellBaseParam.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/CellBaseParam-methods.R \name{CellBaseParam} \alias{CellBaseParam} -\title{A constructor function for CellBaseParam} +\title{A Constructor for the CellBaseParam Object} \usage{ CellBaseParam(genome = character(), gene = character(), region = character(), rs = character(), so = character(), @@ -30,8 +30,11 @@ in the form 1:100000-1500000 not chr1:100000-1500000} \item{limit}{A number limiting the number of results to be returned} } +\value{ +an object of class CellBaseParam +} \description{ -use the CellBaseParam object to control what results are returned from the +CellBaseParam object is used to control what results are returned from the CellBaseR methods } \examples{ @@ -39,7 +42,7 @@ cbParam <- CellBaseParam(genome="GRCh38",gene=c("TP73","TET1")) print(cbParam) } \seealso{ -for more information about the cellbase webservices see +\url{https://github.com/opencb/cellbase/wiki} +and the RESTful API documentation \url{http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/} } - diff --git a/clients/R/man/CellBaseR-class.Rd b/clients/R/man/CellBaseR-class.Rd index bde2145abb..35902a179d 100644 --- a/clients/R/man/CellBaseR-class.Rd +++ b/clients/R/man/CellBaseR-class.Rd @@ -3,17 +3,15 @@ \docType{class} \name{CellBaseR-class} \alias{CellBaseR-class} -\title{This class defines the CellBaseR object} +\title{CellBaseR Class} \description{ -This class defines the CellBaseR object +This is an S4 class which defines the CellBaseR object } \details{ This S4 class holds the default configuration required by CellBaseR methods to connect to the cellbase web services. By default it is configured to query human data based on the GRCh37 -genome assembly. Please, visit https://github.com/opencb/cellbase/wiki and -http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/ for more details on -following parameters. +genome assembly. } \section{Slots}{ @@ -34,3 +32,8 @@ of these batches. Default 200} \item{\code{num_threads}}{the number of threads. Default 8} }} +\seealso{ +\url{https://github.com/opencb/cellbase/wiki} +and the RESTful API documentation +\url{http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/} +} diff --git a/clients/R/man/CellBaseR.Rd b/clients/R/man/CellBaseR.Rd index 9ddd2683dc..ac4fe929a0 100644 --- a/clients/R/man/CellBaseR.Rd +++ b/clients/R/man/CellBaseR.Rd @@ -2,10 +2,11 @@ % Please edit documentation in R/CellBaseR-methods.R \name{CellBaseR} \alias{CellBaseR} -\title{A constructor function for CellBaseR object} +\title{CellBaseR} \usage{ -CellBaseR(host = NULL, version = NULL, species = NULL, - batch_size = NULL, num_threads = NULL) +CellBaseR(host = "http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/rest/", + version = "v4", species = "hsapiens", batch_size = 200L, + num_threads = 8L) } \arguments{ \item{host}{A character the default host url for cellbase webservices, @@ -13,31 +14,36 @@ e.g. "http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/rest/"} \item{version}{A character the cellbae API version, e.g. "V4"} -\item{species}{a character specifying the species to be queried, e.g. "hsapiens"} +\item{species}{a character specifying the species to be queried, e.g. +"hsapiens"} -\item{batch_size}{intger if multiple queries are raised by a single method call, e.g. getting annotation info for several genes, -queries will be sent to the server in batches. This slot indicates the size of each batch, e.g. 200} +\item{batch_size}{intger if multiple queries are raised by a single method +call, e.g. getting annotation info for several genes, queries will be sent +to the server in batches.This slot indicates the size of each batch,e.g. 200} -\item{num_threads}{integer number of asynchronus batches to be sent to the server} +\item{num_threads}{integer number of batches to be sent to the server} } \value{ An object of class CellBaseR } \description{ -This is a constructor function for CellBaseR object +This is a constructor function for the CellBaseR object } \details{ +CellbaseR constructor function + + This class defines the CellBaseR object. It holds the default configuration required by CellBaseR methods to connect to the cellbase web services. By defult it is configured to query human -data based on the GRCh37 genome assembly. Please, visit -https://github.com/opencb/cellbase/wiki and -bioinfodev.hpc.cam.ac.uk/cellbase/webservices/ for more details on -following parameters. -run cbSpeciesClient to see avaiable species and their corresponding data +data based on the GRCh37 genome assembly. } \examples{ cb <- CellBaseR() print(cb) } - +\seealso{ +\url{https://github.com/opencb/cellbase/wiki} +and the RESTful API documentation +\url{http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/} +} diff --git a/clients/R/man/cellbaseR-package.Rd b/clients/R/man/cellbaseR-package.Rd index 87fca5d024..1a15655701 100644 --- a/clients/R/man/cellbaseR-package.Rd +++ b/clients/R/man/cellbaseR-package.Rd @@ -4,7 +4,7 @@ \name{cellbaseR-package} \alias{cellbaseR} \alias{cellbaseR-package} -\title{CellbaseR} +\title{cellbaseR} \description{ Querying annotation data from the high performance Cellbase web services @@ -23,8 +23,14 @@ Currently Homo sapiens, Mus musculus and other 20 species are available and many others will be included soon. Results returned from the cellbase queries are parsed into R data.frames and other common R data strctures so users can readily get into downstream anaysis. +} +\seealso{ +Useful links: +\itemize{ + \item \url{https://github.com/melsiddieg/cellbaseR} +} + } \author{ Mohammed OE Abdallah } - diff --git a/clients/R/man/createGeneModel.Rd b/clients/R/man/createGeneModel.Rd index 4aabc63c0c..8588a74981 100644 --- a/clients/R/man/createGeneModel.Rd +++ b/clients/R/man/createGeneModel.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/tools.R \name{createGeneModel} \alias{createGeneModel} -\title{A convience functon to construct a genemodel} +\title{createGeneModel} \usage{ createGeneModel(object, region = NULL) } @@ -18,7 +18,16 @@ A geneModel A convience functon to construct a genemodel } \details{ -This function takes cbResponse object and returns a geneRegionTrack -model to be plotted by Gviz +This function create a gene model data frame, which can be then +turned into a GeneRegionTrack for visualiaztion + by \code{\link[Gviz]{GeneRegionTrack}} +} +\examples{ +cb <- CellBaseR() +test <- createGeneModel(object = cb, region = "17:1500000-1550000") +} +\seealso{ +\url{https://github.com/opencb/cellbase/wiki} +and the RESTful API documentation +\url{http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/} } - diff --git a/clients/R/man/getCaddScores.Rd b/clients/R/man/getCaddScores.Rd new file mode 100644 index 0000000000..95a33dce95 --- /dev/null +++ b/clients/R/man/getCaddScores.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/user.R +\name{getCaddScores} +\alias{getCaddScores} +\title{getCaddScores} +\usage{ +getCaddScores(object, id, param = NULL) +} +\arguments{ +\item{object}{an object of class CellBaseR} + +\item{id}{a charcter vector of genomic variants, eg 19:45411941:T:C} + +\item{param}{an object of class CellBaseParam} +} +\value{ +a dataframe of the query result +} +\description{ +A convienice method to fetch Cadd scores for specific variant/s +} +\examples{ +cb <- CellBaseR() +res <- getCaddScores(cb, "19:45411941:T:C") +} diff --git a/clients/R/man/getCellBase-CellBaseR-method.Rd b/clients/R/man/getCellBase-CellBaseR-method.Rd new file mode 100644 index 0000000000..22e4ea2359 --- /dev/null +++ b/clients/R/man/getCellBase-CellBaseR-method.Rd @@ -0,0 +1,46 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/getCellbase-methods.R +\docType{methods} +\name{getCellBase,CellBaseR-method} +\alias{getCellBase,CellBaseR-method} +\alias{getCellBase} +\title{getCellBase} +\usage{ +\S4method{getCellBase}{CellBaseR}(object, category, subcategory, ids, resource, + param = NULL) +} +\arguments{ +\item{object}{an object of class CellBaseR} + +\item{category}{character to specify the category to be queried.} + +\item{subcategory}{character to specify the subcategory to be queried} + +\item{ids}{a character vector of the ids to be queried} + +\item{resource}{a character to specify the resource to be queried} + +\item{param}{an object of class CellBaseParam specifying additional param +for the CellBaseR} +} +\value{ +a dataframe holding the results of the query +} +\description{ +The generic method for querying CellBase web services. +} +\details{ +This method allows the user to query the +cellbase web services without any predefined categories, subcategries, +or resources. +} +\examples{ + cb <- CellBaseR() + res <- getCellBase(object=cb, category="feature", subcategory="gene", + ids="TET1", resource="info") +} +\seealso{ +\url{https://github.com/opencb/cellbase/wiki} +and the RESTful API documentation +\url{http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/} +} diff --git a/clients/R/man/getCellBaseResourceHelp.Rd b/clients/R/man/getCellBaseResourceHelp.Rd new file mode 100644 index 0000000000..72e636bde3 --- /dev/null +++ b/clients/R/man/getCellBaseResourceHelp.Rd @@ -0,0 +1,34 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/commons.R +\name{getCellBaseResourceHelp} +\alias{getCellBaseResourceHelp} +\title{getCellBaseResourceHelp} +\usage{ +getCellBaseResourceHelp(object, subcategory) +} +\arguments{ +\item{object}{a cellBase class object} + +\item{subcategory}{a character the subcategory to be queried} +} +\value{ +character vector of the available resources to that particular +subcategory +} +\description{ +A function to get help about available cellbase resources +} +\details{ +This function retrieves available resources for each generic method +like getGene, getRegion, getprotein, etc. It help the user see all possible +resources to use with the getGeneric methods +} +\examples{ +cb <- CellBaseR() +# Get help about what resources are available to the getGene method +getCellBaseResourceHelp(cb, subcategory="gene") +# Get help about what resources are available to the getRegion method +getCellBaseResourceHelp(cb, subcategory="region") +# Get help about what resources are available to the getXref method +getCellBaseResourceHelp(cb, subcategory="id") +} diff --git a/clients/R/man/getChromosomeInfo-CellBaseR-method.Rd b/clients/R/man/getChromosomeInfo-CellBaseR-method.Rd new file mode 100644 index 0000000000..8b752b30da --- /dev/null +++ b/clients/R/man/getChromosomeInfo-CellBaseR-method.Rd @@ -0,0 +1,40 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/getChromosomeInfo-methods.R +\docType{methods} +\name{getChromosomeInfo,CellBaseR-method} +\alias{getChromosomeInfo,CellBaseR-method} +\alias{getChromosomeInfo} +\title{getChromosomeInfo} +\usage{ +\S4method{getChromosomeInfo}{CellBaseR}(object, ids, resource, param = NULL) +} +\arguments{ +\item{object}{an object of class CellBaseR} + +\item{ids}{a character vector of chromosome ids to be queried} + +\item{resource}{a character vector to specify the resource to be queried} + +\item{param}{a object of class CellBaseParam specifying additional param for +the query} +} +\value{ +a dataframe with the results of the query +} +\description{ +A method to query sequence data from Cellbase web services. +} +\details{ +A method to query sequence data from Cellbase web services. This +method retrieves information about chromosomes, including its size and +detailed information about its different cytobands +} +\examples{ + cb <- CellBaseR() + res <- getChromosomeInfo(object=cb, ids="22", resource="info") +} +\seealso{ +\url{https://github.com/opencb/cellbase/wiki} +and the RESTful API documentation +\url{http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/} +} diff --git a/clients/R/man/getClinical-CellBaseR-method.Rd b/clients/R/man/getClinical-CellBaseR-method.Rd new file mode 100644 index 0000000000..e2c3f7b36c --- /dev/null +++ b/clients/R/man/getClinical-CellBaseR-method.Rd @@ -0,0 +1,38 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/getClinical-methods.R +\docType{methods} +\name{getClinical,CellBaseR-method} +\alias{getClinical,CellBaseR-method} +\alias{getClinical} +\title{getClinical} +\usage{ +\S4method{getClinical}{CellBaseR}(object, param = NULL) +} +\arguments{ +\item{object}{an object of class CellBaseR} + +\item{param}{a object of class CellBaseParam specifying the parameters +limiting the CellBaseR} +} +\value{ +a dataframe with the results of the query +} +\description{ +A method to query Clinical data from Cellbase web services. +} +\details{ +This method retrieves clinicaly relevant variants annotations from +multiple resources including clinvar, cosmic and gwas catalog. Furthermore, + the user can filter these data in many ways including phenotype, genes, rs, + etc,. +} +\examples{ + cb <- CellBaseR() + cbParam <- CellBaseParam(gene=c("TP73","TET1")) + res <- getClinical(object=cb,param=cbParam) +} +\seealso{ +\url{https://github.com/opencb/cellbase/wiki} +and the RESTful API documentation +\url{http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/} +} diff --git a/clients/R/man/getClinicalByGene.Rd b/clients/R/man/getClinicalByGene.Rd new file mode 100644 index 0000000000..c34e139616 --- /dev/null +++ b/clients/R/man/getClinicalByGene.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/user.R +\name{getClinicalByGene} +\alias{getClinicalByGene} +\title{getClinicalByGene} +\usage{ +getClinicalByGene(object, id, param = NULL) +} +\arguments{ +\item{object}{an object of CellBaseR class} + +\item{id}{a charcter vector of HUGO symbol (gene names)} + +\item{param}{an object of class CellBaseParam} +} +\value{ +a dataframe of the query result +} +\description{ +A convienice method to fetch clinical variants for specific gene/s +} +\examples{ +cb <- CellBaseR() +res <- getClinicalByGene(cb, "TET1") +} diff --git a/clients/R/man/getClinicalByRegion.Rd b/clients/R/man/getClinicalByRegion.Rd new file mode 100644 index 0000000000..2f68678d68 --- /dev/null +++ b/clients/R/man/getClinicalByRegion.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/user.R +\name{getClinicalByRegion} +\alias{getClinicalByRegion} +\title{getClinicalByRegion} +\usage{ +getClinicalByRegion(object, id, param = NULL) +} +\arguments{ +\item{object}{an object of class CellBaseR} + +\item{id}{a charcter vector of genomic regions, eg 17:1000000-1100000} + +\item{param}{an object of class CellBaseParam} +} +\value{ +a dataframe of the query result +} +\description{ +A convienice method to fetch clinical variants for specific region/s +} +\examples{ +cb <- CellBaseR() +res <- getClinicalByRegion(cb, "17:1000000-1189811") +} diff --git a/clients/R/man/getConservationByRegion.Rd b/clients/R/man/getConservationByRegion.Rd new file mode 100644 index 0000000000..1863c69334 --- /dev/null +++ b/clients/R/man/getConservationByRegion.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/user.R +\name{getConservationByRegion} +\alias{getConservationByRegion} +\title{getConservationByRegion} +\usage{ +getConservationByRegion(object, id, param = NULL) +} +\arguments{ +\item{object}{an object of class CellBaseR} + +\item{id}{a charcter vector of genomic regions, eg 17:1000000-1100000} + +\item{param}{an object of class CellBaseParam} +} +\value{ +a dataframe of the query result +} +\description{ +A convienice method to fetch conservation data for specific region/s +} +\examples{ +cb <- CellBaseR() +res <- getConservationByRegion(cb, "17:1000000-1189811") +} diff --git a/clients/R/man/getGene-CellBaseR-method.Rd b/clients/R/man/getGene-CellBaseR-method.Rd new file mode 100644 index 0000000000..4f7a2e29aa --- /dev/null +++ b/clients/R/man/getGene-CellBaseR-method.Rd @@ -0,0 +1,39 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/getGene-methods.R +\docType{methods} +\name{getGene,CellBaseR-method} +\alias{getGene,CellBaseR-method} +\alias{getGene} +\title{getGene} +\usage{ +\S4method{getGene}{CellBaseR}(object, ids, resource, param = NULL) +} +\arguments{ +\item{object}{an object of class CellBaseR} + +\item{ids}{a character vector of gene ids to be queried} + +\item{resource}{a character vector to specify the resource to be queried} + +\item{param}{an object of class CellBaseParam specifying additional param +for the CellBaseR} +} +\value{ +a dataframe with the results of the query +} +\description{ +A method to query gene data from Cellbase web services. +} +\details{ +This method retrieves various gene annotations including transcripts +and exons data as well as gene expression and clinical data +} +\examples{ + cb <- CellBaseR() + res <- getGene(object=cb, ids=c("TP73","TET1"), resource="info") +} +\seealso{ +\url{https://github.com/opencb/cellbase/wiki} +and the RESTful API documentation +\url{http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/} +} diff --git a/clients/R/man/getGeneInfo.Rd b/clients/R/man/getGeneInfo.Rd new file mode 100644 index 0000000000..15f18223a4 --- /dev/null +++ b/clients/R/man/getGeneInfo.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/user.R +\name{getGeneInfo} +\alias{getGeneInfo} +\title{getGeneInfo} +\usage{ +getGeneInfo(object, id, param = NULL) +} +\arguments{ +\item{object}{an object of class CellBaseR} + +\item{id}{a charcter vector of HUGO symbol (gene names)} + +\item{param}{an object of class CellBaseParam} +} +\value{ +a dataframe of the query result +} +\description{ +A convienice method to fetch gene annotations specific gene/s +} +\examples{ +cb <- CellBaseR() +res <- getGeneInfo(cb, "TET1") +} diff --git a/clients/R/man/getMeta-CellBaseR-method.Rd b/clients/R/man/getMeta-CellBaseR-method.Rd new file mode 100644 index 0000000000..bfff5a385e --- /dev/null +++ b/clients/R/man/getMeta-CellBaseR-method.Rd @@ -0,0 +1,36 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/getMeta-methods.R +\docType{methods} +\name{getMeta,CellBaseR-method} +\alias{getMeta,CellBaseR-method} +\alias{getMeta} +\title{getMeta} +\usage{ +\S4method{getMeta}{CellBaseR}(object, resource) +} +\arguments{ +\item{object}{an object of class CellBaseR} + +\item{resource}{the resource you want to query it metadata} +} +\value{ +a dataframe with the + results of the query +} +\description{ +A method for getting the available metadata from the cellbase web services +} +\details{ +This method is for getting information about the avaialable species +and available annotation, assembly for each species from the cellbase web +services. +} +\examples{ + cb <- CellBaseR() + res <- getMeta(object=cb, resource="species") +} +\seealso{ +\url{https://github.com/opencb/cellbase/wiki} +and the RESTful API documentation +\url{http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/} +} diff --git a/clients/R/man/getProtein-CellBaseR-method.Rd b/clients/R/man/getProtein-CellBaseR-method.Rd new file mode 100644 index 0000000000..73831945ff --- /dev/null +++ b/clients/R/man/getProtein-CellBaseR-method.Rd @@ -0,0 +1,36 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/getProtein-methods.R +\docType{methods} +\name{getProtein,CellBaseR-method} +\alias{getProtein,CellBaseR-method} +\alias{getProtein} +\title{getProtein} +\usage{ +\S4method{getProtein}{CellBaseR}(object, ids, resource, param = NULL) +} +\arguments{ +\item{object}{an object of class CellBaseR} + +\item{ids}{a character vector of uniprot ids to be queried, should be one +or more of uniprot ids, for example O15350.} + +\item{resource}{a character vector to specify the resource to be queried} + +\item{param}{a object of class CellBaseParam specifying additional param +for the query} +} +\value{ +an object of class CellBaseResponse which holds a dataframe with th +e results of the query +} +\description{ +A method to query protein data from Cellbase web services. +} +\details{ +This method retrieves various protein annotations including +protein description, features, sequence, substitution scores, evidence, etc. +} +\examples{ + cb <- CellBaseR() + res <- getProtein(object=cb, ids="O15350", resource="info") +} diff --git a/clients/R/man/getProteinInfo.Rd b/clients/R/man/getProteinInfo.Rd new file mode 100644 index 0000000000..ef48f0dca0 --- /dev/null +++ b/clients/R/man/getProteinInfo.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/user.R +\name{getProteinInfo} +\alias{getProteinInfo} +\title{getProteinInfo} +\usage{ +getProteinInfo(object, id, param = NULL) +} +\arguments{ +\item{object}{an object of class CellBaseR} + +\item{id}{a charcter vector of Uniprot Ids} + +\item{param}{an object of class CellBaseParam} +} +\value{ +a dataframe of the query result +} +\description{ +A convienice method to fetch annotations for specific protein/s +} +\examples{ +cb <- CellBaseR() +res <- getProteinInfo(cb, "O15350") +} diff --git a/clients/R/man/getRegion-CellBaseR-method.Rd b/clients/R/man/getRegion-CellBaseR-method.Rd new file mode 100644 index 0000000000..892e2c996c --- /dev/null +++ b/clients/R/man/getRegion-CellBaseR-method.Rd @@ -0,0 +1,42 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/getRegion-methods.R +\docType{methods} +\name{getRegion,CellBaseR-method} +\alias{getRegion,CellBaseR-method} +\alias{getRegion} +\title{getRegion} +\usage{ +\S4method{getRegion}{CellBaseR}(object, ids, resource, param = NULL) +} +\arguments{ +\item{object}{an object of class CellBaseR} + +\item{ids}{a character vector of the regions to be queried, for example, + "1:1000000-1200000' should always be in the +form 'chr:start-end'} + +\item{resource}{a character vector to specify the resource to be queried} + +\item{param}{a object of class CellBaseParam specifying additional param +for the query} +} +\value{ +a dataframe with the results of the query +} +\description{ +A method to query features within a genomic region from Cellbase web + services. +} +\details{ +This method retrieves various genomic features from a given +region including genes, snps, clincally relevant variants, proteins, etc. +} +\examples{ + cb <- CellBaseR() + res <- getRegion(object=cb, ids="17:1000000-1200000", resource="gene") +} +\seealso{ +\url{https://github.com/opencb/cellbase/wiki} +and the RESTful API documentation +\url{http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/} +} diff --git a/clients/R/man/getRegulatoryByRegion.Rd b/clients/R/man/getRegulatoryByRegion.Rd new file mode 100644 index 0000000000..a5dead28ae --- /dev/null +++ b/clients/R/man/getRegulatoryByRegion.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/user.R +\name{getRegulatoryByRegion} +\alias{getRegulatoryByRegion} +\title{getRegulatoryByRegion} +\usage{ +getRegulatoryByRegion(object, id, param = NULL) +} +\arguments{ +\item{object}{an object of class CellBaseR} + +\item{id}{a charcter vector of genomic regions, eg 17:1000000-1100000} + +\item{param}{an object of class CellBaseParam} +} +\value{ +a dataframe of the query result +} +\description{ +A convienice method to fetch regulatory data for specific region/s +} +\examples{ +cb <- CellBaseR() +res <- getRegulatoryByRegion(cb, "17:1000000-1189811") +} diff --git a/clients/R/man/getSnp-CellBaseR-method.Rd b/clients/R/man/getSnp-CellBaseR-method.Rd new file mode 100644 index 0000000000..a1486e9614 --- /dev/null +++ b/clients/R/man/getSnp-CellBaseR-method.Rd @@ -0,0 +1,43 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/getSnp-methods.R +\docType{methods} +\name{getSnp,CellBaseR-method} +\alias{getSnp,CellBaseR-method} +\alias{getSnp} +\title{getSnp} +\usage{ +\S4method{getSnp}{CellBaseR}(object, ids, resource, param = NULL) +} +\arguments{ +\item{object}{an object of class CellBaseR} + +\item{ids}{a character vector of the ids to be queried, must be a valid rsid, +for example 'rs6025'} + +\item{resource}{a character vector to specify the resource to be queried} + +\item{param}{a object of class CellBaseParam specifying additional param +for the query} +} +\value{ +a dataframe with the results of the query +} +\description{ +A method to query genomic variation data from Cellbase web services. +} +\details{ +. + +This method retrieves known genomic variants (snps) and their +annotations including population frequncies from 1k genomes and Exac projects +as well as clinical data and various other annotations +} +\examples{ +cb <- CellBaseR() +res <- getSnp(object=cb, ids="rs6025", resource="info") +} +\seealso{ +\url{https://github.com/opencb/cellbase/wiki} +and the RESTful API documentation +\url{http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/} +} diff --git a/clients/R/man/getSnpByGene.Rd b/clients/R/man/getSnpByGene.Rd new file mode 100644 index 0000000000..efb4caf44f --- /dev/null +++ b/clients/R/man/getSnpByGene.Rd @@ -0,0 +1,26 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/user.R +\name{getSnpByGene} +\alias{getSnpByGene} +\title{getSnpByGene} +\usage{ +getSnpByGene(object, id, param = NULL) +} +\arguments{ +\item{object}{an object of class CellBaseR} + +\item{id}{a charcter vector of HUGO symbol (gene names)} + +\item{param}{an object of class CellBaseParam} +} +\value{ +a dataframe of the query result +} +\description{ +A convienice method to fetch known variants (snps) for specific gene/s +} +\examples{ +cb <- CellBaseR() +param <- CellBaseParam(limit = 10) +res <- getSnpByGene(cb, "TET1", param = param) +} diff --git a/clients/R/man/getTf-CellBaseR-method.Rd b/clients/R/man/getTf-CellBaseR-method.Rd new file mode 100644 index 0000000000..ef1a11b09e --- /dev/null +++ b/clients/R/man/getTf-CellBaseR-method.Rd @@ -0,0 +1,43 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/getTf-methods.R +\docType{methods} +\name{getTf,CellBaseR-method} +\alias{getTf,CellBaseR-method} +\alias{getTf} +\title{getTf} +\usage{ +\S4method{getTf}{CellBaseR}(object, ids, resource, param = NULL) +} +\arguments{ +\item{object}{an object of class CellBaseR} + +\item{ids}{a character vector of the ids to be queried, must be a valid +transcription factor name, for example, +eg, CTCF} + +\item{resource}{a character vector to specify the resource to be queried} + +\item{param}{a object of class CellBaseParam specifying additional param +for the query} +} +\value{ +a dataframe with the results of the query +} +\description{ +A method to query transcription factors binding sites data from Cellbase web + services. +} +\details{ +This method retrieves various transcription factors binding sites +data +} +\examples{ + cb <- CellBaseR() + param <- CellBaseParam(limit = 12) + res <- getTf(object=cb, ids="CTCF", resource="tfbs", param=param) +} +\seealso{ +\url{https://github.com/opencb/cellbase/wiki} +and the RESTful API documentation +\url{http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/} +} diff --git a/clients/R/man/getTfbsByRegion.Rd b/clients/R/man/getTfbsByRegion.Rd new file mode 100644 index 0000000000..08799f8d42 --- /dev/null +++ b/clients/R/man/getTfbsByRegion.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/user.R +\name{getTfbsByRegion} +\alias{getTfbsByRegion} +\title{getTfbsByRegion} +\usage{ +getTfbsByRegion(object, id, param = NULL) +} +\arguments{ +\item{object}{an object of class CellBaseR} + +\item{id}{a charcter vector of genomic regions, eg 17:1000000-1100000} + +\item{param}{an object of class CellBaseParam} +} +\value{ +a dataframe of the query result +} +\description{ +A convienice method to fetch Transcription facrots data for specific region/s +} +\examples{ +cb <- CellBaseR() +res <- getTfbsByRegion(cb, "17:1000000-1189811") +} diff --git a/clients/R/man/getTranscript-CellBaseR-method.Rd b/clients/R/man/getTranscript-CellBaseR-method.Rd new file mode 100644 index 0000000000..c00909663a --- /dev/null +++ b/clients/R/man/getTranscript-CellBaseR-method.Rd @@ -0,0 +1,40 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/getTranscript-methods.R +\docType{methods} +\name{getTranscript,CellBaseR-method} +\alias{getTranscript,CellBaseR-method} +\alias{getTranscript} +\title{getTranscript} +\usage{ +\S4method{getTranscript}{CellBaseR}(object, ids, resource, param = NULL) +} +\arguments{ +\item{object}{an object of class CellBaseR} + +\item{ids}{a character vector of the transcript ids to be queried, use +ensemble transccript IDs eq, ENST00000380152} + +\item{resource}{a character vector to specify the resource to be queried} + +\item{param}{an object of class CellBaseParam specifying additional params +for the query} +} +\value{ +a dataframe with the results of the query +} +\description{ +A method to query transcript data from Cellbase web services. +} +\details{ +This method retrieves various genomic annotations for transcripts + including exons, cDNA sequence, annotations flags, and cross references,etc. +} +\examples{ + cb <- CellBaseR() + res <- getTranscript(object=cb, ids="ENST00000373644", resource="info") +} +\seealso{ +\url{https://github.com/opencb/cellbase/wiki} +and the RESTful API documentation +\url{http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/} +} diff --git a/clients/R/man/getTranscriptByGene.Rd b/clients/R/man/getTranscriptByGene.Rd new file mode 100644 index 0000000000..696f9700ad --- /dev/null +++ b/clients/R/man/getTranscriptByGene.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/user.R +\name{getTranscriptByGene} +\alias{getTranscriptByGene} +\title{getTranscriptByGene} +\usage{ +getTranscriptByGene(object, id, param = NULL) +} +\arguments{ +\item{object}{an object of class CellBaseR} + +\item{id}{a charcter vector of HUGO symbol (gene names)} + +\item{param}{an object of class CellBaseParam} +} +\value{ +a dataframe of the query result +} +\description{ +A convienice method to fetch transcripts for specific gene/s +} +\examples{ +cb <- CellBaseR() +res <- getTranscriptByGene(cb, "TET1") +} diff --git a/clients/R/man/getVariant-CellBaseR-method.Rd b/clients/R/man/getVariant-CellBaseR-method.Rd new file mode 100644 index 0000000000..1d28d2ca9b --- /dev/null +++ b/clients/R/man/getVariant-CellBaseR-method.Rd @@ -0,0 +1,44 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/getVariant-methods.R +\docType{methods} +\name{getVariant,CellBaseR-method} +\alias{getVariant,CellBaseR-method} +\alias{getVariant} +\title{getVariant} +\usage{ +\S4method{getVariant}{CellBaseR}(object, ids, resource, param = NULL) +} +\arguments{ +\item{object}{an object of class CellBaseR} + +\item{ids}{a character vector of the ids to be queried, must be in the +following format 'chr:start:ref:alt', for +example, '1:128546:A:T'} + +\item{resource}{a character vector to specify the resource to be queried} + +\item{param}{a object of class CellBaseParam specifying additional param +for the query} +} +\value{ +a dataframe with the results of the query +} +\description{ +A method to query variant annotation data from Cellbase web services from + Cellbase web services. +} +\details{ +This method retrieves extensive genomic annotations for variants +including consequence types, conservation data, population frequncies from 1k + genomes and Exac projects, etc. +as well as clinical data and various other annotations +} +\examples{ + cb <- CellBaseR() + res <- getVariant(object=cb, ids="19:45411941:T:C", resource="annotation") +} +\seealso{ +\url{https://github.com/opencb/cellbase/wiki} +and the RESTful API documentation +\url{http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/} +} diff --git a/clients/R/man/getVariantAnnotation.Rd b/clients/R/man/getVariantAnnotation.Rd new file mode 100644 index 0000000000..12149d481a --- /dev/null +++ b/clients/R/man/getVariantAnnotation.Rd @@ -0,0 +1,26 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/user.R +\name{getVariantAnnotation} +\alias{getVariantAnnotation} +\title{getVariantAnnotation} +\usage{ +getVariantAnnotation(object, id, param = NULL) +} +\arguments{ +\item{object}{an object of class CellBaseR} + +\item{id}{a charcter vector of length < 200 of genomic variants, +eg 19:45411941:T:C} + +\item{param}{an object of class CellBaseParam} +} +\value{ +a dataframe of the query result +} +\description{ +A convienice method to fetch variant annotation for specific variant/s +} +\examples{ +cb <- CellBaseR() +res <- getVariantAnnotation(cb, "19:45411941:T:C") +} diff --git a/clients/R/man/getXref-CellBaseR-method.Rd b/clients/R/man/getXref-CellBaseR-method.Rd new file mode 100644 index 0000000000..7ea73a8623 --- /dev/null +++ b/clients/R/man/getXref-CellBaseR-method.Rd @@ -0,0 +1,42 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/getXref-methods.R +\docType{methods} +\name{getXref,CellBaseR-method} +\alias{getXref,CellBaseR-method} +\alias{getXref} +\title{getXref} +\usage{ +\S4method{getXref}{CellBaseR}(object, ids, resource, param = NULL) +} +\arguments{ +\item{object}{an object of class CellBaseR} + +\item{ids}{a character vector of the ids to be queried, any crossrefereable + ID, gene names, transcript ids, +uniprot ids,etc.} + +\item{resource}{a character vector to specify the resource to be queried} + +\item{param}{a object of class CellBaseParam specifying additional param +for the query} +} +\value{ +a dataframe with the results of the query +} +\description{ +A method to query cross reference data from Cellbase web services. +} +\details{ +This method retrieves cross references for genomic identifiers, eg +ENSEMBL ids, it also provide starts_with service that is useful for +autocomplete services. +} +\examples{ + cb <- CellBaseR() + res <- getXref(object=cb, ids="ENST00000373644", resource="xref") +} +\seealso{ +\url{https://github.com/opencb/cellbase/wiki} +and the RESTful API documentation +\url{http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/} +} diff --git a/clients/R/vignettes/cellbaseR.Rmd b/clients/R/vignettes/cellbaseR.Rmd index 4c58081450..3bce5ff940 100644 --- a/clients/R/vignettes/cellbaseR.Rmd +++ b/clients/R/vignettes/cellbaseR.Rmd @@ -2,7 +2,7 @@ title: "Simplifying Genomic Annotations in R" author: "Mohammed Omar Elsiddieg Abdallah" date: "`r doc_date()`" -package: "`r pkg_ver('BiocStyle')`" +package: "`r pkg_ver('cellbaseR')`" # BiocStyle::html_document vignette: > %\VignetteIndexEntry{"Simplifying Genomic Annotations in R"} @@ -32,53 +32,35 @@ Cellbase web services. Let us start by loading the library. library(cellbaseR) # A default cellbaseR object is created as follows cb <- CellBaseR() -# to change the default species from human to mouse for example -mm <-CellBaseR(species = "mmsculus") - -``` - -You can see the avaiable species and their corresonding data by -running the cbSpecies method passing the CellbBseR object you just created - -```{r, message=FALSE, warning=FALSE} -library(cellbaseR) -cb <- CellBaseR() -sp <- cbSpeciesClient(object = cb) -# This will give you a CellbaseResult object -# to get the dataframe of all available species -sp <- cbData(sp) -str(sp,1) - ``` ## The CellbaseR Methods -In addition to the cbSpecies you have seen already, The cellbaseR package +The cellbaseR package provide many methods to query the cellbase webservices, they include: -- cbGeneClient -- cbSnpClient -- cbProteinClient -- cbTranscriptClient -- cbRegionClient -- cbVariantClient -- cbXrefClient -- cbClinicalClient +- getGene +- getSnp +- getProtein +- getTranscript +- getRegion +- getVariant +- getClinical +- getTf +- getXref + In all cases the user is expected to provide the ids for the query and the resource to be queried, in addition to the CellbaseQuery object they created. For example, a query through the cbGene will look something like this -### cbGeneClient +### getGene ```{r, message=FALSE, warning=FALSE} library(cellbaseR) cb <- CellBaseR() genes <- c("TP73","TET1") - -res <- cbGeneClient(object = cb, ids = genes, resource = "info") -# to get the resulting data.frame run cellbaseData() -res <- cbData(object = res) +res <- getGene(object = cb, ids = genes, resource = "info") str(res,2) -# as you can see the res dataframe also contains a transcriots column +# as you can see the res dataframe also contains a transcripts column # which is in fact a list column of nested dataframes, to get the # trasnscripts data.frame for first gene TET1_transcripts <- res$transcripts[[1]] @@ -86,28 +68,27 @@ str(TET1_transcripts,1) ``` -### cbRegionClient +### getRegion ```{r, message=FALSE, warning=FALSE} # making a query through cbRegion to get all the clinically relevant variants # in a specific region library(cellbaseR) cb <- CellBaseR() -res <- cbRegionClient(object=cb,ids="17:1000000-1100000", +res <- getRegion(object=cb,ids="17:1000000-1005000", resource="clinical") # to get all conservation data in this region -res <- cbRegionClient(object=cb,ids="17:1000000-1100000", +res <- getRegion(object=cb,ids="17:1000000-1005000", resource="conservation") #likewise to get all the regulatory data for the same region -res <- cbRegionClient(object=cb,ids="17:1000000-1100000", resource="regulatory") -res <- cbData(res) +res <- getRegion(object=cb,ids="17:1000000-1005000", resource="regulatory") str(res,1) ``` -### cbVraiantClient +### getVariant Getting annotation for a specific variant ```{r, eval=FALSE,message=FALSE, warning=FALSE} library(cellbaseR) cb <- CellBaseR() -res2 <- cbVariantClient(object=cb, ids="1:169549811:A:G", resource="annotation") +res2 <- getVariant(object=cb, ids="1:169549811:A:G", resource="annotation") # to get the data res2 <- cbData(res2) str(res2, 1) @@ -116,20 +97,18 @@ str(res2, 1) A very powerfull feature of cellbaseR is ability to fetch a wealth of clinical data, as well as abiliy to fiter these data by gene, phenotype, rs, etc… -### cbClinical +### getClinical ```{r, eval=TRUE, message=FALSE, warning=FALSE} library(cellbaseR) cb <- CellBaseR() -# First we have to specify aour filters, we do that by creating an object of +# First we have to specify aour param, we do that by creating an object of # class CellbaseParam cbparam <- CellBaseParam(gene="TET1", genome="GRCh38") cbparam -# Note that cbClinical does NOT require any Ids to be passed, only the filters +# Note that cbClinical does NOT require any Ids to be passed, only the param # and of course the CellbaseQuery object -res <- cbClinicalClient(object=cb,filters=cbparam) -res -res <- cbData(res) +res <- getClinical(object=cb,param=cbparam) str(res,1) ``` @@ -139,32 +118,33 @@ str(res,1) A usefull utility for fast building of gene models, compatible with Gviz package for genomic visualization -```{r,message=FALSE, warning=FALSE, eval=FALSE} +```{r,message=FALSE, warning=FALSE, eval=TRUE} library(cellbaseR) cb <- CellBaseR() test <- createGeneModel(object = cb, region = "17:1500000-1550000") -library(Gviz) -testTrack <- GeneRegionTrack(test) -plotTracks(testTrack, transcriptAnnotation='symbol') -# then you can use this track in conjunction with any other tracks -ideoTrack <- IdeogramTrack(genome = "hg19", chromosome = "chr17") -axisTrack <- GenomeAxisTrack() -from <- min(test$start)-5000 -to <- max(test$end)+5000 -plotTracks(list(ideoTrack,axisTrack,testTrack),from = from, to = to, transcriptAnnotation='symbol') - +if(require("Gviz")){ + testTrack <- Gviz::GeneRegionTrack(test) + Gviz::plotTracks(testTrack, transcriptAnnotation='symbol') +} ``` -## cbAnnotateVcf -This utility allows users to annoate genomic variants from small to medium-sized vcf files directly from the cellbase server, with a wealth of genomic annotations including riche clinical annotations like clinvar, gwas, and cosmic data, as well as conservation and functional scores like phast and cadd scores, without the need to download any files. -```{r, message=FALSE, warning=FALSE, eval=FALSE} +## AnnotateVcf +This utility allows users to annoate genomic variants from small to medium-sized +vcf files directly from the cellbase server, with a wealth of genomic +annotations including riche clinical annotations like clinvar, gwas, and cosmic +data, as well as conservation and functional scores like phast and cadd scores +, without the need to download any files. +```{r, message=FALSE, warning=FALSE, eval=TRUE} library(cellbaseR) +library(VariantAnnotation) cb <- CellBaseR() -fl <- system.file("extdata", "chr22.vcf.gz", package="VariantAnnotation") -res <- cbAnnotateVcf(object=cb, file=fl) -res <- cbData(res) -res +fl <- system.file("extdata", "hapmap_exome_chr22_500.vcf.gz",package = "cellbaseR" ) +res <- AnnotateVcf(object=cb, file=fl, BPPARAM = bpparam(workers=2)) +vcf <- readVcf(fl, "hg19") +samples(header(vcf)) +length(rowRanges(vcf))==nrow(res) +str(res,1) ```