## ----- echo = false -----------------------------------------------------------------------------------------------------------------------库(Knitr)opts_chunk $ set(消息= false,警告= false,图。.show =“ hold”)## ---------------------------------------------------------------------------------------------------------------------库(FlowCore)库(FlowWorkspace)库(OPENCYTO)库(库)ggcyto)gs <-load_gs(system.file(“ extdata/gs_bcell_auto”,package =“ flowworkspacedata”))## -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- fr <-gh_pop_get_data(gs [[2]],“ live”,returnType =“ flowframe”)chnl < - “ cd3” g < - opencyto :::。,chnl) + geom_gate(g)autoplot(fr,chnl,“ ssc-a”) + geom_gate(g)## ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- fr <-gh_pop_get_data(gs [[1]],“边界”,returnType =“ flowframe”)chnl < - “ fsc-a” fsc-a“ g <-opencyto :::。mylimits <-ggcyto_par_set(limits =“ instrument”)p < - autoplot(fr,chnl) + mylimits p + geom_gate(g)autoplot(fr,chnl,“ ssc-a”) + geom_gate(g)## ------------------------------------------------------------------------------------------------------------------------------------------------------------ g <-opencyto :::。颗粒病(fr,channels = chnl,gate_range = c(7e4,1e5),调整= 1.5)p + geom_gate(g)autoplot(fr,chnl,ssc-a“) + geom_gate(g)## ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- <-opencyto :::。颗粒病(fr,频道 = chnl, min = 7e4, max = 1e5) p + geom_gate(g) ## ----------------------------------------------------------------------------- fr <- gh_pop_get_data(gs[[1]], "lymph", returnType = "flowFrame") chnl <- "Live" g <- openCyto:::.tailgate(fr, channels = chnl, tol = 0.05) p <- autoplot(fr, chnl) + mylimits p + geom_gate(g) autoplot(fr, chnl, "SSC-A") + geom_gate(g) ## ----------------------------------------------------------------------------- g <- openCyto:::.quantileGate(fr, channels = chnl, probs = 0.99) p <- autoplot(fr, chnl) + mylimits p + geom_gate(g) autoplot(fr, chnl, "SSC-A") + geom_gate(g) ## ----------------------------------------------------------------------------- fr <- gh_pop_get_data(gs[[1]], "root", returnType = "flowFrame") chnl <- c("FSC-A", "SSC-A") g <- openCyto:::.boundary(fr, channels = chnl, min = c(0, 0), max=c(2.5e5,2.5e5)) p <- autoplot(fr, x = chnl[1], y = chnl[2]) p + geom_gate(g) ## ----------------------------------------------------------------------------- fr <- read.FCS(system.file("extdata/CytoTrol_CytoTrol_1.fcs", package = "flowWorkspaceData")) chnl <- c("FSC-A", "FSC-H") g <- openCyto:::.singletGate(fr, channels = chnl) p <- autoplot(fr, x = chnl[1], y = chnl[2]) p + geom_gate(g) ## ----------------------------------------------------------------------------- fr <- gh_pop_get_data(gs[[1]], "nonDebris", returnType = "flowFrame") chnl <- c("FSC-A", "SSC-A") g <- openCyto:::.flowClust.2d(fr, channels = chnl, K=2, target=c(1e5,5e4), quantile=0.95) p <- autoplot(fr, x = chnl[1], y = chnl[2]) + mylimits p + geom_gate(g) ## ----------------------------------------------------------------------------- fr <- gh_pop_get_data(gs[[1]], "CD19andCD20", returnType = "flowFrame") chnl <- c("CD38", "CD24") g <- openCyto:::.flowClust.2d(fr, channels = chnl, K=6,transitional=TRUE,target=c(3.5e3,3.5e3), quantile=0.95,translation=0.15, pp_res = NULL) p <- autoplot(fr, x = chnl[1], y = chnl[2]) + mylimits p + geom_gate(g) ## ----------------------------------------------------------------------------- gs <- load_gs(system.file("extdata/gs_DC_auto", package = "flowWorkspaceData")) fr <- gh_pop_get_data(gs[[2]], "HLADR+", returnType = "flowFrame") chnl <- c("CD11c", "CD123") p <- autoplot(fr, chnl[1], chnl[2]) g <- openCyto:::.quadGate.tmix(fr, channels = chnl, K = 3, usePrior = "no") p + geom_gate(g)