build and train SIMBA PBG graph

build_and_train_pbg(
  adSimb,
  copy = FALSE,
  use_hvg = FALSE,
  dirname = "graph0",
  auto_wd = TRUE,
  save_wd = TRUE,
  output = "model",
  simba_ref
)

Arguments

adSimb

an instance of AnnData with simba layer as produced by basic_preproc

copy

logical(1) passed to gen_graph in simba.tl module, defaults to FALSE

use_hvg

logical(1) passed as `use_highly_variable` to gen_graph, defaults to FALSE

dirname

character(1) defaults to 'graph0'; training stats will be saved to `paste0(simba_ref$settings$workdir, "/", dirname, "/", model, "/", "training_stats.json")`

auto_wd

logical(1) defaults to TRUE, for automatic setting of weight decay

save_wd

logical(1) defaults to TRUE

output

character(1) defaults to 'model'

simba_ref

instance of python.builtin.module, checked to have component 'tl'

Value

NULL; components of `simba_ref` are updated to permit retrieval of embedding.

Examples

p3k = get_10x3kpbmc_path(overwrite=TRUE)
ref = simba_ref()
pp = ref$read_h5ad(p3k)
bb = basic_preproc(pp, simba_ref=ref)
gg = build_and_train_pbg( bb, simba_ref=ref )
dict = ref$read_embedding()
dict 
#> $C
#> AnnData object with n_obs × n_vars = 2700 × 50
#> 
#> $G
#> AnnData object with n_obs × n_vars = 13714 × 50
#>