makePSN_NamedMatrix: Create patient networks from full matrix of named...

Description Usage Arguments Details Value Examples

View source: R/makePSN_NamedMatrix.R

Description

Create patient networks from full matrix of named measurements

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
makePSN_NamedMatrix(
  xpr,
  nm,
  namedSets,
  outDir = tempdir(),
  simMetric = "pearson",
  verbose = TRUE,
  numCores = 1L,
  writeProfiles = TRUE,
  sparsify = FALSE,
  useSparsify2 = FALSE,
  cutoff = 0.3,
  sparsify_edgeMax = Inf,
  sparsify_maxInt = 50,
  minMembers = 1L,
  runSerially = FALSE,
  ...
)

Arguments

xpr

(matrix) rows are measurements, columns are samples. Columns must be named (patient ID)

nm

(character) names for measurements corresponding to row order of xpr. Must match the names in the named sets specified in nameSets

namedSets

(list) sets of names to be grouped together. keys are set names, and networks will be named as these. values are character vectors corresponding to groups of names (matching those in nm) that are input to network generation

outDir

(char) path to directory where networks are written. If missing, is set to tempdir()

simMetric

(char) measure of similarity. See getSimilarity() for details. If writeProfiles is set to TRUE, must be one of pearson (Pearson correlation) or MI (correlation by mutual information).

verbose

(logical) print detailed messages

numCores

(integer) number of cores for parallel network generation

writeProfiles

(logical) use GeneMANIA's ProfileToNetworkDriver to create interaction networks. If TRUE, this function writes subsets of the original data corresponding to networks to file (profiles). If FALSE, uses getSimilarity() and writes interaction networks.

sparsify

(logical). If TRUE, sparsifies patient similarity network. See useSparsify2, sparsify_edgeMax and sparsify_maxInt

useSparsify2

(logical). Cleaner sparsification routine. If FALSE, uses new matrix-based sparsify3

cutoff

(numeric) patients with similarity smaller than this value are not included in the corresponding interaction network

sparsify_edgeMax

(numeric) Max number of edges to include in the final network

sparsify_maxInt

(numeric) Max num edges per node in sparsified network.

minMembers

(integer) min number of measures in a network for the network to be included. Useful when similarity measures require a minimum number of measures to be meaningful (e.g. minimum of 6 for Pearson correlation)

runSerially

(logical) set to TRUE to create nets serially, rather than in parallel

...

passed to getSimilarity()

Details

Creates patient similarity networks when full matrices of data are provided (e.g. gene expression, questionnaire results). To generate networks from sparse data such as CNVs or indels, use makePSN_RangeSets instead. The rows of the data matrix (xpr) must be named (nm); one network is create for each named set (namedSets). There are two options for the way in which networks are created, depending on the value of writeProfiles. 1. writeProfiles=TRUE: GeneMANIA is used to generate interaction networks and sparsify networks. This only works if the desired measure of similarity is network-level Pearson correlation; an example is networks at the level of pathways. In this case, the user does not explicitly specify a similarity measure and simMetric is ignored. 2. writeProfiles=FALSE: GeneMANIA is not used to generate interaction networks. Rather, netDx uses simMetric to create interaction networks. Networks can be sparsified by excluding weak connections (cutoff).

Value

(char) Basename of files to which networks are written. Side effect of writing interaction networks in outDir

Examples

1
2
3
4
5
data(xpr,pheno,pathwayList); 
# you may get a warning message that the output directory already
# exists; ignore it
out <- makePSN_NamedMatrix(xpr,rownames(xpr),pathwayList, 
	'.',writeProfiles=TRUE)

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