[Biopython-dev] Genome Diagram Default Behavior

Peter Cock p.j.a.cock at googlemail.com
Wed Aug 1 11:05:51 UTC 2012

On Wed, Aug 1, 2012 at 11:53 AM, Leighton Pritchard
<Leighton.Pritchard at hutton.ac.uk> wrote:
> It doesn't, if the single track is the same height as before - what differs
> is the whether the features on that track are half, or full, track height.

Yes, but once you've configured the arrows to straddle the axis, you can
then allocate less vertical space to that track. i.e. it needs less space.

>> The question is how to most cleanly expose this to the user while
>> not breaking anything else (e.g. cross links), and ideally allow for
>> a related option which Leighton and I have considered […]
> My original plan was to have more sigils available, implemented as draw_X()
> functions in the AbstractDrawer module. This would seem to be a good case
> for a draw_large_arrow() (or somesuch) function. The issue then would be a
> slight change to the prototypes for the existing draw_box and draw_arrow
> functions. Basically, we'd pass the overall bounding box and strand (x0, x1,
> btm, ctr, top, strand) information to the new functions, and let them decide
> where to place the sigil - above, below, or straddling the centre line.
> Then, we could choose whether draw_arrow() takes an additional argument
> (e.g. straddle=True) for the behaviour that Zachary wants, or whether we use
> a new sigil ('large_arrow'), which could have its own function - just like
> that of draw_arrow() - but would probably be better implemented by just
> passing the straddle=True (or whatever) argument.
> This way, the change is transparent to the user, except for perhaps choosing
> 'large_arrow' rather than 'arrow' as a sigil.

That was another idea I was considering. Under this model, the sigils
could be given the full strand straddling bounding box, and decide if
they will use all of this (i.e. the new 'large_arrow', or the current sigils
when strand-less), or just half as in the stranded current 'arrow' and
'box' sigils where the strand is known.

That could work quite well, and the end user API is quite clean.


More information about the Biopython-dev mailing list