Skip to content

Commit

Permalink
Fix bug in selectBatchHVG
Browse files Browse the repository at this point in the history
  • Loading branch information
mvfki committed Jan 15, 2025
1 parent c074c34 commit aca1681
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: rliger
Version: 2.1.0.9003
Date: 2024-12-04
Version: 2.1.0.9004
Date: 2025-01-07
Type: Package
Title: Linked Inference of Genomic Experimental Relationships
Description: Uses an extension of nonnegative matrix factorization to identify shared and dataset-specific factors. See Welch J, Kozareva V, et al (2019) <doi:10.1016/j.cell.2019.05.006>, and Liu J, Gao C, Sodicoff J, et al (2020) <doi:10.1038/s41596-020-0391-8> for more details.
Expand Down
4 changes: 3 additions & 1 deletion R/selectBatchHVG.R
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ selectBatchHVG.ligerDataset <- function(
fm <- featureMeta(object)
idx <- rep(FALSE, nrow(object))
idx[features] <- TRUE
idx <- idx & (fm$nCell > 0)
# idx <- idx & (fm$nCell > 0)
mat <- mat[idx, , drop = FALSE]
stats <- selectBatchHVG(mat, nGenes = nGenes, verbose = verbose,
returnStats = TRUE, ...)
Expand All @@ -175,6 +175,8 @@ selectBatchHVG.dgCMatrix <- function(
...
) {
# Get mean and var
idx <- Matrix::rowSums(object > 0) > 0
object <- object[idx, , drop = FALSE]
means <- Matrix::rowMeans(object)
vars <- rowVars_sparse_rcpp(object, means)
stats <- .selectBatchHVG.by.metric(
Expand Down

0 comments on commit aca1681

Please sign in to comment.