Skip to content

Commit 8d7960c

Browse files
committed
support with own data for visualization
1 parent 7fd845c commit 8d7960c

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

.Rhistory

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,3 +413,7 @@ library(devtools)
413413
document()
414414
check()
415415
install()
416+
library(devtools)
417+
document()
418+
check()
419+
install()

R/visCluster.R

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#' @title using visCluster to visualize cluster results from clusterData output
44
#'
55
#' @param object clusterData object, default NULL.
6+
#' @param plot.data supply with own data with data.frame format for visualization, default NULL.
67
#' @param ht.col heatmap colors, default c("blue", "white", "red").
78
#' @param border whether add border for heatmap, default TRUE.
89
#' @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",
7778
'membership', 'norm_value','id', 'log10P', 'pval',
7879
'Var1'))
7980
visCluster <- function(object = NULL,
81+
plot.data = NULL,
8082
ht.col = c("blue", "white", "red"),
8183
border = TRUE,
8284
plot.type = c("line","heatmap","both"),
@@ -133,7 +135,11 @@ visCluster <- function(object = NULL,
133135
# choose plot type
134136
if(plot.type == "line"){
135137
# process data
136-
data <- data.frame(object$long.res)
138+
if(is.null(plot.data)){
139+
data <- data.frame(object$long.res)
140+
}else{
141+
data <- plot.data
142+
}
137143

138144
# sample orders
139145
if(!is.null(sample.order)){
@@ -193,7 +199,11 @@ visCluster <- function(object = NULL,
193199
}else{
194200
# ==========================================================================
195201
# process data
196-
data <- data.frame(object$wide.res)
202+
if(is.null(plot.data)){
203+
data <- data.frame(object$wide.res)
204+
}else{
205+
data <- plot.data
206+
}
197207

198208
# prepare matrix
199209
if(object$type == "mfuzz"){

man/visCluster.Rd

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)