theislab / zellkonverter

Conversion between scRNA-seq objects
https://theislab.github.io/zellkonverter/
Other
152 stars 28 forks source link

'x@assays' is not parallel to 'x' #96

Closed lazappi closed 1 year ago

lazappi commented 1 year ago
          Hi everyone,

I would like to jump in on this. I am working with the dataset from GSE174188 (GSE174188_CLUES1_adjusted.h5ad.gz).

In R/4.1.3, zellkonverter 1.4.0, I was able to simply obtain the data with

lupus <- readH5AD(file=lupus_file, use_hdf5 = TRUE, raw = TRUE, verbose = TRUE)

However, after switching to R/4.2.0, zellkoverter 1.8.0, the same code leads to following error:

Error in validObject(.Object) :
 invalid class “SummarizedExperiment” object:
  'x@assays' is not parallel to 'x'
Calls: readH5AD ... new_SummarizedExperiment -> new -> initialize -> initialize -> validObject
In addition: Warning messages:
1: raw 'X' matrix does not support transposition and has been skipped
2: The names of these selected raw var columns have been modified to match R
conventions:
'feature_types-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0'
->
'feature_types.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0'
Execution halted

It turns out that that the warning "raw 'X' matrix does not support transposition and has been skipped" is the underlying cause of the assays and rowdata dimensions being mismatched, which finally results in SummarizedExperiment complaining.

In the light of this thread, I also tried with zellkonverter 1.11.0, but this did not resolve my issues.

Originally posted by @jgilis in https://github.com/theislab/zellkonverter/issues/42#issuecomment-1557207938

lazappi commented 1 year ago

Ok, so there were two things here. One is that the wrong dimensions were being used when reading raw (that is what was causing the error). The other is that the format used for storing backed sparse arrays wasn't been recognised correctly (this was the cause of the transposition warning and maybe some other stuff in #42).

These should both be fixed now in release (v1.10.1) and devel (v1.11.1).

jgilis commented 1 year ago

Thank you for the fast adjustments, I will check if this works on my side before the weekend.

jgilis commented 1 year ago

Okay I already checked, this indeed solves the issue for me! Thank you for the quick fix :pray: