You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
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.
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).
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
Yes, xbbtools is colourful - this is with the Tests/Fasta/sweetpea.nu example file loaded:
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)?
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.
[Picture: Sequence extracted from an .abi file using Biopython's SeqIO]
comes up at several places in this tool. The reason seems to be that the selected text from the text field is exported as unicodeobject. 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.
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.
Activity
peterjc commentedon Jun 9, 2016
Asking on the mailing lists too:
http://lists.open-bio.org/pipermail/biopython/2016-June/015955.html
http://lists.open-bio.org/pipermail/biopython-dev/2016-June/021427.html
MarkusPiotrowski commentedon Jun 9, 2016
It's seems to be using wxPython.
What I can think of is translating it for using
tkinterwith modernttkwidgets. This should make it running on Python 2 and 3 and would remove the additional dependency.peterjc commentedon Jun 9, 2016
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 istkinter(which I remember was a slight pain as the imports are different under Python 3).peterjc commentedon Jun 9, 2016
There is (now) a Tk combobox it might be able to use instead, https://docs.python.org/2/library/ttk.html#ttk.Combobox and https://docs.python.org/3/library/tkinter.ttk.html#tkinter.ttk.Combobox
That should allow getting rid of the Pwm dependency as suggested by @MarkusPiotrowski
MarkusPiotrowski commentedon Jun 9, 2016
Sorry, I got lost in
/Scripts/SeqGui... this requires wxPython...peterjc commentedon Jun 9, 2016
It might be worth deprecating/removing
Scripts/SeqGui/SeqGui.pyas well, unless you want to adopt it? Shall we file a separate issue for that?MarkusPiotrowski commentedon Jun 10, 2016
In contrast to
SeqGui,Xbbtoolslooksterriblecolorful... and it also throws some errors. On the other hand,SeqGuihas minimal functionality that is already included inXbbtools, 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
tkinterusingttkwidgets, update, bugfix and make Python 2/3 compatible. This doesn't seem to be too much work (I rewrote theSeqGuigui with tkinter yesterday evening, just need to add the functionality for the three buttons). See also #849peterjc commentedon Jun 10, 2016
Yes, xbbtools is colourful - this is with the
Tests/Fasta/sweetpea.nuexample file loaded: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:
If you are interested in taking over
xbbtools.pyand/orSeqGui.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
SeqIOfor sequence input output - and perhapsSearchIOfor 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)?MarkusPiotrowski commentedon Jun 10, 2016
@peterjc wrote:
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.
[Picture: Sequence extracted from an
.abifile using Biopython'sSeqIO]But this is a long way to go...
MarkusPiotrowski commentedon Jun 19, 2016
This error:
comes up at several places in this tool. The reason seems to be that the selected text from the text field is exported as
unicodeobject. This is strange, it should bestr, but I haven't found the place which makes it to unicode. I have solved the problem by explicitely casting tostrat several places in the script, but it would be nice to prevent it returning aunicodeobject at first place.peterjc commentedon Jun 20, 2016
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
Seqobject to a GUI widget, in which case wrapping wthstr()is the right fix.peterjc commentedon Apr 17, 2017
Belatedly closing this issue - thank you Markus for the updates.