plotBar_MCI: plot MCI barplots

Description Usage Arguments Value Author(s) References Examples

View source: R/BioTIP_update_4_09282020_v3.R

Description

A barplot of MCI for all clusters in all states.

Usage

1
2
3
4
5
6
7
8
9
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
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)

BioTIP documentation built on Nov. 8, 2020, 6:27 p.m.