distSample: Create a heatmap using distance information between samples

View source: R/tab_values.R

distSampleR Documentation

Create a heatmap using distance information between samples

Description

The function distSample creates a heatmap from a distance matrix created by the function distShiny. The heatmap is annotated by the column specified by the label column in colData(se).

Usage

distSample(d, se, label = "name", title = "raw", ...)

Arguments

d

matrix containing distances, obtained from distShiny

se

SummarizedExperiment

label

character, refers to a column in colData(se)

title

character

...

further arguments passed to ComplexHeatmap::Heatmap

Details

Internal use in shinyQC

Value

Heatmap object from ComplexHeatmap

Examples

## create se
a <- matrix(seq_len(100), nrow = 10, ncol = 10,
            dimnames = list(seq_len(10), paste("sample", seq_len(10))))
a[c(1, 5, 8), seq_len(5)] <- NA
set.seed(1)
a <- a + rnorm(100)
a_i <- imputeAssay(a, method = "MinDet")
cD <- data.frame(name = colnames(a_i),
    type = c(rep("1", 5), rep("2", 5)))
rD <- data.frame(spectra = rownames(a_i))
se <- SummarizedExperiment::SummarizedExperiment(assay = a_i, rowData = rD,
    colData = cD)

dist <- distShiny(a_i)
distSample(dist, se, label = "type", title = "imputed", 
    show_row_names = TRUE)


tnaake/MatrixQCvis documentation built on June 20, 2024, 7:22 a.m.