AnnDataSet can not be converted to AnnData when the X is empty

Open
#331 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python, rust

Research direction

Reproduce the issue with an AnnDataSet whose AnnData objects have empty X, using the to_adata and X entry points. Inspect the reported anndata dataset.py location and verify that conversion and X access no longer panic while preserving the empty-X behavior.

Written by the indexing model from the issue text.

Description

bug :bug:

Hi Kai,

I have several AnnData created directly from fragment files. If I did not add any matrix to AnnData's X, and combine them into AnnDataSet (this step is OK).

  1. I find that it always report Errors when I used to_adata function for the merged AnnDataSet object.

thread '' panicked at /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anndata-0.3.1/src/anndata/dataset.rs:302:81:
called Option::unwrap() on a None value
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

  1. if I run a.X (a: AnnDataSet), it also reports error:

PanicException: called Option::unwrap() on a None value. (this is the last line of the Error, the whole stacks are about using pretty method to print the results in IPython.)

But AnnData is OK if X is empty. Just nothing is showed in my IPython REPL.

Thanks!
Songpeng

Dominant language
Python
Stars
323
Forks
43
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from scverse/SnapATAC2

All issues in scverse/SnapATAC2

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.