smftools.tools.partitioned_hmm

smftools.tools.partitioned_hmm#

Bounded HMM execution over partitioned preprocessing/spatial spines.

Functions

execute_hmm_task(spine_path, task, cfg, ...)

Materialize, annotate, core-crop, and persist one HMM task.

execute_partitioned_hmm(spine_path, cfg, ...)

Run bounded HMM tasks and publish a linked thin spine.

smftools.tools.partitioned_hmm.execute_hmm_task(spine_path, task, cfg, output_dir, models_dir)#

Materialize, annotate, core-crop, and persist one HMM task.

Layers are streamed to disk (incremental_zarr.append_zarr_layer) one at a time and freed from adata.layers immediately after, instead of being collected into a second, core-cropped copy (result's layers= dict) that used to sit in memory alongside the still-live original -- same rationale, and same pattern, as preprocessing.partitioned_ executor.execute_preprocess_task. model.annotate_adata itself still writes every layer for one HMM task (accessibility/cpg) onto adata before returning, so this doesn't lower the peak during annotation, but it removes the double-materialization that followed it.

Return type:

dict[str, object]

smftools.tools.partitioned_hmm.execute_partitioned_hmm(spine_path, cfg, output_dir)#

Run bounded HMM tasks and publish a linked thin spine.

Return type:

dict[str, Path]