kuang-da / sc-transmogrifier

A containerized tool for converting single-cell data between Seurat objects (R) and AnnData (Python) formats.
3 stars 0 forks source link

SaveH5Seurat: error #000: ../../../src/H5A.c in H5Awrite(): line 619: null attribute buffer #6

Open kuang-da opened 8 months ago

kuang-da commented 8 months ago
❯ docker run --rm\
 -v /mnt/nvme-1/2-hubmap/spatial/ref-scrna/data/ft:/app/data\
 -v /mnt/nvme-1/2-hubmap/spatial/ref-scrna/out/ft:/app/out\
 -v /mnt/nvme-1/2-hubmap/sc-transmogrifier:/app/sc-transmogrifier\
 kuangda/sc-transmogrifier\
 bash /app/sc-transmogrifier/run-seurat2ann.sh /app/data/FT_wnn_integrated_annotated-02192024.RDS RNA TRUE
Loading required package: SeuratObject
Loading required package: sp

Attaching package: ‘SeuratObject’

The following object is masked from ‘package:base’:

    intersect

Registered S3 method overwritten by 'SeuratDisk':
  method            from  
  as.sparse.H5Group Seurat
Input Seurat file: /app/data/FT_wnn_integrated_annotated-02192024.RDS 
Output directory: /app/out 
----------------------------------------
Loading Seurat object...
Keeping only raw data.
Warning messages:
1: The `slot` argument of `GetAssayData()` is deprecated as of SeuratObject 5.0.0.
ℹ Please use the `layer` argument instead. 
2: The `slot` argument of `SetAssayData()` is deprecated as of SeuratObject 5.0.0.
ℹ Please use the `layer` argument instead. 
Seurat object info:
Sample cell names: 9-RTAMP#AAACAGCCATGACTAT-1 9-RTAMP#AAACAGCCATTTAAGC-1 9-RTAMP#AAACATGCATAGTCAT-1 9-RTAMP#AAACCGAAGCACGTTG-1 9-RTAMP#AAACCGCGTCATTGTC-1 
Sample gene names: MIR1302-2HG AL627309.1 AL627309.5 AL627309.4 AL669831.2 
An object of class Seurat 
878562 features across 37329 samples within 6 assays 
Active assay: RNA (30289 features, 0 variable features)
 2 layers present: counts, data
 5 other assays present: ATAC, integrated_RNA, GeneScore, peaks, chromvar
 5 dimensional reductions calculated: integrated_lsi, umap.atac.int, pca, umap.rna, wnn.umap
----------------------------------------
--------- Converting Seurat object to AnnData...
Creating h5Seurat file for version 3.1.5.9900
Adding counts for RNA
Adding data for RNA
No variable features found for RNA
No feature-level metadata found for RNA
Adding counts for ATAC
Adding data for ATAC
No variable features found for ATAC
Adding feature-level metadata for ATAC
Writing out ranges for ATAC
Writing out motifs for ATAC
Writing out fragments for ATAC
Writing out seqinfo for ATAC
Writing out annotation for ATAC
Writing out bias for ATAC
Writing out positionEnrichment for ATAC
Writing out links for ATAC
Adding data for integrated_RNA
Adding scale.data for integrated_RNA
Adding variable features for integrated_RNA
No feature-level metadata found for integrated_RNA
Adding counts for GeneScore
Adding data for GeneScore
No variable features found for GeneScore
No feature-level metadata found for GeneScore
Adding counts for peaks
Adding data for peaks
No variable features found for peaks
Adding feature-level metadata for peaks
Writing out ranges for peaks
Writing out motifs for peaks
Error in attr$write(robj) : HDF5-API Errors:
    error #000: ../../../src/H5A.c in H5Awrite(): line 619: null attribute buffer
        class: HDF5
        major: Invalid arguments to routine
        minor: Bad value
Calls: SaveH5Seurat ... WriteH5Group -> <Anonymous> -> <Anonymous> -> .Call
Execution halted
kuang-da commented 8 months ago

There might be some null in the motif slot in the object.

kuang-da commented 8 months ago

To bypass the error, I removed some assay slots I do not need at the moment. Those data structures may not be supported for transformation yet.

> seurat_obj
# An object of class Seurat 
# 878562 features across 37329 samples within 6 assays 
# Active assay: RNA (30289 features, 0 variable features)
#  5 other assays present: ATAC, integrated_RNA, GeneScore, peaks, chromvar
#  5 dimensional reductions calculated: integrated_lsi, umap.atac.int, pca, umap.rna, wnn.umap

> seurat_obj[["peaks"]] <- NULL
> seurat_obj[["chromvar"]] <- NULL
> seurat_obj
# An object of class Seurat 
# 467523 features across 37329 samples within 4 assays 
# Active assay: RNA (30289 features, 0 variable features)
#  3 other assays present: ATAC, integrated_RNA, GeneScore
#  5 dimensional reductions calculated: integrated_lsi, umap.atac.int, pca, umap.rna, wnn.umap