Learn R Programming

DrDimont (version 0.1.4)

network_reduction_by_p_value: [INTERNAL] Reduce the the entries in an adjacency matrix by thresholding on p-values

Description

[INTERNAL] This function reduces an adjacency matrix of correlations based on p-values. If computations are done non-parallel corPvalueStudent is used. If computations are done in parallel, our own parallel implementation (corPvalueStudentParallel) of this function to calculate Student asymptotic p-values taking the number of samples into account is used. P-values are adjusted using p.adjust function. The upper triangle without diagonal entries of the adjacency matrix is passed for faster computation. P-values can be adjusted using one of several methods. A significance threshold `alpha` can be set. All value entries below this threshold within the initial adjacency matrix will be set to NA. If a default cluster is registered with the `parallel` package the computation will happen in parallel automatically.

Usage

network_reduction_by_p_value(
  adjacency_matrix,
  number_of_samples,
  p_value_adjustment_method = "BH",
  reduction_alpha = 0.05,
  parallel_chunk_size = 10^6
)

Value

A reduced adjacency matrix with NA's at martix entries with p-values below threshold.

Arguments

adjacency_matrix

[matrix] Adjacency matrix of correlations computed using cor in compute_correlation_matrices

number_of_samples

[int|matrix] The number of samples used to calculate the correlation matrix. Computed applying sample_size

p_value_adjustment_method

["holm"|"hochberg"|"hommel"|"bonferroni"|"BH"|"BY"|"fdr"|"none"] String of the correction method applied to p-values. Passed to p.adjust. (default: "BH")

reduction_alpha

[float] A number indicating the significance value for correlation p-values during reduction. Not-significant edges are dropped. (default: 0.05)

parallel_chunk_size

[int] Number of p-values in smallest work unit when computing in parallel during network reduction with method `p_value`. (default: 10^6)