View source: R/pipeline_functions.R
compute_correlation_matrices | R Documentation |
Constructs and returns a correlation/adjacency matrices for each network layer and each group. The adjacency matrix of correlations is computed using cor. The handling of missing data can be specified. Optionally, the adjacency matrices of the correlations can be saved. Each node is mapped to the biological identifiers given in the layers and the mapping table is returned as 'annotations'.
compute_correlation_matrices(layers, settings)
layers |
[list] Named list with different network layers containing data and identifiers for both
groups (generated from |
settings |
[list] A named list containing pipeline settings. The settings list has to be
initialized by |
A nested named list with first-level elements 'correlation_matrices' and 'annotations'. The second level elements are 'groupA' and 'groupB' (and 'both' at 'annotations'). These contain a named list of matrix objects ('correlation_matrices') and data frames ('annotations') mapping the graph node IDs to biological identifiers. The third level elements are the layer names given by the user.
example_settings <- drdimont_settings( handling_missing_data=list( default="all.obs")) # mini example with reduced mRNA layer for shorter runtime: data(mrna_data) reduced_mrna_layer <- make_layer(name="mrna", data_groupA=mrna_data$groupA[1:5,2:6], data_groupB=mrna_data$groupB[1:5,2:6], identifiers_groupA=data.frame(gene_name=mrna_data$groupA$gene_name[1:5]), identifiers_groupB=data.frame(gene_name=mrna_data$groupB$gene_name[1:5])) example_correlation_matrices <- compute_correlation_matrices( layers=list(reduced_mrna_layer), settings=example_settings) # to run all layers use layers=layers_example from data(layers_example) # in compute_correlation_matrices()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.