1/4
Looks like no tags are added yet.
What does adata[['Cell_1', 'Cell_10'], :] select?
Just those two specific cells (by name), all genes.
What does adata[mask, :] do if mask = adata.obs['cell_type'] == 'hepatocyte'?
Subsets the AnnData object to only hepatocyte cells
Mask is built via .obs (pandas), then applied to the whole adata object.
What does adata[mask, markers] do?
Subsets both cells (by the boolean mask) and genes (to just the names in markers) at the same time.
Why is the AnnData indexing syntax adata[rows, columns] and not something else?
It deliberately mirrors NumPy's data[rows, columns] and pandas' .iloc[rows, cols] pattern.
Why does applying a mask built from .obs to the whole adata object matter (rather than filtering pieces separately)?
It subsets the count matrix, obs, and any stored coordinates consistently in one step, rather than risking misalignment from filtering each piece separately.