Skip to content

Deprecate (or remove?) Scripts/xbbtools/xbb_*.py #848

Closed

Description

@peterjc

The code under Scripts/xbbtools/ is an old GUI tool, which I have updated bits of over the years but hasn't had any maintainer since 2001 when Thomas Sicheritz Pontén wrote it.

Using pip install Pmw to get Python megawidgets it would run under Python 2.7, but (updated) until 2813643 it wouldn't even start on Python 3.

Unless someone volunteers to take over this, I propose to deprecate it - or maybe even simply delete it for the next release?

Activity

  1. MarkusPiotrowski commented on Jun 9, 2016

    @MarkusPiotrowski
    Contributor

    It's seems to be using wxPython.
    What I can think of is translating it for using tkinter with modern ttk widgets. This should make it running on Python 2 and 3 and would remove the additional dependency.

  2. peterjc commented on Jun 9, 2016

    @peterjc
    MemberAuthor

    Getting it to start on Python 3 again turned out to be trivial: 2813643

    The only bit of Pwm it seems to use is Pmw.ComboBox, the rest is tkinter (which I remember was a slight pain as the imports are different under Python 3).

  3. MarkusPiotrowski commented on Jun 9, 2016

    @MarkusPiotrowski
    Contributor

    Sorry, I got lost in /Scripts/SeqGui... this requires wxPython...

  4. peterjc commented on Jun 9, 2016

    @peterjc
    MemberAuthor

    It might be worth deprecating/removing Scripts/SeqGui/SeqGui.py as well, unless you want to adopt it? Shall we file a separate issue for that?

  5. MarkusPiotrowski commented on Jun 10, 2016

    @MarkusPiotrowski
    Contributor

    In contrast to SeqGui, Xbbtools looks terrible colorful... and it also throws some errors. On the other hand, SeqGui has minimal functionality that is already included in Xbbtools, so if we deprecate/remove the latter we should also do the same with the other.
    I can offer to try to make both running without additional gui dependencies (wxPython, pmw etc.) with tkinter using ttk widgets, update, bugfix and make Python 2/3 compatible. This doesn't seem to be too much work (I rewrote the SeqGui gui with tkinter yesterday evening, just need to add the functionality for the three buttons). See also #849

  6. peterjc commented on Jun 10, 2016

    @peterjc
    MemberAuthor

    Yes, xbbtools is colourful - this is with the Tests/Fasta/sweetpea.nu example file loaded:

    screenshot 2016-06-10 10 44 03

    As far as I recall both xbbtools and SeqGui have worked Python 3 (although getting the dependencies installed was a pain). However, given their age both have also needed updating for changes in Biopython as well (e.g. the translation code).

    The GC frame button in xbbtools seems to have broken at some point:

    $ python xbbtools.py 
    Exception in Tkinter callback
    Traceback (most recent call last):
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py", line 1536, in __call__
        return self.func(*args)
      File "./xbb_widget.py", line 376, in gcframe
        tid.insert(END, self.translator.gcframe(seq, self.current_codon_table_id))
      File "./xbb_translations.py", line 89, in gcframe
        comp = self.complement(seq)
      File "./xbb_translations.py", line 33, in complement
        return reverse_complement(seq)[::-1]
      File "/Library/Python/2.7/site-packages/Bio/Seq.py", line 2223, in reverse_complement
        return sequence.translate(ttable)[::-1]
    TypeError: character mapping must return integer, None or unicode
    

    If you are interested in taking over xbbtools.py and/or SeqGui.py (#849), that would be great. I suggest before committing yourself fully, try fixing a few of the more obvious issues - I'm happy to look at some small pull requests for this.

    Looking ahead, I would happy to see a single tool combining them or replacing them, using SeqIO for sequence input output - and perhaps SearchIO for BLAST integration? However, this is not sometimes I personally want to work on. Also it might be better off outside the main repository (but still under the Biopython GitHub account)?

  7. MarkusPiotrowski commented on Jun 10, 2016

    @MarkusPiotrowski
    Contributor

    @peterjc wrote:

    Looking ahead, I would happy to see a single tool combining them or replacing them, using SeqIO for sequence input output - and perhaps SearchIO for BLAST integration? However, this is not sometimes I personally want to work on. Also it might be better off outside the main repository (but still under the Biopython GitHub account)?

    Coincidentally, I am thinking for a few weeks about (and already started to work a little bit on it) writing a full sequence editor GUI mainly based on (and demonstrating) Biopython code.

    untitled-1
    [Picture: Sequence extracted from an .abi file using Biopython's SeqIO]

    But this is a long way to go...

  8. MarkusPiotrowski commented on Jun 19, 2016

    @MarkusPiotrowski
    Contributor

    This error:

    TypeError: character mapping must return integer, None or unicode

    comes up at several places in this tool. The reason seems to be that the selected text from the text field is exported as unicode object. This is strange, it should be str, but I haven't found the place which makes it to unicode. I have solved the problem by explicitely casting to str at several places in the script, but it would be nice to prevent it returning a unicode object at first place.

  9. peterjc commented on Jun 20, 2016

    @peterjc
    MemberAuthor

    If the is a unicode vs string issue it is likely linked to the Python 2 to 3 conversion - I only did minimal testing at the time (and it is also possible the tk library changed slightly since that work).

    Or it could just be we're passing a Biopython Seq object to a GUI widget, in which case wrapping wth str() is the right fix.

  10. peterjc commented on Apr 17, 2017

    @peterjc
    MemberAuthor

    Belatedly closing this issue - thank you Markus for the updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions