Skip to content

Commit

Permalink
Fix bug in splatSimPathDE()
Browse files Browse the repository at this point in the history
DE factors are now adjusted for the originating path
  • Loading branch information
lazappi committed Oct 11, 2023
1 parent e253676 commit 3ee127b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: splatter
Type: Package
Title: Simple Simulation of Single-cell RNA Sequencing Data
Version: 1.25.0
Date: 2023-04-26
Version: 1.25.1
Date: 2023-10-11
Authors@R:
c(person("Luke", "Zappia", role = c("aut", "cre"),
email = "luke@lazappi.id.au",
Expand Down
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
## DEVELOPMENT VERSION

## Version 1.25.1 (2023-10-11)

* Fix a bug in splatSimPathDE() where DE factors were not adjusted based on the
path origin (path.from parameter). This affected paths where the path origin
was not the simulation origin (path.from != 0), particularly when the path DE
was minimal.

## Version 1.25.0 (2023-04-26)

Bioconductor 3.18 devel
Expand Down
12 changes: 7 additions & 5 deletions R/splat-simulate.R
Original file line number Diff line number Diff line change
Expand Up @@ -463,13 +463,15 @@ splatSimPathDE <- function(sim, params) {
for (path in path.order) {
from <- path.from[path]
if (from == 0) {
means.gene <- rowData(sim)$GeneMean
de.facs.from <- rep(1, nGenes)
} else {
means.gene <- rowData(sim)[[paste0("GeneMeanPath", from)]]
de.facs.from <- rowData(sim)[[paste0("DEFacPath", from)]]
}
de.facs <- getLNormFactors(nGenes, de.prob[path], de.downProb[path],
de.facLoc[path], de.facScale[path])
path.means.gene <- means.gene * de.facs
de.facs.local <- getLNormFactors(nGenes, de.prob[path],
de.downProb[path], de.facLoc[path],
de.facScale[path])
de.facs <- de.facs.local * de.facs.from
rowData(sim)[[paste0("LocalDEFacPath", path)]] <- de.facs.local
rowData(sim)[[paste0("DEFacPath", path)]] <- de.facs
}

Expand Down
8 changes: 7 additions & 1 deletion inst/NEWS.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@

\section{Version 1.26.0, Bioconductor 3.18 Release (2023-10-25)}{
\itemize{
No changes since the previous release
\item{
Fixed a bug in \code{splatSimPathDE()} where DE factors were not adjusted
based on the path origin (\code{path.from} parameter). This affected paths
where the path origin was not the simulation origin (i.e.
\code{path.from != 0}), particularly when the path DE was minimal.
With this fix paths should no longer drift towards the origin.
}
}
}

Expand Down

0 comments on commit 3ee127b

Please sign in to comment.