[Biopython-dev] [Bug 3047] PhyloXML, behavior on setting color and width doesn't match docstring or spec

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Wed Apr 7 07:00:03 UTC 2010


http://bugzilla.open-bio.org/show_bug.cgi?id=3047





------- Comment #8 from biopython-bugzilla at maubp.freeserve.co.uk  2010-04-07 03:00 EST -------
(In reply to comment #5 by Joel)
> Created an attachment (id=1475)
 --> (http://bugzilla.open-bio.org/attachment.cgi?id=1475&action=view) [details]
> phyloXML user code showing how to colorize a tree
> 

Thanks for the example - it looks quite complicated.

You have lots of functions taking "self" as the first argument. Are the
intended to be methods of the tree/clade objects? Otherwise using an
argument name like "tree" or "node" could be clearer.

Why do you use leading underscores on some many variables whose scope is
limited to single functions (in particular function hl_color_on_function)?
They are private by their scope.

(In reply to comment #7 by Eric)
> (In reply to comment #3)
> > (In reply to comment #2)
> > > (In reply to comment #0)
> > > > From the Clade docstring:
> > > > 
> > > > "Both 'color' and 'width' elements apply for the whole clade unless
> > > > overwritten in-sub clades.
> > > 
> > > What is the bug? The docstring doesn't say the property will be explicitly
> > > cascaded down to the sub-clades, which seems to be your interpretation.
> > > Isn't that implicit when interpreting (drawing) the tree?
> > > 
> > > Peter
> > > 
> > 
> > I suppose one could maintain that it's the responsibility of user code to
> > enforce the behavior specified in the docstring, although I think that's a
> > recipe for incompatibilities.  However, neither of the two available user codes
> > I'm aware of (archaeoptryx or biopython's  Phylo.draw_graphviz) actually
> > implement it.  It's better to just change the docstring, I think.
> > 
> 
> 
> That's my interpretation of it -- the color attribute is meant to be handled
> that way by whatever code uses it for drawing.
> 
> Which means two things should happen before closing this bug:
> 
>  - Change the docstring to indicate *user code* is supposed to handle colors
> and widths in a cascading fashion
> 
>  - Fix draw_graphviz (actually to_networkx) to cascade colors down branches,
> like the Archaeopteryx GUI does

So the Bio.Phylo drawing code (using NetworkX) doesn't cascade the
colors/widths yet?

We should probably check the behavour of other phyloXML GUI tools for
consistency... and possibly file a bug in Archaeopteryx.

Peter


-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the Biopython-dev mailing list