load rdata (seurat)¶
In [3]:
load("./bioFound/Geneformer/rdata/cells.choosen.for.anylasis.rdata")
# load("/scratch/PI/jgwang/zmoad/Projects/xQTL/01.Data/cells.choosen.for.anylasis.rdata")
In [4]:
ls()
- 'choose'
- 'pbmc'
In [5]:
choose
An object of class Seurat 32738 features across 247048 samples within 1 assay Active assay: RNA (32738 features, 0 variable features)
convert data from Seurat to AnnData¶
How to install?
mamba install -c conda-forge r-seurat
mamba install -c pwwang r-seuratdisk
In [11]:
library(Seurat)
library(SeuratDisk)
load("./WLsc_IDHwt_GBM.RData")
Warning message: “package ‘SeuratDisk’ was built under R version 4.2.3” Registered S3 method overwritten by 'SeuratDisk': method from as.sparse.H5Group Seurat
In [12]:
pbmc
An object of class Seurat 30223 features across 149341 samples within 2 assays Active assay: RNA (28223 features, 0 variable features) 1 other assay present: integrated 3 dimensional reductions calculated: pca, tsne, umap
In [13]:
pbmc[["integrated"]] <-NULL
pbmc
An object of class Seurat 28223 features across 149341 samples within 1 assay Active assay: RNA (28223 features, 0 variable features) 2 dimensional reductions calculated: tsne, umap
Warning message in reshape_scaled_data(loadings, var, red_name):
“data values for pca
are computed only for a some features (HVGs). For it, an array with full var dimension will be recorded as it has to be match the var dimension of the data/counts.”
In [14]:
pbmc@reductions$tsne <- NULL
pbmc@reductions$umap <- NULL
pbmc
An object of class Seurat 28223 features across 149341 samples within 1 assay Active assay: RNA (28223 features, 0 variable features)
In [15]:
SaveH5Seurat(pbmc, filename = "pbmc_minghao.h5Seurat")
Convert("pbmc_minghao.h5Seurat", dest = "h5ad")
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 Validating h5Seurat file Adding data from RNA as X Adding counts from RNA as raw Transfering meta.data to obs