PlotOverviewCV: Plot overview of CV values for a flowSOM model

View source: R/evaluation.R

PlotOverviewCVR Documentation

Plot overview of CV values for a flowSOM model

Description

Plot overview of CV values for a flowSOM model

Usage

PlotOverviewCV(fsom, cv_res, max_cv = 2.5, show_cv = 1.5)

Arguments

fsom

FlowSOM model

cv_res

As generated by the testCV function

max_cv

All values higher than this value will get the same color

show_cv

All values higher than this one will be shown numerically

dir <- system.file("extdata", package = "CytoNorm") files <- list.files(dir, pattern = "fcs$") data <- data.frame(File = files, Path = file.path(dir, files), Type = stringr::str_match(files, "_([12]).fcs")[,2], Batch = stringr::str_match(files, "PTLG[0-9]*")[,1], stringsAsFactors = FALSE) data$Type <- c("1" = "Train", "2" = "Validation")[data$Type] train_data <- dplyr::filter(data, Type == "Train")

ff <- flowCore::read.FCS(data$Path[1]) channels <- grep("Di$", flowCore::colnames(ff), value = TRUE) transformList <- flowCore::transformList(channels, cytofTransform)

fsom <- prepareFlowSOM(train_data$Path, channels, nCells = 10000, #1000000 FlowSOM.params = list(xdim = 15, ydim = 15, nClus = 25, scale = FALSE), transformList = transformList, seed = 1)

cvs <- testCV(fsom, cluster_values = c(5,15,25,35,45)) # 3:50

PlotOverviewCV(fsom, cvs)


saeyslab/CytoNorm documentation built on March 19, 2024, 6:43 p.m.