mechanochat.tools.mechanical_communication#

mechanochat.tools.mechanical_communication(sem: SEM2 | SEM3, df_mechano: DataFrame, df_ligrec: DataFrame, heteromeric_delimiter: str = '_', lr_delimiter: str = '-', prefix: str = 'mechano', log1p_f: bool = True) → None[source]#

Mechanical cell-cell communication inference.

The cell-cell mechanical interaction sem.f_cc is multiplied by the expression of the mechanotransduction machinery in the receiver cell: for a mechanosensitive gene (ion channel, transcription factor, coactivator) the receiver expression alone, and for a mechanosensitive ligand-receptor pair the ligand in the sender times the receptor in the receiver.

Parameters:
  • sem (SEM2, SEM3) – SEM object after compute_force(), providing .f_cc, .contact_matrix and .adata.

  • df_mechano (pandas.Dataframe) – Dataframe of Mechanosensitive gene. Required column: ‘Symbol’.

  • df_ligrec (pandas.Dataframe) – Dataframe of Mechanosensitive ligand-receptor pairs. Required columns: ‘Ligand’, ‘Receptor’.

  • lr_delimiter (str, default '-') – Delimiter used to construct ligand-receptor pair names in output.

  • heteromeric_delimiter (str, default '_') – Delimiter used to separate subunits in heteromeric complexes within df_ligrec.

  • prefix (str, default 'mechano') – Prefix of the keys written to .obsp.

  • log1p_f (bool) – If True, applying log1p to the cell-cell force before multiplying it with expression.

Returns:

  • None

  • Sets the following fields in `sem.adata` –

    • .obsp[‘<prefix>_<gene>’] : (nc, nc) csr_matrix of mechanical cell-cell communication mediated by mechanosensitive <gene>

    • .obsp[‘<prefix>_<ligand>-<receptor>’] : (nc, nc) csr_matrix of mechanical cell-cell communication mediated by mechanosensitive <ligand>-<receptor>

    • .obsm[‘sender_<prefix>_signal’] : (nc, n_signal) DataFrame of column sums, columns prefixed ‘s-’

    • .obsm[‘receiver_<prefix>_signal’] : (nc, n_signal) DataFrame of row sums, columns prefixed ‘r-’

    • .uns[‘<prefix>_signal_info’] : dict with keys ‘signal’, ‘db’, ‘lr_db’

Notes

Orientation: s[i, j] is the signal from sender j to receiver i (row = receiver, column = sender).