@@ -2,21 +2,23 @@ library(anndata)
22library(flowCore )
33# # VIASH START
44par <- list (
5- input = " resources_test/debug/batchadjust/_viash_par/input_1 /censored_split1.h5ad" ,
5+ input = " resources_test/task_cyto_batch_integration/mouse_spleen_flow_cytometry_subset /censored_split1.h5ad" ,
66 output = " resources_test/debug/batchadjust/output.h5ad" ,
77 percentile = as.integer(' 80' )
88)
99meta <- list (
1010 name = " batchadjust_one_control" ,
11- temp_dir = " resources_test/tmp " ,
11+ temp_dir = " resources_test/tmp_batchadjust_one_control " ,
1212 resources_dir = " src/methods/batchadjust_one_control"
1313)
1414source(" src/utils/anndata_to_fcs.R" )
15+ source(" src/utils/helper_functions.R" )
1516# # VIASH END
1617
1718source(paste0(meta $ resources_dir , " /utils.R" ))
1819source(paste0(meta $ resources_dir , " /anndata_to_fcs.R" ))
1920source(paste0(meta $ resources_dir , " /BatchAdjust.R" ))
21+ source(paste0(meta $ resources_dir , " /helper_functions.R" ))
2022
2123tmp_dir <- get_temp_dir(meta )
2224print(paste0(" Using temp dir: " , tmp_dir ))
@@ -39,7 +41,9 @@ on.exit(clean_temp_dir(tmp_dir))
3941
4042
4143cat(" Reading input files\n " )
42- input <- anndata :: read_h5ad(par [[" input" ]])
44+ input <- anndata :: read_h5ad(par [[" input" ]]) | >
45+ subset_onecontrol()
46+
4347# use Original_ID column to restore cell order after I/O operations
4448# input$layers["preprocessed"][, "Original_ID"] <- seq(1, dim(input)[1])
4549
@@ -92,8 +96,9 @@ if (!non_control_has_batch) {
9296input_no_controls $ obs $ sample <- sapply(input_no_controls $ obs $ sample , fix_batch_underscore_anynum )
9397
9498
95- cat(" Writing FCS files\n " )
99+ cat(" Writing control FCS files\n " )
96100anndata_to_fcs(input_controls , out_dir = tmp_dir )
101+ cat(" Writing non-control FCS files\n " )
97102anndata_to_fcs(input_no_controls , out_dir = tmp_dir )
98103
99104cat(" Writing channels to correct as a text file\n " )
0 commit comments