# 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