End to end
Instrument export to submitted figure.
Eleven stages on one AnnData object. Every stochastic step takes a seed;
every seeded step gives the same answer on a different machine.
Quickstart
The whole cohort analysis
import mortis as mt
# Load, clean, normalise
adatas = mt.load_from_folder("./sections")
clean, stats = mt.filter_background(adatas, cutoff=1.5)
adata = mt.preprocess(mt.merge_samples(clean))
# Collapse pixels to patients, never test pixels across patients
pb = mt.pseudobulk(adata, sample_key="patient")
org = mt.spatial_organization(adata, sample_key="section")
# Test both axes at the patient level
ab = mt.differential_abundance(pb, "response", "R", "NR")
do = mt.differential_spatial_organization(org, "response", "R", "NR")
both = mt.compare_abundance_and_organization(ab, do)
# Identifiers and pathways, in one call
ids, paths = mt.annotate_pathways(adata, ab)
# Figures, vector PDF, text stays editable
mt.set_publication_style(latex=True)
fig = mt.plot_abundance_vs_organization(both)
mt.save_figure(fig, "figures/fig3", provenance={"cohort": "vedo", "seed": 0})