Skip to content

Commit

Permalink
Merge pull request satijalab#412 from satijalab/fix/dimnamecheck
Browse files Browse the repository at this point in the history
Convert to matrix before dimname checks in CreateAssayObject
  • Loading branch information
andrewwbutler authored Sep 17, 2020
2 parents afa9c2e + afee30e commit 02145bc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: Seurat
Version: 3.2.1.9002
Date: 2020-09-11
Version: 3.2.1.9003
Date: 2020-09-17
Title: Tools for Single Cell Genomics
Description: A toolkit for quality control, analysis, and exploration of single cell RNA sequencing data. 'Seurat' aims to enable users to identify and interpret sources of heterogeneity from single cell transcriptomic measurements, and to integrate diverse types of single cell data. See Satija R, Farrell J, Gennert D, et al (2015) <doi:10.1038/nbt.3192>, Macosko E, Basu A, Satija R, et al (2015) <doi:10.1016/j.cell.2015.05.002>, and Stuart T, Butler A, et al (2019) <doi:10.1016/j.cell.2019.05.031> for more details.
Authors@R: c(
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
### Changes
- Set the seed in `WhichCells` regardless of whether or not `idents` is passed
- Retain Graph and Neighbor objects when subsetting only on features
- Fix data.frame input to `CreateAssayObject()` when data.frame has no rownames.

## [3.2.1] - 2020-09-04
### Added
Expand Down
6 changes: 3 additions & 3 deletions R/objects.R
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,9 @@ CreateAssayObject <- function(
} else if (!missing(x = counts) && !missing(x = data)) {
stop("Either 'counts' or 'data' must be missing; both cannot be provided")
} else if (!missing(x = counts)) {
if (!inherits(x = counts, what = 'dgCMatrix')) {
counts <- as(object = as.matrix(x = counts), Class = 'dgCMatrix')
}
# check that dimnames of input counts are unique
if (anyDuplicated(rownames(x = counts))) {
warning(
Expand All @@ -675,9 +678,6 @@ CreateAssayObject <- function(
if (nrow(x = counts) > 0 && is.null(x = rownames(x = counts))) {
stop("No feature names (rownames) names present in the input matrix")
}
if (!inherits(x = counts, what = 'dgCMatrix')) {
counts <- as(object = as.matrix(x = counts), Class = 'dgCMatrix')
}
# Filter based on min.features
if (min.features > 0) {
nfeatures <- Matrix::colSums(x = counts > 0)
Expand Down

0 comments on commit 02145bc

Please sign in to comment.