SOAPy_st.tl.get_c_niche

SOAPy_st.tl.get_c_niche(adata: AnnData, k_max: int, niche_key: str = 'C_niche', celltype_key: str = 'clusters', sample_key: str | None = None, sample: str | list | None = None, sdbw: bool = True, inplace: bool = True) AnnData

Parameters

adataanndata.AnnData

An AnnData object containing spatial omics data and spatial information.

k_max:

If sdbw is true, k_max is the maximum number of c-niche; If sdbw is false, it represents the number of c-niche

niche_keystr, optional

Add the keyword of niche in adata.obs.columns.

celltype_keystr, optional

The keyword of spot cluster in adata.obs.columns.

sample_keystr, optional

The keyword of sample id in adata.obs.columns.

sample: Union[str, list, None],

The samples involved in calculating the niche.

sdbwbool, optional

Automated cluster number screening using sdbw.

inplacebool, optional

Whether to change the original adata.

Returns

  • anndata.AnnData.obs [niche] - c-niche of each spot

  • anndata.AnnData.uns [niche] - i-niche of each spot (cell type composition of neighbors)