get_sigma: Get the covariance matrix

Description Usage Arguments Value Note Examples

View source: R/generics.R

Description

The associations in each module are taken as partial correlations, and the covariance matrix is calculated from these assuming that expression for gene i is the weighted average over each module using 1/sqrt(m_i) as the weight, where m_i is the number of modules containing gene i.

Usage

1

Arguments

x

Either a 'network', 'network_module', or 'matrix' object.

...

Additional arguments.

Value

A covariance matrix.

Note

If a matrix is provided, it is assumed to be a partial correlation matrix; a warning is given in this case. To avoid the warning message, convert the matrix into a network object using 'create_network_from_association_matrix()'.

Examples

1
2
3
4
5
6
7
# Create a random network with 10 nodes and add random edge weights.
nw <- random_network(10)
nw <- gen_partial_correlations(nw)
# Get covariance matrix for the network or individual modules in the network.
get_sigma(nw)
module <- nw$modules[[1]]
get_sigma(module)

tgrimes/SeqNet documentation built on Sept. 1, 2020, 7:50 a.m.