[Biopython-dev] Tutorial: GenomeDiagram problem

Peter Cock p.j.a.cock at googlemail.com
Mon May 19 14:52:04 UTC 2014


On Mon, May 19, 2014 at 3:26 PM, Tiago Antao <tra at popgen.net> wrote:
> Hi,
>
> Before I go to that problem, a somewhat more important one has
> surfaced: The last example of the GenomeDiagram tutorial seems to have
> a bug (either on the example code or on the module). If you scroll to
> the end of the notebook you will see the error and will be clear.
>
> http://nbviewer.ipython.org/github/tiagoantao/biopython-notebook/blob/master/notebooks/17%20-%20Graphics%20including%20GenomeDiagram.ipynb

Do you mean the Chromosome Diagram problem (nothing to do
with GenomeDiagram), which you see failing with:

UnboundLocalError: local variable 'fill_color' referenced before assignment

Scanning the code, yes, if providing SeqFeature objects this does not
seem to define the fill_color - which would be my fault:
https://github.com/biopython/biopython/blob/master/Bio/Graphics/BasicChromosome.py

Time to extend test_GraphicsChromosome.py to cover this...

The reason we don't test this via test_Tutorial.py is the large
data dependency (i.e. the full Arabidopsis thaliana genome).

> Regarding the other problem, I do not think it is a problem with
> sending images or ipython notebook (if you scroll the example above,
> you will see plenty of pictures). I think it might be that the tutorial
> examples are not self contained. Reading the text it seems that it is
> possible to combine several pieces of code to produce some of the
> figures. But it is not clear how (at least for me).

Evidently I got the balance of verbose repetition versus clarity wrong.

The idea would be to repeat the setup steps, use the alternative
feature definition, and then repeat the output step.

Peter



More information about the Biopython-dev mailing list