[Biopython-dev] Genome Diagram Default Behavior

Peter Cock p.j.a.cock at googlemail.com
Wed Aug 1 13:15:31 EDT 2012


On Wed, Aug 1, 2012 at 3:27 PM, Zachary Charlop-Powers
<zcharlop at mail.rockefeller.edu> wrote:
> Leighton,
> Peter,
>
> I love that we're not in the same timezone; I ask a question when I leave
> work and - lo,and, behold - when I return in the morning there is a well
> thought out response.  Thank you both.

:)

Peter wrote:
>>> The good news is the underlying drawing code can do this - the
>>> arrow drawing is just given a bounding box and the requested
>>> orientation (left or right) argument set by the get_feature_sigil
>>> method of the LinearDrawer or CircularDrawer.
>>>
>>> If you need this right now, a careful hack in get_feature_sigil is
>>> the way to proceed.

Zachary wrote:
> I will take a look at this for a quick hack for some drawing I am
> working on.

I hope you found any effort spent useful for understanding the
codebase... even if it doesn't turn out to be needed (see below).

Peter wrote:
>>> 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.

Leighton wrote:
>> This option gets my vote.
>>
>> L.

Zachary wrote:
> If you are both in agreement that this option is desirable and that it can
> be implemented in the sigil style, now we face the question of coding it.
> Would either of you consider working on it? If not this might be a problem I
> could tackle with a small amount of mentoring. Please let me know - I am
> happy to take a stab at it.

I had a go this afternoon (a quite moment between rushes - grin), and
it wasn't as bad as I feared. This is on a git branch at the moment,

https://github.com/peterjc/biopython/tree/gd-big

Thus far, just two commits. The first refactors the current code to move
the strand handling into the sigil code (but should, I hope, have no
side effects):

https://github.com/peterjc/biopython/commit/d9c416be7dd2c7081bd66bd553c9feb0174ecc13

The second commit implements the new axis straddling arrow (for
both linear and circular diagrams) plus a minimal test:

https://github.com/peterjc/biopython/commit/b58903d5c455416028a8ae410b2063d536448d59

To match the current sigil argument names BOX and ARROW, I have
provisionally called BIGARROW. Any better ideas?

Also, to match the current arrow's behaviour, strand-less features
get an arrow pointing to the right (like a forward strand arrow).
Leighton and I had a little debate about this - with hindsight, the
original arrow sigil might have raised an error or drawn a box in
this situation - but I'm not willing to change this and break existing
code.

It would be great if you (Zachary) could give this a test, both to look
for regressions (anything that broke) and try the new sigil out. Are
you familiar with git, and installing Biopython from source?

Regards,

Peter


More information about the Biopython-dev mailing list