Skip to content
Snippets Groups Projects
Commit a681f864 authored by Luke Zappia's avatar Luke Zappia
Browse files

Convert phenoSimulate output to counts

parent aa3d2663
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,9 @@
#' This function is just a wrapper around
#' \code{\link[phenopath]{simulate_phenopath}} that takes a
#' \code{\link{PhenoParams}}, runs the simulation then converts the
#' output to a \code{\link[SingleCellExperiment]{SingleCellExperiment}} object.
#' output from log-counts to counts and returns a
#' \code{\link[SingleCellExperiment]{SingleCellExperiment}} object. The original
#' simulated log-expression values are returned in the \code{LogExprs} asssay.
#' See \code{\link[phenopath]{simulate_phenopath}} and the PhenoPath paper for
#' more details about how the simulation works.
#'
......@@ -59,7 +61,10 @@ phenoSimulate <- function(params = newPhenoParams(), verbose = TRUE, ...) {
cell.names <- paste0("Cell", seq_len(nCells))
gene.names <- paste0("Gene", seq_len(nGenes))
counts <- t(pheno.sim$y)
exprs <- t(pheno.sim$y)
counts <- 2 ^ exprs - 1
counts[counts < 0] <- 0
counts <- round(counts)
rownames(counts) <- gene.names
colnames(counts) <- cell.names
......@@ -75,7 +80,8 @@ phenoSimulate <- function(params = newPhenoParams(), verbose = TRUE, ...) {
Regime = pheno.sim$parameters$regime)
rownames(features) <- gene.names
sim <- SingleCellExperiment(assays = list(counts = counts),
sim <- SingleCellExperiment(assays = list(counts = counts,
LogExprs = exprs),
rowData = features,
colData = cells,
metadata = list(params = params))
......
......@@ -24,7 +24,9 @@ Simulate counts from a pseudotime trajectory using the PhenoPath method.
This function is just a wrapper around
\code{\link[phenopath]{simulate_phenopath}} that takes a
\code{\link{PhenoParams}}, runs the simulation then converts the
output to a \code{\link[SingleCellExperiment]{SingleCellExperiment}} object.
output from log-counts to counts and returns a
\code{\link[SingleCellExperiment]{SingleCellExperiment}} object. The original
simulated log-expression values are returned in the \code{LogExprs} asssay.
See \code{\link[phenopath]{simulate_phenopath}} and the PhenoPath paper for
more details about how the simulation works.
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment