Skip to content

Restore the primary assay in AnnData.X - #8

Draft
stemangiola with Copilot wants to merge 6 commits into
mainfrom
copilot/fix-get-anndata-return-value
Draft

Restore the primary assay in AnnData.X#8
stemangiola with Copilot wants to merge 6 commits into
mainfrom
copilot/fix-get-anndata-return-value

Conversation

Copilot AI commented Aug 6, 2026

Copy link
Copy Markdown

get_anndata() was clearing AnnData.X and storing the primary expression matrix only in layers["counts"], which prevents scanpy workflows from using the returned object normally.

  • AnnData construction
    • Preserve the first requested assay in adata.X.
    • Retain all requested assays in adata.layers, including the primary assay.
  • Regression coverage
    • Verify primary-assay mapping with multiple assays.
adata = get_anndata(metadata, assays=["counts", "cpm"])

adata.X                 # counts matrix
adata.layers["counts"]  # counts matrix
adata.layers["cpm"]     # CPM matrix

Copilot AI and others added 5 commits August 6, 2026 10:20
Co-authored-by: stemangiola <7232890+stemangiola@users.noreply.github.com>
Co-authored-by: stemangiola <7232890+stemangiola@users.noreply.github.com>
Co-authored-by: stemangiola <7232890+stemangiola@users.noreply.github.com>
Co-authored-by: stemangiola <7232890+stemangiola@users.noreply.github.com>
Co-authored-by: stemangiola <7232890+stemangiola@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix get_anndata() to return renamed assay Restore the primary assay in AnnData.X Aug 6, 2026
Copilot AI requested a review from stemangiola August 6, 2026 10:25
@stemangiola

Copy link
Copy Markdown
Contributor

@jdhenaos could you please review?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

get_anndata() returns X = None and puts counts in layers["counts"].

2 participants