Description Usage Arguments Value Author(s) See Also Examples
View source: R/BioTIP_update_4_09282020_v3.R
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.
1 | getMaxStats(membersL, idx)
|
membersL |
A two-layer nested list of character or numeric values,
any one out of the five elements output by the function |
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 |
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.
Zhezhen Wang zhezhen@uchicago.edu
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.