Translate TOM matrin to create graph object
Arguments
- TOM
matrix TOM matrix from WGCNA result
- mat
matrix matrox to WGCNA analysis
- threshold
numeric Absolute-weight cutoff. Edges with
abs(weight) <= thresholdare dropped. Set toNULL(default) to skip.- top_k
integer Per-node top-
knearest-neighbour sparsification. For each node, only itskstrongest TOM neighbours are eligible to contribute edges. An undirected edge (i, j) survives if j is in i's top-kor i is in j's top-k(mutual-kNN union, the standard choice for WGCNA visualization). Set toNULL(default) to skip. Typical values for WGCNA plots are 10 - 30.
Examples
if (FALSE) { # \dontrun{
# `TOM` is a topological overlap matrix from WGCNA and `mat` is the
# expression matrix used to compute it.
# Simple absolute-weight threshold:
edge_df <- trans_TOM_in_WGCNA(TOM = TOM, mat = mat, threshold = 0.1)
# Per-node top-20 neighbours (recommended for visualization):
edge_df <- trans_TOM_in_WGCNA(TOM = TOM, mat = mat, top_k = 20)
# Combine: top-20 per node, then drop anything below 0.05 globally.
edge_df <- trans_TOM_in_WGCNA(TOM = TOM, mat = mat,
threshold = 0.05, top_k = 20)
head(edge_df)
} # }
