Compute triangle features from kernel matrices
Usage
computeTriangles(
kernel,
cell_names,
patient_names,
Dcell = NULL,
unifKernel = NULL,
norm = FALSE,
bundle = TRUE,
zero_threshold = 1
)Arguments
- kernel
Kernel array from
compute_kernel().- cell_names
Character vector of cell-type names.
- patient_names
Character vector of patient names.
- Dcell
Patient-by-cell-type abundance matrix, used to weight raw (unnormalized) scores. Ignored when
unifKernel/normis used.- unifKernel
Optional normalized baseline kernel.
- norm
Logical; if
TRUE, divide by the baseline triangle scores.- bundle
Logical; if
TRUE, aggregate all directions into a single "Tr" triangle score per triple. IfFALSE, two scores are returned per triple: "TT" (trust/transitive triangle,i->j->kandi->k) and, fori<=j<=konly, "CT" (cycle triangle,i->j->k->i).- zero_threshold
Drop a triangle once its fraction of zero-valued patients reaches this threshold. Default
1only drops triangles that are zero for every patient (the original behavior); lower it (e.g.0.9) to also drop merely zero-inflated triangles.