sparsify2 {netDx} | R Documentation |
cleaner sparsification routine
sparsify2(W, outFile = paste(tempdir(), "tmp.txt", sep = getFileSep()), cutoff = 0.3, maxInt = 50, EDGE_MAX = 1000, includeAllNodes = TRUE, verbose = TRUE)
W |
(matrix) similarity matrix |
outFile |
(char) path to file to write sparsified network |
cutoff |
(numeric) edges with weight smaller than this are set to NA |
maxInt |
(numeric) max num edges per node. |
EDGE_MAX |
(numeric) max num edges in network |
includeAllNodes |
(logical) if TRUE, ensures at least one edge is present for each patient. This feature is required when sparsification excludes test patients that are required to be classified. If the sparsification rules exclude all edges for a patient and this flag is set, then the strongest edge for each missing patient is added to the net. Note that this condition results in the total number of edges potentially exceeding EDGE_MAX |
verbose |
(logical) print detailed messages, useful for debugging |
Sparsifies similarity matrix to keep strongest edges. Sets diagonal and edges < cutoff to NA. Keeps strongest maxInt edges per node. Ties are ignored. Keeps a max of EDGE_MAX edges in the network.
writes SIF content to text file (node1,node2,edge weight)
data(xpr); sparsify2(cor(xpr))