gen3DNet: Create a 3D network model.

View source: R/gen3DNet.R

gen3DNetR Documentation

Create a 3D network model.

Description

This function creates a 3D network model relating two matrices. The columns of each matrix should represent two sets of objects, with the rows of both matrices corresponding to observations under the same circumstances. For example, the columns might be phosphoproteins and histones, and the rows might correspond to drugs. In this case, the data values would represent the transcription or GCP activation level in cells treated with different drugs.

Usage

gen3DNet(
  left,
  right,
  nmf_nrun = 10,
  k = NULL,
  k_picker = max_ward_kl,
  seed = 123456,
  p_val_threshold = 1e-04,
  out_folder = NULL,
  verbose = TRUE
)

Arguments

left

Matrix of left objects

right

Matrix of right objects

nmf_nrun

Number of iterations to use for NMF

k

Number of clusters to use for NMF. This can be specified as a

  • single number, or

  • consecutive range. If unspecified, k is picked from 1 to min(num_cols - 1, num_rows - 1)

k_picker

Method for picking k. If unspecified, k values are compared using the KL-index of Ward clusterings based on euclidean distance. Possible values:

  • max_cophenetic

  • kneedle_silhouette_consensus

  • kneedle_cophenetic

  • max_silhouette_consensus

  • max_cophenetic

  • max_ward_kl

To learn more, use help() for each of these functions.

seed

Seed to use for NMF.

p_val_threshold

Threshold for significant p-values in PLSR.

out_folder

Folder used for outputting results.

verbose

Whether to print output (default TRUE).

Details

The final 3D network model consists of connections between the rows and both sets of columns, as follows:

  • Connections between the rows and the left columns. These are found using NMF (nonnegative matrix factorization). The data can contain negative values, as an antilog transformation is used internally. The number of NMF clusters can be specified, but otherwise it will be chosen automatically based on the value that gives the highest KL-index when using Ward hierarchical clustering. The connection weight between a given left column and row is the maximum basis value for the left column object. See the function generate_nmf_modules for further information.

  • Connections between the rows of the right and left columns. These are found using PLSR. The connection strength is the absolute value of the PLSR regression coefficient. See the function generate_plsr for more information.

Examples


library("gen3DNet")
histon_path <- system.file("extdata", "histon_data.csv", package="gen3DNet")
phospho_path <- system.file("extdata", "phospho_data.csv", package="gen3DNet")
result <- gen3DNet(
   histon_path,
   phospho_path,
   nmf_nrun = 10,
   p_val_threshold = 0.01, 
   # k_picker = max_cophenetic
   # k_picker = kneedle_silhouette_consensus
   # k_picker = kneedle_cophenetic 
   # k_picker = max_silhouette_consensus
   # k_picker = max_cophenetic
   # k_picker = max_ward_kl
   k_picker = max_ward_kl
)


MollahLab/gen3DNet documentation built on Nov. 18, 2024, 5:08 a.m.