Skip to content

Commit

Permalink
Merge pull request #32 from timoast/sparse_warning
Browse files Browse the repository at this point in the history
Avoid warning when creating assay from non-dgCMatrix
  • Loading branch information
mojaveazure authored Nov 23, 2021
2 parents 5499191 + 6b6f48f commit fd32116
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: SeuratObject
Type: Package
Title: Data Structures for Single Cell Data
Version: 4.0.3.9001
Date: 2021-11-19
Version: 4.0.3.9002
Date: 2021-11-23
Authors@R: c(
person(given = 'Rahul', family = 'Satija', email = 'rsatija@nygenome.org', role = 'aut', comment = c(ORCID = '0000-0001-9448-8833')),
person(given = 'Andrew', family = 'Butler', email = 'abutler@nygenome.org', role = 'aut', comment = c(ORCID = '0000-0003-3608-0463')),
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Unreleased
## Changed
- `CreateSeuratObject.Assay` sets Assay key when not present (#29)
- Ignore warnings when creating an `Assay` from a data frame (#32)

## Added
- New `CheckMatrix` generic for validating expression matrices
Expand Down
6 changes: 5 additions & 1 deletion R/assay.R
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,11 @@ CreateAssayObject <- function(
stop("No feature names (rownames) names present in the input matrix")
}
if (!inherits(x = counts, what = 'dgCMatrix')) {
counts <- as.sparse(x = counts, ...)
if (inherits(x = counts, what = "data.frame")) {
counts <- as.sparse(x = counts, ...)
} else {
counts <- as.sparse(x = counts)
}
}
if (isTRUE(x = check.matrix)) {
CheckMatrix(object = counts)
Expand Down

0 comments on commit fd32116

Please sign in to comment.