No error message v.4.0.0 when count matrix has no rownames
e.g. a data.table
object passed
#4063
Labels
bug
Something isn't working
When you initialize a Seurat Object in Seurat v3.2.3,
CreateSeuratObject()
will report thatrownames
ar missing. But v.4.0.0 will proceed silently with creating the object which is then will result in all kinds of errors, especially with subsetting. Those errors do not tell you much about what went wrong.One can easily try to pass a
data.frame
looking object, e.g. adata.table
as the input for count matrix which no longer supports therownames
attribute. Sincedata.table
offers a very quick way of loading data and it is also memory efficient, it is popular. However, when interfacing with Seurat, one needs to make sure it is turned into something that supportsrownames
because that holds the feature identifiers. (This can be done via a simpleas.sparse()
call, but rownames still need to be manually added.)A basic check on the presence and validity of
rownames
, i.e. if they are not just sequential integers would be very helpful at the time of initialization because currently, v4.0.0 is silent about the issue.The code below will produce an error in v3.2.3, which is the expected behavior. v4.0.0 will be silent.
In addition, since it seems to me that the trend is not to use
rownames
at all with the more advanced data structures e.g.tibble
,data.table
. It would be great ifCreateSeuratObject()
would support supplying the feature vector as a separate vector, and perhaps allowing for the meta.data input to have a cellnames/barcodes vector as well. Both could be by defaultrownames
of the classicdata.frames
: i.e.features = rownames(counts)
andbarcodes = rownames(meta.data)
. This could also explicitly specify the requirements in the function definition. Seurat could still use the traditionaldata.frame
s internally.SessionInfo:
The text was updated successfully, but these errors were encountered: