Skip to content

Groups of stats

  • Group statistics in egglib.stats.ComputeStats in consistent sets (that can be extended in the future), such as default, differentiation, rooted, phased (list to be defined precisely).
  • Allow adding a group of stats as a whole (simpler way is to allow passing their name as a flag, which will trigger automatically all stats).
  • For convenience, provide a list of the statistics for a given group name.

The groups are: site, unphased, phase and sizevariance, matching the first four tables of the statistics section of the documentation. They can be specified, possibly along individual statistics, using codes such as +site, etc.

Example usage:

>>> cs = egglib.stats.ComputeStats()
>>> print(cs.stats_group('allelesize'))
['V', 'Ar', 'M', 'Rst']
>>> cs.add_stats('+site', '+unphased')
>>> stats = cs.process_align(aln)
>>> print(stats['thetaW'])
1.23123
>>> print(stats['D'])
-0.123456
>>> print(stats['lseff'])
123

new feature egglib.stats

Edited by Stéphane De Mita