# #——包括= FALSE --------------------------------------------------------- knitr: opts_chunk美元集(崩溃= TRUE,发表评论 = "#>" ) ## ---- 安装、eval = FALSE ------------------------------------------------ # 如果(!requireNamespace(“BiocManager”,悄悄地= TRUE)) {# install.packages (BiocManager) #} # BiocManager::安装(“infinityFlow ") ## ---- load_package eval = TRUE ----------------------------------------------- 库(infinityFlow)数据(steady_state_lung ) ## ---- load_example eval = TRUE ------------------------------------------------- dir < - file.path (tempdir(),“infinity_flow_example”)打印(dir) input_dir < -文件。路径(dir, fcs)写。flowSet (steady_state_lung outdir = input_dir) # #省略这个如果你已经FCS文件list.files (input_dir ) ## ---- load_annotation --------------------------------------------------------- 数据(steady_state_lung_annotation)打印(steady_state_lung_annotation ) ## ---- eval = FALSE ------------------------------------------------------------ # backbone_specification < select_backbone_and_exploratory_markers(列表。Files (input_dir, pattern = "。fcs”,full.names = TRUE )) ## ---- 主干规范输入 -------------------------------------------- 数据(steady_state_lung_backbone_specification)打印头(steady_state_lung_backbone_specification )) ## ---- 主干规范输出 ------------------------------------------- write.csv (steady_state_lung_backbone_specification文件=文件。路径(dir,“backbone_selection_file.csv”),row.names = FALSE ) ## ---- 检查输入目录 ------------------------------------------------- list.files (dir ) ## ---- 输入FCS文件路径的论点 ------------------------------------------- path_to_fcs < -文件。路径(dir, fcs)头(列表。文件(path_to_fcs,模式= " .fcs ")) ## ---- 输出路径参数 ---------------------------------------------------- path_to_output < -文件。路径(dir,"output") ## ---- backbone selection file path argument----------------------------------- list.files(dir) backbone_selection_file <- file.path(dir, "backbone_selection_file.csv") head(read.csv(backbone_selection_file)) ## ---- targets and isotypes arguments------------------------------------------ targets <- steady_state_lung_annotation$Infinity_target names(targets) <- rownames(steady_state_lung_annotation) isotypes <- steady_state_lung_annotation$Infinity_isotype names(isotypes) <- rownames(steady_state_lung_annotation) head(targets) head(isotypes) ## ---- input and output events downsampling argument--------------------------- input_events_downsampling <- 1000 prediction_events_downsampling <- 500 cores = 1L ## ---- input temporary directory path------------------------------------------ path_to_intermediary_results <- file.path(dir, "tmp") ## ---- pipeline execution, eval = TRUE----------------------------------------- imputed_data <- infinity_flow( path_to_fcs = path_to_fcs, path_to_output = path_to_output, path_to_intermediary_results = path_to_intermediary_results, backbone_selection_file = backbone_selection_file, annotation = targets, isotype = isotypes, input_events_downsampling = input_events_downsampling, prediction_events_downsampling = prediction_events_downsampling, verbose = TRUE, cores = cores ) ## ----------------------------------------------------------------------------- head(list.files(path_to_fcs)) ## Input files fcs_raw <- file.path(path_to_output, "FCS", "split") head(list.files(fcs_raw)) ## Raw output FCS files fcs_bgc <- file.path(path_to_output, "FCS_background_corrected", "split") ## Background-corrected output FCS files head(list.files(fcs_bgc)) ## Background-corrected output FCS files ## ----------------------------------------------------------------------------- file.path(path_to_output, "umap_plot_annotated.pdf") ## Raw plot file.path(path_to_output, "umap_plot_annotated_backgroundcorrected.pdf") ## Background-corrected plot ## ---- eval = FALSE, echo = FALSE---------------------------------------------- # knitr::include_graphics(file.path(path_to_output, "umap_plot_annotated.pdf")) ## ----------------------------------------------------------------------------- sessionInfo() ## ---- debugging, eval = FALSE, echo = FALSE----------------------------------- # files = list.files(dir, recursive = TRUE) # sapply( # files, # function(x){ # file.copy(from = file.path(dir, x), to = "~/Desktop/test/", recursive = TRUE) # } # )