greedyModuleSelection: Greedy Module Selection for a Seed

Description Usage Arguments Value References Examples

View source: R/greedyModuleSelection.R

Description

Greedy Module Selection for a Seed

Usage

1
2
3
4
greedyModuleSelection(nodeNr, graph, data, phenotype, covars = NULL,
  alpha = 0.05, moduleCache = NULL, cacheFolder = NULL,
  better.than.components = TRUE, representative.method = "average",
  scoringFunction = linearScoring)

Arguments

nodeNr

the number of the node, which should be used as a seed.

graph

an igraph object, which can be generated with generateNetwork. The ID of the nodes must correspond to the name of the variables.

data

a data.table with three columns: name, sampleID and z-score.

phenotype

a vector with the values for a phenotype of interest. It must have the same number of samples as in data.

covars

a data.table containing the covariates to correct for. The rows for the observations must be in the same order as in the phenotype vector.

alpha

significance level (type 1 error) for accepting the modules.

cacheFolder

location of the temporary files, where the cache is stored

better.than.components

if TRUE, modules will only be enlarged and accepted, if they are better than all of their components.

representative.method

the method used for the calculation of the module representatives. Currently implemented: "eigenmetabolite" and "average"

scoringFunction

a scoring function accepting parameters moduleRepresentatives, phenotype and covars. See linearScoring

Value

a list containing the members of the module, the module-score, its regression coefficient for the given phenotype, the score and regression coefficient for the seed, the cache and the consecutive module-scores after adding each new node.

References

\insertRef

Do2017MoDentify

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
data(qmdiab.data)
data(qmdiab.annos)
data(qmdiab.phenos)

net.graph <- generateNetwork(data = qmdiab.data, annotations = qmdiab.annos)
data <- data.table(
  sampleID = paste0("sample", 1:dim(qmdiab.data)[1]),
  qmdiab.data
)
data <- melt(data = data, id.vars = "sampleID", variable.name = "name")
data[, z.score := scale(value), by = .(name)]

module <- greedyModuleSelection(
  graph = net.graph, nodeNr = 51, data = data,
  phenotype = qmdiab.phenos$T2D
)

krumsieklab/MoDentify documentation built on March 24, 2021, 9:01 p.m.