comparison toolfactory/rgToolFactory2.py @ 133:b843d75a5107 draft

Uploaded
author fubar
date Sat, 10 Apr 2021 01:44:50 +0000
parents 65b5e9acf98a
children 1f353bee783f
comparison
equal deleted inserted replaced
132:65b5e9acf98a 133:b843d75a5107
26 import sys 26 import sys
27 import tarfile 27 import tarfile
28 import tempfile 28 import tempfile
29 import time 29 import time
30 30
31 31 import galaxyxml.tool as gxt
32 import galaxyxml.tool.parameters as gxtp
33 import lxml
34 import yaml
32 from bioblend import ConnectionError 35 from bioblend import ConnectionError
33 from bioblend import toolshed 36 from bioblend import toolshed
34
35 import galaxyxml.tool as gxt
36 import galaxyxml.tool.parameters as gxtp
37
38 import lxml
39
40 import yaml
41 37
42 myversion = "V2.2 February 2021" 38 myversion = "V2.2 February 2021"
43 verbose = True 39 verbose = True
44 debug = True 40 debug = True
45 toolFactoryURL = "https://github.com/fubar2/toolfactory" 41 toolFactoryURL = "https://github.com/fubar2/toolfactory"
303 rep = p["repeat"] == "1" # repeats make NO sense 299 rep = p["repeat"] == "1" # repeats make NO sense
304 if rep: 300 if rep:
305 print(f'### warning. Repeats for {nam} ignored - not permitted in positional parameter command lines!') 301 print(f'### warning. Repeats for {nam} ignored - not permitted in positional parameter command lines!')
306 over = p["override"] 302 over = p["override"]
307 clsuffix.append([p["CL"], nam, over]) 303 clsuffix.append([p["CL"], nam, over])
308 xclsuffix.append([p["CL"], '"$%s"' % nam, over]) 304 xclsuffix.append([p["CL"], '"$%s"' % nam, over])
309 for p in self.selpar: 305 for p in self.selpar:
310 clsuffix.append([p["CL"], nam, p["override"]]) 306 clsuffix.append([p["CL"], p["name"], p["override"]])
311 xclsuffix.append([p["CL"], '"$%s"' % nam, p["override"]]) 307 xclsuffix.append([p["CL"], '"$%s"' % nam, p["override"]])
312 clsuffix.sort() 308 clsuffix.sort()
313 xclsuffix.sort() 309 xclsuffix.sort()
314 self.xclsuffix = xclsuffix 310 self.xclsuffix = xclsuffix
315 self.clsuffix = clsuffix 311 self.clsuffix = clsuffix
488 self.testparam.append(tp) 484 self.testparam.append(tp)
489 for p in self.infiles: 485 for p in self.infiles:
490 newname = p["infilename"] 486 newname = p["infilename"]
491 newfmt = p["format"] 487 newfmt = p["format"]
492 ndash = self.getNdash(newname) 488 ndash = self.getNdash(newname)
493 reps = p.get("repeat",0) == 1 489 reps = p.get("repeat", 0) == 1
494 if not len(p["label"]) > 0: 490 if not len(p["label"]) > 0:
495 alab = p["CL"] 491 alab = p["CL"]
496 else: 492 else:
497 alab = p["label"] 493 alab = p["label"]
498 aninput = gxtp.DataParam( 494 aninput = gxtp.DataParam(
511 aninput.command_line_override = "> $%s" % newname 507 aninput.command_line_override = "> $%s" % newname
512 else: 508 else:
513 aninput.positional = int(p["origCL"]) 509 aninput.positional = int(p["origCL"])
514 aninput.command_line_override = "$%s" % newname 510 aninput.command_line_override = "$%s" % newname
515 if reps: 511 if reps:
516 repe = gxtp.Repeat(name=f"R_{newname}", title=f"Add as many {newlabel} as needed") 512 repe = gxtp.Repeat(name=f"R_{newname}", title=f"Add as many {alab} as needed")
517 repe.append(aninput) 513 repe.append(aninput)
518 self.tinputs.append(repe) 514 self.tinputs.append(repe)
519 tparm = gxtp.TestRepeat(name=f"R_{newname}") 515 tparm = gxtp.TestRepeat(name=f"R_{newname}")
520 tparm2 = gxtp.TestParam(newname, value="%s_sample" % newname) 516 tparm2 = gxtp.TestParam(newname, value="%s_sample" % newname)
521 tparm.append(tparm2) 517 tparm.append(tparm2)