Commit 73633507 authored by Aurelien Brionne's avatar Aurelien Brionne
Browse files

merge_enrich_terms update for Ensembl

parent 08efc447
Package: ViSEAGO Package: ViSEAGO
Version: 1.7.2 Version: 1.7.3
Title: ViSEAGO: a Bioconductor package for clustering biological functions using Gene Ontology and semantic similarity Title: ViSEAGO: a Bioconductor package for clustering biological functions using Gene Ontology and semantic similarity
Author: Aurelien Brionne [aut, cre], Author: Aurelien Brionne [aut, cre],
Amelie Juanchich [aut], Amelie Juanchich [aut],
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#' @importFrom biomaRt useEnsembl listEnsembl listEnsemblGenomes useEnsemblGenomes listDatasets #' @importFrom biomaRt useEnsembl listEnsembl listEnsemblGenomes useEnsemblGenomes listDatasets
#' @importFrom data.table data.table #' @importFrom data.table data.table
#' @param biomart the biomart name available with \pkg{biomaRt} package \code{\link[biomaRt]{listEnsembl}} ("genes", the default) or \code{\link[biomaRt]{listEnsemblGenomes}} ("protists_mart", "fungi_mart", "plants_mart"). #' @param biomart the biomart name available with \pkg{biomaRt} package \code{\link[biomaRt]{listEnsembl}} ("genes", the default) or \code{\link[biomaRt]{listEnsemblGenomes}} ("protists_mart", "fungi_mart", "plants_mart").
#' @param GRCh GRCh version to connect to if not the current GRCh38, currently this can only be 37
#' @param version the annotation version to use (eg. NULL for the default current version, or a version number in \code{character}) #' @param version the annotation version to use (eg. NULL for the default current version, or a version number in \code{character})
#' @family genomic_ressource #' @family genomic_ressource
#' @details #' @details
...@@ -27,11 +28,12 @@ ...@@ -27,11 +28,12 @@
#' # List Ensembl available organisms #' # List Ensembl available organisms
#' Ensembl<-ViSEAGO::Ensembl2GO( #' Ensembl<-ViSEAGO::Ensembl2GO(
#' biomart="genes", #' biomart="genes",
#' GRCh = NULL,
#' version=NULL #' version=NULL
#' ) #' )
#' } #' }
#' @export #' @export
Ensembl2GO=function(biomart="genes",version=NULL){ Ensembl2GO=function(biomart="genes",GRCh = NULL,version=NULL){
# check the ensembl host versus mart name # check the ensembl host versus mart name
match.arg(biomart,c("genes","protists_mart","fungi_mart","metazoa_mart","plants_mart")) match.arg(biomart,c("genes","protists_mart","fungi_mart","metazoa_mart","plants_mart"))
...@@ -40,10 +42,17 @@ Ensembl2GO=function(biomart="genes",version=NULL){ ...@@ -40,10 +42,17 @@ Ensembl2GO=function(biomart="genes",version=NULL){
if(biomart=="genes"){ if(biomart=="genes"){
# check the ensembl genes releases # check the ensembl genes releases
Ensembl<-listEnsembl(version=version) Ensembl<-listEnsembl(
GRCh =GRCh,
version=version
)
# connect to Ensembl # connect to Ensembl
mart<-useEnsembl(biomart,version=version) mart<-useEnsembl(
biomart,
GRCh =GRCh,
version=version
)
}else{ }else{
...@@ -58,7 +67,7 @@ Ensembl2GO=function(biomart="genes",version=NULL){ ...@@ -58,7 +67,7 @@ Ensembl2GO=function(biomart="genes",version=NULL){
new( new(
"genomic_ressource", "genomic_ressource",
db="Ensembl", db="Ensembl",
stamp=paste(biomart,Ensembl$version[Ensembl$biomart==biomart]), stamp=paste(biomart,GRCh,Ensembl$version[Ensembl$biomart==biomart]),
data=data.table(), data=data.table(),
mart=list(mart), mart=list(mart),
organisms=data.table(listDatasets(mart)) organisms=data.table(listDatasets(mart))
......
...@@ -493,21 +493,31 @@ setMethod( ...@@ -493,21 +493,31 @@ setMethod(
# if db match to Ensembl # if db match to Ensembl
if(db[1]=="Ensembl"){ if(db[1]=="Ensembl"){
if(db[3]!="http://grch37.ensembl.org"){ if(db[4]==""){
# connect to Ensembl # Connect to Ensembl
mart<-useEnsembl( if(db[3]=="genes"){
biomart="genes",
host=db[3],
version=db[6]
)
# connect to Ensembl
mart<-useEnsembl(
biomart=db[3],
version=tail(db,n=1)
)
}else{
# connect to Ensembl
mart<-useEnsemblGenomes(
biomart=db[3]
)
}
}else{ }else{
# connect to Ensembl # connect to Ensembl
mart<-useEnsembl( mart<-useEnsembl(
biomart="genes", biomart="genes",
GRCh =37, GRCh =db[4],
version=db[6] version=tail(db,n=1)
) )
} }
......
...@@ -27,7 +27,7 @@ remotes::install_gitlab( ...@@ -27,7 +27,7 @@ remotes::install_gitlab(
devtools::build("ViSEAGO") devtools::build("ViSEAGO")
# install package (from R console) # install package (from R console)
install.packages("ViSEAGO_1.7.1.tar.gz", repos = NULL, type = "source") install.packages("ViSEAGO_1.7.3.tar.gz", repos = NULL, type = "source")
``` ```
## Citation ## Citation
......
...@@ -4,11 +4,13 @@ ...@@ -4,11 +4,13 @@
\alias{Ensembl2GO} \alias{Ensembl2GO}
\title{Check available organisms datasets at Ensembl.} \title{Check available organisms datasets at Ensembl.}
\usage{ \usage{
Ensembl2GO(biomart = "genes", version = NULL) Ensembl2GO(biomart = "genes", GRCh = NULL, version = NULL)
} }
\arguments{ \arguments{
\item{biomart}{the biomart name available with \pkg{biomaRt} package \code{\link[biomaRt]{listEnsembl}} ("genes", the default) or \code{\link[biomaRt]{listEnsemblGenomes}} ("protists_mart", "fungi_mart", "plants_mart").} \item{biomart}{the biomart name available with \pkg{biomaRt} package \code{\link[biomaRt]{listEnsembl}} ("genes", the default) or \code{\link[biomaRt]{listEnsemblGenomes}} ("protists_mart", "fungi_mart", "plants_mart").}
\item{GRCh}{GRCh version to connect to if not the current GRCh38, currently this can only be 37}
\item{version}{the annotation version to use (eg. NULL for the default current version, or a version number in \code{character})} \item{version}{the annotation version to use (eg. NULL for the default current version, or a version number in \code{character})}
} }
\value{ \value{
...@@ -29,6 +31,7 @@ biomaRt::listEnsembl() ...@@ -29,6 +31,7 @@ biomaRt::listEnsembl()
# List Ensembl available organisms # List Ensembl available organisms
Ensembl<-ViSEAGO::Ensembl2GO( Ensembl<-ViSEAGO::Ensembl2GO(
biomart="genes", biomart="genes",
GRCh = NULL,
version=NULL version=NULL
) )
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment