The kernel is the unweighted structural kernel: cell-type abundances are
not baked into it. calculateDirect(), calculateWedges(),
computeTriangles(), and computeGSCC() each multiply in the abundance of
every node they use, exactly once per node, when computing raw
(unnormalized) features from this kernel.
Arguments
- liglist
Cell-by-ligand compatibility matrix.
- reclist
Cell-by-receptor compatibility matrix.
- Cmatrix
Patient-by-cell-type abundance matrix.
- LRmatrix
Ligand-by-receptor-by-patient interaction tensor.
- normalize
Logical; if
TRUE, also compute a second kernel (kernel_norm) under a NULL DISTRIBUTION where every ligand-receptor pair that is structurally possible (nonzero inLRmatrix) is given the same uniform strength (1 / number of active pairs for that patient), instead of its real measured expression-derived strength.kernel_normtherefore reflects only network topology and cell-type abundance – "how much communication would you expect between these two cell types if every possible ligand-receptor pair were equally active" – with no information about which pairs are actually more or less expressed. Downstream functions (calculateDirect(),calculateWedges(), etc.) use this as a baseline to compute a composition-independent enrichment score (kernel / kernel_norm) instead of the raw, abundance-weighted score – the abundance weighting cancels out of that ratio algebraically, since bothkernelandkernel_normare built from the same per-patientlig_weight/rec_weightterms. Usenormalize = FALSE(default) when you want absolute communication strength (abundance and real LR expression both matter); usenormalize = TRUEwhen you want a score that isolates specificity/enrichment of a cell-type pair's communication relative to what topology alone would predict, independent of how common those cell types are or how strong LR expression is overall.