Skip to content

Potential bug in NormalizedShannon and NormalizedRenyi - #2

Open
gallardoalba wants to merge 4 commits into
gaolabtools:v1.1.0from
gallardoalba:Fix_bugs
Open

Potential bug in NormalizedShannon and NormalizedRenyi#2
gallardoalba wants to merge 4 commits into
gaolabtools:v1.1.0from
gallardoalba:Fix_bugs

Conversation

@gallardoalba

Copy link
Copy Markdown

Base Shannon and Renyi indices restrict to the top 2 isoforms but their normalized counterparts were using all isoforms with a log(n) divisor, breaking the expected NormalizedShannon = Shannon / log(2) relationship.

  • Fixed by applying the same top-2 restriction to NormalizedShannon and NormalizedRenyi and normalizing by log(2) instead.
  • Default thresholds updated from 0 (which classified everything as polyform) to 0.500/log(2) and 0.435/log(2).
  • Added value-equality tests to lock in the relationship, and uncommented the previously disabled RunDIV tests for these indices. Affects GetDiversity.R, RunDIV.R, and their tests.

@gallardoalba gallardoalba changed the title Bug NormalizedShannon and NormalizedRenyi Potential bug in NormalizedShannon and NormalizedRenyi Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant