Previous changeset 112:5509dc4c1cf2 (2020-11-29) Next changeset 114:e0cf315853cf (2020-12-02) |
Commit message:
Uploaded |
modified:
toolfactory/rgToolFactory2.py toolfactory/rgToolFactory2.xml |
b |
diff -r 5509dc4c1cf2 -r 6873c211b250 toolfactory/rgToolFactory2.py --- a/toolfactory/rgToolFactory2.py Sun Nov 29 10:34:48 2020 +0000 +++ b/toolfactory/rgToolFactory2.py Tue Dec 01 09:03:34 2020 +0000 |
[ |
b'@@ -194,7 +194,7 @@\n if not os.path.exists(self.tooloutdir):\n os.mkdir(self.tooloutdir)\n if not os.path.exists(self.testdir):\n- os.mkdir(self.testdir) # make tests directory\n+ os.mkdir(self.testdir)\n if not os.path.exists(self.repdir):\n os.mkdir(self.repdir)\n self.tinputs = gxtp.Inputs()\n@@ -224,7 +224,7 @@\n aXCL(self.executeme)\n aXCL("$runme")\n else:\n- aCL(self.executeme) # this little CL will just run\n+ aCL(self.executeme)\n aXCL(self.executeme)\n self.elog = os.path.join(self.repdir, "%s_error_log.txt" % self.tool_name)\n self.tlog = os.path.join(self.repdir, "%s_runner_log.txt" % self.tool_name)\n@@ -257,7 +257,7 @@\n if p[OOCLPOS] == "STDOUT":\n self.lastclredirect = [">", p[ONAMEPOS]]\n self.lastxclredirect = [">", "$%s" % p[OCLPOS]]\n- else: # for (o_v, k, v, koverride) in self.xclsuffix:\n+ else:\n clsuffix.append([p[ONAMEPOS], p[ONAMEPOS], p[ONAMEPOS], ""])\n xclsuffix.append([p[ONAMEPOS], p[ONAMEPOS], "$%s" % p[ONAMEPOS], ""])\n for p in self.addpar:\n@@ -313,7 +313,7 @@\n for i, p in enumerate(\n self.outfiles\n ):\n- if self.args.parampass == "positional" and p[OCLPOS] != "STDOUT":\n+ if self.args.parampass == "positional" and p[OCLPOS].upper() != "STDOUT":\n assert p[\n OCLPOS\n ].isdigit(), "Positional parameters must be ordinal integers - got %s for %s" % (\n@@ -321,7 +321,7 @@\n p[ONAMEPOS],\n )\n p.append(p[OCLPOS]) # keep copy\n- if p[OOCLPOS].isdigit() or p[OOCLPOS] == "STDOUT":\n+ if p[OOCLPOS].isdigit() or p[OOCLPOS].upper() == "STDOUT":\n scl = p[ONAMEPOS]\n p[OCLPOS] = scl\n self.outfiles[i] = p\n@@ -369,12 +369,6 @@\n if self.lastxclredirect:\n aXCL(self.lastxclredirect[0])\n aXCL(self.lastxclredirect[1])\n- if os.path.exists(self.tlog):\n- tout = open(self.tlog, "a")\n- else:\n- tout = open(self.tlog, "w")\n- tout.write(f" #### clpositional: self.clsuffix = {self.clsuffix} and self.xclsuffix = {self.xclsuffix}")\n- tout.close()\n \n \n def clargparse(self):\n@@ -401,12 +395,6 @@\n k = "--%s" % k\n aCL(k)\n aCL(v)\n- if os.path.exists(self.tlog):\n- tout = open(self.tlog, "a")\n- else:\n- tout = open(self.tlog, "w")\n- tout.write(f" #### clargparse: self.clsuffix = {self.clsuffix} and self.xclsuffix = {self.xclsuffix}")\n- tout.close()\n \n \n def getNdash(self, newname):\n@@ -427,7 +415,7 @@\n aparm = gxtp.OutputData(name=newname, format=newfmt, num_dashes=ndash, label=newcl)\n aparm.positional = self.is_positional\n if self.is_positional:\n- if oldcl == "STDOUT":\n+ if oldcl.upper() == "STDOUT":\n aparm.positional = 9999999\n aparm.command_line_override = "> $%s" % newname\n else:\n@@ -603,11 +591,13 @@\n requirements = gxtp.Requirements()\n if self.args.packages:\n for d in self.args.packages.split(","):\n+ ver = \'\'\n+ d = d.replace(\'==\',\':\')\n+ d = d.replace(\'=\',\':\')\n if ":" in d:\n packg, ver = d.split(":")\n else:\n packg = d\n- ver = ""\n requirements.append(\n gxtp.Requirement("package", packg.strip(), ver.strip())\n )\n@@ -751,6 +741,7 @@\n slogl = str(rlog).split("\\\\n")\n slog = "\\n".join(slogl)\n t'..b'ontainer running so sleep a while - we stop and destroy it when we are done\n+ # need to keep the container running so keep it open with tail -f.\n+ # will stop and destroy it when we are done\n container = client.containers.run(\n planemoimage,\n- "sleep 30m",\n+ "tail -f /galaxy-central/CITATION",\n detach=True,\n user="biodocker",\n volumes={f"{tvolname}": {"bind": "/toolfactory", "mode": "rw"}},\n )\n cl = f"mkdir -p {destdir}"\n prun(container, tout, cl, user="root")\n+ # that\'s how hard it is to get root on a biodocker container :(\n cl = f"rm -rf {destdir}/*"\n prun(container, tout, cl, user="root")\n ptestpath = os.path.join(destdir, "tfout", xreal)\n@@ -785,10 +778,10 @@\n ptestcl = f"planemo test --update_test_data --no_cleanup --test_data {destdir}/tfout/test-data --galaxy_root /home/biodocker/galaxy-central {ptestpath}"\n try:\n rlog = container.exec_run(ptestcl)\n+ # fails because test outputs missing but updates the test-data directory\n except:\n e = sys.exc_info()[0]\n tout.write(f"#### error: {e} from {ptestcl}\\n")\n- # fails - used to generate test outputs\n cl = f"planemo test --test_output {imrep} --no_cleanup --test_data {destdir}/tfout/test-data --galaxy_root /home/biodocker/galaxy-central {ptestpath}"\n try:\n prun(container, tout, cl)\n@@ -808,17 +801,12 @@\n container.stop()\n container.remove()\n tvol.remove()\n- # shutil.rmtree(testouts)\n+ # shutil.rmtree(testouts) leave for debugging\n \n def shedLoad(self):\n """\n- {\'deleted\': False,\n- \'description\': \'Tools for manipulating data\',\n- \'id\': \'175812cd7caaf439\',\n- \'model_class\': \'Category\',\n- \'name\': \'Text Manipulation\',\n- \'url\': \'/api/categories/175812cd7caaf439\'}]\n-\n+ use bioblend to create new repository\n+ or update existing\n \n """\n if os.path.exists(self.tlog):\n@@ -851,7 +839,7 @@\n category_ids=catID,\n )\n tid = res.get("id", None)\n- sto.write(f"#####create_repository {self.args.tool_name} tid={tid} res={res}\\n")\n+ sto.write(f"#create_repository {self.args.tool_name} tid={tid} res={res}\\n")\n else:\n i = rnames.index(self.tool_name)\n tid = rids[i]\n@@ -859,15 +847,17 @@\n res = ts.repositories.update_repository(\n id=tid, tar_ball_path=self.newtarpath, commit_message=None\n )\n- sto.write(f"#####update res id {id} ={res}\\n")\n+ sto.write(f"#update res id {id} ={res}\\n")\n except ConnectionError:\n sto.write(\n- "Is the toolshed running and the API key correct? Bioblend shed upload failed\\n"\n+ "####### Is the toolshed running and the API key correct? Bioblend shed upload failed\\n"\n )\n sto.close()\n \n def eph_galaxy_load(self):\n- """load the new tool from the local toolshed after planemo uploads it"""\n+ """\n+ use ephemeris to load the new tool from the local toolshed after planemo uploads it\n+ """\n if os.path.exists(self.tlog):\n tout = open(self.tlog, "a")\n else:\n@@ -1034,7 +1024,7 @@\n a("--galaxy_venv", default="/galaxy_venv")\n args = parser.parse_args()\n assert not args.bad_user, (\n- \'UNAUTHORISED: %s is NOT authorized to use this tool until Galaxy admin adds %s to "admin_users" in the Galaxy configuration file\'\n+ \'UNAUTHORISED: %s is NOT authorized to use this tool until Galaxy admin adds %s to "admin_users" in the galaxy.yml Galaxy configuration file\'\n % (args.bad_user, args.bad_user)\n )\n assert args.tool_name, "## Tool Factory expects a tool name - eg --tool_name=DESeq"\n' |
b |
diff -r 5509dc4c1cf2 -r 6873c211b250 toolfactory/rgToolFactory2.xml --- a/toolfactory/rgToolFactory2.xml Sun Nov 29 10:34:48 2020 +0000 +++ b/toolfactory/rgToolFactory2.xml Tue Dec 01 09:03:34 2020 +0000 |
[ |
@@ -39,7 +39,7 @@ </repeat> </xml> <xml name="io"> - <repeat name="history_inputs" title="Add a data file from your history to pass in to the script. Use the '+' button as needed" + <repeat name="history_inputs" title="zero or more input data file parameters to appear on the tool form to be passed to the executable" help="USE SMALL SAMPLES for the new tool's test. Prompts will form a history item selector as input for users of this new tool"> <param name="input_files" type="data" format="data" label="Select an input file from your history" optional="true" multiple="false" help=""/> @@ -67,7 +67,7 @@ help="If you will pass positional parameters, enter the integer ordinal for this parameter. If Argparse style, '--' will be prepended or '-' if single character" value=""> </param> </repeat> - <repeat name="history_outputs" title="Add a tool run output file to the user's history from your tool - Use the '+' button to add as many as needed" + <repeat name="history_outputs" title="one or more output file parameters generated by the tool to be added to the user history" help="The name will become a history item for users of the new tool you are making containing one of it's outputs"> <param name="history_name" type="text" label="Name for this output to appear in new history" optional="false" help="Argparse will also use this name as --[name]"/> <param name="history_format" type="select" multiple="false" label="Select the datatype for this output" @@ -83,13 +83,13 @@ </repeat> </xml> <xml name="additparam"> - <param name="edit_params" type="select" display="radio" label="Add any additional parameters to the generated tool form so they are user editable?" + <param name="edit_params" type="select" display="radio" label="Make parameters on the generated tool form user editable?" help="If no (default), users will NOT be able to alter any additional parameters. If yes, these will appear on the tool form as text fields with no validation or sanitizing"> <option value="yes" selected="true">Yes, allow user to edit all additional parameters on the generated tool form</option> <option value="no">No - use the fixed values for all additional parameters - no user editing</option> </param> - <repeat name="additional_parameters" title="Pass additional parameters to the script" + <repeat name="additional_parameters" title="zero or more user supplied parameter fields to the tool form for the executable" help="See examples below to see how these can be parsed by scripts in the various languages"> <param name="param_name" type="text" value="" label="Choose the name for this parameter - MUST not be blank!"> <sanitizer invalid_char=""> @@ -238,7 +238,7 @@ </sanitizer> </param> <param name="packages" type="text" value="" label="Conda dependencies as package name[:version, name:version...]. These will always be available when this tool executes" - optional="false" help="Use :[ver] for specific version - 'bwa:0.17.0'. Default is latest. Will be used every time the tool is (re)run. Only Conda is currently supported" /> + optional="false" help="Use =[ver] or :[ver] for specific version - 'bwa=0.17.0'. Default is latest. Will be used every time the tool is (re)run. Only Conda is currently supported" /> <conditional name="usescript"> <param name="choosescript" type="select" display="radio" label="Supply a script for a dependency (e.g. python/R/bash) or a system executable such as Bash" |