View source: R/interGradientsDL.R
topGradientsCellType | R Documentation |
Retrieve feature names with the largest/smallest gradients per cell
type. These genes can be used to plot the calculated
gradients as a heatmap (plotGradHeatmap
function).
topGradientsCellType(object, method = "class", top.n.genes = 15)
object |
|
method |
Method gradients were calculated by. It can be either
|
top.n.genes |
Top n genes (positive and negative) taken per cell type. |
List of gene names with the top positive and negative gradients per cell type.
interGradientsDL
trainDDLSModel
set.seed(123)
sce <- SingleCellExperiment::SingleCellExperiment(
assays = list(
counts = matrix(
rpois(30, lambda = 5), nrow = 15, ncol = 10,
dimnames = list(paste0("Gene", seq(15)), paste0("RHC", seq(10)))
)
),
colData = data.frame(
Cell_ID = paste0("RHC", seq(10)),
Cell_Type = sample(x = paste0("CellType", seq(2)), size = 10,
replace = TRUE)
),
rowData = data.frame(
Gene_ID = paste0("Gene", seq(15))
)
)
DDLS <- createDDLSobject(
sc.data = sce,
sc.cell.ID.column = "Cell_ID",
sc.gene.ID.column = "Gene_ID",
sc.filt.genes.cluster = FALSE
)
prop.design <- data.frame(
Cell_Type = paste0("CellType", seq(2)),
from = c(1, 30),
to = c(15, 70)
)
DDLS <- generateBulkCellMatrix(
object = DDLS,
cell.ID.column = "Cell_ID",
cell.type.column = "Cell_Type",
prob.design = prop.design,
num.bulk.samples = 50,
verbose = TRUE
)
DDLS <- simBulkProfiles(DDLS)
DDLS <- trainDDLSModel(
object = DDLS,
batch.size = 12,
num.epochs = 5
)
## calculating gradients
DDLS <- interGradientsDL(DDLS)
listGradients <- topGradientsCellType(DDLS)
lapply(listGradients, head, n = 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.