evaluateDensities: Evaluate the densities in the estimated SPsimSeq object

View source: R/evaluateDensities.R

evaluateDensitiesR Documentation

Evaluate the densities in the estimated SPsimSeq object

Description

Evaluate the densities in the estimated SPsimSeq object

Usage

evaluateDensities(SPobj, newData = names(SPobj$detailed.results$densList))

Arguments

SPobj

The SPsimSeq object, with details retained

newData

A character vector of gene names

Value

a list of estimated densities, breaks and midpoints, one for every gene in newData

Examples

data("zhang.data.sub")
# filter genes with sufficient expression (important step to avoid bugs)
zhang.counts <- zhang.data.sub$counts
MYCN.status  <- zhang.data.sub$MYCN.status
# simulate data
sim.data.bulk <- SPsimSeq(n.sim = 1, s.data = zhang.counts,
                          group = MYCN.status, n.genes = 2000, batch.config = 1,
                          group.config = c(0.5, 0.5), tot.samples = 20,
                          pDE = 0.1, lfc.thrld = 0.5, result.format = "list",
                          return.details = TRUE)
outDens = evaluateDensities(sim.data.bulk)
select.genes <- sample(names(outDens), 4)
select.sample = sample(
seq_along(sim.data.bulk$detailed.results$exprmt.design$sub.groups), 1)
par(mfrow=c(2, 2))
for(i in select.genes){
     plot(outDens[[i]][[select.sample]]$mids, outDens[[i]][[select.sample]]$gy, type = "l", 
     xlab = "Outcome", ylab = "Density", main = paste("Gene", i))
  }

CenterForStatistics-UGent/SPsimSeq documentation built on Nov. 21, 2024, 6:30 a.m.