sceasy和 CELLxGENE

sceasy

sceasy 是一个帮助不同单细胞数据格式间相互转换的包。转换为 AnnData 格式后,可以直接在 cellxgene 中使用,这是一个用于单细胞转录组数据集的交互式浏览器。

如果需要将 h5ad 转换为 rds 格式,也可以参考 https://github.com/cellgeni/schard

安装

sceasy 可以作为 bioconda 包安装:

conda install -c bioconda r-sceasy

也可以作为 R 包安装:

devtools::install_github("cellgeni/sceasy")

这将需要安装 bioconductor 包 BiocManager 和 LoomExperiment:

if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")

BiocManager::install(c("LoomExperiment", "SingleCellExperiment"))

使用 sceasy 时,请确保已安装 anndata 包:

conda install anndata -c bioconda

如果计划在 loom 和 anndata 之间进行转换,请确保已安装 loompy 包:

conda install loompy  -c bioconda

你还需要安装 reticulate 包:

install.packages('reticulate')

使用

在转换数据之前,加载以下库:

library(sceasy)
library(reticulate)
use_condaenv('EnvironmentName')
loompy <- reticulate::import('loompy')

Seurat 转 AnnData

sceasy::convertFormat(seurat_object, from="seurat", to="anndata",
                      outFile='filename.h5ad')

AnnData 转 Seurat

sceasy::convertFormat(h5ad_file, from="anndata", to="seurat",
                      outFile='filename.rds')

Seurat 转 SingleCellExperiment

sceasy::convertFormat(seurat_object, from="seurat", to="sce",
                      outFile='filename.rds')

SingleCellExperiment 转 AnnData

sceasy::convertFormat(sce_object, from="sce", to="anndata",
                      outFile='filename.h5ad')

SingleCellExperiment 转 Loom

sceasy::convertFormat(sce_object, from="sce", to="loom",
                      outFile='filename.loom')

Loom 转 AnnData

sceasy::convertFormat('filename.loom', from="loom", to="anndata",
                      outFile='filename.h5ad')

Loom 转 SingleCellExperiment

sceasy::convertFormat('filename.loom', from="loom", to="sce",
                      outFile='filename.rds')

CELLxGENE Annotate

CELLxGENE Annotate(发音为 "cell-by-gene")是一个用于单细胞数据集(例如来自人类细胞图谱的数据集)的交互式数据浏览器。利用现代Web开发技术,实现了对至少100万个细胞的快速可视化。

入门指南

快速开始

要安装 CELLxGENE Annotate,需要 Python 3.6+

安装包:

pip install cellxgene

使用示例 anndata 文件启动 Annotate:

cellxgene launch https://cellxgene-example-data.czi.technology/pbmc3k.h5ad

重用

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容