Skip to content

Convert: SCope looms from SCENIC+, pySCENIC and pycistopic #27

Description

@Claptar

Part of #20. Builds on the loom reader in #26.

These looms follow SCope conventions that a generic loom reader mangles (compound arrays, compressed JSON metadata).

Plan

Detection: loom with a MetaData global attribute and/or col_attrs/RegulonsAUC.

SCope loom AnnData
global MetaData (base64-encoded, zlib-compressed JSON: embeddings, clusterings, annotations, regulon thresholds) decoded into uns/scope/…
col_attrs/RegulonsAUC (compound array, cells × regulons) obsm["X_regulons_auc"], regulon names in uns/scope/regulons
row_attrs/Regulons (binary compound array, genes × regulons) varm["regulons"]
col_attrs/Embedding, Embeddings_X, Embeddings_Y obsm["X_<embedding name from MetaData>"]
col_attrs/Clusterings categorical obs columns, labels taken from MetaData
other SCope global attrs (SCopeTreeL1..3, Genome, CreationDate) uns/scope/…

pycistopic looms (export_region_accessibility_to_loom, export_gene_activity_to_loom) store regions or gene activity in /matrix — detect region-style names (chr:start-end) and use them as var_names.

Export (stretch goal): h5ad → SCope loom with regulon AUC and embeddings, so results can be browsed in SCope.

Needs

Real pySCENIC, SCENIC+ and pycistopic looms to build small fixtures from.

  • Source: the public SCope instance at https://scope.aertslab.org/#/6ac5a322-5e87-4a2c-b732-3ab5ef4cd21f/*/welcome hosts published SCope looms (pySCENIC, SCENIC+, pycistopic), which can be downloaded from the dataset view.
  • Plan: download one loom of each flavour (gene-based pySCENIC, SCENIC+ eRegulon, pycistopic region accessibility / gene activity), record the dataset name and URL, and inspect the layout (adata ls / h5ls -r). Then write a script under tests/fixtures/ that cuts each one down to a few hundred cells and genes while keeping every attribute, compound array and the MetaData structure. Only the cut-down fixtures are committed.
  • Full-size files can back an optional test under the integration marker that downloads them on demand.

Note

Current SCENIC+ writes MuData (.h5mu) rather than looms; that is tracked in #31.

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