How nanostring-biostats/cosmx-analysis-scratch-space works
This repository is an exploratory CosMx spatial-analysis resource, with HierAnnot as its principal package and a separate GeoMx scMask script. HierAnnot’s user workflow accepts expression data and marker hierarchies/programs, prepares and scores normal and malignant tracks, routes cluster decisions, integrates annotations, then supports inspection, plotting, and result export. The graph preserves documented built-in hierarchy/program capabilities and the separate scMask utility. Unsampled modules are represented by exact tree paths; their internal connections are omitted unless the README or indexed excerpts establish them.
Main entry points: pipeline.py Analysis pipeline · registry.py Hierarchy registry · datamodels.py Annotation models · malignant_scoring.py Malignant scoring
Components 22
Inputs and models
- Expression data
- Annotation models
_code/HierAnnot/hierannot/datamodels.py
Hierarchy resources
- Built-in hierarchies
_code/HierAnnot/hierannot/builtin/factories.py - Hierarchy registry
_code/HierAnnot/hierannot/builtin/registry.py - Hierarchy matching
_code/HierAnnot/hierannot/builtin/matching.py - Malignant programs
_code/HierAnnot/hierannot/builtin/malignant_programs.py
Scoring and decisions
- Input preprocessing
_code/HierAnnot/hierannot/preprocessing.py - Hierarchy routing
_code/HierAnnot/hierannot/hierarchy.py - Marker scoring
_code/HierAnnot/hierannot/scoring.py - Score aggregation
_code/HierAnnot/hierannot/aggregate.py - Analysis pipeline
_code/HierAnnot/hierannot/pipeline.py - Malignant scoring
_code/HierAnnot/hierannot/malignant_scoring.py - Control selection
_code/HierAnnot/hierannot/controls.py - Decision workflows
_code/HierAnnot/hierannot/workflows.py - Track integration
_code/HierAnnot/hierannot/integration/integrate_tracks.py
Results and reporting
- Malignant reporting
_code/HierAnnot/hierannot/malignant_reporting.py - Hierarchy inspection
_code/HierAnnot/hierannot/inspect.py - Result plotting
_code/HierAnnot/hierannot/plotting.py - Result persistence
_code/HierAnnot/hierannot/result_io.py - Input/output helpers
_code/HierAnnot/hierannot/io.py
Spatial utilities
- GeoMx scMask generation
_code/GeoMx-scMask-generation/Generate_scMask_given_query.py
Other components
- Analyst
Connections 22
- Analyst → Expression data: provides data
- Analyst → Annotation models: selects models
- Expression data → Analysis pipeline: supplies expression
- Annotation models → Analysis pipeline: configures analysis
_code/HierAnnot/hierannot/pipeline.py - Analysis pipeline → Input preprocessing: calls preparation
_code/HierAnnot/hierannot/pipeline.py - Analysis pipeline → Control selection: builds controls
_code/HierAnnot/hierannot/pipeline.py - Analysis pipeline → Marker scoring: computes scores
_code/HierAnnot/hierannot/pipeline.py - Analysis pipeline → Hierarchy routing: routes annotations
_code/HierAnnot/hierannot/pipeline.py - Analysis pipeline → Malignant scoring: scores programs
_code/HierAnnot/hierannot/pipeline.py - Analysis pipeline → Track integration: integrates tracks
_code/HierAnnot/hierannot/pipeline.py - Analysis pipeline → Decision workflows: runs workflows
_code/HierAnnot/hierannot/pipeline.py - Hierarchy registry → Built-in hierarchies: constructs hierarchies
_code/HierAnnot/hierannot/builtin/registry.py - Hierarchy registry → Hierarchy matching: matches queries
_code/HierAnnot/hierannot/builtin/registry.py - Hierarchy registry → Annotation models: creates models
_code/HierAnnot/hierannot/builtin/registry.py - Malignant scoring → Malignant reporting: applies report rules
_code/HierAnnot/hierannot/malignant_scoring.py - Track integration → Malignant reporting: resolves report preset
_code/HierAnnot/hierannot/integration/integrate_tracks.py - Decision workflows → Hierarchy routing: decides clusters
_code/HierAnnot/hierannot/workflows.py - Analysis pipeline → Result persistence: exports results
- Analyst → Hierarchy inspection: inspects results
- Analyst → Result plotting: plots results
- Result persistence → Input/output helpers: uses file helpers
_code/HierAnnot/hierannot/result_io.py - Analyst → GeoMx scMask generation: runs query script