sparsify2: cleaner sparsification routine

Description Usage Arguments Details Value Examples

View source: R/sparsify2.R

Description

cleaner sparsification routine

Usage

1
2
3
4
5
6
7
8
9
sparsify2(
  W,
  outFile = paste(tempdir(), "tmp.txt", sep = getFileSep()),
  cutoff = 0.3,
  maxInt = 50,
  EDGE_MAX = 1000,
  includeAllNodes = TRUE,
  verbose = TRUE
)

Arguments

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

Details

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.

Value

writes SIF content to text file (node1,node2,edge weight)

Examples

1
2

BaderLab/netDx documentation built on Sept. 26, 2021, 9:13 a.m.