scverse / scverse/scanpy

`anndata.acc` based API for `obs_df`,`var_df`

Open
#4,360 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

What kind of feature would you like to request?

Additional function parameters / changed functionality / changed defaults?

Please describe your wishes

Should just be something like this, but making sure that it works for AdRefs as well, handles collisions, …

def df(adata: AnnData, accs: Mapping[str, AnyAcc | AdRef] | Iterable[AnyAcc | AdRef]) -> pd.DataFrame:
    chunks = (
        {k: adata[acc] for k, acc in accs.items()}
        if isinstance(accs, Mapping)
        else [adata[acc] for acc in accs]
    )
    pd.concat(chunks, axis=1)

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

Locate the existing obs_df and var_df implementations and inspect how the anndata.acc APIs handle AnyAcc and AdRef; the issue provides no file or test paths. Compare the proposed DataFrame assembly with current collision behavior, then add coverage for mappings, iterables, AdRefs, and collisions once the intended API is confirmed.

Written by the indexing model from the issue text.

Assessment

Tech stack
pandas, python
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.