[Biopython-dev] Modifications to CircularDrawer

Peter Cock p.j.a.cock at googlemail.com
Wed Dec 5 15:57:44 UTC 2012


On Wed, Dec 5, 2012 at 1:50 PM, David Martin <d.m.a.martin at dundee.ac.uk> wrote:
> Peter, Leighton and I have had a brief discussion on Twitter re drawing circular genome diagrams.
>
> I'd like to modify the CircularDrawer feature drawing to allow the following:
>
> label_position: start|middle|end as per LinearDrawer

I would find it natural if we treated start/middle/end from the point of view
of the feature (and its strand) as in the LinearDrawer. However the current
circular drawer tries to position things at the vertical bottom of the feature
(it cares about the left and right halves of the circle) which is
rather different.

I am suggesting a break in backwards compatibility (old code would still
run but put the labels in different places) but for large circular diagrams
the difference should be minor - and I think it would be an overall
improvement.

> label_placement: inside|outside|overlap where inside and outside are
> anchored just inside and just outside the feature but do not overlap it,
> and overlap is the current behaviour

If I have understood your intended meaning, that won't work nicely with
stranded features.

I would suggest two options: outside (i.e. outside the feature's bounding
box, either outside the track circle for forward strand or strand-less, or
inside the track circle for reverse strand) matching the current linear code,
or inside matching the current circular code. i.e. This would essentially
toggle the text element's anchoring between start/end.

i.e. Maintain the convention that labels above/outside the track are for
the forward strand (and strand-less) features, while labels below/inside
the track are for reverse strand features.

> label_orientation: upright|circular which determines the orientation of
> the label. upright is the current behaviour. Circular would be oriented
> to face clockwise for the forward strand and anticlockwise for the reverse

I would prefer making the existing (linear) option label_angle work nicely
on circular diagrams (which would make sense as part of reworking the
code to obey label_placement).

> This will cause some issues with track widths (how can you specify a
> track width for a feature track?)

Do you mean how to allocate more white space between the tracks
to ensure the labels have a clear background if printed outside the
features? The quick and dirty solution is a spacer track (you can
allocate track numbers to leave a gap).

> Any thoughts/suggestions?
>

Comments in-line, if need be we could meet up to hash some of this
out in person (although I not be in the Dundee area next week).

Regards,

Peter



More information about the Biopython-dev mailing list