Learn R Programming

scTenifoldNet (version 1.2.2)

scTenifoldNet: scTenifoldNet

Description

Construct and compare single-cell gene regulatory networks (scGRNs) using single-cell RNA-seq (scRNA-seq) data sets collected from different conditions based on principal component regression, tensor decomposition, and manifold alignment.

Usage

scTenifoldNet(X, Y, qc_minLibSize = 1000, qc_removeOutlierCells = TRUE,
  qc_minPCT = 0.05, qc_maxMTratio = 0.1, nc_nNet = 10,
  nc_nCells = 500, nc_nComp = 3, nc_symmetric = FALSE,
  nc_scaleScores = TRUE, nc_q = 0.05, td_K = 3, td_maxIter = 1000,
  td_maxError = 1e-05, ma_nDim = 30)

Arguments

X

Raw counts matrix with cells as columns and genes (symbols) as rows.

Y

Raw counts matrix with cells as columns and genes (symbols) as rows.

qc_minLibSize

An integer value. Defines the minimum library size required for a cell to be included in the analysis.

qc_removeOutlierCells

A boolean value (TRUE/FALSE), if TRUE, the identified cells with library size greater than 1.58 IQR/sqrt(n) computed from the sample, are removed. For further details see: ?boxplot.stats

qc_minPCT

A decimal value between 0 and 1. Defines the minimum fraction of cells where the gene needs to be expressed to be included in the analysis.

qc_maxMTratio

A decimal value between 0 and 1. Defines the maximum ratio of mitochondrial reads (mithocondrial reads / library size) present in a cell to be included in the analysis. It's computed using the symbol genes starting with 'MT-' non-case sensitive.

nc_nNet

An integer value. The number of networks based on principal components regression to generate.

nc_nCells

An integer value. The number of cells to subsample each time to generate a network.

nc_nComp

An integer value. The number of principal components in PCA to generate the networks. Should be greater than 2 and lower than the total number of genes.

nc_symmetric

A boolean value (TRUE/FALSE), if TRUE, the weights matrix returned will be symmetric.

nc_scaleScores

A boolean value (TRUE/FALSE), if TRUE, the weights will be normalized such that the maximum absolute value is 1.

nc_q

A decimal value between 0 and 1. Defines the cut-off threshold of top q% relationships to be returned.

td_K

An integer value. Defines the number of rank-one tensors used to approximate the data using CANDECOMP/PARAFAC (CP) Tensor Decomposition.

td_maxIter

An integer value. Defines the maximum number of iterations if error stay above td_maxError.

td_maxError

A decimal value between 0 and 1. Defines the relative Frobenius norm error tolerance.

ma_nDim

An integer value. Defines the number of dimensions of the low-dimensional feature space to be returned from the non-linear manifold alignment.

Value

A list with 3 slots as follows:

  • tensorNetworks: The generated weight-averaged denoised gene regulatory networks using CANDECOMP/PARAFAC (CP) Tensor Decomposition.

  • manifoldAlignment: The generated low-dimensional features result of the non-linear manifold alignment.

  • diffRegulation The results of the differential regulation analysis.

Examples

Run this code
# NOT RUN {
library(scTenifoldNet)

# Simulating of a dataset following a negative binomial distribution with high sparcity (~67%)
nCells = 2000
nGenes = 100
set.seed(1)
X <- rnbinom(n = nGenes * nCells, size = 20, prob = 0.98)
X <- round(X)
X <- matrix(X, ncol = nCells)
rownames(X) <- c(paste0('ng', 1:90), paste0('mt-', 1:10))

# Generating a perturbed network modifying the expression of genes 10, 2 and 3
Y <- X
Y[10,] <- Y[50,]
Y[2,] <- Y[11,]
Y[3,] <- Y[5,]

# }
# NOT RUN {
# scTenifoldNet
Output <- scTenifoldNet(X = X, Y = Y,
                       nc_nNet = 10, nc_nCells = 500,
                       td_K = 3, qc_minLibSize = 30,
                       dc_minDist = 0)

# Structure of the output
str(Output)

# Differential Regulation
head(Output$diffRegulation,n = 10)

# Plotting
# Genes with FDR < 0.1 are labeled as red
geneColor <- ifelse(Output$diffRegulation$p.adj < 0.1, 'red', 'black')
qqnorm(Output$diffRegulation$Z, pch = 16, main = 'Standardized distance', col = geneColor)
qqline(Output$diffRegulation$Z)
# }

Run the code above in your browser using DataLab