library(uwot)
library(RColorBrewer)
knitr::opts_chunk$set(echo = FALSE)
res <- readRDS('cytofQCdata_temp.rds')
tech <- res$tech
labels <- factor(res$label)
rm(res)
stopifnot(nrow(tech) == length(labels))
message('Found ', nrow(tech), ' events.', '\n')
message('Found the following technical variables:','\n',
        paste(colnames(tech), collapse = ', '), '\n')

Event type summary

cbind(count = table(labels), 
      percent = round(100 * table(labels) / length(labels), digits = 2))
if(params$runUMAP){
    s.tech <- scale(tech[, -1])
    umap <- uwot::umap(s.tech)

    require(RColorBrewer)
    cols <- brewer.pal(5, "Set2")
    layout(matrix(c(1,1,2), nrow=1))
    plot(umap, asp=1, col = cols[labels], cex = .25, pch=16,
         main = "UMAP on Technical Variables")
    plot.new()
    legend("left", pch=19, col = cols, legend = levels(labels), bty='n')
}


jillbo1000/cytofQC documentation built on Aug. 23, 2023, 9:47 p.m.