Visualize Clustered Gene Data Using Line Plots and Heatmaps
visCluster(
object = NULL,
ht.col.list = list(col_range = c(-2, 0, 2), col_color = c("#08519C", "white",
"#A50F15")),
border = TRUE,
plot.type = c("line", "heatmap", "both"),
ms.col = c("#0099CC", "grey90", "#CC3333"),
line.size = 0.1,
line.col = "grey90",
add.mline = TRUE,
mline.size = 2,
mline.col = "#CC3333",
ncol = 4,
ctAnno.col = NULL,
set.md = "median",
textbox.pos = c(0.5, 0.8),
textbox.size = 8,
panel.arg = c(2, 0.25, 4, "grey90", NA),
ggplot.panel.arg = c(2, 0.25, 4, "grey90", NA),
annoTerm.data = NULL,
annoTerm.mside = "right",
termAnno.arg = c("grey95", "grey50"),
add.bar = FALSE,
bar.width = 8,
textbar.pos = c(0.8, 0.8),
go.col = NULL,
go.size = NULL,
by.go = "anno_link",
annoKegg.data = NULL,
annoKegg.mside = "right",
keggAnno.arg = c("grey95", "grey50"),
add.kegg.bar = FALSE,
kegg.col = NULL,
kegg.size = NULL,
by.kegg = "anno_link",
word_wrap = TRUE,
add_new_line = TRUE,
add.box = FALSE,
boxcol = NULL,
box.arg = c(0.1, "grey50"),
add.point = FALSE,
point.arg = c(19, "orange", "orange", 1),
add.line = TRUE,
line.side = "right",
markGenes = NULL,
markGenes.side = "right",
genes.gp = c("italic", 10, NA),
term.text.limit = c(10, 18),
mulGroup = NULL,
lgd.label = NULL,
show_row_names = FALSE,
subgroup.anno = NULL,
annnoblock.text = TRUE,
annnoblock.gp = c("white", 8),
add.sampleanno = TRUE,
sample.group = NULL,
sample.col = NULL,
sample.order = NULL,
cluster.order = NULL,
sample.cell.order = NULL,
HeatmapAnnotation = NULL,
column.split = NULL,
cluster_columns = FALSE,
pseudotime_col = NULL,
gglist = NULL,
row_annotation_obj = NULL,
...
)
a ggplot2 or Heatmap object.
clusterData object, default NULL.
list of heatmap col_range and col_color, default list(col_range = c(-2, 0, 2),col_color = c("#08519C", "white", "#A50F15")).
whether add border for heatmap, default TRUE.
the plot type to choose which incuding "line","heatmap" and "both".
membership line color form Mfuzz cluster method results, default c('#0099CC','grey90','#CC3333').
line size for line plot, default 0.1.
line color for line plot, default "grey90".
whether add median line on plot, default TRUE.
median line size, default 2.
median line color, default "#CC3333".
the columns for facet plot with line plot, default 4.
the heatmap cluster annotation bar colors, default NULL.
the represent line method on heatmap-line plot(mean/median), default "median".
the relative position of text in left-line plot, default c(0.5,0.8).
the text size of the text in left-line plot, default 8.
the settings for the left-line panel which are panel size,gap,width,fill and col, default c(2,0.25,4,"grey90",NA).
the settings for the ggplot2 object plot panel which are panel size,gap,width,fill and col, default c(2,0.25,4,"grey90",NA).
the GO term annotation for the clusters, default NULL.
the wider GO term annotation box side, default "right".
the settings for GO term panel annotations which are fill and col, default c("grey95","grey50").
whether add bar plot for GO enrichment, default FALSE.
the GO enrichment bar width, default 8.
the barplot text relative position, default c(0.8,0.8).
the GO term text colors, default NULL.
the GO term text size(numeric or "pval"), default NULL.
the GO term text box style("anno_link" or "anno_block"), default "anno_link".
the KEGG term annotation for the clusters, default NULL.
the wider KEGG term annotation box side, default "right".
the settings for KEGG term panel annotations which are fill and col, default c("grey95","grey50").
whether add bar plot for KEGG enrichment, default FALSE.
the KEGG term text colors, default NULL.
the KEGG term text size(numeric or "pval"), default NULL.
the KEGG term text box style("anno_link" or "anno_block"), default "anno_link".
whether wrap the text, default TRUE.
whether add new line when text is long, default TRUE.
whether add boxplot, default FALSE.
the box fill colors, default NULL.
this is related to boxplot width and border color, default c(0.1,"grey50").
whether add point, default FALSE.
this is related to point shape,fill,color and size, default c(19,"orange","orange",1).
whether add line, default TRUE.
the line annotation side, default "right".
the gene names to be added on plot, default NULL.
the gene label side, default "right".
gene labels graphics settings, default c('italic',10,NA).
the GO term text size limit, default c(10,18).
to draw multiple lines annotation, supply the groups numbers with vector, default NULL.
the lines annotation legend labels, default NULL.
whether to show row names, default FALSE.
the sub-cluster for annotation, supply sub-cluster id, default NULL.
whether add cluster numbers on right block annotation, default TRUE.
right block annotation text color and size, default c("white",8).
whether add column annotation, default TRUE.
the column sample groups, default NULL.
column annotation colors, default NULL.
the orders for column samples, default NULL.
the row cluster orders for user's own defination, default NULL.
the celltype order when input is scRNA data and "showAverage = FALSE" for prepareDataFromscRNA.
the 'HeatmapAnnotation' object from 'ComplexHeatmap' when you have multiple annotations, default NULL.
how to split the columns when supply multiple column annotations, default NULL.
whether cluster the columns, default FALSE.
the branch color control for monocle input data.
a list of ggplot object to annotate each cluster, default NULL.
Row annotation for heatmap, it is a ComplexHeatmap::rowAnnotation()
object
when "markGenes.side" or ”line.side“ is "right". Otherwise is a list of named vectors.
othe aruguments passed by Heatmap fuction.
JunZhang
This function visualizes clustered gene expression data as line plots, heatmaps, or
a combination of both, using the ComplexHeatmap
and ggplot2
frameworks. Gene
annotations, sample annotations, and additional features like custom color schemes
and annotations for GO/KEGG terms are supported for visualization.
data("exps")
# mfuzz
cm <- clusterData(obj = exps,
cluster.method = "kmeans",
cluster.num = 8)
# plot
visCluster(object = cm,
plot.type = "line")
Run the code above in your browser using DataLab