Skip to content

Convert: pycistopic CistopicObject pickles #28

Description

@Claptar

Part of #20. Depends on #21.

Constraints

  • A CistopicObject is a Python pickle of pycisTopic.cistopic_class.CistopicObject. Unpickling needs pycistopic installed (and its scipy/pandas stack) and executes arbitrary code from the file.
  • Put it behind an optional extra (pyadata-cli[pycistopic]), import lazily with a clear error when missing, require an explicit --from pycistopic, and document the security caveat.
  • Alternative to evaluate: run the unpickling in a subprocess via uv run --with pycisTopic so the core install stays clean and heavy deps never land in the main environment.

Mapping

CistopicObject AnnData
fragment_matrix (scipy sparse, regions × cells) X as cells × regions CSR
binary_matrix layers["binary"]
cell_names, cell_data obs_names, obs
region_names, region_data var_names, var
selected_model.cell_topic obsm["X_topic"]
selected_model.topic_region varm["topic_region"]
selected_model metrics / parameters uns["pycistopic"]["model"]
projections obsm["X_<name>"]
project, path_to_fragments uns["pycistopic"]

Plan

Unpickle → write through the elements.write helpers. This path is necessarily in memory (the pickle is); document that clearly.

Tests

Fixture pickled in a uv run --with pycisTopic subprocess under the integration marker; check shapes, names and topic matrices.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions