1/5
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
What does adata.obs['log_n_genes'] = np.log1p(adata.obs['n_genes']) do?
Adds a new column to the .obs DataFrame
Same mechanism as adding a column to any pandas DataFrame.
What's the difference between what .obs and .obsm store per cell?
.obs holds a single value per cell (a category, count, percentage)
.obsm holds a small array per cell (e.g. an x,y pair, or PCA/UMAP coordinates).
What shape is adata.obsm['spatial']?
(n_cells, 2) → x,y coordinates per cell
What shape is adata.obsm['X_pca']?
(n_cells, 50) → PCA coordinates.
What does adata.write_h5ad('my_data.h5ad') save?
Everything in the object in one file (X, .obs, .var, .obsm, .uns, .layers) in one round trip.
Why is saving everything in one .h5ad file better than saving separate files for each piece?
It avoids having to separately save and reload multiple files and hope they stay aligned with each other.