[Biopython-dev] Modifications to CircularDrawer
Peter Cock
p.j.a.cock at googlemail.com
Sat Mar 16 20:37:12 UTC 2013
On Sat, Mar 16, 2013 at 2:38 PM, Peter Cock <p.j.a.cock at googlemail.com> wrote:
> On Wed, Dec 5, 2012 at 6:41 PM, Peter Cock <p.j.a.cock at googlemail.com> wrote:
>> Hi David,
>>
>> I've been experimenting with your pull request, thank you:
>> https://github.com/biopython/biopython/pull/116
>>
>
> Hi again David,
>
> I've not used your code as is, but have started by pulling out
> and generalising what I felt was the least contentious part:
>
> https://github.com/biopython/biopython/commit/087712510421ec7f655a7981926a757aa93e9177
>
> This means that label_position = start, middle, end (and some
> historic aliases defined in the linear drawer code) now work
> on circular GenomeDiagrams. I have made the default None,
> which gives the current behaviour (as 'start' on linear, the
> more complicated to explain vertical bottom on circular).
>
> Support for allowing the default label orientation to be radially
> consistent all round the circle (rather than the current flipping
> for the left/right halves which assumes the output is kept
> vertical) would be nice, but the thing I am most keen on is the
> inside/outside of the track label placement. Hopefully I'll have
> time to finish that this weekend...
Here's a version on a branch which addresses the label placement
by adding a label_strand argument, where +1 means the label is
on the forward strand side of the track (above or outside), while
-1 means the reverse strand side of the track (below or inside),
and the default is to follow the strand of the feature being draw.
This seemed to me quite an intuitive arrangement:
https://github.com/peterjc/biopython/tree/label_strand
This branch also (without making it optional) switches circular
diagram feature labels to be "outside" the sigil like the linear
diagram, rather than "insider" the sigil. This does tend to take
up more space (which would explain the original motivation),
but rarely gives a very legible result except with a box sigil
and a very small/short label which falls completely within the
sigil. This could be made a user option if there is demand...
my inclination is not to (the API is already quite complex).
David, I will email you an updated version of your example
script using this branch for you to look at. It allows me to
recreate the same effect as your code (bar the orientation
changes which I have not at this point incorporated).
David & Leighton, what do you think of this label idea?
Peter
More information about the Biopython-dev
mailing list