R/sce_to_embeddings.R
sce_to_embeddings.Rd
produce torchbiggraph embeddings for discretized single-cell RNA-seq measures in a SingleCellExperiment
sce_to_embeddings(
sce,
workdir,
N_EPOCHS,
N_GENES,
N_GPUS = 1L,
BATCH_SIZE = 100000L,
pbg,
palib
)
SingleCellExperiment instance that includes `disc` among its assays, intended to hold output of `disc_mat` applied to normalized log counts
character(1) folder for interim computations, must exist prior to call
numeric(1)
numeric(1)
numeric(1)
integer
reference to torchbiggraph
reference to pathlib
a list with elements `cemb` and `gemb` (matrix representations of embeddings of cells and genes respectively), `cents` and `gents` (vectors of names of cells and genes as ordered in the returned matrices), stats (a data.frame of training statistics), call (the match.call) and config (a python reference, not useful after the session in which object was produced ends).
pbg = reticulate::import("torchbiggraph")
palib = reticulate::import("pathlib")
data(t3k)
testd = paste0(tempdir(), "/testse")
dir.create(testd)
nn2 = sce_to_embeddings(t3k, testd, N_EPOCHS=2L, BATCH_SIZE=1000L,
N_GENES=500L, N_GPUS=0L, pbg=pbg, palib=palib)
#> ......................................................
dir(testd, full.names=TRUE)
#> [1] "/home/vincent/TEMP/Rtmpf7vh4D/testse/basic.tsv"
#> [2] "/home/vincent/TEMP/Rtmpf7vh4D/testse/cp2"
#> [3] "/home/vincent/TEMP/Rtmpf7vh4D/testse/ents2"
#> [4] "/home/vincent/TEMP/Rtmpf7vh4D/testse/tr"