subset adata is a view
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.6k
- Forks
- 779
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 27
Description
Hi thanks for your excellent work!
I noticed for a subset adata object, say
batch1 = adata[adata.obs["batch"] == "batch1", :]
it will be a view of the original adata
For further analysis, if I just wanted to calculate the mean of selected rows (it will give me the mean of all the rows of original data as it is a view),
I was wondering if there is any memory-efficient way to do it instead of using copy?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the slicing example with adata[adata.obs["batch"] == "batch1", :] and compare the mean from the resulting view with the expected selected rows. Start by tracing how views are handled during subsetting; done means the selected-row mean is correct without requiring a full copy, with the memory implications documented or tested.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- bioinformatics, data
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100