smftools.analysis.compute.hmm_features

smftools.analysis.compute.hmm_features#

Interval extraction from binary HMM feature layers.

Key function: extract_intervals_from_row() — returns interval sizes and neighbor center-to-center distances for one read's binary HMM row.

Position masking utilities live in smftools.analysis.filters.position_filters.

Functions

extract_intervals_from_row(row, coords[, ...])

Return (sizes_bp, neighbor_center_distances_bp) for one binary HMM row.

smftools.analysis.compute.hmm_features.extract_intervals_from_row(row, coords, full_row=None, full_coords=None, max_mask_overlap_frac=0.5)#

Return (sizes_bp, neighbor_center_distances_bp) for one binary HMM row.

Return type:

tuple[list[int], list[float]]

Parameters#

rownp.ndarray

1-D float/int array within the analysis window (0/1/NaN).

coordsnp.ndarray

TSS-centred bp coordinates matching row.

full_rownp.ndarray, optional

Full-locus row used to clip partial-boundary features.

full_coordsnp.ndarray, optional

Coordinates for full_row.

max_mask_overlap_fracfloat

Features where more than this fraction lies outside the analysis window (as determined via full_row) are dropped.

Returns#

tuple of (list of int, list of float)

Interval lengths in bp and center-to-center distances between adjacent intervals.