runLTMG: Get discretised regulatory signals from LTMG model

Description Usage Arguments Value References Examples

View source: R/preprocessCSV.R

Description

A wrapper function for running scGNNLTMG that uses the Left-Trunctruncated-Mixed-Gaussian(LTMG) model to translate the input gene expression data pre-processed by preprocessCSV into a discretised regulatory signal as the regularizer for the feature autoencoder of scGNN. It will take around 10-15 minutes for inferring LTMG tags, depending on the dataset. This step is optional but highly recommended prior to scGNN analysis.

Usage

1
2
3
4
5
6
7
8
runLTMG(
  scDataset = NULL,
  fromFile = FALSE,
  readPath = NULL,
  toFile = FALSE,
  outdir_path = file.path(getwd(), "output"),
  savename = "ltmg"
)

Arguments

scDataset

A scDataset object containing a matrix with row names as cell samples and column names as genes containing scRNA-seq expression values pre-processed by preprocessCSV. If reading from a expression file, this argument needs not be provided.

fromFile

A Boolean value indicating whether to read RNA-seq matrix from a expression file. If TRUE, expr_mat needs not be provided, and it will check whether the expression file exists in readPath. If FALSE, expr_mat must be provided.

readPath

A character vector representing path to the expression file. If fromFile is TRUE, it must be provided. Otherwise optional.

toFile

A Boolean value indicating whether to write the returned LTMG object to file. If TRUE, outdir_path and savename must be provided.

outdir_path

A character vector representing the path to the parent directory where the object will be saved as a file. If toFile is TRUE, it must be provided. Otherwise optional.

savename

A character vector representing the name of the saved LTMG object file. If toFile is TRUE, it must be provided. Otherwise optional.

Value

Returns an LTMG matrix containing the inferred LTMG tags of expr_mat.

References

\insertRef

LTMGscRGNet \insertRefscGNNscRGNet

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# Example 1:
# Tested examples. Not run for fast package compiling
## Not run: 
# Accessing the demo gene_counts_small dataset available with the package
inputCountsPath <- system.file("extdata", "GSE138852_small.csv", package = "scRGNet")
# Preprocess the raw counts
counts <- preprocessCSV(path = inputCountsPath)
LTMG <- runLTMG(counts)
# ~30 seconds

## End(Not run)
# Example 2:
# Preprocess the whole scRNA-seq dataset
## Not run: 
inputCountsPath <- system.file("extdata", "GSE138852_counts.csv.gz", package = "scRGNet")
counts <- preprocessCSV(path = inputCountsPath)
LTMG <- runLTMG(counts)
# Take 10-14 minutes to finish running

## End(Not run)

ff98li/scRGNet documentation built on Jan. 14, 2022, 4:58 a.m.