Description Usage Arguments Value Examples
Main function for scAlignMulti that aligns multiple datasets
1 2 3 4 5 6 7 8 9 10 11 12 13 | scAlignMulti(
sce.object,
options = scAlignOptions(),
encoder.data,
decoder.data = encoder.data,
reference.data = "NULL",
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. |
reference.data |
Name of assay or reducedDim slot to use as reference. (Disables all pairs alignment and only aligns to a single reference) |
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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | 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
scAlign = 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
scAlign = scAlignMulti(scAlign,
options=scAlignOptions(steps=1, log.every=1, norm=TRUE, early.stop=FALSE),
encoder.data="scale.data",
reference.data="YOUNG",
supervised='none',
run.encoder=TRUE,
run.decoder=FALSE,
log.dir=file.path(tempdir(),'gene_input'),
device="CPU")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.