Unable to edit backed AnnData
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 323
- Forks
- 43
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
Thanks again for writing a wonderful package. I'm currently trying to implement the backed AnnData objects into a pipeline I'm building. I have a couple items of feedback to share, but I'll start with this one.
After I create backed AnnData objects via pp.import_data I'm unable to add new columns to .obs (i.e., adata.obs["barcode"] = adata.obs_names). Attempting to do so, I get the error
called `Result::unwrap()` on an `Err` value: H5Ldelete(): unable to delete link: no write intent on file note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
I'm able to resolve this error by closing the AnnData object (adata.close()), and then rereading with write permissions (adata = snap.read(f"{file_name}.h5ad", "r+")). While this works, it's awkward and I have to do it again after running snap.metrics.tsse. I wonder if there's a better way to specify permissions when create backed AnnData objects. If not, perhaps an option to specify in import_data would be helpful.
Thanks!
Contributor guide
No contributing guide indexed for this repository
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
Start by reproducing the write-permission error after creating a backed AnnData object with pp.import_data, then compare it with reopening through snap.read(..., "r+"). Check the related behavior after snap.metrics.tsse and adata.close(). Done means the issue's requested permission behavior is clear and backed AnnData objects can be edited without the reported H5Ldelete error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100