diff --git a/.Rhistory b/.Rhistory index eee0f7e..65b127f 100644 --- a/.Rhistory +++ b/.Rhistory @@ -413,3 +413,7 @@ library(devtools) document() check() install() +library(devtools) +document() +check() +install() diff --git a/R/visCluster.R b/R/visCluster.R index 1890807..530543e 100644 --- a/R/visCluster.R +++ b/R/visCluster.R @@ -3,6 +3,7 @@ #' @title using visCluster to visualize cluster results from clusterData output #' #' @param object clusterData object, default NULL. +#' @param plot.data supply with own data with data.frame format for visualization, default NULL. #' @param ht.col heatmap colors, default c("blue", "white", "red"). #' @param border whether add border for heatmap, default TRUE. #' @param plot.type the plot type to choose which incuding "line","heatmap" and "both". @@ -77,6 +78,7 @@ globalVariables(c('cell_type', 'cluster.num', 'gene',"ratio","bary", 'membership', 'norm_value','id', 'log10P', 'pval', 'Var1')) visCluster <- function(object = NULL, + plot.data = NULL, ht.col = c("blue", "white", "red"), border = TRUE, plot.type = c("line","heatmap","both"), @@ -133,7 +135,11 @@ visCluster <- function(object = NULL, # choose plot type if(plot.type == "line"){ # process data - data <- data.frame(object$long.res) + if(is.null(plot.data)){ + data <- data.frame(object$long.res) + }else{ + data <- plot.data + } # sample orders if(!is.null(sample.order)){ @@ -193,7 +199,11 @@ visCluster <- function(object = NULL, }else{ # ========================================================================== # process data - data <- data.frame(object$wide.res) + if(is.null(plot.data)){ + data <- data.frame(object$wide.res) + }else{ + data <- plot.data + } # prepare matrix if(object$type == "mfuzz"){ diff --git a/man/visCluster.Rd b/man/visCluster.Rd index 59a2e19..44ab738 100644 --- a/man/visCluster.Rd +++ b/man/visCluster.Rd @@ -6,6 +6,8 @@ \arguments{ \item{object}{clusterData object, default NULL.} +\item{plot.data}{supply with own data with data.frame format for visualization, default NULL.} + \item{ht.col}{heatmap colors, default c("blue", "white", "red").} \item{border}{whether add border for heatmap, default TRUE.}