Skip to contents

Plot individual eigengene distributions

Usage

plot_consensus_eig_dist(
  eigen_list,
  target_study_index = 1,
  filename = NA,
  device = "png",
  width = 12,
  height = 10,
  dpi = 1000
)

Arguments

eigen_list

a list of community signatures (eigengenes) for studies, using the output of calc_consensus_memberships() as the membership_matrix.

target_study_index

the study you want to normalized eigengenes to for displaying the distributions. It should likely be the largest/best quality study

filename

File name

device

Device to use. Can either be a device function (e.g. png), or one of "eps", "ps", "tex" (pictex), "pdf", "jpeg", "tiff", "png", "bmp", "svg" or "wmf" (windows only).

width

Plot width in units ("in", "cm", "mm", or "px"). If not supplied, uses the size of current graphics device.

height

Plot height in units ("in", "cm", "mm", or "px"). If not supplied, uses the size of current graphics device.

dpi

Plot resolution. Also accepts a string input: "retina" (320), "print" (300), or "screen" (72). Applies only to raster output types.

Value

eigengene distributions if filename is na, and saved figure is filename provided

Details

In icWGCNA eigen_list is created using icWGCNA::compute_eigengene_matrix() for each study and then combining all outputs into a list.

Examples

if (FALSE) {
memb_list <- list(
  GSE39582 = GSE39582_icwgcna$community_membership,
  READ = read_icwgcna$community_membership,
  COAD = coad_icwgcna$community_membership
)
ma <- construct_rbh_correlation_based(
  memb_list,
  upper_quant = .99,
  lower_quant = .05,
  max_rank = 2
)
consensus_comms <- detect_consensus_communities(ma)
consensus_memb <- calc_consensus_memberships(consensus_comms, memb_list,
  gene_cohort_N = 2
)

# Need to use icWGCNA for individual eigengenes
GSE39582_eigen <- icWGCNA::compute_eigengene_matrix(
  ex = GSE39582_df,
  membership_matrix = consensus_memb
)
read_eigen <- icWGCNA::compute_eigengene_matrix(
  ex = read_df,
  membership_matrix = consensus_memb
)
coad_eigen <- icWGCNA::compute_eigengene_matrix(
  ex = coad_df,
  membership_matrix = consensus_memb
)
eigen_list <- list(GSE39582_eigen, read_eigen, coad_eigen)

plot_consensus_eig_dist(eigen_list)
}