scAlign: Run scAlign framework

Description Usage Arguments Value Examples

View source: R/scAlign.R

Description

Main function for scAlign that runs encoder and decoder networks

Usage

1
2
3
4
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")

Arguments

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.

Value

SingleCellExperiment

Examples

 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
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('~/models','gene_input'),
                   device="CPU")

scAlign documentation built on April 28, 2020, 6:10 p.m.