[Biopython-dev] [Bug 2671] Including GenomeDiagram in the main Biopython distribution

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Tue Dec 9 16:20:23 UTC 2008


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





------- Comment #22 from biopython-bugzilla at maubp.freeserve.co.uk  2008-12-09 11:20 EST -------
(In reply to comment #21)
> Regarding my GC skew code (and the corresponding AT skew code): that the
> behaviour when there is no GC in the sequence is misleading
> (read: wrong ;) ). 
> Strictly, a divide-by-zero error would be correct here, but I just lazily went
> for a zero value for ease of drawing, instead of doing something that properly
> indicated 'not a number'.  

Yeah - you're right.  Either we just allow the divide by zero to be raised, or
return a NaN, maybe via float("nan") unless there is a better way without
getting NumPy involved.

> I think that what needs to be done for GenomeDiagram
> is to modify the graphing code so that it does something appropriate for NaNs
> (however they may be indicated) - this should perhaps be to stop at the
> preceding point, and resume at the subsequent point, for line graphs; not to
> draw a box for the heat map; and not to draw a bar for the bar chart (not that
> this will always be distinguishable from a zero value...).

OK.  I can see what just using zero was a nice short cut here.

> The GenomeDiagram GC/AT skew code also needs to be modified to return None or
> some other NaN indicator before its behaviour can be considered correct.

Or, if we accept that "sequence scoring functions" may raise a divide by zero
error, then apply_to_window should be also to cope and map this to an
appropriate nan indicator (e.g. None or float("nan")).

Peter


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



More information about the Biopython-dev mailing list