How species diversity is estimated?

I have read that some tools that use sequence similarity-dependent methods as Megan considers different issues as lengths of target genome, genome relative abundance, among others to estimate the species diversity. I was wonder how Megan calculates for example shannon index? and if it only considers the read counts?

MEGAN considers p_i to be the proportion of reads assigned to taxon i, if you have setup the analysis so as to report read counts.