Deck 12: Subsetting AnnData

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/4

encourage image

There's no tags or description

Looks like no tags are added yet.

5 Terms

1
New cards

What does adata[['Cell_1', 'Cell_10'], :] select?

Just those two specific cells (by name), all genes.

2
New cards

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.


3
New cards

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.

4
New cards

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.

5
New cards

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.