nichesphere.coloc.reshapeColoc#
- nichesphere.coloc.reshapeColoc(CTcoloc, oneCTinteractions='', complete=1)#
Transforms matrix obtained with getColocProbs into a matrix of CT pairs x samples CTcoloc=previously obtained colocalisation matrix from getColocprobs complete=list with repeated values (ct1_x_ct2 and ct2_x_ct1)
- Parameters:
CTcoloc (pd.DataFrame) – Concatenated dataframes of cell type pairs co-localization probabilities per sample (obtained via getColocProbs())
oneCTinteractions (list) – list of single cell interactions (celltype-celltype)
complete (flag (default: 1)) – indicates if the co-localization matrices are complete (1) (not just half) , with repeated values at ct1_x_ct2 and ct2_x_ct1 or half matrices are used as input (0)
- Returns:
colocPerSample1 – Probabilities of each cell type pair per sample
- Return type:
pd.DataFrame