getMaxStats: Get the cluster index and network nodes of biomodule

Description Usage Arguments Value Author(s) See Also Examples

View source: R/BioTIP_update_4_09282020_v3.R

Description

This function retrieves the cluster index and network-node ids for the identified biomodule (that shows the maximum MCI score) at each state in the study.

Usage

1
getMaxStats(membersL, idx)

Arguments

membersL

A two-layer nested list of character or numeric values, any one out of the five elements output by the function getMCI.

idx

A vector of integers that are cluster ids of the biomodule (the module with the highest MCI score) per state. This is the first element of the result from getMaxMCImember.

Value

A list describing the biomodule of each state, corresponding to one of the five elements (members, MCI, Sd, PCC, and PCCo) outputted by the function getMCI. The calss of the vector depends on the class of the input parameter membersL.

Author(s)

Zhezhen Wang zhezhen@uchicago.edu

See Also

getMCI

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
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)
idx = c(1, 2, 1)
names(idx) = names(membersL_noweight[['sd']])
selectedSD = getMaxStats(membersL_noweight[['sd']], idx)

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