Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

latest version of cellbaseR #334

Open
wants to merge 1 commit into
base: feature/services
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions clients/R/Bioc_Sub.Rproj
Original file line number Diff line number Diff line change
@@ -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
79 changes: 25 additions & 54 deletions clients/R/DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>
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
46 changes: 27 additions & 19 deletions clients/R/NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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)
48 changes: 21 additions & 27 deletions clients/R/R/AllClasses.R
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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
Expand All @@ -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",
Expand Down
115 changes: 51 additions & 64 deletions clients/R/R/AllGenerics.R
Original file line number Diff line number Diff line change
@@ -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"))

Loading