Description Usage Arguments Value Note See Also Examples
View source: R/combine.networks.R
Takes as input two or more adjacency matrices, and the corresponding contributions. Computes a combined network (weighted graph) in which the weight on an edge between two nodes is an average of the weights on the same edge in the input networks.
1 2 3 | combine.networks(nets, contributions, outPath, midfix="",
powerVector=1:20, verbose=1, RsquaredCut=0.75, minModuleSize=5,
doRemoveTOM=TRUE, datExpr, doReturNetworks=FALSE, doSave=FALSE)
|
nets |
A list of adjacency matrices (networks), which can be generated using e.g.,
the |
contributions |
A numeric vector with the same length as nets. In computing the average weight on each edge in the combined network, first the edge weights from individual networks are multiplied by their corresponding contributions, then the result will be divided by the sum of weights of all networks containing this edge. |
outPath |
A string to the path where plots and results will be saved. |
midfix |
An optional string used in the output file names. |
powerVector |
A numeric vector of power values that are tried to
find the best one.
See |
verbose |
The integer level of verbosity. 0 means silent and higher values produce more details of computation. |
RsquaredCut |
A threshold in the range [0,1] used to estimate the power. A higher value
can increase power. For technical use only. See |
minModuleSize |
The value that controls the minimum number of genes per module. |
doRemoveTOM |
A boolean determining the big TOM file must remove or not. |
datExpr |
The expression matrix that
|
doReturNetworks |
A boolean value to determine whether to return |
doSave |
A boolean value to determine whether the whole output of this
function (typically 1-2 GBs) should be saved as |
A list with following components
call |
The command that created the results |
midfix |
The input argument |
Network |
The adjacency matrix of the combined network |
denominators |
A matrix, each cell of which is the sum of weights of all networks contributing to the edge corresponding to that cell |
power |
The power (beta) value used for the combined network |
fits |
The fit indices calculated for the combined network |
net |
The output of |
modules |
The output of |
combinedNetworkFile |
The path to the saved file containing |
If the networks have different node sets, the combined network will be computed on the union of nodes.
WGCNA::blockwiseModules
,
WGCNA::TOMsimilarity
, and
WGCNA::pickSoftThreshold.fromSimilarity
1 2 3 4 5 6 7 8 9 10 | data(aml)
data(mds)
nets <- list()
## Make the coexpression networks:
nets[["aml"]] <- abs(stats::cor(aml[,1:200]))
nets[["mds"]] <- abs(stats::cor(mds[,1:200]))
## Combine them:
combined <- combine.networks(nets=nets, contributions=c(nrow(aml), nrow(mds)),
outPath=".", datExpr=rbind(aml, mds)[,1:200])
print(table(combined$modules))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.