scverse / scverse/scanpy

using `adata.var_names` in `sc.get.obs_df`

Open
#2,256 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.6k
Forks
779
Avg merge
1d 4h
Merged PRs (30d)
27

Description

Calling sc.get.obs_df with keys=adata.var_names raises a value error since here an Index object is used to re-order the dataframe.
I think its a trivial fix to re-cast keys locally if an Index object is passed (aka adata.var_names) and could be nice for the user :)

Contributor guide

Open the contributing guide

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.

Research direction

Start in scanpy/get/get.py at lines 303-304 and reproduce the failure by calling sc.get.obs_df with keys=adata.var_names. Check how the Index is used to reorder the dataframe and verify that the call no longer raises a ValueError after the fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
bioinformatics, data
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.