Skip to content

Support cell-level metadata input in sccompPy - #5

Draft
stemangiola with Copilot wants to merge 4 commits into
mainfrom
copilot/allow-metadata-input-for-sccomppy
Draft

Support cell-level metadata input in sccompPy#5
stemangiola with Copilot wants to merge 4 commits into
mainfrom
copilot/allow-metadata-input-for-sccomppy

Conversation

Copilot AI commented Aug 6, 2026

Copy link
Copy Markdown

sccompPy previously required pre-aggregated count tables, unlike R sccomp, which accepts cell metadata and derives counts internally.

  • Input handling

    • Aggregate metadata by sample and cell_group when the configured count column is absent.
    • Support count_col as an alias for the derived count column.
    • Preserve sample-level metadata for formula evaluation while excluding cell-specific fields.
  • Documentation and coverage

    • Document direct cell-metadata input.
    • Add regression coverage for aggregation, metadata retention, and schema.
estimate_res = sccompPy.sccomp_estimate(
    data=cell_metadata,
    formula_composition="~ 0 + type",
    sample="sample",
    cell_group="cell_group",
)

Copilot AI linked an issue Aug 6, 2026 that may be closed by this pull request
Copilot AI and others added 3 commits August 6, 2026 10:24
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 metadata input handling for sccompPy Support cell-level metadata input in sccompPy Aug 6, 2026
Copilot AI requested a review from stemangiola August 6, 2026 10:27
@stemangiola

Copy link
Copy Markdown
Contributor

@zhanchen could you please review that t the API and argumente behaviour is the same as R?

@stemangiola

Copy link
Copy Markdown
Contributor

@copilot have you added unit tests?

Copilot AI commented Aug 6, 2026

Copy link
Copy Markdown
Author

@copilot have you added unit tests?

Yes. tests/test_metadata_input.py::test_sccomp_estimate_aggregates_cell_metadata covers cell-level aggregation, preservation of sample-level metadata, exclusion of cell-specific fields, and the resulting schema.

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.

allow metadata input for sccomppy

2 participants