wilkelab / Opfi

A Python package for discovery, annotation, and analysis of gene clusters in genomics or metagenomics data sets.
https://opfi.readthedocs.io/
MIT License
21 stars 5 forks source link

Dynamically determine stacked figure dimensions #127

Closed jimrybarski closed 4 years ago

jimrybarski commented 4 years ago

We're using DNA features viewer in a way its authors didn't anticipate, and so it doesn't have the information it needs to correctly determine the figure dimensions (though to be sure, it can also fail even when plotting a single operon - see issue #99). This commit uses a horrendous combination of heuristics and magic numbers to come up with dimensions that balance many competing requirements:

This may be unappealing, but testing on a range of operons with few or many features, and narrow and wide contigs, seems to work well. I've examined hundreds of random examples and they all seemed effectively flawless.

Resolves #125