library(knitr) knitr::opts_chunk$set(warning = FALSE, message = FALSE) icuSetCollate(locale="en_US")
library(flowCore) library(flowWorkspace) library(cytoqc)
# prepare the test data data("GvHD") set.seed(1) fs <- Subset(GvHD, sampleFilter(10)) 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
#clean up keywordnames for(cf in cqc_data) { kw <- keyword(cf) kn <- names(kw) kn <- gsub("^\\&[0-9]+", "", kn) names(kw) <- kn keyword(cf) <- kw } #simulate channel discrepancy #case cf <- cqc_data[[1]] cf_keyword_rename(cf, "Patient ID", "patient id") #missing cf <- cqc_data[[2]] cf_keyword_delete(cf, "Patient ID") #redundant cf_keyword_insert(cf, "kw1", "test") cf_keyword_insert(cf, "kw2", "test") #redundant cf <- cqc_data[[1]] cf_keyword_insert(cf, "new_kw", "test") #typo cf <- cqc_data[[3]] kw <- keyword(cf) kn <- names(kw) cf_keyword_rename(cf, "Patient ID", "PatientId")
groups <- cqc_check(cqc_data, "keyword") groups
match_result <- cqc_match(groups, ref = 3) match_result
sub_data_ref <- cqc_get_data(groups, id = 3) unique(sapply(sub_data_ref, keyword, keyword = "Patient ID")) sub_data <- cqc_get_data(groups, id = 5) unique(sapply(sub_data, keyword, keyword = "pt name"))
match_result <- cqc_match_update(match_result, c("pt name" = "Patient ID")) match_result
# match_result <- cqc_match_remove(match_result, c("pt name" = "Patient ID"))
match_result <- cqc_match_delete_unmatched(match_result, c("kw1", "kw2")) match_result
cqc_fix(match_result)
cqc_check(cqc_data, "keyword")
sub_data_ref <- cqc_get_data(groups, id = 1) unique(sapply(sub_data_ref, keyword, keyword = "Patient ID"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.