smftools.analysis.compute.pearson#
NaN-aware position × position Pearson correlation matrices.
Key functions: nan_pearson_matrix(), make_ticks().
Functions
|
Return evenly spaced tick indices and formatted labels for a coordinate array. |
NaN-aware position × position Pearson correlation. |
- smftools.analysis.compute.pearson.nan_pearson_matrix(X)#
NaN-aware position × position Pearson correlation.
- Return type:
Parameters#
- Xnp.ndarray
Shape (n_reads × n_positions); values typically in {0, 1, NaN}. NaN positions are excluded from column means, then zero-filled before the matrix multiply (consistent with the reference EMseq implementation).
Returns#
- np.ndarray
Shape (n_positions × n_positions); NaN where denominator is zero.
- smftools.analysis.compute.pearson.make_ticks(coords, n_ticks=10)#
Return evenly spaced tick indices and formatted labels for a coordinate array.
Parameters#
coords : 1-D array of TSS-centred integer coordinates. n_ticks : number of ticks to generate.
Returns#
indices : integer indices into coords labels : formatted coordinate strings