merenlab / anvio

An analysis and visualization platform for 'omics data
http://merenlab.org/software/anvio
GNU General Public License v3.0
415 stars 142 forks source link

Fix overinflated stepwise copy number values from multiple annotations on same gene #2176

Closed ivagljiva closed 8 months ago

ivagljiva commented 8 months ago

This very simple PR fixes issue #2173 and another bug that I found along the way. The fix and its caveats are detailed in #2173, but to summarize:

In short, stepwise copy numbers will no longer be inflated when one gene has multiple annotations. In the worst case, they may be too low rather than too high.

Finally, there was another bug that was also contributing to the inflation of step copy numbers in some cases -- missing annotations for direct alternatives were not counted as 0s if they were the first out of all the alternatives to be considered. This and its fix are also described in #2173, and I will note that it is perhaps the more important of the two fixes because it was not obvious and it affected more modules (15, in my test data, compared to 8 for the multiple annotations bug).