Clinical Heatmap
Usage
clinicalheatmap(
data,
rowVar,
colVar,
valueVar,
annotationCols,
annotationRows,
scaleMethod = "none",
clusterRows = TRUE,
clusterCols = TRUE,
colorPalette = "viridis",
showRownames = TRUE,
showColnames = TRUE,
naHandling = "exclude",
showDataSummary = TRUE,
showInterpretation = TRUE,
exportWidth = 8,
exportHeight = 6,
clusterDistanceRows = "euclidean",
clusterMethodRows = "complete",
clusterDistanceCols = "euclidean",
clusterMethodCols = "complete",
annotationType = "tile",
addLayer = FALSE,
layerType = "point",
layerFilter = "",
splitRows = 1,
splitCols = 1,
findOptimalK = FALSE,
kRange = "2:8",
exportRowClusters = FALSE,
exportColClusters = FALSE,
rowClusterPrefix = "RowCluster",
colClusterPrefix = "ColCluster",
survivalAnalysis = FALSE,
survivalTime,
survivalEvent,
survivalEventLevel,
clusterComparison = FALSE,
comparisonVars
)Arguments
- data
The dataset as a data frame containing the variables for analysis.
- rowVar
A string naming the variable from
datathat will define the heatmap rows (e.g., patient IDs, gene names).- colVar
A string naming the variable from
datathat will define the heatmap columns (e.g., biomarkers, time points).- valueVar
A string naming the numeric variable from
datathat will be visualized in the heatmap.- annotationCols
Optional variables to use as column annotations (e.g., treatment groups, clinical stages).
- annotationRows
Optional variables to use as row annotations (e.g., patient characteristics, gene families).
- scaleMethod
Method for scaling the data values before visualization.
- clusterRows
Whether to perform hierarchical clustering on rows.
- clusterCols
Whether to perform hierarchical clustering on columns.
- colorPalette
Color palette for the heatmap visualization.
- showRownames
Whether to display row names in the heatmap.
- showColnames
Whether to display column names in the heatmap.
- naHandling
How to handle missing values in the data.
- showDataSummary
Display a summary of the data structure and values.
- showInterpretation
Display interpretation guidelines and clinical context.
- exportWidth
Width of exported heatmap in inches.
- exportHeight
Height of exported heatmap in inches.
- clusterDistanceRows
Distance metric for row clustering.
- clusterMethodRows
Agglomeration method for row clustering.
- clusterDistanceCols
Distance metric for column clustering.
- clusterMethodCols
Agglomeration method for column clustering.
- annotationType
Type of annotation visualization for tidyHeatmap.
- addLayer
Add a symbol layer on top of the heatmap.
- layerType
Type of symbol to add as a layer.
- layerFilter
Logical expression to filter which cells show symbols (e.g., "> 0.5").
- splitRows
Number of row groups to split based on dendrogram branches.
- splitCols
Number of column groups to split based on dendrogram branches.
- findOptimalK
Automatically determine optimal number of clusters using elbow method and silhouette analysis.
- kRange
Range of K values to test (format: "min:max", e.g., "2:10").
- exportRowClusters
Add row cluster assignments as a new column in the dataset.
- exportColClusters
Add column cluster assignments as a new column in the dataset.
- rowClusterPrefix
Name for the exported row cluster assignment column.
- colClusterPrefix
Name for the exported column cluster assignment column.
- survivalAnalysis
Perform survival analysis comparing row clusters (requires survival data).
- survivalTime
.
- survivalEvent
.
- survivalEventLevel
.
- clusterComparison
Compare clinical/molecular characteristics across discovered clusters.
- comparisonVars
.
Value
A results object containing:
results$todo | a html | ||||
results$aboutAnalysis | a html | ||||
results$dataSummary$dataStructure | a table | ||||
results$dataSummary$valueSummary | a table | ||||
results$dataSummary$missingData | a table | ||||
results$heatmap | an image | ||||
results$annotations$columnAnnotations | a html | ||||
results$annotations$rowAnnotations | a html | ||||
results$interpretation | a html | ||||
results$clinicalSummary | a html | ||||
results$reportSentences | a html | ||||
results$assumptions | a html | ||||
results$optimalKAnalysis$elbowPlot | an image | ||||
results$optimalKAnalysis$silhouettePlot | an image | ||||
results$optimalKAnalysis$optimalKTable | a table | ||||
results$clusterAssignments$rowClusterTable | a table | ||||
results$clusterAssignments$colClusterTable | a table | ||||
results$clusterSurvival$kmPlot | an image | ||||
results$clusterSurvival$survivalTable | a table | ||||
results$clusterSurvival$logRankTest | a table | ||||
results$clusterCharacteristics$characteristicTable | a table | ||||
results$clusterCharacteristics$clusterInterpretation | a html |