cytoqc checks and standardizes channels, markers, keywords, gates of the cytodata .
knitr::opts_chunk$set(warning = FALSE, message = FALSE) library(knitr)
remotes::install_github("RGLab/cytoqc")
library(flowCore) library(flowWorkspace) library(cytoqc)
# prepare the test data data("GvHD") fs <- GvHD[8:28]#exclude samples that has different Time length data_dir <- tempfile() dir.create(data_dir) write.flowSet(fs, data_dir)
files <- list.files(data_dir, ".fcs", full.names = TRUE) cqc_data <- cqc_load_fcs(files) cqc_data
#simulate channel discrepancy #case cf <- cqc_data[[1]] colnames(cf)[1] <- "fsc-h" #missing cqc_data[[1]] <- cf[,1:7] #redundant thisfile <- files[2] fr <- read.FCS(thisfile) new_col <- exprs(fr)[,8,drop=F] colnames(new_col) <- "channelA" fr <- fr_append_cols(fr, new_col) write.FCS(fr, files[2]) cqc_data[[2]] <- load_cytoframe_from_fcs(thisfile, is_h5 = TRUE) #typo cf <- cqc_data[[2]] colnames(cf)[2] <- "SSC1-H" #both case and typo cf <- cqc_data[[3]] colnames(cf)[1:2] <- c("fsc-h", "SSC1-H") #order cf <- cqc_data[[4]] cf_swap_colnames(cf, "FL1-H", "FL2-H")
check_results <- cqc_check(cqc_data, type = "channel") check_results
res <- cqc_match(check_results, ref = 3) res
cqc_fix(res)
check_results <- cqc_check(cqc_data, type = "channel") check_results
cqc_data <- cqc_get_data(check_results) cqc_data
cytoset
cytoset(cqc_data)
cqc_write_fcs(cqc_data, outdir)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.