Skip to content
Snippets Groups Projects
Commit 38998712 authored by Aurelien Brionne's avatar Aurelien Brionne
Browse files

show_heatmap upgrade

parent 41b6313b
No related branches found
No related tags found
No related merge requests found
Package: ViSEAGO Package: ViSEAGO
Version: 1.3.2 Version: 1.3.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],
......
...@@ -69,4 +69,5 @@ CHANGES IN VERSION 1.3 ...@@ -69,4 +69,5 @@ CHANGES IN VERSION 1.3
------------------------ ------------------------
o print graph with orca o print graph with orca
o Ensembl2GO() biomart update o Ensembl2GO() biomart update
o show_heatmap() upgrade
...@@ -8,9 +8,12 @@ ...@@ -8,9 +8,12 @@
#' @param object a \code{\link{GO_clusters-class}} object from \code{\link{GOterms_heatmap}} or \code{\link{GOclusters_heatmap}}. #' @param object a \code{\link{GO_clusters-class}} object from \code{\link{GOterms_heatmap}} or \code{\link{GOclusters_heatmap}}.
#' @param type could be "GOterms" to display GOterms clustering heatmap, or "GOclusters" to display GOclusters heatmap. #' @param type could be "GOterms" to display GOterms clustering heatmap, or "GOclusters" to display GOclusters heatmap.
#' @param file static image output file name (default to NULL). #' @param file static image output file name (default to NULL).
#' @param plotly_update update plotly html dependencies (default to FALSE).
#' @details #' @details
#' This method displays an interactive heatmap (if \code{file}=NULL) from \code{\link{GO_clusters-class}} object for "GOterms" or "GOclusters" type.\cr #' This method displays an interactive heatmap (if \code{file}=NULL) from \code{\link{GO_clusters-class}} object for "GOterms" or "GOclusters" type.\cr
#' A static png image could be printed by setting \code{file} argument. #' A static png image could be printed by setting \code{file} argument.\cr
#' Interactive heatmap cannot be displayed between two R versions.
#' Then interactive view (build with previous R version) can be updated to new R version using \code{plotly_update} argument setting to TRUE.
#' @return display or print heatmap. #' @return display or print heatmap.
#' @examples #' @examples
#' # load data example #' # load data example
...@@ -98,7 +101,7 @@ ...@@ -98,7 +101,7 @@
#' @exportMethod show_heatmap #' @exportMethod show_heatmap
setGeneric( setGeneric(
name="show_heatmap", name="show_heatmap",
def=function(object,type,file=NULL) { def=function(object,type,file=NULL,plotly_update=FALSE) {
standardGeneric("show_heatmap") standardGeneric("show_heatmap")
} }
) )
...@@ -111,7 +114,7 @@ setMethod( ...@@ -111,7 +114,7 @@ setMethod(
object="GO_clusters", object="GO_clusters",
type="character" type="character"
), ),
definition=function(object,type,file){ definition=function(object,type,file,plotly_update){
# check type argument # check type argument
type=match.arg(type,c("GOterms","GOclusters")) type=match.arg(type,c("GOterms","GOclusters"))
...@@ -126,6 +129,18 @@ setMethod( ...@@ -126,6 +129,18 @@ setMethod(
GOclusters=slot(object,"heatmap")$GOclusters GOclusters=slot(object,"heatmap")$GOclusters
) )
# redirect plotly html_dependency to local packages
if(plotly_update==TRUE){
for(i in seq_len(length(heatmap[["dependencies"]]))){
heatmap[["dependencies"]][[i]][["src"]][["file"]]<-gsub(
"^.+[[:digit:]]\\.[[:digit:]]",
.libPaths()[1],
heatmap[["dependencies"]][[i]][["src"]][["file"]]
)
}
}
# return interactive or static heatmap according file # return interactive or static heatmap according file
if(is.null(file)){ if(is.null(file)){
......
...@@ -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.3.2.tar.gz", repos = NULL, type = "source") install.packages("ViSEAGO_1.3.3.tar.gz", repos = NULL, type = "source")
``` ```
## Citation ## Citation
......
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
\alias{show_heatmap,GO_clusters,character-method} \alias{show_heatmap,GO_clusters,character-method}
\title{Display an interactive or static heatmap.} \title{Display an interactive or static heatmap.}
\usage{ \usage{
show_heatmap(object, type, file = NULL) show_heatmap(object, type, file = NULL, plotly_update = FALSE)
\S4method{show_heatmap}{GO_clusters,character}(object, type, file = NULL) \S4method{show_heatmap}{GO_clusters,character}(object, type, file = NULL, plotly_update = FALSE)
} }
\arguments{ \arguments{
\item{object}{a \code{\link{GO_clusters-class}} object from \code{\link{GOterms_heatmap}} or \code{\link{GOclusters_heatmap}}.} \item{object}{a \code{\link{GO_clusters-class}} object from \code{\link{GOterms_heatmap}} or \code{\link{GOclusters_heatmap}}.}
...@@ -15,6 +15,8 @@ show_heatmap(object, type, file = NULL) ...@@ -15,6 +15,8 @@ show_heatmap(object, type, file = NULL)
\item{type}{could be "GOterms" to display GOterms clustering heatmap, or "GOclusters" to display GOclusters heatmap.} \item{type}{could be "GOterms" to display GOterms clustering heatmap, or "GOclusters" to display GOclusters heatmap.}
\item{file}{static image output file name (default to NULL).} \item{file}{static image output file name (default to NULL).}
\item{plotly_update}{update plotly html dependencies (default to FALSE).}
} }
\value{ \value{
display or print heatmap. display or print heatmap.
...@@ -24,7 +26,9 @@ Display a heatmap in interactive or static mode. ...@@ -24,7 +26,9 @@ Display a heatmap in interactive or static mode.
} }
\details{ \details{
This method displays an interactive heatmap (if \code{file}=NULL) from \code{\link{GO_clusters-class}} object for "GOterms" or "GOclusters" type.\cr This method displays an interactive heatmap (if \code{file}=NULL) from \code{\link{GO_clusters-class}} object for "GOterms" or "GOclusters" type.\cr
A static png image could be printed by setting \code{file} argument. A static png image could be printed by setting \code{file} argument.\cr
Interactive heatmap cannot be displayed between two R versions.
Then interactive view (build with previous R version) can be updated to new R version using \code{plotly_update} argument setting to TRUE.
} }
\examples{ \examples{
# load data example # load data example
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment