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

merge_enrich_terms update for Ensembl

parent 08efc447
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
Author: Aurelien Brionne [aut, cre],
Amelie Juanchich [aut],
......
......@@ -3,6 +3,7 @@
#' @importFrom biomaRt useEnsembl listEnsembl listEnsemblGenomes useEnsemblGenomes listDatasets
#' @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 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})
#' @family genomic_ressource
#' @details
......@@ -27,11 +28,12 @@
#' # List Ensembl available organisms
#' Ensembl<-ViSEAGO::Ensembl2GO(
#' biomart="genes",
#' GRCh = NULL,
#' version=NULL
#' )
#' }
#' @export
Ensembl2GO=function(biomart="genes",version=NULL){
Ensembl2GO=function(biomart="genes",GRCh = NULL,version=NULL){
# check the ensembl host versus mart name
match.arg(biomart,c("genes","protists_mart","fungi_mart","metazoa_mart","plants_mart"))
......@@ -40,10 +42,17 @@ Ensembl2GO=function(biomart="genes",version=NULL){
if(biomart=="genes"){
# check the ensembl genes releases
Ensembl<-listEnsembl(version=version)
Ensembl<-listEnsembl(
GRCh =GRCh,
version=version
)
# connect to Ensembl
mart<-useEnsembl(biomart,version=version)
mart<-useEnsembl(
biomart,
GRCh =GRCh,
version=version
)
}else{
......@@ -58,7 +67,7 @@ Ensembl2GO=function(biomart="genes",version=NULL){
new(
"genomic_ressource",
db="Ensembl",
stamp=paste(biomart,Ensembl$version[Ensembl$biomart==biomart]),
stamp=paste(biomart,GRCh,Ensembl$version[Ensembl$biomart==biomart]),
data=data.table(),
mart=list(mart),
organisms=data.table(listDatasets(mart))
......
......@@ -493,21 +493,31 @@ setMethod(
# if db match to Ensembl
if(db[1]=="Ensembl"){
if(db[3]!="http://grch37.ensembl.org"){
if(db[4]==""){
# connect to Ensembl
mart<-useEnsembl(
biomart="genes",
host=db[3],
version=db[6]
)
# Connect to Ensembl
if(db[3]=="genes"){
# connect to Ensembl
mart<-useEnsembl(
biomart=db[3],
version=tail(db,n=1)
)
}else{
# connect to Ensembl
mart<-useEnsemblGenomes(
biomart=db[3]
)
}
}else{
# connect to Ensembl
mart<-useEnsembl(
biomart="genes",
GRCh =37,
version=db[6]
GRCh =db[4],
version=tail(db,n=1)
)
}
......
......@@ -27,7 +27,7 @@ remotes::install_gitlab(
devtools::build("ViSEAGO")
# 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
......
......@@ -4,11 +4,13 @@
\alias{Ensembl2GO}
\title{Check available organisms datasets at Ensembl.}
\usage{
Ensembl2GO(biomart = "genes", version = NULL)
Ensembl2GO(biomart = "genes", GRCh = NULL, version = NULL)
}
\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{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})}
}
\value{
......@@ -29,6 +31,7 @@ biomaRt::listEnsembl()
# List Ensembl available organisms
Ensembl<-ViSEAGO::Ensembl2GO(
biomart="genes",
GRCh = 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