interactivereport / cellxgene_VIP

Enables cellxgene to generate violin, stacked violin, stacked bar, heatmap, volcano, embedding, dot, track, density, 2D density, sankey and dual-gene plot in high-resolution SVG/PNG format. It also performs differential gene expression analysis and provides a Command Line Interface (CLI) for advanced users to perform analysis using python and R.
https://cellxgenevip-ms.bxgenomics.com
MIT License
129 stars 44 forks source link

Seurat4 SeuratDisk exported h5ad cause blank VIP menu #48

Closed likejie closed 3 years ago

likejie commented 3 years ago

If we are using Seurat v4 and SeuratDisk to export h5ad file, it seems that cellxgene basic still works fine but cellxgene VIP came up as blank.

library(Seurat)
library(SeuratDisk)
SaveH5Seurat(query, filename = "data.h5Seurat")
Convert("data.h5Seurat", dest = "h5ad")
likejie commented 3 years ago

Searched around and found the problem is SeuratDisk output h5ad file, and when read in by scanpy, this:

adata.__dict__['_raw'].__dict__['_var'] has a column named _index. But python has it reserved.

One solution is to rename _index to something else such as features:

adata.__dict__['_raw'].__dict__['_var'] = adata.__dict__['_raw'].__dict__['_var'].rename(columns={'_index': 'features'})

z5ouyang commented 3 years ago

If cellxgene works, VIP should work as well, since VIP didn't use scanpy to read the h5ad directly.

FADHLyemen commented 3 years ago

use library(sceasy) for conversion,