plotBar_MCI: plot MCI barplots

View source: R/BioTIP_update_04202022.R

plotBar_MCIR Documentation

plot MCI barplots

Description

A barplot of MCI for all clusters in all states.

Usage

plotBar_MCI(
  MCIl,
  ylim = NULL,
  nr = 1,
  nc = NULL,
  order = NULL,
  minsize = 3,
  states = NULL
)

Arguments

MCIl

A list can be obtained through getMCI.

ylim

A vector needed if the output barplots need to be on the same y scale.

nr

The number of rows to plot.

nc

The number of columns to plot, default length(groups).

order

A character vector of the order of the barplot. Default is NULL which uses the input list order.

minsize

A non-negative numeric value of minimum size allowed for a cluster.

states

A character of the state names to be shown on the plot. Default is NULL, assign this if you want to show all states including states without nodes.

Value

Return a barplot of MCI scores across states.

Author(s)

Zhezhen Wang zhezhen@uchicago.edu

References

Chen L, Liu R, Liu Z, Li M & Aihara K (2012) Detecting early-warning signals for sudden deterioration of complex diseases by dynamical network biomarkers Scientific Reports 2:342

Examples

test = list('state1' = matrix(sample(1:10, 6), 4, 3), 
  'state2' = matrix(sample(1:10, 6), 4, 3), 
  'state3' = matrix(sample(1:10, 6), 4, 3))
# assign colnames and rownames to the matrix
for(i in names(test)){
 colnames(test[[i]]) = 1:3
 row.names(test[[i]]) = c('g1', 'g2', 'g3', 'g4')
}

cluster = list(c(1, 2, 2, 1),  c(1, 2, 3, 1),  c(2, 2, 1, 1))
names(cluster) = names(test)
for(i in names(cluster)){
 names(cluster[[i]]) = c('g1', 'g2', 'g3', 'g4')
}
membersL_noweight <- getMCI(cluster, test)
plotBar_MCI(membersL_noweight)


xyang2uchicago/BioTIP documentation built on June 30, 2024, 10:14 p.m.