Edinburgh-Genome-Foundry / DnaFeaturesViewer

:eye: Python library to plot DNA sequence features (e.g. from Genbank files)
https://edinburgh-genome-foundry.github.io/DnaFeaturesViewer/
MIT License
584 stars 90 forks source link

Set custom feature_level_height for each GraphicFeature #87

Open josephrich98 opened 2 months ago

josephrich98 commented 2 months ago

Is it possible to set a custom feature_level_height for each GraphicFeature, rather than a single global value for GraphicRecord?

veghp commented 2 months ago

If I understand your intention correctly, then I think unfortunately no, it's not possible. Also it will likely be not implemented either, as the key problem this software solves is arranging the features in a non-overlapping manner, i.e. grouping (assigning) them to the lines (or levels) on the plot. The algorithm in DNA Features Viewer finds the minimum number of levels that allows plotting the labels without overlap; the heights (levels) are really categories, not distance. This approach works well and simple when the height of the levels, that is, the height of the letters, are the same.