Gentoo Archives: gentoo-commits

From: Aisha Tammy <gentoo@×××××.cc>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sci:master commit in: sci-chemistry/modeller/files/, sci-chemistry/modeller/
Date: Thu, 31 Dec 2020 15:07:30
Message-Id: 1609426863.53f4815ede1a74949c87692ebf4c6b8f94ac3c42.epsilon-0@gentoo
1 commit: 53f4815ede1a74949c87692ebf4c6b8f94ac3c42
2 Author: Aisha Tammy <gentoo <AT> aisha <DOT> cc>
3 AuthorDate: Thu Dec 31 15:01:03 2020 +0000
4 Commit: Aisha Tammy <gentoo <AT> aisha <DOT> cc>
5 CommitDate: Thu Dec 31 15:01:03 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=53f4815e
7
8 sci-chemistry/modeller: break patch into 2
9
10 Package-Manager: Portage-3.0.12, Repoman-3.0.2
11 Signed-off-by: Aisha Tammy <gentoo <AT> aisha.cc>
12
13 .../files/modeller-9.25-convert2to3-p1.patch | 339 +++++++++++++++++++++
14 ...o3.patch => modeller-9.25-convert2to3-p2.patch} | 339 ---------------------
15 sci-chemistry/modeller/modeller-9.25.ebuild | 7 +-
16 3 files changed, 344 insertions(+), 341 deletions(-)
17
18 diff --git a/sci-chemistry/modeller/files/modeller-9.25-convert2to3-p1.patch b/sci-chemistry/modeller/files/modeller-9.25-convert2to3-p1.patch
19 new file mode 100644
20 index 000000000..deab6d68f
21 --- /dev/null
22 +++ b/sci-chemistry/modeller/files/modeller-9.25-convert2to3-p1.patch
23 @@ -0,0 +1,339 @@
24 +--- modeller-9.25/modlib/modeller/__init__.py (original)
25 ++++ modeller-9.25/modlib/modeller/__init__.py (refactored)
26 +@@ -48,7 +48,7 @@
27 + return sys.maxsize > 2**32
28 + # This works on older Pythons, but not in Python 3
29 + else:
30 +- return type(sys.dllhandle) == long
31 ++ return type(sys.dllhandle) == int
32 +
33 + # Special processing on Windows to find _modeller.pyd and Modeller DLLs:
34 + if hasattr(config, 'install_dir') and hasattr(sys, 'dllhandle'):
35 +--- modeller-9.25/modlib/modeller/coordinates.py (original)
36 ++++ modeller-9.25/modlib/modeller/coordinates.py (refactored)
37 +@@ -147,7 +147,7 @@
38 + (startres, endres) = self._get_resind()
39 + (startatm, endatm) = get_residue_atom_indices(self.seq, startres,
40 + endres)
41 +- return (range(startatm+1, endatm+1), self.seq)
42 ++ return (list(range(startatm+1, endatm+1)), self.seq)
43 +
44 + atoms = property(__get_atoms, doc="List of all atoms in this chain")
45 +
46 +@@ -158,7 +158,7 @@
47 + def get_atom_indices(self):
48 + (startind, endind) = get_residue_atom_indices(self.mdl, self._num,
49 + self._num + 1)
50 +- return range(startind + 1, endind + 1), self.mdl
51 ++ return list(range(startind + 1, endind + 1)), self.mdl
52 +
53 + def __repr__(self):
54 + # Get residue number before we do anything else. For alignment
55 +@@ -252,7 +252,7 @@
56 + def get_atom_indices(self):
57 + (startind, endind) = get_residue_atom_indices(self.mdl, self.offset,
58 + self.offset + len(self))
59 +- return range(startind + 1, endind + 1), self.mdl
60 ++ return list(range(startind + 1, endind + 1)), self.mdl
61 +
62 + def __getitem__(self, indx):
63 + ret = modutil.handle_seq_indx(self, indx, self.mdl._indxres,
64 +@@ -398,7 +398,7 @@
65 + return self.mdl.natm
66 +
67 + def get_atom_indices(self):
68 +- return range(self.offset + 1, self.offset + len(self) + 1), self.mdl
69 ++ return list(range(self.offset + 1, self.offset + len(self) + 1)), self.mdl
70 +
71 + def __getitem__(self, indx):
72 + ret = modutil.handle_seq_indx(self, indx, self.mdl._indxatm,
73 +--- modeller-9.25/modlib/modeller/id_table.py (original)
74 ++++ modeller-9.25/modlib/modeller/id_table.py (refactored)
75 +@@ -40,7 +40,7 @@
76 + def write_seqid_matrix(fh, coder, mat):
77 + """Write a sequence identity matrix to a file"""
78 + nseq = len(mat)
79 +- print(" " * 9 + "".join([ s[:8] for s in coder ]))
80 ++ print((" " * 9 + "".join([ s[:8] for s in coder ])))
81 + for n1 in range(nseq):
82 + fh.write(coder[n1][:8] + " " + \
83 + "".join(["%8d" % (mat[n1][n2]+0.5) for n2 in range(nseq)]))
84 +--- modeller-9.25/modlib/modeller/libraries.py (original)
85 ++++ modeller-9.25/modlib/modeller/libraries.py (refactored)
86 +@@ -32,7 +32,7 @@
87 + return BytesIO(*args)
88 + else:
89 + def _make_bytes_io(self, *args):
90 +- from cStringIO import StringIO
91 ++ from io import StringIO
92 + return StringIO(*args)
93 +
94 + def __getstate__(self):
95 +--- modeller-9.25/modlib/modeller/model.py (original)
96 ++++ modeller-9.25/modlib/modeller/model.py (refactored)
97 +@@ -121,7 +121,7 @@
98 +
99 + def get_atom_indices(self):
100 + """Get the indices of all atoms in this model"""
101 +- return (range(1, self.natm+1), self)
102 ++ return (list(range(1, self.natm+1)), self)
103 +
104 + def read(self, file, model_format='PDB',
105 + model_segment=('FIRST:@', 'LAST:'), io=None,
106 +@@ -340,7 +340,7 @@
107 + dope_score = sel.assess_dope()
108 + scorer = normalized_dope.DOPEScorer(self)
109 + z_score = scorer.get_z_score(dope_score)
110 +- print(">> Normalized DOPE z score: %.3f" % z_score)
111 ++ print((">> Normalized DOPE z score: %.3f" % z_score))
112 + return z_score
113 +
114 + def assess_normalized_dopehr(self):
115 +@@ -351,7 +351,7 @@
116 + dope_score = sel.assess_dopehr()
117 + scorer = normalized_dope.DOPEHRScorer(self)
118 + z_score = scorer.get_z_score(dope_score)
119 +- print(">> Normalized DOPE-HR z score: %.3f" % z_score)
120 ++ print((">> Normalized DOPE-HR z score: %.3f" % z_score))
121 + return z_score
122 +
123 + def get_normalized_dope_profile(self):
124 +--- modeller-9.25/modlib/modeller/model_topology.py (original)
125 ++++ modeller-9.25/modlib/modeller/model_topology.py (refactored)
126 +@@ -50,7 +50,7 @@
127 + self.check_args = args
128 + def __iter__(self):
129 + return self
130 +- def next(self):
131 ++ def __next__(self):
132 + while True:
133 + atoms = self.__int_next()
134 + if self.check_func is None \
135 +@@ -82,7 +82,7 @@
136 + self.check_args = args
137 + def __iter__(self):
138 + return self
139 +- def next(self):
140 ++ def __next__(self):
141 + while True:
142 + atoms = self.__int_next()
143 + if self.check_func is None \
144 +--- modeller-9.25/modlib/modeller/physical.py (original)
145 ++++ modeller-9.25/modlib/modeller/physical.py (refactored)
146 +@@ -31,7 +31,7 @@
147 + def __init__(self, default=1.0, **keys):
148 + self._default = default
149 + self._dict = {}
150 +- for (term,val) in keys.items():
151 ++ for (term,val) in list(keys.items()):
152 + term = eval("%s" % term)
153 + self[term] = val
154 +
155 +--- modeller-9.25/modlib/modeller/salign.py (original)
156 ++++ modeller-9.25/modlib/modeller/salign.py (refactored)
157 +@@ -38,8 +38,8 @@
158 + return aln.salign(auto_overhang=True, overhang_auto_limit=5,
159 + overhang_factor=1, **keys)
160 + except modeller.ModellerError:
161 +- print("SALIGN with auto_overhang failed: %s" \
162 +- % str(sys.exc_info()[1]))
163 ++ print(("SALIGN with auto_overhang failed: %s" \
164 ++ % str(sys.exc_info()[1])))
165 + print("Retrying without auto_overhang")
166 + return aln.salign(**keys)
167 +
168 +@@ -118,13 +118,13 @@
169 + self.qscore = res.qscorepct
170 + self.aln.write(file=output_aln_file, alignment_format='PIR')
171 + better = True
172 +- print("Qlty scrs %g\t%g\t%g" % (open_penalty, extend_penalty,
173 +- res.qscorepct))
174 ++ print(("Qlty scrs %g\t%g\t%g" % (open_penalty, extend_penalty,
175 ++ res.qscorepct)))
176 + except modeller.ModellerError:
177 +- print("Set of parameters %s %g %g resulted in the "
178 ++ print(("Set of parameters %s %g %g resulted in the "
179 + "following error\t%s" % (str(weights), open_penalty,
180 + extend_penalty,
181 +- str(sys.exc_info()[1])))
182 ++ str(sys.exc_info()[1]))))
183 + return better
184 +
185 +
186 +@@ -181,7 +181,7 @@
187 + best.try_struc_align(opfile, opfile2, fw2, ogp3d, egp3d,
188 + align_block)
189 +
190 +- print("final max quality = %g" % best.qscore)
191 ++ print(("final max quality = %g" % best.qscore))
192 +
193 + if best.found_struc_align:
194 + aln.clear()
195 +--- modeller-9.25/modlib/modeller/saxsdata.py (original)
196 ++++ modeller-9.25/modlib/modeller/saxsdata.py (refactored)
197 +@@ -206,7 +206,7 @@
198 + try:
199 + fh = open(saxsfilename,'r')
200 + except:
201 +- print("file "+saxsfilename+" not found :(")
202 ++ print(("file "+saxsfilename+" not found :("))
203 + return
204 + fh.close()
205 + ns = 0
206 +@@ -225,8 +225,8 @@
207 + s_low = s_min - .001
208 + if (not s_hi):
209 + s_hi = s_max + .001
210 +- print("s_min=%s, s_max=%s" % (str(s_min), str(s_max)))
211 +- print("s_low=%s, s_hi=%s" % (str(s_low), str(s_hi)))
212 ++ print(("s_min=%s, s_max=%s" % (str(s_min), str(s_max))))
213 ++ print(("s_low=%s, s_hi=%s" % (str(s_low), str(s_hi))))
214 + self.ini_saxs(atmsel,
215 + filename=formfacfilename,
216 + s_min=s_min, s_max=s_max, maxs=ns, nmesh=ns, natomtyp=natomtyp,
217 +--- modeller-9.25/modlib/modeller/selection.py (original)
218 ++++ modeller-9.25/modlib/modeller/selection.py (refactored)
219 +@@ -23,7 +23,7 @@
220 + return self.mdl.atoms[obj - 1]
221 + else:
222 + def next(self):
223 +- obj = self.seliter.next()
224 ++ obj = next(self.seliter)
225 + return self.mdl.atoms[obj - 1]
226 +
227 + class selection(object):
228 +@@ -52,7 +52,7 @@
229 + :rtype: list of ints
230 + """
231 + if sys.version_info[:2] == (2,3):
232 +- keys = self.__selection.keys()
233 ++ keys = list(self.__selection.keys())
234 + keys.sort()
235 + else:
236 + keys = sorted(self.__selection.keys())
237 +@@ -722,9 +722,9 @@
238 + def assess(self, assessor, output='SHORT NO_REPORT', **vars):
239 + """Assess with the given assessor object
240 + (e.g. :class:`soap_loop.Scorer`)."""
241 +- print(">> Model assessment by %s" % assessor.name)
242 ++ print((">> Model assessment by %s" % assessor.name))
243 + molpdf, terms = assessor._assess(self, output=output, **vars)
244 +- print("%s : %12.6f" % (assessor.name, molpdf))
245 ++ print(("%s : %12.6f" % (assessor.name, molpdf)))
246 + return molpdf
247 +
248 + def _dope_energy(self, gprsr, name, output='SHORT NO_REPORT',
249 +@@ -733,7 +733,7 @@
250 + nonbond_spline=1.), **vars):
251 + """Internal function to do DOPE or DOPE-HR assessment"""
252 + mdl = self.__mdl
253 +- print(">> Model assessment by %s potential" % name)
254 ++ print((">> Model assessment by %s potential" % name))
255 + edat = self.get_dope_energy_data()
256 + old_gprsr = mdl.group_restraints
257 + mdl.group_restraints = gprsr
258 +@@ -744,7 +744,7 @@
259 + **vars)
260 + finally:
261 + mdl.group_restraints = old_gprsr
262 +- print("%s score : %12.6f" % (name, molpdf))
263 ++ print(("%s score : %12.6f" % (name, molpdf)))
264 + return molpdf
265 +
266 + def debug_function(self, residue_span_range=(0, 99999),
267 +--- modeller-9.25/modlib/modeller/test.py (original)
268 ++++ modeller-9.25/modlib/modeller/test.py (refactored)
269 +@@ -2,7 +2,7 @@
270 + import modeller
271 + import math
272 + try:
273 +- from cStringIO import StringIO
274 ++ from io import StringIO
275 + except ImportError:
276 + from io import StringIO
277 + import sys
278 +@@ -150,7 +150,7 @@
279 + diff = abs(num1 - num2)
280 + if msg is None:
281 + msg = "%f != %f within %g" % (num1, num2, tolerance)
282 +- self.assert_(diff < tolerance, msg)
283 ++ self.assertTrue(diff < tolerance, msg)
284 +
285 + def run_capture_stdout(self, method, *args, **keys):
286 + """Run a method and capture its standard output. Returns both the
287 +--- modeller-9.25/modlib/modeller/automodel/automodel.py (original)
288 ++++ modeller-9.25/modlib/modeller/automodel/automodel.py (refactored)
289 +@@ -203,13 +203,13 @@
290 +
291 + def write_ok_summary(self, all, modeltyp):
292 + """Print out a summary of all successfully generated models"""
293 +- print("\n>> Summary of successfully produced %s:" % modeltyp)
294 +- fields = [x for x in all[0].keys() if x.endswith(' score')]
295 ++ print(("\n>> Summary of successfully produced %s:" % modeltyp))
296 ++ fields = [x for x in list(all[0].keys()) if x.endswith(' score')]
297 + fields.sort()
298 + fields = ['molpdf'] + fields
299 + header = '%-25s ' % 'Filename' + " ".join(['%14s' % x for x in fields])
300 + print(header)
301 +- print('-' * len(header))
302 ++ print(('-' * len(header)))
303 + for mdl in all:
304 + text = '%-25s' % mdl['name']
305 + for field in fields:
306 +@@ -222,9 +222,9 @@
307 +
308 + def write_failure_summary(self, all, modeltyp):
309 + """Print out a summary of all failed models"""
310 +- print("\n>> Summary of failed %s:" % modeltyp)
311 ++ print(("\n>> Summary of failed %s:" % modeltyp))
312 + for mdl in all:
313 +- print("%-25s %s" % (mdl['name'], mdl['failure']))
314 ++ print(("%-25s %s" % (mdl['name'], mdl['failure'])))
315 + print('')
316 +
317 + def rd_restraints(self):
318 +@@ -692,8 +692,8 @@
319 + elif atmsel.get_model() is not self:
320 + raise ModellerError("selection is defined on the wrong model")
321 + elif len(atmsel) < len(self.atoms):
322 +- print("%d (of %d total) atoms selected for optimization" \
323 +- % (len(atmsel), len(self.atoms)))
324 ++ print(("%d (of %d total) atoms selected for optimization" \
325 ++ % (len(atmsel), len(self.atoms))))
326 + return atmsel
327 +
328 + def mkhomcsr(self, atmsel, aln):
329 +@@ -774,9 +774,9 @@
330 + selstd = selection(self).only_std_residues()
331 + selca = selstd.only_atom_types('CA')
332 +
333 +- print("%d atoms in HETATM/BLK residues constrained\n" % len(selhet) \
334 ++ print(("%d atoms in HETATM/BLK residues constrained\n" % len(selhet) \
335 + + "to protein atoms within %.2f angstroms\n" % bond_distance \
336 +- + "and protein CA atoms within %.2f angstroms" % ca_distance)
337 ++ + "and protein CA atoms within %.2f angstroms" % ca_distance))
338 + # Build the bonds first; this avoids duplicated CA-ligand bonds since
339 + # make_distance() will not build restraints that are already on the
340 + # nonbond exclusion list
341 +@@ -823,8 +823,8 @@
342 + selhet = selhet.only_no_topology()
343 +
344 + # Intra-residue:
345 +- print("%d atoms in residues without defined topology\n" % len(selhet) \
346 +- + "constrained to be rigid bodies")
347 ++ print(("%d atoms in residues without defined topology\n" % len(selhet) \
348 ++ + "constrained to be rigid bodies"))
349 + rsr = self.restraints
350 + rsr.make_distance(selhet, selhet, aln=aln,
351 + distance_rsr_model=7, maximal_distance=10.0,
352 +@@ -898,8 +898,8 @@
353 + print("\nThe following CHARMM atom type assignments were made:")
354 + print(" Atom Old type New type")
355 + for atom, old_type, new_type in zip(sel, old_types, new_types):
356 +- print(" %-20s %-15s %-15s"
357 +- % (str(atom), fmt_typ(old_type), fmt_typ(new_type)))
358 ++ print((" %-20s %-15s %-15s"
359 ++ % (str(atom), fmt_typ(old_type), fmt_typ(new_type))))
360 +
361 + def select_atoms(self):
362 + """Select atoms to be optimized in the model building procedure. By
363
364 diff --git a/sci-chemistry/modeller/files/modeller-9.25-convert2to3.patch b/sci-chemistry/modeller/files/modeller-9.25-convert2to3-p2.patch
365 similarity index 51%
366 rename from sci-chemistry/modeller/files/modeller-9.25-convert2to3.patch
367 rename to sci-chemistry/modeller/files/modeller-9.25-convert2to3-p2.patch
368 index d7df05ce6..bd86d9cef 100644
369 --- a/sci-chemistry/modeller/files/modeller-9.25-convert2to3.patch
370 +++ b/sci-chemistry/modeller/files/modeller-9.25-convert2to3-p2.patch
371 @@ -1,342 +1,3 @@
372 ---- modeller-9.25/modlib/modeller/__init__.py (original)
373 -+++ modeller-9.25/modlib/modeller/__init__.py (refactored)
374 -@@ -48,7 +48,7 @@
375 - return sys.maxsize > 2**32
376 - # This works on older Pythons, but not in Python 3
377 - else:
378 -- return type(sys.dllhandle) == long
379 -+ return type(sys.dllhandle) == int
380 -
381 - # Special processing on Windows to find _modeller.pyd and Modeller DLLs:
382 - if hasattr(config, 'install_dir') and hasattr(sys, 'dllhandle'):
383 ---- modeller-9.25/modlib/modeller/coordinates.py (original)
384 -+++ modeller-9.25/modlib/modeller/coordinates.py (refactored)
385 -@@ -147,7 +147,7 @@
386 - (startres, endres) = self._get_resind()
387 - (startatm, endatm) = get_residue_atom_indices(self.seq, startres,
388 - endres)
389 -- return (range(startatm+1, endatm+1), self.seq)
390 -+ return (list(range(startatm+1, endatm+1)), self.seq)
391 -
392 - atoms = property(__get_atoms, doc="List of all atoms in this chain")
393 -
394 -@@ -158,7 +158,7 @@
395 - def get_atom_indices(self):
396 - (startind, endind) = get_residue_atom_indices(self.mdl, self._num,
397 - self._num + 1)
398 -- return range(startind + 1, endind + 1), self.mdl
399 -+ return list(range(startind + 1, endind + 1)), self.mdl
400 -
401 - def __repr__(self):
402 - # Get residue number before we do anything else. For alignment
403 -@@ -252,7 +252,7 @@
404 - def get_atom_indices(self):
405 - (startind, endind) = get_residue_atom_indices(self.mdl, self.offset,
406 - self.offset + len(self))
407 -- return range(startind + 1, endind + 1), self.mdl
408 -+ return list(range(startind + 1, endind + 1)), self.mdl
409 -
410 - def __getitem__(self, indx):
411 - ret = modutil.handle_seq_indx(self, indx, self.mdl._indxres,
412 -@@ -398,7 +398,7 @@
413 - return self.mdl.natm
414 -
415 - def get_atom_indices(self):
416 -- return range(self.offset + 1, self.offset + len(self) + 1), self.mdl
417 -+ return list(range(self.offset + 1, self.offset + len(self) + 1)), self.mdl
418 -
419 - def __getitem__(self, indx):
420 - ret = modutil.handle_seq_indx(self, indx, self.mdl._indxatm,
421 ---- modeller-9.25/modlib/modeller/id_table.py (original)
422 -+++ modeller-9.25/modlib/modeller/id_table.py (refactored)
423 -@@ -40,7 +40,7 @@
424 - def write_seqid_matrix(fh, coder, mat):
425 - """Write a sequence identity matrix to a file"""
426 - nseq = len(mat)
427 -- print(" " * 9 + "".join([ s[:8] for s in coder ]))
428 -+ print((" " * 9 + "".join([ s[:8] for s in coder ])))
429 - for n1 in range(nseq):
430 - fh.write(coder[n1][:8] + " " + \
431 - "".join(["%8d" % (mat[n1][n2]+0.5) for n2 in range(nseq)]))
432 ---- modeller-9.25/modlib/modeller/libraries.py (original)
433 -+++ modeller-9.25/modlib/modeller/libraries.py (refactored)
434 -@@ -32,7 +32,7 @@
435 - return BytesIO(*args)
436 - else:
437 - def _make_bytes_io(self, *args):
438 -- from cStringIO import StringIO
439 -+ from io import StringIO
440 - return StringIO(*args)
441 -
442 - def __getstate__(self):
443 ---- modeller-9.25/modlib/modeller/model.py (original)
444 -+++ modeller-9.25/modlib/modeller/model.py (refactored)
445 -@@ -121,7 +121,7 @@
446 -
447 - def get_atom_indices(self):
448 - """Get the indices of all atoms in this model"""
449 -- return (range(1, self.natm+1), self)
450 -+ return (list(range(1, self.natm+1)), self)
451 -
452 - def read(self, file, model_format='PDB',
453 - model_segment=('FIRST:@', 'LAST:'), io=None,
454 -@@ -340,7 +340,7 @@
455 - dope_score = sel.assess_dope()
456 - scorer = normalized_dope.DOPEScorer(self)
457 - z_score = scorer.get_z_score(dope_score)
458 -- print(">> Normalized DOPE z score: %.3f" % z_score)
459 -+ print((">> Normalized DOPE z score: %.3f" % z_score))
460 - return z_score
461 -
462 - def assess_normalized_dopehr(self):
463 -@@ -351,7 +351,7 @@
464 - dope_score = sel.assess_dopehr()
465 - scorer = normalized_dope.DOPEHRScorer(self)
466 - z_score = scorer.get_z_score(dope_score)
467 -- print(">> Normalized DOPE-HR z score: %.3f" % z_score)
468 -+ print((">> Normalized DOPE-HR z score: %.3f" % z_score))
469 - return z_score
470 -
471 - def get_normalized_dope_profile(self):
472 ---- modeller-9.25/modlib/modeller/model_topology.py (original)
473 -+++ modeller-9.25/modlib/modeller/model_topology.py (refactored)
474 -@@ -50,7 +50,7 @@
475 - self.check_args = args
476 - def __iter__(self):
477 - return self
478 -- def next(self):
479 -+ def __next__(self):
480 - while True:
481 - atoms = self.__int_next()
482 - if self.check_func is None \
483 -@@ -82,7 +82,7 @@
484 - self.check_args = args
485 - def __iter__(self):
486 - return self
487 -- def next(self):
488 -+ def __next__(self):
489 - while True:
490 - atoms = self.__int_next()
491 - if self.check_func is None \
492 ---- modeller-9.25/modlib/modeller/physical.py (original)
493 -+++ modeller-9.25/modlib/modeller/physical.py (refactored)
494 -@@ -31,7 +31,7 @@
495 - def __init__(self, default=1.0, **keys):
496 - self._default = default
497 - self._dict = {}
498 -- for (term,val) in keys.items():
499 -+ for (term,val) in list(keys.items()):
500 - term = eval("%s" % term)
501 - self[term] = val
502 -
503 ---- modeller-9.25/modlib/modeller/salign.py (original)
504 -+++ modeller-9.25/modlib/modeller/salign.py (refactored)
505 -@@ -38,8 +38,8 @@
506 - return aln.salign(auto_overhang=True, overhang_auto_limit=5,
507 - overhang_factor=1, **keys)
508 - except modeller.ModellerError:
509 -- print("SALIGN with auto_overhang failed: %s" \
510 -- % str(sys.exc_info()[1]))
511 -+ print(("SALIGN with auto_overhang failed: %s" \
512 -+ % str(sys.exc_info()[1])))
513 - print("Retrying without auto_overhang")
514 - return aln.salign(**keys)
515 -
516 -@@ -118,13 +118,13 @@
517 - self.qscore = res.qscorepct
518 - self.aln.write(file=output_aln_file, alignment_format='PIR')
519 - better = True
520 -- print("Qlty scrs %g\t%g\t%g" % (open_penalty, extend_penalty,
521 -- res.qscorepct))
522 -+ print(("Qlty scrs %g\t%g\t%g" % (open_penalty, extend_penalty,
523 -+ res.qscorepct)))
524 - except modeller.ModellerError:
525 -- print("Set of parameters %s %g %g resulted in the "
526 -+ print(("Set of parameters %s %g %g resulted in the "
527 - "following error\t%s" % (str(weights), open_penalty,
528 - extend_penalty,
529 -- str(sys.exc_info()[1])))
530 -+ str(sys.exc_info()[1]))))
531 - return better
532 -
533 -
534 -@@ -181,7 +181,7 @@
535 - best.try_struc_align(opfile, opfile2, fw2, ogp3d, egp3d,
536 - align_block)
537 -
538 -- print("final max quality = %g" % best.qscore)
539 -+ print(("final max quality = %g" % best.qscore))
540 -
541 - if best.found_struc_align:
542 - aln.clear()
543 ---- modeller-9.25/modlib/modeller/saxsdata.py (original)
544 -+++ modeller-9.25/modlib/modeller/saxsdata.py (refactored)
545 -@@ -206,7 +206,7 @@
546 - try:
547 - fh = open(saxsfilename,'r')
548 - except:
549 -- print("file "+saxsfilename+" not found :(")
550 -+ print(("file "+saxsfilename+" not found :("))
551 - return
552 - fh.close()
553 - ns = 0
554 -@@ -225,8 +225,8 @@
555 - s_low = s_min - .001
556 - if (not s_hi):
557 - s_hi = s_max + .001
558 -- print("s_min=%s, s_max=%s" % (str(s_min), str(s_max)))
559 -- print("s_low=%s, s_hi=%s" % (str(s_low), str(s_hi)))
560 -+ print(("s_min=%s, s_max=%s" % (str(s_min), str(s_max))))
561 -+ print(("s_low=%s, s_hi=%s" % (str(s_low), str(s_hi))))
562 - self.ini_saxs(atmsel,
563 - filename=formfacfilename,
564 - s_min=s_min, s_max=s_max, maxs=ns, nmesh=ns, natomtyp=natomtyp,
565 ---- modeller-9.25/modlib/modeller/selection.py (original)
566 -+++ modeller-9.25/modlib/modeller/selection.py (refactored)
567 -@@ -23,7 +23,7 @@
568 - return self.mdl.atoms[obj - 1]
569 - else:
570 - def next(self):
571 -- obj = self.seliter.next()
572 -+ obj = next(self.seliter)
573 - return self.mdl.atoms[obj - 1]
574 -
575 - class selection(object):
576 -@@ -52,7 +52,7 @@
577 - :rtype: list of ints
578 - """
579 - if sys.version_info[:2] == (2,3):
580 -- keys = self.__selection.keys()
581 -+ keys = list(self.__selection.keys())
582 - keys.sort()
583 - else:
584 - keys = sorted(self.__selection.keys())
585 -@@ -722,9 +722,9 @@
586 - def assess(self, assessor, output='SHORT NO_REPORT', **vars):
587 - """Assess with the given assessor object
588 - (e.g. :class:`soap_loop.Scorer`)."""
589 -- print(">> Model assessment by %s" % assessor.name)
590 -+ print((">> Model assessment by %s" % assessor.name))
591 - molpdf, terms = assessor._assess(self, output=output, **vars)
592 -- print("%s : %12.6f" % (assessor.name, molpdf))
593 -+ print(("%s : %12.6f" % (assessor.name, molpdf)))
594 - return molpdf
595 -
596 - def _dope_energy(self, gprsr, name, output='SHORT NO_REPORT',
597 -@@ -733,7 +733,7 @@
598 - nonbond_spline=1.), **vars):
599 - """Internal function to do DOPE or DOPE-HR assessment"""
600 - mdl = self.__mdl
601 -- print(">> Model assessment by %s potential" % name)
602 -+ print((">> Model assessment by %s potential" % name))
603 - edat = self.get_dope_energy_data()
604 - old_gprsr = mdl.group_restraints
605 - mdl.group_restraints = gprsr
606 -@@ -744,7 +744,7 @@
607 - **vars)
608 - finally:
609 - mdl.group_restraints = old_gprsr
610 -- print("%s score : %12.6f" % (name, molpdf))
611 -+ print(("%s score : %12.6f" % (name, molpdf)))
612 - return molpdf
613 -
614 - def debug_function(self, residue_span_range=(0, 99999),
615 ---- modeller-9.25/modlib/modeller/test.py (original)
616 -+++ modeller-9.25/modlib/modeller/test.py (refactored)
617 -@@ -2,7 +2,7 @@
618 - import modeller
619 - import math
620 - try:
621 -- from cStringIO import StringIO
622 -+ from io import StringIO
623 - except ImportError:
624 - from io import StringIO
625 - import sys
626 -@@ -150,7 +150,7 @@
627 - diff = abs(num1 - num2)
628 - if msg is None:
629 - msg = "%f != %f within %g" % (num1, num2, tolerance)
630 -- self.assert_(diff < tolerance, msg)
631 -+ self.assertTrue(diff < tolerance, msg)
632 -
633 - def run_capture_stdout(self, method, *args, **keys):
634 - """Run a method and capture its standard output. Returns both the
635 ---- modeller-9.25/modlib/modeller/automodel/automodel.py (original)
636 -+++ modeller-9.25/modlib/modeller/automodel/automodel.py (refactored)
637 -@@ -203,13 +203,13 @@
638 -
639 - def write_ok_summary(self, all, modeltyp):
640 - """Print out a summary of all successfully generated models"""
641 -- print("\n>> Summary of successfully produced %s:" % modeltyp)
642 -- fields = [x for x in all[0].keys() if x.endswith(' score')]
643 -+ print(("\n>> Summary of successfully produced %s:" % modeltyp))
644 -+ fields = [x for x in list(all[0].keys()) if x.endswith(' score')]
645 - fields.sort()
646 - fields = ['molpdf'] + fields
647 - header = '%-25s ' % 'Filename' + " ".join(['%14s' % x for x in fields])
648 - print(header)
649 -- print('-' * len(header))
650 -+ print(('-' * len(header)))
651 - for mdl in all:
652 - text = '%-25s' % mdl['name']
653 - for field in fields:
654 -@@ -222,9 +222,9 @@
655 -
656 - def write_failure_summary(self, all, modeltyp):
657 - """Print out a summary of all failed models"""
658 -- print("\n>> Summary of failed %s:" % modeltyp)
659 -+ print(("\n>> Summary of failed %s:" % modeltyp))
660 - for mdl in all:
661 -- print("%-25s %s" % (mdl['name'], mdl['failure']))
662 -+ print(("%-25s %s" % (mdl['name'], mdl['failure'])))
663 - print('')
664 -
665 - def rd_restraints(self):
666 -@@ -692,8 +692,8 @@
667 - elif atmsel.get_model() is not self:
668 - raise ModellerError("selection is defined on the wrong model")
669 - elif len(atmsel) < len(self.atoms):
670 -- print("%d (of %d total) atoms selected for optimization" \
671 -- % (len(atmsel), len(self.atoms)))
672 -+ print(("%d (of %d total) atoms selected for optimization" \
673 -+ % (len(atmsel), len(self.atoms))))
674 - return atmsel
675 -
676 - def mkhomcsr(self, atmsel, aln):
677 -@@ -774,9 +774,9 @@
678 - selstd = selection(self).only_std_residues()
679 - selca = selstd.only_atom_types('CA')
680 -
681 -- print("%d atoms in HETATM/BLK residues constrained\n" % len(selhet) \
682 -+ print(("%d atoms in HETATM/BLK residues constrained\n" % len(selhet) \
683 - + "to protein atoms within %.2f angstroms\n" % bond_distance \
684 -- + "and protein CA atoms within %.2f angstroms" % ca_distance)
685 -+ + "and protein CA atoms within %.2f angstroms" % ca_distance))
686 - # Build the bonds first; this avoids duplicated CA-ligand bonds since
687 - # make_distance() will not build restraints that are already on the
688 - # nonbond exclusion list
689 -@@ -823,8 +823,8 @@
690 - selhet = selhet.only_no_topology()
691 -
692 - # Intra-residue:
693 -- print("%d atoms in residues without defined topology\n" % len(selhet) \
694 -- + "constrained to be rigid bodies")
695 -+ print(("%d atoms in residues without defined topology\n" % len(selhet) \
696 -+ + "constrained to be rigid bodies"))
697 - rsr = self.restraints
698 - rsr.make_distance(selhet, selhet, aln=aln,
699 - distance_rsr_model=7, maximal_distance=10.0,
700 -@@ -898,8 +898,8 @@
701 - print("\nThe following CHARMM atom type assignments were made:")
702 - print(" Atom Old type New type")
703 - for atom, old_type, new_type in zip(sel, old_types, new_types):
704 -- print(" %-20s %-15s %-15s"
705 -- % (str(atom), fmt_typ(old_type), fmt_typ(new_type)))
706 -+ print((" %-20s %-15s %-15s"
707 -+ % (str(atom), fmt_typ(old_type), fmt_typ(new_type))))
708 -
709 - def select_atoms(self):
710 - """Select atoms to be optimized in the model building procedure. By
711 --- modeller-9.25/modlib/modeller/automodel/generate.py (original)
712 +++ modeller-9.25/modlib/modeller/automodel/generate.py (refactored)
713 @@ -88,11 +88,11 @@
714
715 diff --git a/sci-chemistry/modeller/modeller-9.25.ebuild b/sci-chemistry/modeller/modeller-9.25.ebuild
716 index 8db00ea11..cac137131 100644
717 --- a/sci-chemistry/modeller/modeller-9.25.ebuild
718 +++ b/sci-chemistry/modeller/modeller-9.25.ebuild
719 @@ -4,7 +4,7 @@
720 EAPI=7
721
722 PYTHON_COMPAT=( python3_{7,8,9} )
723 -
724 +DISTUTILS_USE_SETUPTOOLS=no
725 inherit distutils-r1 eutils multilib
726
727 DESCRIPTION="Homology or comparative modeling of protein three-dimensional structures"
728 @@ -24,7 +24,10 @@ INPATH="${EPREFIX}"/opt/modeller${ver}
729
730 QA_PREBUILT="/opt/*"
731
732 -PATCHES=( "${FILESDIR}/${P}-convert2to3.patch" )
733 +PATCHES=(
734 + "${FILESDIR}/${P}-convert2to3-p1.patch"
735 + "${FILESDIR}/${P}-convert2to3-p2.patch"
736 +)
737
738 pkg_setup() {
739 case ${ARCH} in