SOAPy_st.tl.spearman_correlation

SOAPy_st.tl.spearman_correlation(adata: AnnData, mask: ndarray, radius: float, gene_name: str | list = 'all', clusters: str | int | list = 'all', cluster_key: str | None = None, scale: float | str = 'hires', spatial_in_obsm: str = 'spatial', num: float | None = None, ran: float | None = None, drop_zero: bool = False, inplace: bool = True) DataFrame

Spearman test was performed on the expression levels of genes in each class after the samples were classified equally by distance

Parameters

adataanndata.AnnData

An AnnData object containing spatial omics data and spatial information.

masknumpy.ndarray

A binarized image data of ROI

radiusfloat

Maximum distance considered, negative distance by absolute value

gene_nameUnion[list, str, None], optional

The gene names for the regression model need to be calculated.

clustersUnion[str, int, list], optional

The cluster of the spot being counted, the default is all clusters.

cluster_labelstr, optional

The label of cluster in adata.obs.

scaleUnion[str, float], optional

Scale used in subsequent analyses. If it’s Visium data it can also be HE image labels (hires or lower). Most of the time you don’t need to change this

spatial_in_obsmstr, optional

The key of spatial coordinates in adata.obsm

numint, optional

The number of gap

ranfloat, optional

Minimum range, genes are ignored when their range is smaller than this value.

drop_zerobool, optional

Whether to remove all spots with 0 expression.

inplacebool, optional

Whether to change the original adata.

Returns

pandas.DataFrame

The spearman result is stored, including the p-value(‘P value’), the fdr p-value(‘P fdr’), and the label of whether the p-value is significant or not(‘P rej’).