scAlign {scAlign} | R Documentation |
Main function for scAlign that runs encoder and decoder networks
scAlign( sce.object, options = scAlignOptions(), encoder.data, decoder.data = encoder.data, supervised = "none", run.encoder = TRUE, run.decoder = FALSE, log.dir = "./models/", log.results = FALSE, device = "CPU" )
sce.object |
scAlign object. |
options |
Training options for scAlign. |
encoder.data |
Which data format to use for alignment. |
decoder.data |
Which data format to use for interpolation. |
supervised |
Run scAlign in supervised mode, requires labels. |
run.encoder |
Run scAlign alignment procedure. |
run.decoder |
Run scAlign projection through paired decoders. |
log.dir |
Location to save results. |
log.results |
Determines if results should be written to log.dir. |
device |
Specify hardware to use. May not work on all systems, manually set CUDA_VISIBLE_DEVICES if necessary. |
SingleCellExperiment
library(Seurat) library(SingleCellExperiment) ## Input data, 1000 genes x 100 cells data = matrix(sample.int(10000, 1000*100, TRUE), 1000, 100) rownames(data) = paste0("gene", seq_len(1000)) colnames(data) = paste0("cell", seq_len(100)) age = c(rep("young",50), rep("old",50)) labels = c(c(rep("type1",25), rep("type2",25)), c(rep("type1",25), rep("type2",25))) ## Build the SCE object for input to scAlign using Seurat preprocessing and variable gene selection ctrlSCE <- SingleCellExperiment( assays = list(scale.data = data[,which(age == "young")])) stimSCE <- SingleCellExperiment( assays = list(scale.data = data[,which(age == "old")])) ## Build the scAlign class object and compute PCs scAlignHSC = scAlignCreateObject(sce.objects = list("YOUNG"=ctrlSCE, "OLD"=stimSCE), labels = list(labels[which(age == "young")], labels[which(age == "old")]), pca.reduce = TRUE, pcs.compute = 50, cca.reduce = TRUE, ccs.compute = 15, project.name = "scAlign_Kowalcyzk_HSC") ## Run scAlign with high_var_genes scAlignHSC = scAlign(scAlignHSC, options=scAlignOptions(steps=1, log.every=1, norm=TRUE, early.stop=FALSE), encoder.data="scale.data", supervised='none', run.encoder=TRUE, run.decoder=FALSE, log.dir=file.path(tempdir(),'gene_input'), device="CPU")