[med-svn] [Git][med-team/scoary][master] 2 commits: There is no need to do any patching with 2to3 - code works perfectly with Python3
Andreas Tille
gitlab at salsa.debian.org
Fri Sep 13 23:44:23 BST 2019
Andreas Tille pushed to branch master at Debian Med / scoary
Commits:
f0b1ee8e by Andreas Tille at 2019-09-13T22:36:10Z
There is no need to do any patching with 2to3 - code works perfectly with Python3
- - - - -
8f85a774 by Andreas Tille at 2019-09-13T22:38:59Z
Upload to unstable
- - - - -
3 changed files:
- debian/changelog
- − debian/patches/2to3.patch
- − debian/patches/series
Changes:
=====================================
debian/changelog
=====================================
@@ -1,11 +1,11 @@
-scoary (1.6.16-2) UNRELEASED; urgency=medium
+scoary (1.6.16-2) unstable; urgency=medium
- * Use 2to3 to port to Python3
+ * Switch (Build-)Depends from Python2 to Python3
Closes: #938447
* debhelper-compat 12
* Standards-Version: 4.4.0
- -- Andreas Tille <tille at debian.org> Fri, 13 Sep 2019 16:13:39 +0200
+ -- Andreas Tille <tille at debian.org> Sat, 14 Sep 2019 00:37:02 +0200
scoary (1.6.16-1) unstable; urgency=medium
=====================================
debian/patches/2to3.patch deleted
=====================================
@@ -1,1123 +0,0 @@
-Description: Use 2to3 to port to Python3
-Bug-Debian: https://bugs.debian.org/938447
-Author: Andreas Tille <tille at debian.org>
-Last-Update: Fri, 13 Sep 2019 16:13:39 +0200
-
---- a/scoary.py
-+++ b/scoary.py
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python3
-
- # Scoary - Microbial Pan-GWAS. Associates genes in Roary output with phenotypes
- # Copyright (C) 2016 Ola Brynildsrud (ola.brynildsrud at fhi.no)
---- a/scoary/GUI.py
-+++ b/scoary/GUI.py
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python3
- # -*- coding: utf-8 -*-
-
- """
-@@ -12,7 +12,7 @@ import sys, os
- import threading
-
- try:
-- import Tkinter
-+ import tkinter
- except ImportError:
- #Python 3 issues
- try:
-@@ -21,7 +21,7 @@ except ImportError:
- sys.exit("Need to have Tkinter / tkinter installed")
-
- try:
-- import tkFileDialog
-+ import tkinter.filedialog
- except ImportError:
- # Python 3 issues
- try:
-@@ -31,7 +31,7 @@ except ImportError:
- sys.exit("Could not find tkFileDialog / filedialog")
-
- try:
-- import ttk
-+ import tkinter.ttk
- except ImportError:
- # Python 3 issues
- try:
-@@ -63,12 +63,12 @@ except ImportError:
-
- from pkg_resources import resource_string, resource_filename
-
--class ScoaryGUI(Tkinter.Tk):
-+class ScoaryGUI(tkinter.Tk):
- """
- Create the main GUI window
- """
- def __init__(self,parent):
-- Tkinter.Tk.__init__(self,parent)
-+ tkinter.Tk.__init__(self,parent)
- self.parent = parent
-
- self.Scoary_parameters = {"GPA": None,"Trait":None,"Tree":None,
-@@ -86,15 +86,15 @@ class ScoaryGUI(Tkinter.Tk):
- }
- self.initialize_menu()
-
-- self.toppart = Tkinter.Frame(self,height="350",width="800")
-- self.bottompart = Tkinter.Frame(self,height="50",width="800")
-+ self.toppart = tkinter.Frame(self,height="350",width="800")
-+ self.bottompart = tkinter.Frame(self,height="50",width="800")
- self.toppart.pack(side='top',expand=False)
- self.bottompart.pack(side='bottom',expand=True,fill='both')
-
-- self.nwpart = Tkinter.Frame(self.toppart,
-+ self.nwpart = tkinter.Frame(self.toppart,
- height="350",
- width="250")
-- self.nepart = Tkinter.LabelFrame(self.toppart,
-+ self.nepart = tkinter.LabelFrame(self.toppart,
- height="350",
- width="550",
- text="Control panel")
-@@ -103,7 +103,7 @@ class ScoaryGUI(Tkinter.Tk):
-
- # Add further frames to top or bottom
-
-- self.logocanvas = Tkinter.Canvas(self.nwpart,
-+ self.logocanvas = tkinter.Canvas(self.nwpart,
- height="250",
- width="250",
- relief="ridge",
-@@ -111,7 +111,7 @@ class ScoaryGUI(Tkinter.Tk):
- highlightthickness=0)
- self.logocanvas.pack(side='top',expand=False)
-
-- self.citationframe = Tkinter.Frame(self.nwpart,
-+ self.citationframe = tkinter.Frame(self.nwpart,
- height="100",
- width="250")
- self.citationframe.pack(side='bottom',expand=False,fill='none')
-@@ -127,15 +127,15 @@ class ScoaryGUI(Tkinter.Tk):
- """
- Initialize the menu at the top
- """
-- self.menubar = Tkinter.Menu(self,relief="flat")
-- filemenu = Tkinter.Menu(self.menubar,tearoff=0)
-+ self.menubar = tkinter.Menu(self,relief="flat")
-+ filemenu = tkinter.Menu(self.menubar,tearoff=0)
- filemenu.add_command(label="About",command=self.AboutScoary)
- filemenu.add_separator()
- filemenu.add_command(label="Quit",command=self.quit)
- self.filemenu = filemenu
- self.menubar.add_cascade(label="File",menu=self.filemenu)
-
-- optsmenu = Tkinter.Menu(self.menubar,tearoff=0)
-+ optsmenu = tkinter.Menu(self.menubar,tearoff=0)
- optsmenu.add_command(label="Clear", command=self.ClearAll)
- optsmenu.add_command(label="Test example",
- command=self.TestExample)
-@@ -149,7 +149,7 @@ class ScoaryGUI(Tkinter.Tk):
- Initialize the citation frame - below the logo
- """
- myfontstyle = ("Arial",8)
-- self.citation = Tkinter.Label(self.citationframe,
-+ self.citation = tkinter.Label(self.citationframe,
- text=self.citationtext(),
- anchor='center',
- justify='center',
-@@ -162,13 +162,13 @@ class ScoaryGUI(Tkinter.Tk):
- """
- frame = self.bottompart
-
-- frame.pb = ttk.Progressbar(frame,
-+ frame.pb = tkinter.ttk.Progressbar(frame,
- orient='horizontal',
- mode='determinate',
- maximum=100)
- frame.pb.pack(fill='both',expand=True,side='top')
-
-- frame.lab = Tkinter.Label(frame,text=u"Awaiting input options")
-+ frame.lab = tkinter.Label(frame,text="Awaiting input options")
- frame.lab.pack(in_=frame.pb,expand=True)
- #sys.stdout = StdoutToLabel(frame.lab, progressbar=frame.pb)
- sys.stdout = StdoutToLabel(frame.lab,
-@@ -181,87 +181,87 @@ class ScoaryGUI(Tkinter.Tk):
- """
- board = self.nepart
-
-- self.GPAentryVariable = Tkinter.StringVar()
-+ self.GPAentryVariable = tkinter.StringVar()
- board.GPAentry = \
-- Tkinter.Entry(board,
-+ tkinter.Entry(board,
- textvariable = self.GPAentryVariable,
- width=60)
- board.GPAentry.grid(column=0,row=0,sticky='W',columnspan=2)
- self.GPAentryVariable.set("Path to gene presence absence file")
-
-- self.TraitsentryVariable = Tkinter.StringVar()
-+ self.TraitsentryVariable = tkinter.StringVar()
- board.Traitsentry = \
-- Tkinter.Entry(board,
-+ tkinter.Entry(board,
- textvariable=self.TraitsentryVariable,
- width=60)
- board.Traitsentry.grid(column=0,row=1,sticky='W',columnspan=2)
- self.TraitsentryVariable.set("Path to traits/phenotype file")
-
-- self.TreeentryVariable = Tkinter.StringVar()
-+ self.TreeentryVariable = tkinter.StringVar()
- board.Treeentry = \
-- Tkinter.Entry(board,
-+ tkinter.Entry(board,
- textvariable=self.TreeentryVariable,
- width=60)
- board.Treeentry.grid(column=0,row=2,sticky='W',columnspan=2)
- self.TreeentryVariable.set(
- "(Optional) Path to custom tree file")
-
-- self.RestrictVariable = Tkinter.StringVar()
-+ self.RestrictVariable = tkinter.StringVar()
- board.Restrictentry = \
-- Tkinter.Entry(board,
-+ tkinter.Entry(board,
- textvariable=self.RestrictVariable,
- width=60)
- board.Restrictentry.grid(column=0,row=3,sticky='W',columnspan=2)
- self.RestrictVariable.set(
- "(Optional) Path to file naming isolates to include")
-
-- self.Outputdir = Tkinter.StringVar()
-+ self.Outputdir = tkinter.StringVar()
- board.Outputentry = \
-- Tkinter.Entry(board,
-+ tkinter.Entry(board,
- textvariable=self.Outputdir,
- width=60)
- board.Outputentry.grid(column=0,row=4,sticky='W',columnspan=2)
- self.Outputdir.set("(Optional) Output directory")
-
- browsebuttonGPA = \
-- Tkinter.Button(board,
-- text=u"Browse...",
-+ tkinter.Button(board,
-+ text="Browse...",
- command=self.BrowseButtonClickGPA)
- browsebuttonGPA.grid(column=2,row=0,sticky='e')
-
- browsebuttonTraits = \
-- Tkinter.Button(board,
-- text=u"Browse...",
-+ tkinter.Button(board,
-+ text="Browse...",
- command=self.BrowseButtonClickTraits)
- browsebuttonTraits.grid(column=2,row=1,sticky='e')
-
- browsebuttonTreeFile = \
-- Tkinter.Button(board,
-- text=u"Browse...",
-+ tkinter.Button(board,
-+ text="Browse...",
- command=self.BrowseButtonClickTreeFile)
- browsebuttonTreeFile.grid(column=2,row=2,sticky='e')
-
- browsebuttonRestrict = \
-- Tkinter.Button(board,
-- text=u"Browse...",
-+ tkinter.Button(board,
-+ text="Browse...",
- command=self.BrowseButtonClickRestrict)
- browsebuttonRestrict.grid(column=2,row=3,sticky='e')
-
- browsebuttonOutput = \
-- Tkinter.Button(board,
-- text=u"Browse...",
-+ tkinter.Button(board,
-+ text="Browse...",
- command=self.BrowseButtonClickOutput)
- browsebuttonOutput.grid(column=2,row=4,sticky='e')
-
- # Initialize frame for cutoffs
-- board.pframe = Tkinter.LabelFrame(board,
-+ board.pframe = tkinter.LabelFrame(board,
- text="Cut-offs",
- relief='ridge')
- board.pframe.grid(column=0,row=5,sticky='w')
- self.initialize_pvalueframe()
-
- # Initialize frame for misc options
-- board.miscframe = Tkinter.LabelFrame(board,
-+ board.miscframe = tkinter.LabelFrame(board,
- text="Misc options",
- relief='ridge')
- board.miscframe.grid(column=1,row=5,sticky='e',columnspan=2)
-@@ -269,26 +269,26 @@ class ScoaryGUI(Tkinter.Tk):
-
- ## Create extra space
-
-- board.emptyspace = Tkinter.Frame(board)
-+ board.emptyspace = tkinter.Frame(board)
- board.emptyspace.grid(column=0,row=6,columnspan=3,pady=(20,20))
-
- masterbuttonfont = ("Courier", 16)
-
-- RunButton = Tkinter.Button(board.emptyspace,
-- text=u"Run analysis",
-+ RunButton = tkinter.Button(board.emptyspace,
-+ text="Run analysis",
- font=masterbuttonfont,
- command=self.RunAnalysis,
- padx=15,pady=10)
- RunButton.grid(column=2,row=0)
-
-- QuitButton = Tkinter.Button(board.emptyspace,
-- text=u"Quit",
-+ QuitButton = tkinter.Button(board.emptyspace,
-+ text="Quit",
- font=masterbuttonfont,
- command=self.quit,padx=15,pady=10)
- QuitButton.grid(column=1,row=0)
-
-- HelpButton = Tkinter.Button(board.emptyspace,
-- text=u"Help",
-+ HelpButton = tkinter.Button(board.emptyspace,
-+ text="Help",
- font=masterbuttonfont,
- command=self.HelpButton,
- padx=15,pady=10)
-@@ -302,100 +302,100 @@ class ScoaryGUI(Tkinter.Tk):
- miscframe = board.miscframe
-
- # Max hits
-- self.mhtext = Tkinter.StringVar()
-- miscframe.mhlab = Tkinter.Label(miscframe,
-+ self.mhtext = tkinter.StringVar()
-+ miscframe.mhlab = tkinter.Label(miscframe,
- textvariable=self.mhtext)
- miscframe.mhlab.grid(column=0,row=0,sticky='w')
- self.mhtext.set("Max hits")
-
-- self.maxhitsvar = Tkinter.StringVar()
-+ self.maxhitsvar = tkinter.StringVar()
- miscframe.maxhitsentry = \
-- Tkinter.Entry(miscframe,
-+ tkinter.Entry(miscframe,
- textvariable=self.maxhitsvar,
- width=8)
- miscframe.maxhitsentry.grid(column=1,row=0)
- self.maxhitsvar.set("")
-
- # Delimiter
-- self.delimtext = Tkinter.StringVar()
-+ self.delimtext = tkinter.StringVar()
- miscframe.delim = \
-- Tkinter.Label(miscframe,
-+ tkinter.Label(miscframe,
- textvariable=self.delimtext)
- miscframe.delim.grid(column=0,row=1,sticky='w')
- self.delimtext.set("Delimiter")
-
-- self.delimvar = Tkinter.StringVar()
-+ self.delimvar = tkinter.StringVar()
- miscframe.delimentry = \
-- Tkinter.Entry(miscframe,
-+ tkinter.Entry(miscframe,
- textvariable=self.delimvar,
- width=8)
- miscframe.delimentry.grid(column=1,row=1)
- self.delimvar.set(",")
-
- # Starting column
-- self.sctext = Tkinter.StringVar()
-+ self.sctext = tkinter.StringVar()
- miscframe.sclab = \
-- Tkinter.Label(miscframe,
-+ tkinter.Label(miscframe,
- textvariable=self.sctext)
- miscframe.sclab.grid(row=2,column=0,sticky='w')
- self.sctext.set("Startcol GPA file")
-
-- self.scvar = Tkinter.StringVar()
-- miscframe.sc = Tkinter.Entry(miscframe,textvariable=self.scvar,width=8)
-+ self.scvar = tkinter.StringVar()
-+ miscframe.sc = tkinter.Entry(miscframe,textvariable=self.scvar,width=8)
- miscframe.sc.grid(row=2,column=1)
- self.scvar.set("15")
-
- # Permutations
-- self.permtext = Tkinter.StringVar()
-+ self.permtext = tkinter.StringVar()
- miscframe.permlab = \
-- Tkinter.Label(miscframe,
-+ tkinter.Label(miscframe,
- textvariable=self.permtext)
- miscframe.permlab.grid(row=3,column=0,sticky='w')
- self.permtext.set("Permutations")
-
-- self.permvar = Tkinter.StringVar()
-+ self.permvar = tkinter.StringVar()
- miscframe.perm = \
-- Tkinter.Entry(miscframe,
-+ tkinter.Entry(miscframe,
- textvariable=self.permvar,
- width=8)
- miscframe.perm.grid(row=3,column=1)
- self.permvar.set("0")
-
- # No timestamp
-- self.notimevar = Tkinter.IntVar()
-+ self.notimevar = tkinter.IntVar()
- miscframe.notime = \
-- Tkinter.Checkbutton(miscframe,
-- text=u"No timestamp",
-+ tkinter.Checkbutton(miscframe,
-+ text="No timestamp",
- onvalue=1,
- offvalue=0,
- variable=self.notimevar)
- miscframe.notime.grid(row=5,column=0,sticky='w')
-
- # Write tree
-- self.writetreevar = Tkinter.IntVar()
-+ self.writetreevar = tkinter.IntVar()
- miscframe.writetree = \
-- Tkinter.Checkbutton(miscframe,
-- text=u"Write tree",
-+ tkinter.Checkbutton(miscframe,
-+ text="Write tree",
- onvalue=1,
- offvalue=0,
- variable=self.writetreevar)
- miscframe.writetree.grid(row=6,column=0,sticky='w')
-
- # No_pairwise
-- self.nopairwisevar = Tkinter.IntVar()
-+ self.nopairwisevar = tkinter.IntVar()
- miscframe.nopairwise = \
-- Tkinter.Checkbutton(miscframe,
-- text=u"No pairwise",
-+ tkinter.Checkbutton(miscframe,
-+ text="No pairwise",
- onvalue=1,
- offvalue=0,
- variable=self.nopairwisevar)
- miscframe.nopairwise.grid(row=7,column=0,sticky='w')
-
- # Collapse
-- self.collapsevar = Tkinter.IntVar()
-+ self.collapsevar = tkinter.IntVar()
- miscframe.collapse = \
-- Tkinter.Checkbutton(miscframe,
-- text=u"Collapse corr",
-+ tkinter.Checkbutton(miscframe,
-+ text="Collapse corr",
- onvalue=1,
- offvalue=0,
- variable=self.collapsevar)
-@@ -410,59 +410,59 @@ class ScoaryGUI(Tkinter.Tk):
-
- # Add p-value checkboxes
-
-- self.naivetext = Tkinter.StringVar()
-- self.pVar = Tkinter.IntVar()
-+ self.naivetext = tkinter.StringVar()
-+ self.pVar = tkinter.IntVar()
- self.pVar.set(1)
-- self.pBVar = Tkinter.IntVar()
-- self.pBHVar = Tkinter.IntVar()
-- self.pstext = Tkinter.StringVar()
-- self.pPWVar = Tkinter.IntVar()
-- self.pEPWVar = Tkinter.IntVar()
-+ self.pBVar = tkinter.IntVar()
-+ self.pBHVar = tkinter.IntVar()
-+ self.pstext = tkinter.StringVar()
-+ self.pPWVar = tkinter.IntVar()
-+ self.pEPWVar = tkinter.IntVar()
- self.pEPWVar.set(1)
-- self.pPermVar = Tkinter.IntVar()
-+ self.pPermVar = tkinter.IntVar()
-
- pframe.naivelab = \
-- Tkinter.Label(pframe,
-+ tkinter.Label(pframe,
- textvariable=self.naivetext)
-- self.naivetext.set(u"Pop structure-naive filters")
-+ self.naivetext.set("Pop structure-naive filters")
- pframe.pNcheck = \
-- Tkinter.Checkbutton(pframe,
-- text=u"Naive (Fisher's)",
-+ tkinter.Checkbutton(pframe,
-+ text="Naive (Fisher's)",
- onvalue=1,
- offvalue=0,
- variable=self.pVar)
- pframe.pBcheck = \
-- Tkinter.Checkbutton(pframe,
-- text=u"Bonferroni",
-+ tkinter.Checkbutton(pframe,
-+ text="Bonferroni",
- onvalue=1,
- offvalue=0,
- variable=self.pBVar)
- pframe.pBHcheck = \
-- Tkinter.Checkbutton(
-+ tkinter.Checkbutton(
- pframe,
-- text=u"Benjamini-Hochberg",
-+ text="Benjamini-Hochberg",
- onvalue=1,
- offvalue=0,
- variable=self.pBHVar)
- pframe.pslab = \
-- Tkinter.Label(pframe,
-+ tkinter.Label(pframe,
- textvariable=self.pstext)
-- self.pstext.set(u"Pop structure-aware filters")
-+ self.pstext.set("Pop structure-aware filters")
- pframe.pPWcheck = \
-- Tkinter.Checkbutton(pframe,
-- text=u"Pairwise comparison (Best)",
-+ tkinter.Checkbutton(pframe,
-+ text="Pairwise comparison (Best)",
- onvalue=1,
- offvalue=0,
- variable=self.pPWVar)
- pframe.pEPWcheck = \
-- Tkinter.Checkbutton(pframe,
-- text=u"Pairwise comparison (Entire)",
-+ tkinter.Checkbutton(pframe,
-+ text="Pairwise comparison (Entire)",
- onvalue=1,
- offvalue=0,
- variable=self.pEPWVar)
- pframe.pPermcheck = \
-- Tkinter.Checkbutton(pframe,
-- text=u"Empirical p-value (Permutation)",
-+ tkinter.Checkbutton(pframe,
-+ text="Empirical p-value (Permutation)",
- onvalue=1,
- offvalue=0,
- variable=self.pPermVar)
-@@ -478,29 +478,29 @@ class ScoaryGUI(Tkinter.Tk):
-
- # Add p-value entry cells
-
-- self.pNaive = Tkinter.StringVar()
-- self.pBonf = Tkinter.StringVar()
-- self.pBH = Tkinter.StringVar()
-- self.pPW = Tkinter.StringVar()
-- self.pEPW = Tkinter.StringVar()
-- self.pPerm = Tkinter.StringVar()
-+ self.pNaive = tkinter.StringVar()
-+ self.pBonf = tkinter.StringVar()
-+ self.pBH = tkinter.StringVar()
-+ self.pPW = tkinter.StringVar()
-+ self.pEPW = tkinter.StringVar()
-+ self.pPerm = tkinter.StringVar()
-
-- pframe.pNaiveEntry = Tkinter.Entry(pframe,
-+ pframe.pNaiveEntry = tkinter.Entry(pframe,
- textvariable=self.pNaive,
- width=8)
-- pframe.pBonfEntry = Tkinter.Entry(pframe,
-+ pframe.pBonfEntry = tkinter.Entry(pframe,
- textvariable=self.pBonf,
- width=8)
-- pframe.pBHEntry = Tkinter.Entry(pframe,
-+ pframe.pBHEntry = tkinter.Entry(pframe,
- textvariable=self.pBH,
- width=8)
-- pframe.pPWEntry = Tkinter.Entry(pframe,
-+ pframe.pPWEntry = tkinter.Entry(pframe,
- textvariable=self.pPW,
- width=8)
-- pframe.pEPWEntry = Tkinter.Entry(pframe,
-+ pframe.pEPWEntry = tkinter.Entry(pframe,
- textvariable=self.pEPW,
- width=8)
-- pframe.pPermEntry = Tkinter.Entry(pframe,
-+ pframe.pPermEntry = tkinter.Entry(pframe,
- textvariable=self.pPerm,
- width=8)
-
-@@ -524,9 +524,9 @@ class ScoaryGUI(Tkinter.Tk):
- """
- Placeholder button. Planned short information about the method
- """
-- topwin = Tkinter.Toplevel(self)
-+ topwin = tkinter.Toplevel(self)
- button = \
-- Tkinter.Button(topwin,
-+ tkinter.Button(topwin,
- text=str("https://github.com/AdmiralenOla/Scoary"))
- button.pack()
-
-@@ -535,7 +535,7 @@ class ScoaryGUI(Tkinter.Tk):
- Browse button for gene presence absence field
- """
- myfile = \
-- tkFileDialog.askopenfilename(
-+ tkinter.filedialog.askopenfilename(
- filetypes=[('comma-separated values', '.csv'),
- ('all files','.*')])
- self.GPAentryVariable.set(myfile)
-@@ -545,7 +545,7 @@ class ScoaryGUI(Tkinter.Tk):
- Browse button for traits field
- """
- myfile = \
-- tkFileDialog.askopenfilename(
-+ tkinter.filedialog.askopenfilename(
- filetypes=[('comma-separated values', '.csv'),
- ('all files','.*')])
- self.TraitsentryVariable.set(myfile)
-@@ -555,7 +555,7 @@ class ScoaryGUI(Tkinter.Tk):
- Browse button for tree field
- """
- myfile = \
-- tkFileDialog.askopenfilename(
-+ tkinter.filedialog.askopenfilename(
- filetypes=[('newick tree files', '.nwk'),
- ('all files','.*')])
- self.TreeentryVariable.set(myfile)
-@@ -565,7 +565,7 @@ class ScoaryGUI(Tkinter.Tk):
- Browse button for isolate restriction field
- """
- myfile = \
-- tkFileDialog.askopenfilename(
-+ tkinter.filedialog.askopenfilename(
- filetypes=[('comma-separated values','.csv'),
- ('all files','.*')])
- self.RestrictVariable.set(myfile)
-@@ -574,7 +574,7 @@ class ScoaryGUI(Tkinter.Tk):
- """
- Browse button for choosing output dir
- """
-- mydir = tkFileDialog.askdirectory(mustexist=True)
-+ mydir = tkinter.filedialog.askdirectory(mustexist=True)
- self.Outputdir.set(mydir)
-
- def HelpButton(self):
-@@ -790,7 +790,7 @@ class ScoaryGUI(Tkinter.Tk):
- if str(SE) == "0":
- print("Analysis complete!")
- else:
-- print("Fatal error: %s" % str(SE))
-+ print(("Fatal error: %s" % str(SE)))
-
- # Listen to stdout and update statusbar
-
-@@ -800,7 +800,7 @@ class ScoaryGUI(Tkinter.Tk):
- """
- Initialize logo
- """
-- photo=Tkinter.PhotoImage(data=self.Photobase64())
-+ photo=tkinter.PhotoImage(data=self.Photobase64())
- self.logocanvas.img = photo
- self.logocanvas.create_image(0,0,anchor='nw',image=photo)
-
-@@ -946,7 +946,7 @@ class ScoaryGUI(Tkinter.Tk):
- """
- return photo
-
--class StdoutToLabel(Tkinter.Label):
-+class StdoutToLabel(tkinter.Label):
- """
- The special widget that listens to sys.stdout and updates its
- label accordingly. This widget also owns the progressbar it is
-@@ -956,7 +956,7 @@ class StdoutToLabel(Tkinter.Label):
- """
-
- def __init__(self, widget, progressbar=None, width='default'):
-- Tkinter.Label.__init__(self)
-+ tkinter.Label.__init__(self)
- self.defstdout = sys.stdout
- self.widget = widget
- self.progressbar = progressbar
---- a/scoary/classes.py
-+++ b/scoary/classes.py
-@@ -76,7 +76,7 @@ class Matrix:
- self.undef = sys.maxsize
- self.dim = int(dim)
- self.data = []
-- for i in xrange(self.dim):
-+ for i in range(self.dim):
- self.data.append(self.dim * [elm])
-
- def __getitem__(self, i):
-@@ -87,8 +87,8 @@ class Matrix:
-
- def __str__(self):
- s = ""
-- for i in xrange(self.dim):
-- for j in xrange(self.dim):
-+ for i in range(self.dim):
-+ for j in range(self.dim):
- s += str(self.data[i][j]) + " "
- s += "\n"
- return s.strip("\n")
-@@ -106,7 +106,7 @@ class QuadTree:
- self.dim = dim
- n = self.dim + self.dim % 2
- if names is None:
-- names = [str(x) for x in xrange(dim)]
-+ names = [str(x) for x in range(dim)]
- self.names = names
- self.level = []
- while n > 1:
-@@ -129,7 +129,7 @@ class QuadTree:
- if len(curr_row) % 2 == 1:
- curr_row.append(self.undef)
- next_row = []
-- for j in xrange(len(curr_row)):
-+ for j in range(len(curr_row)):
- l[i][j] = curr_row[j]
- if j % 2 == 1:
- next_row.append(self.quad_min(i, j, l))
-@@ -145,7 +145,7 @@ class QuadTree:
- if len(curr_col) % 2 == 1:
- curr_col.append(self.undef)
- next_col = []
-- for i in xrange(len(curr_col)):
-+ for i in range(len(curr_col)):
- l[i][j] = curr_col[i]
- if i % 2 == 1:
- next_col.append(self.quad_min(i, j, l))
-@@ -588,8 +588,8 @@ class Tip:
- self.maxvalues[condition] = 0
- else:
- self.maxvalues[condition] = -1
-- self.max_propairs = {k: v for (k, v) in self.maxvalues.items()}
-- self.max_antipairs = {k: v for (k, v) in self.maxvalues.items()}
-+ self.max_propairs = {k: v for (k, v) in list(self.maxvalues.items())}
-+ self.max_antipairs = {k: v for (k, v) in list(self.maxvalues.items())}
-
- if __name__ == '__main__':
- pass
---- a/scoary/methods.py
-+++ b/scoary/methods.py
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python3
- # -*- coding: utf-8 -*-
-
- # Script for associating Roary output with phenotypic trait (+/-)
-@@ -380,7 +380,7 @@ def Csv_to_dic_Roary(genefile, delimiter
-
- # Move forwards from startcol to find correct startcol
- if strains[0] in Roarycols and roaryfile:
-- for c in xrange(len(strains)):
-+ for c in range(len(strains)):
- if strains[c] not in Roarycols:
- correctstartcol = startcol + c
- break
-@@ -397,7 +397,7 @@ def Csv_to_dic_Roary(genefile, delimiter
- Firstcols = header[:startcol][::-1]
- minus = 0
- Censored_isolates = []
-- for c in xrange(len(Firstcols)):
-+ for c in range(len(Firstcols)):
- if Firstcols[c] not in Roarycols:
- minus += 1
- Censored_isolates.append(Firstcols[c])
-@@ -415,7 +415,7 @@ def Csv_to_dic_Roary(genefile, delimiter
-
- if allowed_isolates is not None:
- strain_names_allowed = [val for val in strains
-- if val in allowed_isolates.keys()]
-+ if val in list(allowed_isolates.keys())]
- else:
- strain_names_allowed = strains
-
-@@ -469,9 +469,9 @@ def Csv_to_dic_Roary(genefile, delimiter
- # between strains.
- zero_ones_line = []
-
-- for strain in xrange(len(strains)):
-+ for strain in range(len(strains)):
- if (allowed_isolates is not None):
-- if strains[strain] not in allowed_isolates.keys():
-+ if strains[strain] not in list(allowed_isolates.keys()):
- continue
- if q[startcol + strain] in ["", "0", "-"]:
- # If the gene is not present, AND The isolate is allowed
-@@ -499,7 +499,7 @@ def Csv_to_dic_Roary(genefile, delimiter
- # Transpose list for distance calculation purposes
- if writereducedset:
- file.close()
-- zero_ones_matrix = list(map(list, zip(*zero_ones_matrix)))
-+ zero_ones_matrix = list(map(list, list(zip(*zero_ones_matrix))))
-
- return {"Roarydic": r,
- "Zero_ones_matrix": zero_ones_matrix,
-@@ -520,8 +520,8 @@ def ReduceSet(genefile, delimiter, grabc
- delimiter=delimiter)
- header = next(csvfile)
- allowed_indexes = list(range(startcol))
-- for c in xrange(len(header)):
-- if header[c] in allowed_isolates.keys():
-+ for c in range(len(header)):
-+ if header[c] in list(allowed_isolates.keys()):
- allowed_indexes.append(c)
-
- log.info("Writing gene presence absence file for the reduced set of "
-@@ -556,8 +556,8 @@ def Csv_to_dic(csvfile, delimiter, allow
- if len(tab) < 2:
- sys.exit("Please check that your traits file is formatted "
- "properly and contains at least one trait")
-- for num_trait in xrange(1, len(tab)):
-- p = dict(zip(tab[0], tab[num_trait]))
-+ for num_trait in range(1, len(tab)):
-+ p = dict(list(zip(tab[0], tab[num_trait])))
- if "" in p:
- name_trait = p[""]
- del p[""]
-@@ -571,26 +571,26 @@ def Csv_to_dic(csvfile, delimiter, allow
- # Filter so that only allowed isolates are included
- if allowed_isolates is not None:
- p = {strain: indicator for (strain, indicator) in
-- list(p.items()) if strain in allowed_isolates.keys()}
-+ list(p.items()) if strain in list(allowed_isolates.keys())}
- # Stop if unknown character found in traits file
- allowed_values = ["0","1","NA",".","-"," ",""]
-- if not all([x in allowed_values for x in p.values()]):
-+ if not all([x in allowed_values for x in list(p.values())]):
- sys.exit("Unrecognized character found in trait file. Allowed "
- "values (no commas): %s" % str(",".join(allowed_values)))
- # Remove isolates with missing values, but only for the
- # trait for which they are missing
-- if ("NA" in p.values()
-- or "-" in p.values()
-- or "." in p.values()
-- or " " in p.values()
-- or "" in p.values()):
-+ if ("NA" in list(p.values())
-+ or "-" in list(p.values())
-+ or "." in list(p.values())
-+ or " " in list(p.values())
-+ or "" in list(p.values())):
- log.warning("WARNING: Some isolates have missing values for "
- "trait %s. Missing-value isolates will not be counted in "
- "association analysis towards this trait."
- % str(name_trait))
- p_filt = {strain: indicator for (strain, indicator) in
-- p.items() if indicator not in ["NA","-","."," ",""]}
-- Prunedic[name_trait] = [k for (k,v) in p.items() if
-+ list(p.items()) if indicator not in ["NA","-","."," ",""]}
-+ Prunedic[name_trait] = [k for (k,v) in list(p.items()) if
- v in ["NA","-","."," ",""]]
- #p = p_filt
- else:
-@@ -599,14 +599,14 @@ def Csv_to_dic(csvfile, delimiter, allow
- # Remove isolates that did not have rows in the trait file but
- # that were allowed by the GPA file/restrict_to
- #if not all(s in p.keys() for s in strains):
-- if not all(s in p.keys() for s in strains):
-+ if not all(s in list(p.keys()) for s in strains):
- log.error("ERROR: Some isolates in your gene presence "
- "absence file were not represented in your traits file. "
- "These will count as MISSING data and will not be included."
- )
-
- Prunedic[name_trait] += [s for s in strains if
-- s not in p.keys() and
-+ s not in list(p.keys()) and
- s not in Prunedic[name_trait]]
- r[name_trait] = p_filt
- Prunedic[name_trait] += [None]
-@@ -632,7 +632,7 @@ def CreateTriangularDistanceMatrix(zeroo
- nstrains = int((1 + (1 + 8*len(hamming_distances))**0.5)/2)
- TriangularDistanceMatrix = []
- Strain_names = []
-- for i in xrange(nstrains):
-+ for i in range(nstrains):
- # Adding the maximum relative hamming distance to prevent
- # Quadtree algorithm to pick a pair where i = j
- add = [1]
-@@ -650,8 +650,8 @@ def PopulateQuadTreeWithDistances(TDM):
- First creates a Quadmatrix, so not really optimized.
- """
- Quadmatrix = Matrix(dim=len(TDM["matrix"]))
-- for i in xrange(Quadmatrix.dim):
-- for j in xrange(i, Quadmatrix.dim):
-+ for i in range(Quadmatrix.dim):
-+ for j in range(i, Quadmatrix.dim):
- try:
- Quadmatrix[i][j] = \
- Quadmatrix[j][i] = TDM["matrix"][i][(j-i)]
-@@ -660,7 +660,7 @@ def PopulateQuadTreeWithDistances(TDM):
- "Quadtree with pairwise distances. Please "
- "report this bug to olbb at fhi.no")
- PopulatedQuadtree = QuadTree(Quadmatrix.dim, names=TDM["names"])
-- for i in xrange(Quadmatrix.dim):
-+ for i in range(Quadmatrix.dim):
- PopulatedQuadtree.insert_row(i, Quadmatrix[i])
- return PopulatedQuadtree
-
-@@ -683,7 +683,7 @@ def upgma(d):
- new_cluster = [cluster[i], cluster[j]]
- new_size = size[i] + size[j]
- new_dist = []
-- for k in xrange(d.dim):
-+ for k in range(d.dim):
- if cluster[k] is None:
- new_dist.append(1)
- else:
-@@ -906,7 +906,7 @@ def Setup_results(genedic, traitsdic, co
- # Note: Changed from step-down to step-up
- # (from least significant to most significant)
- tie = [s_p_v[i-1][1] == s_p_v[i][1] for i in
-- xrange(1, len(s_p_v))]
-+ range(1, len(s_p_v))]
- # Initialize dics of corrected p values
- # bh_c_p_v = abbreviation for bh_corrected_p_values
- bh_c_p_v = {}
-@@ -1074,8 +1074,8 @@ def StoreTraitResult(Trait, Traitname, m
- # results list
-
- if multithreaded:
-- domains = [list(xrange(tnum, num_results, num_threads))
-- for tnum in xrange(num_threads)]
-+ domains = [list(range(tnum, num_results, num_threads))
-+ for tnum in range(num_threads)]
- # The Progress variable holds the total progress status of
- # the subprocesses. It is locked, but can be written to by
- # all subprocs
-@@ -1089,14 +1089,14 @@ def StoreTraitResult(Trait, Traitname, m
- # Need to make a copy of dict to prevent then from pointing
- # to the same object
- all_args = [ (domains[x], dict(argumentlist))
-- for x in xrange(len(domains)) ]
-+ for x in range(len(domains)) ]
-
- Threadresults = pool.imap(PairWiseComparisons,all_args)
-
- pool.close()
- pool.join()
- else:
-- domains = list(xrange(num_results))
-+ domains = list(range(num_results))
- argumentlist = {"si":sort_instructions,"tree":upgmatree,
- "GTC": GTC[Traitname],"cutoffs": cutoffs,
- "cp": cut_possibilities,"perm":permutations,
-@@ -1115,7 +1115,7 @@ def StoreTraitResult(Trait, Traitname, m
- Filteredresults = {}
- Threadresults = list(Threadresults)
-
-- for thread in xrange(num_threads):
-+ for thread in range(num_threads):
- for currentgene in Threadresults[thread]:
- Filteredresults[currentgene] = \
- Threadresults[thread][currentgene]
-@@ -1141,7 +1141,7 @@ def StoreTraitResult(Trait, Traitname, m
-
- log.info("Storing results to file")
- num_filteredresults = min(num_results, len(Filteredresults))
-- for x in xrange(num_filteredresults):
-+ for x in range(num_filteredresults):
- currentgene = sort_instructions[x]
-
- # Final check that the currentgene passes all filters
-@@ -1345,7 +1345,7 @@ def Permute(tree, GTC, permutations, cut
- proceed = False
-
- if proceed:
-- for i in xrange(permutations):
-+ for i in range(permutations):
- # Make a permutation using random.shuffle
- PermutedGTC = PermuteGTC(GTCcopy)
- # Send new set to phylotree
-@@ -1374,7 +1374,7 @@ def PermuteGTC(GTC):
- labels have been swapped
- """
- # Set of trait labels to distribute
-- trait_labels = [s[-1] for s in GTC.values()]
-+ trait_labels = [s[-1] for s in list(GTC.values())]
- # Shuffle list of labels
- random.shuffle(trait_labels)
- for isolate in GTC:
-@@ -1480,7 +1480,7 @@ def filtrationoptions(cutoffs, collapse)
- "EPW": "Pairwise comparison (Entire range)",
- "P": "Empirical p-value (permutation-based)"}
- filters = [str(translation[k]) + ": " + str(v)
-- for k,v in cutoffs.items()]
-+ for k,v in list(cutoffs.items())]
- filters.append("Collapse genes: " + str(collapse) + "\n\n")
- filters = ["-- Filtration options --"] + filters
-
-@@ -1528,7 +1528,7 @@ def grabcoltype(string):
- bydash = s.split("-")
- if not (int(bydash[1]) > int(bydash[0])):
- raise
-- add = range(int(bydash[0]), int(bydash[1]))
-+ add = list(range(int(bydash[0]), int(bydash[1])))
- returnlist += list(add)
- except:
- sys.exit("Could not understand --include_input_columns "
---- a/scoary/vcf2scoary.py
-+++ b/scoary/vcf2scoary.py
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python3
- # -*- coding: utf-8 -*-
-
- # Script to search vcf files for mutations within specific coordinates
-@@ -116,7 +116,7 @@ def main():
- try:
- line = next(lines)
- except StopIteration:
-- print(traceback.print_exc())
-+ print((traceback.print_exc()))
- sys.exit("ERROR: There appears to be only metainformation "
- "(lines starting with ##) in your VCF file.")
- # Get metainfo from file
-@@ -145,11 +145,11 @@ def main():
- print("WARNING: A VCF format other than 4.x detected."
- " File parsing may proceed with errors.")
- else:
-- print("VCF version %s detected" % vcfversion)
-+ print(("VCF version %s detected" % vcfversion))
- except:
- print("WARNING: Could not detect VCF format. Expected "
- "v4.x. File parsing may proceed with errors.")
-- print(traceback.print_exc())
-+ print((traceback.print_exc()))
-
- # Check that genotype fields have a single allele
- if metainfo["##FORMAT"]["GT"]["Number"] != "1":
-@@ -213,7 +213,7 @@ def fixdummy(line,c):
- else:
- newline[x] = "0"
- except ValueError:
-- print(newline, c)
-+ print((newline, c))
- sys.exit(-1)
- return newline
-
---- a/tests/test_scoary_output.py
-+++ b/tests/test_scoary_output.py
-@@ -30,94 +30,94 @@ for Test in ["1","2","4"]:
- try:
- assert data[0] == reference[0]
- except AssertionError:
-- print("Not equal at Test %s col 0: %s %s" % (Test, data[0], reference[0]))
-+ print(("Not equal at Test %s col 0: %s %s" % (Test, data[0], reference[0])))
- sys.exit(-1)
- try:
- assert data[1] == reference[1]
- except AssertionError:
-- print("Not equal at Test %s col 1: %s %s" % (Test, data[1], reference[1]))
-+ print(("Not equal at Test %s col 1: %s %s" % (Test, data[1], reference[1])))
- sys.exit(-1)
- try:
- assert data[2] == reference[2]
- except AssertionError:
-- print("Not equal at Test %s col 2: %s %s" % (Test, data[2], reference[2]))
-+ print(("Not equal at Test %s col 2: %s %s" % (Test, data[2], reference[2])))
- sys.exit(-1)
- try:
- assert int(data[3]) == reference[3]
- except AssertionError:
-- print("Not equal at Test %s col 3: %s %s" % (Test, data[3], str(reference[3])))
-+ print(("Not equal at Test %s col 3: %s %s" % (Test, data[3], str(reference[3]))))
- sys.exit(-1)
- try:
- assert int(data[4]) == reference[4]
- except AssertionError:
-- print("Not equal at Test %s col 4: %s %s" % (Test, data[4], str(reference[4])))
-+ print(("Not equal at Test %s col 4: %s %s" % (Test, data[4], str(reference[4]))))
- sys.exit(-1)
- try:
- assert int(data[5]) == reference[5]
- except AssertionError:
-- print("Not equal at Test %s col 5: %s %s" % (Test, data[5], str(reference[5])))
-+ print(("Not equal at Test %s col 5: %s %s" % (Test, data[5], str(reference[5]))))
- sys.exit(-1)
- try:
- assert int(data[6]) == reference[6]
- except AssertionError:
-- print("Not equal at Test %s col 6: %s %s" % (Test, data[6], str(reference[6])))
-+ print(("Not equal at Test %s col 6: %s %s" % (Test, data[6], str(reference[6]))))
- sys.exit(-1)
- try:
- assert abs(float(data[7]) - reference[7]) <= 0.01
- except AssertionError:
-- print("Not equal at Test %s col 7: %s %s" % (Test, data[7], str(reference[7])))
-+ print(("Not equal at Test %s col 7: %s %s" % (Test, data[7], str(reference[7]))))
- sys.exit(-1)
- try:
- assert abs(float(data[8]) - reference[8]) <= 0.01
- except AssertionError:
-- print("Not equal at Test %s col 8: %s %s" % (Test, data[8], str(reference[8])))
-+ print(("Not equal at Test %s col 8: %s %s" % (Test, data[8], str(reference[8]))))
- sys.exit(-1)
- try:
- assert abs(float(data[9]) - reference[9]) <= 0.1
- except AssertionError:
-- print("Not equal at Test %s col 9: %s %s" % (Test, data[9], str(reference[9])))
-+ print(("Not equal at Test %s col 9: %s %s" % (Test, data[9], str(reference[9]))))
- sys.exit(-1)
- try:
- assert abs(float(data[10]) - reference[10]) <= 1E-15
- except AssertionError:
-- print("Not equal at Test %s col 10: %s %s" % (Test, data[10], str(reference[10])))
-+ print(("Not equal at Test %s col 10: %s %s" % (Test, data[10], str(reference[10]))))
- sys.exit(-1)
- try:
- assert abs(float(data[11]) - reference[11]) <= 1E-12
- except AssertionError:
-- print("Not equal at Test %s col 11: %s %s" % (Test, data[11], str(reference[11])))
-+ print(("Not equal at Test %s col 11: %s %s" % (Test, data[11], str(reference[11]))))
- sys.exit(-1)
- try:
- assert abs(float(data[12]) - reference[12]) <= 1E-12
- except AssertionError:
-- print("Not equal at Test %s col 12: %s %s" % (Test, data[12], str(reference[12])))
-+ print(("Not equal at Test %s col 12: %s %s" % (Test, data[12], str(reference[12]))))
- sys.exit(-1)
-
- if not Test == "2":
- try:
- assert int(data[13]) == reference[13]
- except AssertionError:
-- print("Not equal at Test %s col 13: %s %s" % (Test, data[13], str(reference[13])))
-+ print(("Not equal at Test %s col 13: %s %s" % (Test, data[13], str(reference[13]))))
- sys.exit(-1)
- try:
- assert int(data[14]) == reference[14]
- except AssertionError:
-- print("Not equal at Test %s col 14: %s %s" % (Test, data[14], str(reference[14])))
-+ print(("Not equal at Test %s col 14: %s %s" % (Test, data[14], str(reference[14]))))
- sys.exit(-1)
- try:
- assert int(data[15]) == reference[15]
- except AssertionError:
-- print("Not equal at Test %s col 15: %s %s" % (Test, data[15], str(reference[15])))
-+ print(("Not equal at Test %s col 15: %s %s" % (Test, data[15], str(reference[15]))))
- sys.exit(-1)
- try:
- assert abs(float(data[16]) - reference[16]) <= 1E-9
- except AssertionError:
-- print("Not equal at Test %s col 16: %s %s" % (Test, data[16], str(reference[16])))
-+ print(("Not equal at Test %s col 16: %s %s" % (Test, data[16], str(reference[16]))))
- sys.exit(-1)
- try:
- assert abs(float(data[17]) - reference[17]) <= 1E-7
- except AssertionError:
-- print("Not equal at Test %s col 17: %s %s" % (Test, data[17], str(reference[17])))
-+ print(("Not equal at Test %s col 17: %s %s" % (Test, data[17], str(reference[17]))))
- sys.exit(-1)
-
- with open(os.getcwd() + "/mutations_presence_absence.csv" ,"rU") as vcfresfile:
-@@ -130,8 +130,8 @@ with open(os.getcwd() + "/mutations_pres
- try:
- assert data == referencevcf
- except AssertionError:
-- print("Got: %s" % ",".join(data))
-- print("Expected: %s" % ",".join(referencevcf))
-+ print(("Got: %s" % ",".join(data)))
-+ print(("Expected: %s" % ",".join(referencevcf)))
- print("VCF conversion did not produce the expected output")
- sys.exit(-1)
-
=====================================
debian/patches/series deleted
=====================================
@@ -1 +0,0 @@
-2to3.patch
View it on GitLab: https://salsa.debian.org/med-team/scoary/compare/f635c072de0321d257461571177818af056c4822...8f85a774dd4fdfba0c393f26761aeb611a29f218
--
View it on GitLab: https://salsa.debian.org/med-team/scoary/compare/f635c072de0321d257461571177818af056c4822...8f85a774dd4fdfba0c393f26761aeb611a29f218
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20190913/ebd52771/attachment-0001.html>
More information about the debian-med-commit
mailing list