Description Usage Arguments Value References Examples
View source: R/calculateModuleScore.R
Calculate Module-score
1 2 | calculateModuleScore(graph, nodes, data, phenotype, covars = NULL,
representative.method = "average", scoringFunction = linearScoring)
|
graph |
an igraph object, which can be generated with |
nodes |
a vector containing the ID of the nodes contained in the module |
data |
a |
phenotype |
a vector with the values for a phenotype of interest. It must have the same number of observations as in data. |
covars |
a |
representative.method |
the method, that is used for the calculation of the eigenmetabolites. Currently implemented: "eigenmetabolite" and "average" |
scoringFunction |
a scoring function accepting parameters
moduleRepresentatives, phenotype and covars. See |
a list containing the module score and the regression coefficient
Do2017MoDentify
\insertRefChuang2007MoDentify
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | 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.nodes <- c(3, neighbors(net.graph, 3))
module.score <- calculateModuleScore(
graph = net.graph, nodes = module.nodes,
data = data, phenotype = qmdiab.phenos$T2D
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.