Description Usage Arguments Value Author(s) See Also Examples

This function computes the weighted normalized mutual information (wNMI), which computes the agreement of two partitions (often a gold standard reference and a clustering result) based on a modified normalized mutual information definition to account for cell type hierarchy.

1 |

`ctStruct` |
The reference hierarchy, returned from ‘createRef’ function. |

`trueclass` |
A vector for the true classes of cells. Often from an outside experiement. |

`cluster` |
A vector for the clustering results. |

`use.weight` |
A logical for using the weight or not. If TRUE, weighted normalized mutual information will be computed. If FALSE, the weights are not used and the result will just be the traditional normalized mutual information. |

A numeric for the value of weighted normalized mutual information.

Zhijin Wu <zhijin_wu@brown.edu>, Hao Wu <hao.wu@emory.edu>

createRef, wRI

1 2 3 4 5 6 7 8 9 10 11 12 | ```
data(Zhengmix8eq)
ctStruct = createRef(Y, trueclass)
methods = names(clusterRes)
allNMI = matrix(0, nrow=length(methods), ncol=2)
rownames(allNMI) = methods
colnames(allNMI) = c("NMI", "wNMI")
for(i in 1:length(clusterRes)) {
allNMI[i,1] = wNMI(ctStruct, trueclass, clusterRes[[i]], FALSE)
allNMI[i,2] = wNMI(ctStruct, trueclass, clusterRes[[i]])
}
barplot(t(allNMI), beside=TRUE, ylim=c(0.4,1.05), legend.text=TRUE, xpd=FALSE)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.