PitchInteractiveInc / Phinch

Phinch is an open-source framework for visualizing biological data, funded by a grant from the Alfred P. Sloan foundation. This project represents an interdisciplinary collaboration between Pitch Interactive, a data visualization studio in Oakland, CA, and biological researchers at UC Riverside.
http://phinch.org/
BSD 2-Clause "Simplified" License
149 stars 30 forks source link

Donut charts have wrong proportions #72

Closed iimog closed 6 years ago

iimog commented 7 years ago

The donuts in the "Donut Partition" charts have a strange scaling applied that leads to wrong calculation of proportions and misleading charts.

Here is a minimal example to demonstrate the bug:

  1. Load this biom file into Phinch.
  2. "Proceed to Gallery" > "Donut Chart"

The a group consists of two OTUs with a total of 400 reads of which 100 are animals and 300 are fungi. All values are shown correctly but the proportion for fungi (300/400 = 75%) is calculated as 60.8%. This is also resembled in the donut chart where the arc is smaller than 270°

phinchdonutscale

This is a critical bug as any large proportions are scaled down. So differences between groups are very hard to spot. It has been misleading for my own analyses multiple times before finally discovering this unexpected and undocumented scaling.