pruneNets: Prune interaction networks to keep only the networks and...

Description Usage Arguments Details Value Examples

View source: R/pruneNets.R

Description

Prune interaction networks to keep only the networks and patients requested

Usage

1
2
3
4
5
6
7
8
pruneNets(
  oldDir,
  newDir = tempdir(),
  filterNets = "*",
  filterIDs = "*",
  netSfx = "_cont.txt$",
  verbose = TRUE
)

Arguments

oldDir

(char) path to directory with original networks

newDir

(char) path to output directory for pruned networks

filterNets

(char) vector of networks to include. These should match filenames in netDir. Value of '*' results in pruning all networks

filterIDs

(char) patients to include in pruned networks. These should match nodes in the input interaction networks

netSfx

(char) suffix for network file names. Only used if filterNets='*'.

verbose

(logical) print messages

Details

This function is crucial for patient data that is highly sparse; examples include patient CNVs indels, as opposed to full matrix measures (gene expression, questionnaire data). Each step where the pool of patients is subset - e.g. limiting feature selection only to patients in training set - changes the set of networks that are eligible. Some networks may only contain test patients, while others may contain a single edge between a training and a test patient. Upon subsetting, such networks are no longer eligible for downstream use, such as feature selection. This function rewrites those subnetworks of the original networks that consist of eligible patients.

Value

(no value). Side effect of writing pruned network files to newDir

Examples

1
2
3
4
data(npheno)
netDir <- system.file("extdata","example_nets",package='netDx')
pruneNets(netDir,tempdir(),filterIDs=npheno[seq_len(10),],
 netSfx='txt$')

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