[Biopython-dev] Modifications to CircularDrawer

David Martin d.m.a.martin at dundee.ac.uk
Wed Dec 5 11:29:14 EST 2012


Just got my head out of hacking at this. The options I have now are:

label_position: start|middle|end with reference to the feature. So the end is always the pointy bit.
label_orientation: circular|upright  Sometimes it is nice to have a proper circular plot
label_placement: inside|outside|overlap|strand which maintains overlap as default, inside is all inside, outside is all outside, strand is forward outside and reverse inside.

It even works. Angles and so on are not so relevant with circular plots though I would prefer a label_angle: radial|tangent|[degrees]

Should I attach an example?

..d


From: Leighton Pritchard [mailto:Leighton.Pritchard at hutton.ac.uk]
Sent: 05 December 2012 16:21
To: David Martin
Cc: BioPython-Dev; Peter Cock
Subject: Re: [Biopython-dev] Modifications to CircularDrawer

Hi all,

On 5 Dec 2012, at Wednesday, December 5, 13:50, David Martin 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
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
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

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

Any thoughts/suggestions?

I think that the proposed changes are all sensible, but circular labels are fiddly, so we'll need to think a wee bit about what to do exactly (probably another reason why I didn't do much on this originally ;) ).

label_position makes perfect sense, as suggested.

label_placement as a concept is fine, but I think we might need to be more precise about the intended behaviour of the arguments. I think that 'overlap' is possibly just a result of the choice of two anchoring parameters: 'inside'/'outside' and 'start'/'end' of the label string (see .png if the list accepts them).  We might be able to cover all possibilities with just these two choices - does this image cover the range of intended positioning David?  If so, then how about two arguments (I'm easy on the argument names): 'label_outer=True/False' and 'label_anchor=start/end/0/1'?

[cid:image001.png at 01CDD305.AA06C500]

label_orientation: What I think you're saying is that we want a distinction between text that orients to assume a static page (one you always view upright: e.g. a monitor), and text that doesn't.  I prefer 'reorient_labels=True/False', or some other geometrically neutral argument name, to 'upright' (whose expected meaning could change depending on page location and local context) as a parameter, but it's a good idea.

IIRC Track widths are relative, rather than absolute, and don't include label bounding boxes, so off-hand I don't think there ought to be any downstream issues.  Famous last words, there! ;)

Cheers,

L.

--
Dr Leighton Pritchard
Information and Computing Sciences Group; Weeds, Pests and Diseases Theme
DG31, James Hutton Institute (Dundee)
Errol Road, Invergowrie, Perth and Kinross, Scotland, DD2 5DA
e:leighton.pritchard at hutton.ac.uk       w:http://www.hutton.ac.uk/staff/leighton-pritchard
gpg/pgp: 0xFEFC205C tel: +44(0)844 928 5428 x8827 or +44(0)1382 568827



________________________________________________________

This email is from the James Hutton Institute, however the views
expressed by the sender are not necessarily the views of the James Hutton
Institute and its subsidiaries. This email and any attachments are confidential and
are intended solely for the use of the recipient(s) to whom they are addressed.
If you are not the intended recipient, you should not read, copy, disclose or rely on
any information contained in this email, and we would ask you to contact the
sender immediately and delete the email from your system. Although the James
Hutton Institute has taken reasonable precautions to ensure no viruses are present
in this email, neither the Institute nor the sender accepts any responsibility for any
viruses, and it is your responsibility to scan the email and any attachments.

The James Hutton Institute is a Scottish charitable company limited by guarantee.
Registered in Scotland No. SC374831
Registered Office: The James Hutton Institute, Invergowrie Dundee DD2 5DA.
Charity No. SC041796

The University of Dundee is a registered Scottish Charity, No: SC015096
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 22969 bytes
Desc: image001.png
URL: <http://lists.open-bio.org/pipermail/biopython-dev/attachments/20121205/bc3027ca/attachment-0001.png>


More information about the Biopython-dev mailing list