Title: | One-Step to Cluster and Visualize Gene Expression Data |
---|---|
Description: | Streamlining the clustering and visualization of time-series gene expression data from RNA-Seq experiments, this tool supports fuzzy c-means and k-means clustering algorithms. It is compatible with outputs from widely-used packages such as 'Seurat', 'Monocle', and 'WGCNA', enabling seamless downstream visualization and analysis. See Lokesh Kumar and Matthias E Futschik (2007) <doi:10.6026/97320630002005> for more details. |
Authors: | Jun Zhang [aut, cre] |
Maintainer: | Jun Zhang <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.2 |
Built: | 2025-03-10 02:16:35 UTC |
Source: | https://github.com/junjunlab/clustergvis |
This is a test data for this package test data describtion
BEAM_res
BEAM_res
An object of class data.frame
with 47192 rows and 8 columns.
JunZhang
Cluster Data Based on Different Methods
clusterData( obj = NULL, scaleData = TRUE, cluster.method = c("mfuzz", "TCseq", "kmeans", "wgcna"), TCseq_params_list = list(), object = NULL, min.std = 0, cluster.num = NULL, subcluster = NULL, seed = 5201314, ... )
clusterData( obj = NULL, scaleData = TRUE, cluster.method = c("mfuzz", "TCseq", "kmeans", "wgcna"), TCseq_params_list = list(), object = NULL, min.std = 0, cluster.num = NULL, subcluster = NULL, seed = 5201314, ... )
obj |
An input object that can take one of two types: - A cell_data_set object for trajectory analysis. - A matrix or data.frame containing expression data. |
scaleData |
Logical. Whether to scale the data (e.g., z-score normalization). |
cluster.method |
Character. Clustering method to use.
Options are one of |
TCseq_params_list |
A list of additional parameters passed to the |
object |
A pre-calculated object required when using |
min.std |
Numeric. Minimum standard deviation for filtering expression data. |
cluster.num |
Integer. The number of clusters to identify. |
subcluster |
A numeric vector of specific cluster IDs to include in the results.
If |
seed |
An integer seed for reproducibility in clustering operations. |
... |
Additional arguments passed to internal functions such as |
Depending on the selected cluster.method
, different clustering algorithms are used:
"mfuzz"
: Applies Mfuzz soft clustering method, suitable for identifying overlapping clusters.
"TCseq"
: Uses TCseq clustering for time-series expression data with support for additional parameters.
"kmeans"
: Employs standard k-means clustering via base R's stats::kmeans
.
"wgcna"
: Leverages pre-calculated WGCNA (Weighted Gene Co-expression Network Analysis) networks.
The function is designed to be flexible, allowing preprocessing (e.g., filtering by min.std
),
scaling the data (scaleData = TRUE
), and generating results compatible with data visualization pipelines.
A list containing the following clustering results:
wide.res: A wide-format data frame with clusters and normalized expression levels.
long.res: A long-format data frame for visualizations, containing cluster information, normalized values, cluster names, and memberships.
cluster.list: A list where each element contains genes belonging to a specific cluster.
type: The clustering method used ("mfuzz"
, "TCseq"
, "kmeans"
, or "wgcna"
).
geneMode: Currently set to "none"
(reserved for future use).
geneType: Currently set to "none"
(reserved for future use).
If the WGCNA method is selected, the object
parameter must contain a pre-calculated WGCNA network object.
This is typically obtained using the WGCNA package functions.
Use the subcluster
parameter to focus on specific clusters. Cluster IDs not included in the
subcluster
vector will be excluded from the final results.
JunZhang
This function performs clustering on input data using one of four methods: mfuzz, TCseq, kmeans, or wgcna. The clustering results include metadata, normalized data, and cluster memberships.
data("exps") # kmeans ck <- clusterData(obj = exps, cluster.method = "kmeans", cluster.num = 8)
data("exps") # kmeans ck <- clusterData(obj = exps, cluster.method = "kmeans", cluster.num = 8)
Perform GO/KEGG Enrichment Analysis for Multiple Clusters
enrichCluster( object = NULL, type = c("BP", "MF", "CC", "KEGG", "ownSet"), TERM2GENE = NULL, TERM2NAME = NULL, OrgDb = NULL, id.trans = TRUE, fromType = "SYMBOL", toType = c("ENTREZID"), readable = TRUE, organism = "hsa", pvalueCutoff = 0.05, topn = 5, seed = 5201314, add.gene = FALSE, use_internal_data = FALSE, heatmap.type = c("plot_pseudotime_heatmap2", "plot_genes_branched_heatmap2", "plot_multiple_branches_heatmap2"), ... )
enrichCluster( object = NULL, type = c("BP", "MF", "CC", "KEGG", "ownSet"), TERM2GENE = NULL, TERM2NAME = NULL, OrgDb = NULL, id.trans = TRUE, fromType = "SYMBOL", toType = c("ENTREZID"), readable = TRUE, organism = "hsa", pvalueCutoff = 0.05, topn = 5, seed = 5201314, add.gene = FALSE, use_internal_data = FALSE, heatmap.type = c("plot_pseudotime_heatmap2", "plot_genes_branched_heatmap2", "plot_multiple_branches_heatmap2"), ... )
object |
An object containing clustering results.
This is clusterData object. Alternatively, it can be a |
type |
Character. The type of enrichment analysis to perform. Options include:
|
TERM2GENE |
A data frame containing mappings of terms to genes. Required when |
TERM2NAME |
A data frame containing term-to-name mappings. Optional when |
OrgDb |
An organism database object (e.g., |
id.trans |
Logical. Whether to perform gene ID transformation. Default is |
fromType |
Character. The type of the input gene IDs (e.g., |
toType |
Character. The target ID type for transformation using |
readable |
Logical. Whether to convert the enrichment result IDs back to a readable format (e.g., SYMBOL).
Only applicable for GO and KEGG analysis. Default is |
organism |
Character. The KEGG organism code (e.g., |
pvalueCutoff |
Numeric. The p-value cutoff for enriched terms to be included in the results. Default is |
topn |
Integer or vector. The number of top enrichment results to extract. If a single value, it is applied
to all clusters. Otherwise, it should match the number of clusters. Default is |
seed |
Numeric. Seed for random operations to ensure reproducibility. Default is |
add.gene |
Logical. Whether to include the list of genes associated with each enriched term in the results.
Default is |
use_internal_data |
Logical, use KEGG.db or latest online KEGG data for enrichKEGG function.
Default is |
heatmap.type |
Character. The type of heatmap visualization to use when input data is a
|
... |
Additional arguments passed to plot_pseudotime_heatmap2/plot_genes_branched_heatmap2/plot_multiple_branches_heatmap2 functions. |
a data.frame.
JunZhang
This function performs Gene Ontology (GO) or KEGG enrichment analysis, or custom gene set enrichment, on clustered genes. It supports multiple clusters, incorporating cluster-specific results into its analysis.
Generic to access cds count matrix
exprs(x)
exprs(x)
x |
A cell_data_set object. |
Count matrix.
https://github.com/cole-trapnell-lab/monocle3
Method to access cds count matrix
## S4 method for signature 'cell_data_set' exprs(x)
## S4 method for signature 'cell_data_set' exprs(x)
x |
A cell_data_set object. |
Count matrix.
This is a test data for this package test data describtion
exps
exps
An object of class data.frame
with 3767 rows and 6 columns.
Junjun Lao
using filter.std to filter low expression genes
filter.std(eset, min.std, visu = TRUE, verbose = TRUE)
filter.std(eset, min.std, visu = TRUE, verbose = TRUE)
eset |
expression matrix, default NULL. |
min.std |
min stand error, default 0. |
visu |
whether plot, default FALSE. |
verbose |
show filter information. |
matrix.
Determine Optimal Clusters for Gene Expression or Pseudotime Data
getClusters(obj = NULL, ...)
getClusters(obj = NULL, ...)
obj |
A data object representing the gene expression data or pseudotime data:
|
... |
Additional arguments passed to the preprocessing function
|
A ggplot
object visualizing the Elbow plot, where:
The x-axis represents the number of clusters tested.
The y-axis represents the WSS for each cluster number.
The optimal cluster number can be visually identified at the "elbow point," where the reduction in WSS diminishes sharply.
a ggplot.
JunZhang
The getClusters
function identifies the optimal number of clusters for a given data object.
It supports multiple input types, including gene expression matrices and objects such as
cell_data_set
. The function implements the Elbow method to evaluate within-cluster
sum of squares (WSS) across a range of cluster numbers and visualizes the results.
This is a test data for this package test data describtion
net
net
An object of class list
of length 10.
Junjun Lao
Return a size-factor normalized and (optionally) log-transformed expression
normalized_counts( cds, norm_method = c("log", "binary", "size_only"), pseudocount = 1 )
normalized_counts( cds, norm_method = c("log", "binary", "size_only"), pseudocount = 1 )
cds |
A CDS object to calculate normalized expression matrix from. |
norm_method |
String indicating the normalization method. Options are "log" (Default), "binary" and "size_only". |
pseudocount |
A pseudocount to add before log transformation. Ignored if norm_method is not "log". Default is 1. |
Size-factor normalized, and optionally log-transformed, expression matrix.
https://github.com/cole-trapnell-lab/monocle3
matrix
@description returns a heatmap that shows changes in both lineages at the same time. It also requires that you choose a branch point to inspect. Columns are points in pseudotime, rows are genes, and the beginning of pseudotime is in the middle of the heatmap. As you read from the middle of the heatmap to the right, you are following one lineage through pseudotime. As you read left, the other. The genes are clustered hierarchically, so you can visualize modules of genes that have similar lineage-dependent expression patterns.
plot_genes_branched_heatmap2( cds_subset = NULL, branch_point = 1, branch_states = NULL, branch_labels = c("Cell fate 1", "Cell fate 2"), cluster_rows = TRUE, hclust_method = "ward.D2", num_clusters = 6, hmcols = NULL, branch_colors = c("#979797", "#F05662", "#7990C8"), add_annotation_row = NULL, add_annotation_col = NULL, show_rownames = FALSE, use_gene_short_name = TRUE, scale_max = 3, scale_min = -3, norm_method = c("log", "vstExprs"), trend_formula = "~sm.ns(Pseudotime, df=3) * Branch", return_heatmap = FALSE, cores = 1, ... )
plot_genes_branched_heatmap2( cds_subset = NULL, branch_point = 1, branch_states = NULL, branch_labels = c("Cell fate 1", "Cell fate 2"), cluster_rows = TRUE, hclust_method = "ward.D2", num_clusters = 6, hmcols = NULL, branch_colors = c("#979797", "#F05662", "#7990C8"), add_annotation_row = NULL, add_annotation_col = NULL, show_rownames = FALSE, use_gene_short_name = TRUE, scale_max = 3, scale_min = -3, norm_method = c("log", "vstExprs"), trend_formula = "~sm.ns(Pseudotime, df=3) * Branch", return_heatmap = FALSE, cores = 1, ... )
cds_subset |
CellDataSet for the experiment (normally only the branching genes detected with branchTest) |
branch_point |
The ID of the branch point to visualize. Can only be used when reduceDimension is called with method = "DDRTree". |
branch_states |
The two states to compare in the heatmap. Mutually exclusive with branch_point. |
branch_labels |
The labels for the branchs. |
cluster_rows |
Whether to cluster the rows of the heatmap. |
hclust_method |
The method used by pheatmap to perform hirearchical clustering of the rows. |
num_clusters |
Number of clusters for the heatmap of branch genes |
hmcols |
The color scheme for drawing the heatmap. |
branch_colors |
The colors used in the annotation strip indicating the pre- and post-branch cells. |
add_annotation_row |
Additional annotations to show for each row in the heatmap. Must be a dataframe with one row for each row in the fData table of cds_subset, with matching IDs. |
add_annotation_col |
Additional annotations to show for each column in the heatmap. Must be a dataframe with one row for each cell in the pData table of cds_subset, with matching IDs. |
show_rownames |
Whether to show the names for each row in the table. |
use_gene_short_name |
Whether to use the short names for each row. If FALSE, uses row IDs from the fData table. |
scale_max |
The maximum value (in standard deviations) to show in the heatmap. Values larger than this are set to the max. |
scale_min |
The minimum value (in standard deviations) to show in the heatmap. Values smaller than this are set to the min. |
norm_method |
Determines how to transform expression values prior to rendering |
trend_formula |
A formula string specifying the model used in fitting the spline curve for each gene/feature. |
return_heatmap |
Whether to return the pheatmap object to the user. |
cores |
Number of cores to use when smoothing the expression curves shown in the heatmap. |
... |
Additional arguments passed to buildBranchCellDataSet |
A list of heatmap_matrix (expression matrix for the branch committment), ph (pheatmap heatmap object), annotation_row (annotation data.frame for the row), annotation_col (annotation data.frame for the column).
Create a heatmap to demonstrate the bifurcation of gene expression along multiple branches
plot_multiple_branches_heatmap2( cds = NULL, branches, branches_name = NULL, cluster_rows = TRUE, hclust_method = "ward.D2", num_clusters = 6, hmcols = NULL, add_annotation_row = NULL, add_annotation_col = NULL, show_rownames = FALSE, use_gene_short_name = TRUE, norm_method = c("vstExprs", "log"), scale_max = 3, scale_min = -3, trend_formula = "~sm.ns(Pseudotime, df=3)", return_heatmap = FALSE, cores = 1 )
plot_multiple_branches_heatmap2( cds = NULL, branches, branches_name = NULL, cluster_rows = TRUE, hclust_method = "ward.D2", num_clusters = 6, hmcols = NULL, add_annotation_row = NULL, add_annotation_col = NULL, show_rownames = FALSE, use_gene_short_name = TRUE, norm_method = c("vstExprs", "log"), scale_max = 3, scale_min = -3, trend_formula = "~sm.ns(Pseudotime, df=3)", return_heatmap = FALSE, cores = 1 )
cds |
CellDataSet for the experiment (normally only the branching genes detected with BEAM) |
branches |
The terminal branches (states) on the developmental tree you want to investigate. |
branches_name |
Name (for example, cell type) of branches you believe the cells on the branches are associated with. |
cluster_rows |
Whether to cluster the rows of the heatmap. |
hclust_method |
The method used by pheatmap to perform hirearchical clustering of the rows. |
num_clusters |
Number of clusters for the heatmap of branch genes |
hmcols |
The color scheme for drawing the heatmap. |
add_annotation_row |
Additional annotations to show for each row in the heatmap. Must be a dataframe with one row for each row in the fData table of cds_subset, with matching IDs. |
add_annotation_col |
Additional annotations to show for each column in the heatmap. Must be a dataframe with one row for each cell in the pData table of cds_subset, with matching IDs. |
show_rownames |
Whether to show the names for each row in the table. |
use_gene_short_name |
Whether to use the short names for each row. If FALSE, uses row IDs from the fData table. |
norm_method |
Determines how to transform expression values prior to rendering |
scale_max |
The maximum value (in standard deviations) to show in the heatmap. Values larger than this are set to the max. |
scale_min |
The minimum value (in standard deviations) to show in the heatmap. Values smaller than this are set to the min. |
trend_formula |
A formula string specifying the model used in fitting the spline curve for each gene/feature. |
return_heatmap |
Whether to return the pheatmap object to the user. |
cores |
Number of cores to use when smoothing the expression curves shown in the heatmap. |
A list of heatmap_matrix (expression matrix for the branch committment), ph (pheatmap heatmap object), annotation_row (annotation data.frame for the row), annotation_col (annotation data.frame for the column).
The function plot_pseudotime_heatmap takes a CellDataSet object (usually containing a only subset of significant genes) and generates smooth expression curves much like plot_genes_in_pseudotime. Then, it clusters these genes and plots them using the pheatmap package. This allows you to visualize modules of genes that co-vary across pseudotime.
plot_pseudotime_heatmap2( cds_subset, cluster_rows = TRUE, hclust_method = "ward.D2", num_clusters = 6, hmcols = NULL, add_annotation_row = NULL, add_annotation_col = NULL, show_rownames = FALSE, use_gene_short_name = TRUE, norm_method = c("log", "vstExprs"), scale_max = 3, scale_min = -3, trend_formula = "~sm.ns(Pseudotime, df=3)", return_heatmap = FALSE, cores = 1 )
plot_pseudotime_heatmap2( cds_subset, cluster_rows = TRUE, hclust_method = "ward.D2", num_clusters = 6, hmcols = NULL, add_annotation_row = NULL, add_annotation_col = NULL, show_rownames = FALSE, use_gene_short_name = TRUE, norm_method = c("log", "vstExprs"), scale_max = 3, scale_min = -3, trend_formula = "~sm.ns(Pseudotime, df=3)", return_heatmap = FALSE, cores = 1 )
cds_subset |
CellDataSet for the experiment (normally only the branching genes detected with branchTest) |
cluster_rows |
Whether to cluster the rows of the heatmap. |
hclust_method |
The method used by pheatmap to perform hirearchical clustering of the rows. |
num_clusters |
Number of clusters for the heatmap of branch genes |
hmcols |
The color scheme for drawing the heatmap. |
add_annotation_row |
Additional annotations to show for each row in the heatmap. Must be a dataframe with one row for each row in the fData table of cds_subset, with matching IDs. |
add_annotation_col |
Additional annotations to show for each column in the heatmap. Must be a dataframe with one row for each cell in the pData table of cds_subset, with matching IDs. |
show_rownames |
Whether to show the names for each row in the table. |
use_gene_short_name |
Whether to use the short names for each row. If FALSE, uses row IDs from the fData table. |
norm_method |
Determines how to transform expression values prior to rendering |
scale_max |
The maximum value (in standard deviations) to show in the heatmap. Values larger than this are set to the max. |
scale_min |
The minimum value (in standard deviations) to show in the heatmap. Values smaller than this are set to the min. |
trend_formula |
A formula string specifying the model used in fitting the spline curve for each gene/feature. |
return_heatmap |
Whether to return the pheatmap object to the user. |
cores |
Number of cores to use when smoothing the expression curves shown in the heatmap. |
A list of heatmap_matrix (expression matrix for the branch committment), ph (pheatmap heatmap object), annotation_row (annotation data.frame for the row), annotation_col (annotation data.frame for the column).
This function takes in a monocle3 object and returns a smoothed pseudotime matrix for the given gene list, either in counts or normalized form. The function first matches the gene list with the rownames of the SummarizedExperiment object, and then orders the pseudotime information. The function then uses smooth.spline to apply smoothing to the data. Finally, the function normalizes the data by subtracting the mean and dividing by the standard deviation for each row.
pre_pseudotime_matrix( cds_obj = NULL, assays = c("counts", "normalized"), gene_list = NULL )
pre_pseudotime_matrix( cds_obj = NULL, assays = c("counts", "normalized"), gene_list = NULL )
cds_obj |
A monocle3 object |
assays |
Type of assay to be used for the analysis, either "counts" or "normalized" |
gene_list |
A vector of gene names |
A smoothed pseudotime matrix for the given gene list
This function prepares single-cell RNA sequencing (scRNA-seq) data for differential gene expression analysis. It extracts the expression data for the specified cells and genes, and organizes them into a dataframe format suitable for downstream analysis.
prepareDataFromscRNA( object = NULL, diffData = NULL, showAverage = TRUE, cells = NULL, group.by = "ident", assays = "RNA", slot = "data", scale.data = TRUE, cluster.order = NULL, keep.uniqGene = TRUE, sep = "_" )
prepareDataFromscRNA( object = NULL, diffData = NULL, showAverage = TRUE, cells = NULL, group.by = "ident", assays = "RNA", slot = "data", scale.data = TRUE, cluster.order = NULL, keep.uniqGene = TRUE, sep = "_" )
object |
an object of class Seurat containing the scRNA-seq data. |
diffData |
a dataframe containing information about the differential expression analysis which can be output from function FindAllMarkers. |
showAverage |
a logical indicating whether to show the average gene expression across all cells. |
cells |
a vector of cell names to extract from the Seurat object. If NULL, all cells will be used. |
group.by |
a string specifying the grouping variable for differential expression analysis. Default is 'ident', which groups cells by their assigned clusters. |
assays |
a string or vector of strings specifying the assay(s) to extract from the Seurat object. Default is 'RNA'. |
slot |
a string specifying the slot name where the assay data is stored in the Seurat object. Default is 'data'. |
scale.data |
whether do Z-score for expression data, default TRUE. |
cluster.order |
the celltype orders. |
keep.uniqGene |
a logical indicating whether to keep only unique gene names. Default is TRUE. |
sep |
a character string to separate gene and cell names in the output dataframe. Default is "_". |
a dataframe containing the expression data for the specified genes and cells, organized in a format suitable for differential gene expression analysis.
Generic to extract pseudotime from CDS object
pseudotime(x, reduction_method = "UMAP")
pseudotime(x, reduction_method = "UMAP")
x |
A cell_data_set object. |
reduction_method |
Reduced dimension to extract pseudotime for. |
Pseudotime values.
https://github.com/cole-trapnell-lab/monocle3
Method to extract pseudotime from CDS object
## S4 method for signature 'cell_data_set' pseudotime(x, reduction_method = "UMAP")
## S4 method for signature 'cell_data_set' pseudotime(x, reduction_method = "UMAP")
x |
A cell_data_set object. |
reduction_method |
Reduced dimension to extract clusters for. |
Pseudotime values.
This is a test data for this package test data describtion
sig_gene_names
sig_gene_names
An object of class character
of length 1331.
JunZhang
A wrapper around colData(cds)$Size_Factor
size_factors(cds)
size_factors(cds)
cds |
A cell_data_set object. |
An updated cell_data_set object
This is a test data for this package test data describtion
termanno
termanno
An object of class data.frame
with 24 rows and 2 columns.
Junjun Lao
This is a test data for this package test data describtion
termanno2
termanno2
An object of class data.frame
with 24 rows and 3 columns.
Junjun Lao
traverseTree function
traverseTree(g, starting_cell, end_cells)
traverseTree(g, starting_cell, end_cells)
g |
NULL |
starting_cell |
NULL |
end_cells |
NULL |
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, ... )
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, ... )
object |
clusterData object, default NULL. |
ht.col.list |
list of heatmap col_range and col_color, default list(col_range = c(-2, 0, 2),col_color = c("#08519C", "white", "#A50F15")). |
border |
whether add border for heatmap, default TRUE. |
plot.type |
the plot type to choose which incuding "line","heatmap" and "both". |
ms.col |
membership line color form Mfuzz cluster method results, default c('#0099CC','grey90','#CC3333'). |
line.size |
line size for line plot, default 0.1. |
line.col |
line color for line plot, default "grey90". |
add.mline |
whether add median line on plot, default TRUE. |
mline.size |
median line size, default 2. |
mline.col |
median line color, default "#CC3333". |
ncol |
the columns for facet plot with line plot, default 4. |
ctAnno.col |
the heatmap cluster annotation bar colors, default NULL. |
set.md |
the represent line method on heatmap-line plot(mean/median), default "median". |
textbox.pos |
the relative position of text in left-line plot, default c(0.5,0.8). |
textbox.size |
the text size of the text in left-line plot, default 8. |
panel.arg |
the settings for the left-line panel which are panel size,gap,width,fill and col, default c(2,0.25,4,"grey90",NA). |
ggplot.panel.arg |
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). |
annoTerm.data |
the GO term annotation for the clusters, default NULL. |
annoTerm.mside |
the wider GO term annotation box side, default "right". |
termAnno.arg |
the settings for GO term panel annotations which are fill and col, default c("grey95","grey50"). |
add.bar |
whether add bar plot for GO enrichment, default FALSE. |
bar.width |
the GO enrichment bar width, default 8. |
textbar.pos |
the barplot text relative position, default c(0.8,0.8). |
go.col |
the GO term text colors, default NULL. |
go.size |
the GO term text size(numeric or "pval"), default NULL. |
by.go |
the GO term text box style("anno_link" or "anno_block"), default "anno_link". |
annoKegg.data |
the KEGG term annotation for the clusters, default NULL. |
annoKegg.mside |
the wider KEGG term annotation box side, default "right". |
keggAnno.arg |
the settings for KEGG term panel annotations which are fill and col, default c("grey95","grey50"). |
add.kegg.bar |
whether add bar plot for KEGG enrichment, default FALSE. |
kegg.col |
the KEGG term text colors, default NULL. |
kegg.size |
the KEGG term text size(numeric or "pval"), default NULL. |
by.kegg |
the KEGG term text box style("anno_link" or "anno_block"), default "anno_link". |
word_wrap |
whether wrap the text, default TRUE. |
add_new_line |
whether add new line when text is long, default TRUE. |
add.box |
whether add boxplot, default FALSE. |
boxcol |
the box fill colors, default NULL. |
box.arg |
this is related to boxplot width and border color, default c(0.1,"grey50"). |
add.point |
whether add point, default FALSE. |
point.arg |
this is related to point shape,fill,color and size, default c(19,"orange","orange",1). |
add.line |
whether add line, default TRUE. |
line.side |
the line annotation side, default "right". |
markGenes |
the gene names to be added on plot, default NULL. |
markGenes.side |
the gene label side, default "right". |
genes.gp |
gene labels graphics settings, default c('italic',10,NA). |
term.text.limit |
the GO term text size limit, default c(10,18). |
mulGroup |
to draw multiple lines annotation, supply the groups numbers with vector, default NULL. |
lgd.label |
the lines annotation legend labels, default NULL. |
show_row_names |
whether to show row names, default FALSE. |
subgroup.anno |
the sub-cluster for annotation, supply sub-cluster id, default NULL. |
annnoblock.text |
whether add cluster numbers on right block annotation, default TRUE. |
annnoblock.gp |
right block annotation text color and size, default c("white",8). |
add.sampleanno |
whether add column annotation, default TRUE. |
sample.group |
the column sample groups, default NULL. |
sample.col |
column annotation colors, default NULL. |
sample.order |
the orders for column samples, default NULL. |
cluster.order |
the row cluster orders for user's own defination, default NULL. |
sample.cell.order |
the celltype order when input is scRNA data and "showAverage = FALSE" for prepareDataFromscRNA. |
HeatmapAnnotation |
the 'HeatmapAnnotation' object from 'ComplexHeatmap' when you have multiple annotations, default NULL. |
column.split |
how to split the columns when supply multiple column annotations, default NULL. |
cluster_columns |
whether cluster the columns, default FALSE. |
pseudotime_col |
the branch color control for monocle input data. |
gglist |
a list of ggplot object to annotate each cluster, default NULL. |
row_annotation_obj |
Row annotation for heatmap, it is a |
... |
othe aruguments passed by Heatmap fuction. |
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.
a ggplot2 or Heatmap object.
JunZhang
data("exps") # mfuzz cm <- clusterData(obj = exps, cluster.method = "kmeans", cluster.num = 8) # plot visCluster(object = cm, plot.type = "line")
data("exps") # mfuzz cm <- clusterData(obj = exps, cluster.method = "kmeans", cluster.num = 8) # plot visCluster(object = cm, plot.type = "line")