saeyslab / spatial_ccc_experiments

MIT License
0 stars 1 forks source link

CCC: Decide on an input format #2

Open rcannood opened 2 months ago

csangara commented 2 months ago

Since many of us prefer working in Python, I propose the input format to be AnnData with the following specifications:

rcannood commented 2 months ago

Note that you can do many of the same thing R as in Python:

How to read in Python:

import anndata as ad

adata = ad.read_h5ad('path/to/file.h5ad')

# Access celltype
adata.obs['celltype']

# Access spatial coordinates
adata.obsm['spatial']

# Access counts
adata.layers['counts']

How to read in R:

library(anndata)

adata <- read_h5ad('path/to/file.h5ad')

# Access celltype
adata$obs[["celltype"]]

# Access spatial coordinates
adata$obsm[["spatial"]]

# Access counts
adata$layers[["counts"]]