Skip to contents

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 data that will define the heatmap rows (e.g., patient IDs, gene names).

colVar

A string naming the variable from data that will define the heatmap columns (e.g., biomarkers, time points).

valueVar

A string naming the numeric variable from data that 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$todoa html
results$aboutAnalysisa html
results$dataSummary$dataStructurea table
results$dataSummary$valueSummarya table
results$dataSummary$missingDataa table
results$heatmapan image
results$annotations$columnAnnotationsa html
results$annotations$rowAnnotationsa html
results$interpretationa html
results$clinicalSummarya html
results$reportSentencesa html
results$assumptionsa html
results$optimalKAnalysis$elbowPlotan image
results$optimalKAnalysis$silhouettePlotan image
results$optimalKAnalysis$optimalKTablea table
results$clusterAssignments$rowClusterTablea table
results$clusterAssignments$colClusterTablea table
results$clusterSurvival$kmPlotan image
results$clusterSurvival$survivalTablea table
results$clusterSurvival$logRankTesta table
results$clusterCharacteristics$characteristicTablea table
results$clusterCharacteristics$clusterInterpretationa html