pyXenium.mechanostress#

pyXenium.mechanostress is the canonical beta surface for morphology-derived mechanical stress analysis in Xenium data. It converts cell and nucleus boundaries into fibroblast axis strength, tumor-stroma growth patterning, and cell polarity outputs.

AxisStrengthConfig

Configuration for axial orientation and ANE density analysis.

TumorStromaGrowthConfig

Configuration for tumor-stroma growth pattern classification.

PolarityConfig

Configuration for cell/nucleus centroid polarity analysis.

MechanostressConfig

Configuration for the integrated mechanostress workflow.

MechanostressCohortResult

Per-sample mechanostress results and cohort-level artifact paths.

MechanostressResult

Computed mechanostress tables, summary metadata, and artifact paths.

estimate_cell_axes

Estimate per-cell axial orientation and elongation ratio from boundary vertices.

summarize_axial_orientation

Summarize global and local axial orientation coherence.

compute_ane_density

Compute Aligned Neighbour Energy density across radius-based neighborhoods.

classify_tumor_stroma_growth

Classify tumor cells as infiltrative or expanding from tumor-stroma geometry.

summarize_tumor_growth

Summarize infiltrative and expanding tumor fractions.

compute_distance_expression_coupling

Compute gene-wise Spearman coupling to tumor-stromal distance.

compute_cell_polarity

Compute cell polarity from cell and nucleus centroid offsets.

summarize_cell_polarity

Summarize polarized cell fractions and offset magnitudes.

run_mechanostress_cohort

Run the mechanostress workflow across sample directories and write cohort summaries.

run_mechanostress_workflow

Run the integrated mechanostress workflow on a XeniumSlide object or Xenium export path.

write_mechanostress_artifacts

Write the fixed mechanostress artifact set to disk.

render_mechanostress_report

Render a compact markdown report for mechanostress outputs.

validate_hnscc_mechanostress_outputs

Validate HNSCC tumor-stroma reference outputs or compare recomputed outputs.

validate_suzuki_luad_mechanostress_outputs

Validate Suzuki LUAD/TSU ER and ANE reference outputs or compare recomputed outputs.