Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with the Delayed Array matrix #111

Open
Marwansha opened this issue Mar 6, 2024 · 1 comment
Open

problem with the Delayed Array matrix #111

Marwansha opened this issue Mar 6, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Marwansha
Copy link

Marwansha commented Mar 6, 2024

hey,
i generated a sce object using readH5AD with big object and i am failing to convert it the delayed matrix to dgCMatrix or CsparseMatrix and i wanted to ask if this is related to how readH5AD works and if you have any advice on how to convert the matrix would apperciate it.
thanks

 > sce
class: SingleCellExperiment 
dim: 36623 697321 
metadata(11): _scvi_manager_uuid _scvi_uuid ... umap x_condition
assays(1): counts
rownames: NULL
rowData names(8): FDR bio ... tech total
colnames(697321): TTCAATCTCGAACCTA CGTAAGTTCACTCCGT ... GCTGGGTGTGTTCCAA AGTGATCAGCAATTAG-1
colData names(56): sample_id condition ... age_group age_sex
reducedDimNames(0):
mainExpName: NULL
altExpNames(0):

 > sce@assays@data@listData$counts%>%str()
**Formal class 'DelayedMatrix' [package "DelayedArray"] with 1 slot**
  ..@ seed:Formal class 'DelayedSetDimnames' [package "DelayedArray"] with 2 slots
  .. .. ..@ dimnames:List of 2
  .. .. .. ..$ **: int -1**
  .. .. .. ..$ : chr [1:697321] "TTCAATCTCGAACCTA" "CGTAAGTTCACTCCGT" "GAGAGGTCACCCTATC" "GTGCACGAGTCGAAGC" ...
  .. .. ..@ seed    :Formal class 'DelayedSubset' [package "DelayedArray"] with 2 slots
  .. .. .. .. ..@ index:List of 2
  .. .. .. .. .. ..$ : NULL
  .. .. .. .. .. ..$ : int [1:697321] 1 2 3 4 5 6 7 8 9 10 ...
  .. .. .. .. ..@ seed :Formal class 'CSC_H5SparseMatrixSeed' [package "HDF5Array"] with 6 slots
  .. .. .. .. .. .. ..@ filepath     : chr **"/pasteur/zeus/projets/p02/LabExMI/singleCell/V3/scRNA_NS_IAV_COV/results/merged_object/raw_v4.h5ad"**
  .. .. .. .. .. .. ..@ group        : chr "/X"
  .. .. .. .. .. .. ..@ subdata      : NULL
  .. .. .. .. .. .. ..@ dim          : int [1:2] 36623 714138
  .. .. .. .. .. .. ..@ indptr_ranges:'data.frame':	714138 obs. of  2 variables:
  .. .. .. .. .. .. .. ..$ start: num [1:714138] 1 8370 16015 24161 30876 ...
  .. .. .. .. .. .. .. ..$ width: int [1:714138] 8369 7645 8146 6715 7141 7118 7349 7288 7221 6599 ...
  .. .. .. .. .. .. ..@ dimnames     :List of 2
  .. .. .. .. .. .. .. ..$ : NULL
  .. .. .. .. .. .. .. ..$ : NULL

>assays(sce)$counts
36623 x 697321> sparse matrix of class DelayedMatrix and type "double":

 > assays(sce)$counts_dgC <- as(assays(sce)$counts, "dgCMatrix")
Error in rbind(...) : negative extents to matrix
@lazappi lazappi added the bug Something isn't working label Mar 7, 2024
@lazappi
Copy link
Member

lazappi commented Mar 7, 2024

If you have managed to get a SingleCellExperiment object then {zellkonverter} is no longer involved so this might be a better question for the {DelayedArray} maintainers. Do you see the same problem if you try it on a subset of the matrix?

Was the H5AD file created with zellkonverter::writeH5AD() and/or do you have any issues reading it in Python? If that is the case it might be something that needs to be addressed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants