Repository 'tool_factory_2'
hg clone https://toolshed.g2.bx.psu.edu/repos/fubar/tool_factory_2

Changeset 47:e95d9fe5ab50 (2020-08-23)
Previous changeset 46:f8700bed1e17 (2020-08-18) Next changeset 48:5a7a5b06bce0 (2020-08-23)
Commit message:
adding tests and local installation
added:
home/ross/galaxy/tools/tool_makers/toolfactory/.shed.yml
home/ross/galaxy/tools/tool_makers/toolfactory/LICENSE
home/ross/galaxy/tools/tool_makers/toolfactory/README.md
home/ross/galaxy/tools/tool_makers/toolfactory/images/dynamicScriptTool.png
home/ross/galaxy/tools/tool_makers/toolfactory/rgToolFactory2.py
home/ross/galaxy/tools/tool_makers/toolfactory/rgToolFactory2.xml
home/ross/galaxy/tools/tool_makers/toolfactory/test-data/input1_sample
home/ross/galaxy/tools/tool_makers/toolfactory/test-data/output2_sample
home/ross/galaxy/tools/tool_makers/toolfactory/test-data/pyrevpos.python
home/ross/galaxy/tools/tool_makers/toolfactory/test-data/test1_log.txt
home/ross/galaxy/tools/tool_makers/toolfactory/test-data/toolfactory_pyrevpos_tgz_sample
removed:
TF_example_wf.ga
toolfactory/.github/workflows/commit.yml
toolfactory/.gitignore
toolfactory/.shed.yml
toolfactory/LICENSE
toolfactory/README.md
toolfactory/docker/Dockerfile
toolfactory/docker/TF_example_wf.ga
toolfactory/docker/TF_example_wf2.ga
toolfactory/docker/dockerfile.seq
toolfactory/docker/my_tool_list.yml
toolfactory/docker/post-start-actions.sh
toolfactory/docker/postinstall.py
toolfactory/docker/startgaldock.sh
toolfactory/docker/startup
toolfactory/docker/startup.sh
toolfactory/docker/tfwelcome.html
toolfactory/html_dir.py
toolfactory/images/dynamicScriptTool.png
toolfactory/rgToolFactory2.py
toolfactory/rgToolFactory2.xml
toolfactory/test-data/input1_sample
toolfactory/test-data/output2_sample
toolfactory/test-data/pyrevpos.python
toolfactory/test-data/test1_log.txt
toolfactory/test-data/toolfactory_pyrevpos_tgz_sample
toolfactory/testtf.sh
b
diff -r f8700bed1e17 -r e95d9fe5ab50 TF_example_wf.ga
--- a/TF_example_wf.ga Tue Aug 18 08:25:43 2020 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
[
b'@@ -1,458 +0,0 @@\n-{\n-    "a_galaxy_workflow": "true",\n-    "annotation": "",\n-    "format-version": "0.1",\n-    "name": "TF examples",\n-    "steps": {\n-        "0": {\n-            "annotation": "a fasta file - gc ratio will be estimated",\n-            "content_id": null,\n-            "errors": null,\n-            "id": 0,\n-            "input_connections": {},\n-            "inputs": [\n-                {\n-                    "description": "a fasta file - gc ratio will be estimated",\n-                    "name": "phiX.fasta"\n-                }\n-            ],\n-            "label": "phiX.fasta",\n-            "name": "Input dataset",\n-            "outputs": [],\n-            "position": {\n-                "bottom": 231,\n-                "height": 61,\n-                "left": 393,\n-                "right": 593,\n-                "top": 170,\n-                "width": 200,\n-                "x": 393,\n-                "y": 170\n-            },\n-            "tool_id": null,\n-            "tool_state": "{\\"optional\\": false}",\n-            "tool_version": null,\n-            "type": "data_input",\n-            "uuid": "7e2e24c8-2327-4893-a5b3-6b696a6ecd33",\n-            "workflow_outputs": [\n-                {\n-                    "label": null,\n-                    "output_name": "output",\n-                    "uuid": "f5ce2386-b80c-4691-a0a7-abeec8854461"\n-                }\n-            ]\n-        },\n-        "1": {\n-            "annotation": "Any text file to be reversed lots of times and bjorked once.",\n-            "content_id": null,\n-            "errors": null,\n-            "id": 1,\n-            "input_connections": {},\n-            "inputs": [\n-                {\n-                    "description": "Any text file to be reversed lots of times and bjorked once.",\n-                    "name": "rgToolFactory2.py"\n-                }\n-            ],\n-            "label": "rgToolFactory2.py",\n-            "name": "Input dataset",\n-            "outputs": [],\n-            "position": {\n-                "bottom": 371,\n-                "height": 81,\n-                "left": 393,\n-                "right": 593,\n-                "top": 290,\n-                "width": 200,\n-                "x": 393,\n-                "y": 290\n-            },\n-            "tool_id": null,\n-            "tool_state": "{\\"optional\\": false}",\n-            "tool_version": null,\n-            "type": "data_input",\n-            "uuid": "f530b390-2424-4aae-8bd9-dd9d30277561",\n-            "workflow_outputs": [\n-                {\n-                    "label": null,\n-                    "output_name": "output",\n-                    "uuid": "3d2a1699-50af-46e1-8981-dc6c3de2cf6c"\n-                }\n-            ]\n-        },\n-        "2": {\n-            "annotation": "",\n-            "content_id": "rgTF2",\n-            "errors": null,\n-            "id": 2,\n-            "input_connections": {\n-                "ppass|history_inputs_0|input_files": {\n-                    "id": 0,\n-                    "output_name": "output"\n-                }\n-            },\n-            "inputs": [],\n-            "label": null,\n-            "name": "toolfactory",\n-            "outputs": [\n-                {\n-                    "name": "TF_run_report",\n-                    "type": "input"\n-                },\n-                {\n-                    "name": "new_tool",\n-                    "type": "tgz"\n-                }\n-            ],\n-            "position": {\n-                "bottom": 372,\n-                "height": 202,\n-                "left": 613,\n-                "right": 813,\n-                "top": 170,\n-                "width": 200,\n-                "x": 613,\n-                "y": 170\n-            },\n-            "post_job_actions": {},\n-            "tool_id": "rgTF2",\n-            "tool_state": "{\\"__input_ext\\": \\"input\\", \\"chromInfo\\": \\"/home/ross/galaxy/tool-data/shared/ucsc/chrom/?.len\\", \\"interexe\\": {\\"interpreter\\": \\"perl\\", \\"__current_case__\\": 4, \\"interpreter_version\\": \\"\\'..b'\n-                "height": 242,\n-                "left": 833,\n-                "right": 1033,\n-                "top": 170,\n-                "width": 200,\n-                "x": 833,\n-                "y": 170\n-            },\n-            "post_job_actions": {},\n-            "tool_id": "rgTF2",\n-            "tool_state": "{\\"__input_ext\\": \\"input\\", \\"chromInfo\\": \\"/home/ross/galaxy/tool-data/shared/ucsc/chrom/?.len\\", \\"interexe\\": {\\"interpreter\\": \\"python\\", \\"__current_case__\\": 2, \\"interpreter_version\\": \\"\\", \\"exe_package_version\\": \\"\\", \\"dynScript\\": \\"import argparse\\\\nimport tarfile\\\\nimport os\\\\nimport tempfile\\\\nimport subprocess\\\\n\\\\n\\\\\\"\\\\\\"\\\\\\"\\\\nplanemo test --no_cleanup --no_dependency_resolution --skip_venv --galaxy_root ~/galaxy ~/galaxy/tools/tool_makers/pyrevargparse/ &> pyrevargparse\\\\n\\\\\\"\\\\\\"\\\\\\"\\\\n\\\\nparser = argparse.ArgumentParser()\\\\na = parser.add_argument\\\\na(\'--tooltgz\',default=\'\')\\\\na(\'--report\',default=None)\\\\na(\'--toolout\',default=None)\\\\na(\'--galaxy_root\',default=None)\\\\nargs = parser.parse_args()\\\\ntoolname = args.toolout.split(os.sep)[-1]\\\\ntoolpath = os.path.join(args.galaxy_root,args.toolout)\\\\ntf = tarfile.open(args.tooltgz,\\\\\\"r:gz\\\\\\")\\\\ntf.extractall(toolpath)\\\\ncl = \\\\\\"planemo test --skip_venv --galaxy_root %s %s\\\\\\" % (args.galaxy_root,toolpath)\\\\ncll = cl.split(\' \')\\\\nsto = open(args.report, \'w\')\\\\np = subprocess.run(cll, shell=False, stdout=sto)\\\\nretval = p.returncode\\\\nsto.close()\\\\n\\"}, \\"makeMode\\": {\\"make_Tool\\": \\"yes\\", \\"__current_case__\\": 0, \\"tool_version\\": \\"0.01\\", \\"tool_desc\\": \\"Tool to test toolshed tool archives generated by the tool factory.\\", \\"help_text\\": \\"**What it Does**\\\\n\\\\nGiven a toolshed tgz file generated by a tool factory run, this will unpack it and run planemo test, returning the planemo stdout as a report\\\\nIt was generated using the tool factory.\\", \\"citations\\": []}, \\"ppass\\": {\\"parampass\\": \\"argparse\\", \\"__current_case__\\": 0, \\"history_inputs\\": [{\\"__index__\\": 0, \\"input_files\\": {\\"__class__\\": \\"ConnectedValue\\"}, \\"input_formats\\": [\\"tgz\\"], \\"input_label\\": \\"tool toolshed tgz archive from history\\", \\"input_help\\": \\"Run planemo test on a tool shed tool archive tgz format file generated by the ToolFactory or Planemo\\", \\"input_CL\\": \\"tooltgz\\"}], \\"history_outputs\\": [{\\"__index__\\": 0, \\"history_name\\": \\"report\\", \\"history_format\\": \\"txt\\", \\"history_CL\\": \\"report\\"}], \\"edit_params\\": \\"yes\\", \\"additional_parameters\\": [{\\"__index__\\": 0, \\"param_name\\": \\"toolout\\", \\"param_type\\": \\"text\\", \\"param_value\\": \\"tools/toolmakers/planemotest\\", \\"param_label\\": \\"output path under galaxy root\\", \\"param_help\\": \\"This is where the tgz file will be extracted and tested by planemo\\", \\"param_CL\\": \\"toolout\\", \\"param_CLprefixed\\": \\"\\"}, {\\"__index__\\": 1, \\"param_name\\": \\"galaxy_root\\", \\"param_type\\": \\"text\\", \\"param_value\\": \\"/home/ross/galaxy\\", \\"param_label\\": \\"Galaxy source root directory to use for running planemo\\", \\"param_help\\": \\"This will form the galaxy_root parameter for rnning planemo using an existing Galaxy source tree, and the tgz will be extracted at a path relative to that rootu\\", \\"param_CL\\": \\"galaxy_root\\", \\"param_CLprefixed\\": \\"\\"}]}, \\"tool_name\\": \\"planemotest\\", \\"__page__\\": null, \\"__rerun_remap_job_id__\\": null}",\n-            "tool_version": "2.00",\n-            "type": "tool",\n-            "uuid": "b9bfb1a4-4c0c-4d39-9e74-223da72f8abc",\n-            "workflow_outputs": [\n-                {\n-                    "label": null,\n-                    "output_name": "TF_run_report",\n-                    "uuid": "09ba44ea-4da8-46f5-a411-ca054ccedd3b"\n-                },\n-                {\n-                    "label": null,\n-                    "output_name": "new_tool",\n-                    "uuid": "50a8ff4a-702a-4983-8202-8a79c0a3c978"\n-                }\n-            ]\n-        }\n-    },\n-    "tags": [],\n-    "uuid": "321a7f9f-c287-453c-807a-43afd948770e",\n-    "version": 1\n-}\n'
b
diff -r f8700bed1e17 -r e95d9fe5ab50 home/ross/galaxy/tools/tool_makers/toolfactory/.shed.yml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/home/ross/galaxy/tools/tool_makers/toolfactory/.shed.yml Sun Aug 23 21:02:03 2020 -0400
b
@@ -0,0 +1,13 @@
+name: toolfactory
+owner: fubar
+description: ToolFactory - tool to make Galaxy tools ready for the toolshed
+homepage_url: https://github.com/fubar2/toolfactory
+long_description: |
+    ToolFactory - turn executable packages and R/python/perl/bash scripts into ordinary Galaxy tools
+
+    Creating re-usable tools from scripts: The Galaxy Tool Factory Ross Lazarus; Antony Kaspi; Mark Ziemann; The Galaxy Team 
+    Bioinformatics 2012; doi: 10.1093/bioinformatics/bts573
+remote_repository_url: https://github.com/fubar2/toolfactory
+type: tool_dependency_definition
+categories:
+- Tool Generators
b
diff -r f8700bed1e17 -r e95d9fe5ab50 home/ross/galaxy/tools/tool_makers/toolfactory/LICENSE
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/home/ross/galaxy/tools/tool_makers/toolfactory/LICENSE Sun Aug 23 21:02:03 2020 -0400
b
b"@@ -0,0 +1,504 @@\n+GNU LESSER GENERAL PUBLIC LICENSE\n+                       Version 2.1, February 1999\n+\n+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.\n+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n+ Everyone is permitted to copy and distribute verbatim copies\n+ of this license document, but changing it is not allowed.\n+\n+(This is the first released version of the Lesser GPL.  It also counts\n+ as the successor of the GNU Library Public License, version 2, hence\n+ the version number 2.1.)\n+\n+                            Preamble\n+\n+  The licenses for most software are designed to take away your\n+freedom to share and change it.  By contrast, the GNU General Public\n+Licenses are intended to guarantee your freedom to share and change\n+free software--to make sure the software is free for all its users.\n+\n+  This license, the Lesser General Public License, applies to some\n+specially designated software packages--typically libraries--of the\n+Free Software Foundation and other authors who decide to use it.  You\n+can use it too, but we suggest you first think carefully about whether\n+this license or the ordinary General Public License is the better\n+strategy to use in any particular case, based on the explanations below.\n+\n+  When we speak of free software, we are referring to freedom of use,\n+not price.  Our General Public Licenses are designed to make sure that\n+you have the freedom to distribute copies of free software (and charge\n+for this service if you wish); that you receive source code or can get\n+it if you want it; that you can change the software and use pieces of\n+it in new free programs; and that you are informed that you can do\n+these things.\n+\n+  To protect your rights, we need to make restrictions that forbid\n+distributors to deny you these rights or to ask you to surrender these\n+rights.  These restrictions translate to certain responsibilities for\n+you if you distribute copies of the library or if you modify it.\n+\n+  For example, if you distribute copies of the library, whether gratis\n+or for a fee, you must give the recipients all the rights that we gave\n+you.  You must make sure that they, too, receive or can get the source\n+code.  If you link other code with the library, you must provide\n+complete object files to the recipients, so that they can relink them\n+with the library after making changes to the library and recompiling\n+it.  And you must show them these terms so they know their rights.\n+\n+  We protect your rights with a two-step method: (1) we copyright the\n+library, and (2) we offer you this license, which gives you legal\n+permission to copy, distribute and/or modify the library.\n+\n+  To protect each distributor, we want to make it very clear that\n+there is no warranty for the free library.  Also, if the library is\n+modified by someone else and passed on, the recipients should know\n+that what they have is not the original version, so that the original\n+author's reputation will not be affected by problems that might be\n+introduced by others.\n+\n+  Finally, software patents pose a constant threat to the existence of\n+any free program.  We wish to make sure that a company cannot\n+effectively restrict the users of a free program by obtaining a\n+restrictive license from a patent holder.  Therefore, we insist that\n+any patent license obtained for a version of the library must be\n+consistent with the full freedom of use specified in this license.\n+\n+  Most GNU software, including some libraries, is covered by the\n+ordinary GNU General Public License.  This license, the GNU Lesser\n+General Public License, applies to certain designated libraries, and\n+is quite different from the ordinary General Public License.  We use\n+this license for certain libraries in order to permit linking those\n+libraries into non-free programs.\n+\n+  When a program is linked with a library, whether statically or using\n+a shared library, the combination of the two is legally speaking a\n+combined work, a derivative "..b'oes not specify a\n+license version number, you may choose any version ever published by\n+the Free Software Foundation.\n+\n+  14. If you wish to incorporate parts of the Library into other free\n+programs whose distribution conditions are incompatible with these,\n+write to the author to ask for permission.  For software which is\n+copyrighted by the Free Software Foundation, write to the Free\n+Software Foundation; we sometimes make exceptions for this.  Our\n+decision will be guided by the two goals of preserving the free status\n+of all derivatives of our free software and of promoting the sharing\n+and reuse of software generally.\n+\n+                            NO WARRANTY\n+\n+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO\n+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.\n+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR\n+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY\n+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE\n+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE\n+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME\n+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n+\n+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN\n+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY\n+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU\n+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR\n+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE\n+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING\n+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A\n+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF\n+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\n+DAMAGES.\n+\n+                     END OF TERMS AND CONDITIONS\n+\n+           How to Apply These Terms to Your New Libraries\n+\n+  If you develop a new library, and you want it to be of the greatest\n+possible use to the public, we recommend making it free software that\n+everyone can redistribute and change.  You can do so by permitting\n+redistribution under these terms (or, alternatively, under the terms of the\n+ordinary General Public License).\n+\n+  To apply these terms, attach the following notices to the library.  It is\n+safest to attach them to the start of each source file to most effectively\n+convey the exclusion of warranty; and each file should have at least the\n+"copyright" line and a pointer to where the full notice is found.\n+\n+    {description}\n+    Copyright (C) {year} {fullname}\n+\n+    This library is free software; you can redistribute it and/or\n+    modify it under the terms of the GNU Lesser General Public\n+    License as published by the Free Software Foundation; either\n+    version 2.1 of the License, or (at your option) any later version.\n+\n+    This library is distributed in the hope that it will be useful,\n+    but WITHOUT ANY WARRANTY; without even the implied warranty of\n+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n+    Lesser General Public License for more details.\n+\n+    You should have received a copy of the GNU Lesser General Public\n+    License along with this library; if not, write to the Free Software\n+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301\n+    USA\n+\n+Also add information on how to contact you by electronic and paper mail.\n+\n+You should also get your employer (if you work as a programmer) or your\n+school, if any, to sign a "copyright disclaimer" for the library, if\n+necessary.  Here is a sample; alter the names:\n+\n+  Yoyodyne, Inc., hereby disclaims all copyright interest in the\n+  library `Frob\' (a library for tweaking knobs) written by James Random\n+  Hacker.\n+\n+  {signature of Ty Coon}, 1 April 1990\n+  Ty Coon, President of Vice\n+\n+That\'s all there is to it!\n'
b
diff -r f8700bed1e17 -r e95d9fe5ab50 home/ross/galaxy/tools/tool_makers/toolfactory/README.md
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/home/ross/galaxy/tools/tool_makers/toolfactory/README.md Sun Aug 23 21:02:03 2020 -0400
b
@@ -0,0 +1,166 @@
+*WARNING before you start*
+
+ Install this tool on a private Galaxy ONLY
+ Please NEVER on a public or production instance

+Updated august 2014 by John Chilton adding citation support
+
+Updated august 8 2014 to fix bugs reported by Marius van den Beek
+
+Please cite the resource at
+http://bioinformatics.oxfordjournals.org/cgi/reprint/bts573?ijkey=lczQh1sWrMwdYWJ&keytype=ref
+if you use this tool in your published work.
+
+**Short Story**
+
+This is an unusual Galaxy tool capable of generating new Galaxy tools.
+It works by exposing *unrestricted* and therefore extremely dangerous scripting
+to all designated administrators of the host Galaxy server, allowing them to
+run scripts in R, python, sh and perl over multiple selected input data sets,
+writing a single new data set as output.
+
+*You have a working r/python/perl/bash script or any executable with positional or argparse style parameters*
+
+It can be turned into an ordinary Galaxy tool in minutes, using a Galaxy tool.
+
+
+**Automated generation of new Galaxy tools for installation into any Galaxy**
+
+A test is generated using small sample test data inputs and parameter settings you supply.
+Once the test case outputs have been produced, they can be used to build a
+new Galaxy tool. The supplied script or executable is baked as a requirement
+into a new, ordinary Galaxy tool, fully workflow compatible out of the box.
+Generated tools are installed via a tool shed by an administrator
+and work exactly like all other Galaxy tools for your users.
+
+**More Detail**
+
+To use the ToolFactory, you should have prepared a script to paste into a
+text box, or have a package in mind and a small test input example ready to select from your history
+to test your new script.
+
+```planemo test rgToolFactory2.xml --galaxy_root ~/galaxy --test_data ~/galaxy/tools/tool_makers/toolfactory/test-data``` works for me
+
+There is an example in each scripting language on the Tool Factory form. You
+can just cut and paste these to try it out - remember to select the right
+interpreter please. You'll also need to create a small test data set using
+the Galaxy history add new data tool.
+
+If the script fails somehow, use the "redo" button on the tool output in
+your history to recreate the form complete with broken script. Fix the bug
+and execute again. Rinse, wash, repeat.
+
+Once the script runs sucessfully, a new Galaxy tool that runs your script
+can be generated. Select the "generate" option and supply some help text and
+names. The new tool will be generated in the form of a new Galaxy datatype
+*toolshed.gz* - as the name suggests, it's an archive ready to upload to a
+Galaxy ToolShed as a new tool repository.
+
+Once it's in a ToolShed, it can be installed into any local Galaxy server
+from the server administrative interface.
+
+Once the new tool is installed, local users can run it - each time, the script
+that was supplied when it was built will be executed with the input chosen
+from the user's history. In other words, the tools you generate with the
+ToolFactory run just like any other Galaxy tool,but run your script every time.
+
+Tool factory tools are perfect for workflow components. One input, one output,
+no variables.
+
+*To fully and safely exploit the awesome power* of this tool,
+Galaxy and the ToolShed, you should be a developer installing this
+tool on a private/personal/scratch local instance where you are an
+admin_user. Then, if you break it, you get to keep all the pieces see
+https://bitbucket.org/fubar/galaxytoolfactory/wiki/Home
+
+**Installation**
+This is a Galaxy tool. You can install it most conveniently using the
+administrative "Search and browse tool sheds" link. Find the Galaxy Main
+toolshed at https://toolshed.g2.bx.psu.edu/ and search for the toolfactory
+repository. Open it and review the code and select the option to install it.
+
+If you can't get the tool that way, the xml and py files here need to be
+copied into a new tools
+subdirectory such as tools/toolfactory Your tool_conf.xml needs a new entry
+pointing to the xml
+file - something like::
+
+  <section name="Tool building tools" id="toolbuilders">
+    <tool file="toolfactory/rgToolFactory.xml"/>
+  </section>
+
+If not already there,
+please add:
+<datatype extension="toolshed.gz" type="galaxy.datatypes.binary:Binary"
+mimetype="multipart/x-gzip" subclass="True" />
+to your local data_types_conf.xml.
+
+
+**Restricted execution**
+
+The tool factory tool itself will then be usable ONLY by admin users -
+people with IDs in admin_users in universe_wsgi.ini **Yes, that's right. ONLY
+admin_users can run this tool** Think about it for a moment. If allowed to
+run any arbitrary script on your Galaxy server, the only thing that would
+impede a miscreant bent on destroying all your Galaxy data would probably
+be lack of appropriate technical skills.
+
+**What it does** 
+
+This is a tool factory for simple scripts in python, R and
+perl currently. Functional tests are automatically generated. How cool is that.
+
+LIMITED to simple scripts that read one input from the history. Optionally can
+write one new history dataset, and optionally collect any number of outputs
+into links on an autogenerated HTML index page for the user to navigate -
+useful if the script writes images and output files - pdf outputs are shown
+as thumbnails and R's bloated pdf's are shrunk with ghostscript so that and
+imagemagik need to be available.
+
+Generated tools can be edited and enhanced like any Galaxy tool, so start
+small and build up since a generated script gets you a serious leg up to a
+more complex one.
+
+**What you do**
+
+You paste and run your script, you fix the syntax errors and
+eventually it runs. You can use the redo button and edit the script before
+trying to rerun it as you debug - it works pretty well.
+
+Once the script works on some test data, you can generate a toolshed compatible
+gzip file containing your script ready to run as an ordinary Galaxy tool in
+a repository on your local toolshed. That means safe and largely automated
+installation in any production Galaxy configured to use your toolshed.
+
+**Generated tool Security**
+
+Once you install a generated tool, it's just
+another tool - assuming the script is safe. They just run normally and their
+user cannot do anything unusually insecure but please, practice safe toolshed.
+Read the code before you install any tool. Especially this one - it is really scary.
+
+**Send Code**
+
+Patches and suggestions welcome as bitbucket issues please?
+
+**Attribution**
+
+Creating re-usable tools from scripts: The Galaxy Tool Factory
+Ross Lazarus; Antony Kaspi; Mark Ziemann; The Galaxy Team
+Bioinformatics 2012; doi: 10.1093/bioinformatics/bts573
+
+http://bioinformatics.oxfordjournals.org/cgi/reprint/bts573?ijkey=lczQh1sWrMwdYWJ&keytype=ref
+
+**Licensing**
+
+Copyright Ross Lazarus 2010
+ross lazarus at g mail period com
+
+All rights reserved.
+
+Licensed under the LGPL
+
+**Obligatory screenshot**
+
+http://bitbucket.org/fubar/galaxytoolmaker/src/fda8032fe989/images/dynamicScriptTool.png
+
b
diff -r f8700bed1e17 -r e95d9fe5ab50 home/ross/galaxy/tools/tool_makers/toolfactory/images/dynamicScriptTool.png
b
Binary file home/ross/galaxy/tools/tool_makers/toolfactory/images/dynamicScriptTool.png has changed
b
diff -r f8700bed1e17 -r e95d9fe5ab50 home/ross/galaxy/tools/tool_makers/toolfactory/rgToolFactory2.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/home/ross/galaxy/tools/tool_makers/toolfactory/rgToolFactory2.py Sun Aug 23 21:02:03 2020 -0400
[
b'@@ -0,0 +1,843 @@\n+#!/usr/bin/env python\n+# rgToolFactory.py\n+# see https://github.com/fubar2/toolfactory\n+#\n+# copyright ross lazarus (ross stop lazarus at gmail stop com) May 2012\n+#\n+# all rights reserved\n+# Licensed under the LGPL\n+# suggestions for improvement and bug fixes welcome at https://github.com/fubar2/toolfactory\n+#\n+# July 2020: BCC was fun and I feel like rip van winkle after 5 years.\n+# Decided to\n+# 1. Fix the toolfactory so it works - done for simplest case\n+# 2. Fix planemo so the toolfactory function works\n+# 3. Rewrite bits using galaxyxml functions where that makes sense - done\n+#\n+# removed all the old complications including making the new tool use this same script\n+# galaxyxml now generates the tool xml https://github.com/hexylena/galaxyxml\n+# No support for automatic HTML file creation from arbitrary outputs\n+# essential problem is to create two command lines - one for the tool xml and a different\n+# one to run the executable with the supplied test data and settings\n+# Be simpler to write the tool, then run it with planemo and soak up the test outputs.\n+\n+\n+\n+import argparse\n+import logging\n+import os\n+import re\n+import shutil\n+import subprocess\n+import sys\n+import tarfile\n+import tempfile\n+import time\n+\n+import galaxyxml.tool as gxt\n+import galaxyxml.tool.parameters as gxtp\n+\n+import lxml\n+\n+import yaml\n+\n+myversion = "V2.1 July 2020"\n+verbose = True\n+debug = True\n+toolFactoryURL = "https://github.com/fubar2/toolfactory"\n+ourdelim = "~~~"\n+\n+# --input_files="$input_files~~~$CL~~~$input_formats~~~$input_label\n+# ~~~$input_help"\n+IPATHPOS = 0\n+ICLPOS = 1\n+IFMTPOS = 2\n+ILABPOS = 3\n+IHELPOS = 4\n+IOCLPOS = 5\n+\n+# --output_files "$otab.history_name~~~$otab.history_format~~~$otab.CL\n+ONAMEPOS = 0\n+OFMTPOS = 1\n+OCLPOS = 2\n+OOCLPOS = 3\n+\n+# --additional_parameters="$i.param_name~~~$i.param_value~~~\n+# $i.param_label~~~$i.param_help~~~$i.param_type~~~$i.CL~~~i$.param_CLoverride"\n+ANAMEPOS = 0\n+AVALPOS = 1\n+ALABPOS = 2\n+AHELPPOS = 3\n+ATYPEPOS = 4\n+ACLPOS = 5\n+AOVERPOS = 6\n+AOCLPOS = 7\n+\n+\n+foo = len(lxml.__version__)\n+# fug you, flake8. Say my name!\n+\n+def timenow():\n+    """return current time as a string\n+    """\n+    return time.strftime("%d/%m/%Y %H:%M:%S", time.localtime(time.time()))\n+\n+\n+def quote_non_numeric(s):\n+    """return a prequoted string for non-numerics\n+    useful for perl and Rscript parameter passing?\n+    """\n+    try:\n+        _ = float(s)\n+        return s\n+    except ValueError:\n+        return \'"%s"\' % s\n+\n+\n+html_escape_table = {"&": "&amp;", ">": "&gt;", "<": "&lt;", "$": r"\\$"}\n+\n+\n+def html_escape(text):\n+    """Produce entities within text."""\n+    return "".join(html_escape_table.get(c, c) for c in text)\n+\n+\n+def html_unescape(text):\n+    """Revert entities within text. Multiple character targets so use replace"""\n+    t = text.replace("&amp;", "&")\n+    t = t.replace("&gt;", ">")\n+    t = t.replace("&lt;", "<")\n+    t = t.replace("\\\\$", "$")\n+    return t\n+\n+\n+def parse_citations(citations_text):\n+    """\n+    """\n+    citations = [c for c in citations_text.split("**ENTRY**") if c.strip()]\n+    citation_tuples = []\n+    for citation in citations:\n+        if citation.startswith("doi"):\n+            citation_tuples.append(("doi", citation[len("doi") :].strip()))\n+        else:\n+            citation_tuples.append(\n+                ("bibtex", citation[len("bibtex") :].strip())\n+            )\n+    return citation_tuples\n+\n+\n+class ScriptRunner:\n+    """Wrapper for an arbitrary script\n+    uses galaxyxml\n+\n+    """\n+\n+    def __init__(self, args=None):\n+        """\n+        prepare command line cl for running the tool here\n+        and prepare elements needed for galaxyxml tool generation\n+        """\n+\n+        self.infiles = [x.split(ourdelim) for x in args.input_files]\n+        self.outfiles = [x.split(ourdelim) for x in args.output_files]\n+        self.addpar = [x.split(ourdelim) for x in args.additional_parameters]\n+        self.args = args\n+        self.cleanuppar()\n+        s'..b'elf):\n+        """\n+        """\n+        cll = [\'shed-tools\', \'install\', \'-g\', self.args.galaxy_url, \'--latest\',\n+           \'-a\', self.args.galaxy_api_key , \'--name\', self.args.tool_name, \'--owner\',\'fubar\',\n+           \'--toolshed\', self.args.toolshed_url,\n+           \'--section_label\',\'Generated Tools\',\'--install_tool_dependencies\',]\n+        print(\'running\\n\',\' \'.join(cll))\n+        p = subprocess.run(cll, shell=False)\n+        if p.returncode != 0:\n+            print(\'Repository %s installation returned %d\' % (self.args.tool_name,p.retcode))\n+        else:\n+            print(\'installed %s\' % self.args.tool_name)\n+        return p.returncode\n+\n+    def writeShedyml(self):\n+        yuser = self.args.user_email.split(\'@\')[0]\n+        yfname = os.path.join(self.tooloutdir,\'.shed.yml\')\n+        yamlf = open(yfname, \'w\')\n+        odict = {\'name\':self.tool_name,\'owner\':yuser,\'type\':\'unrestricted\',\'description\':self.args.tool_desc}\n+        yaml.dump(odict, yamlf, allow_unicode=True)\n+        yamlf.close()\n+\n+def main():\n+    """\n+    This is a Galaxy wrapper. It expects to be called by a special purpose tool.xml as:\n+    <command interpreter="python">rgBaseScriptWrapper.py --script_path "$scriptPath" --tool_name "foo" --interpreter "Rscript"\n+    </command>\n+    """\n+    parser = argparse.ArgumentParser()\n+    a = parser.add_argument\n+    a("--script_path", default="")\n+    a("--dependencies", default="")\n+    a("--cl_override", default="")\n+    a("--tool_name", default=None)\n+    a("--interpreter_name", default=None)\n+    a("--interpreter_version", default=None)\n+    a("--exe_package", default=None)\n+    a("--exe_package_version", default=None)\n+    a("--input_files", default=[], action="append")\n+    a("--output_files", default=[], action="append")\n+    a("--user_email", default="Unknown")\n+    a("--bad_user", default=None)\n+    a("--make_Tool", default=None)\n+    a("--help_text", default=None)\n+    a("--tool_desc", default=None)\n+    a("--tool_version", default=None)\n+    a("--citations", default=None)\n+    a("--additional_parameters", action="append", default=[])\n+    a("--edit_additional_parameters", action="store_true", default=False)\n+    a("--parampass", default="positional")\n+    a("--tfout", default="./tfout")\n+    a("--new_tool", default="new_tool")\n+    a("--runmode", default=None)\n+    a("--galaxy_url", default="http://localhost")\n+    a("--galaxy_api_key", default=\'fakekey\')\n+    a("--toolshed_url", default="http://localhost:9009")\n+    a("--toolshed_api_key", default=None)\n+    a("--planemo_test", default="yes")\n+\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+        % (args.bad_user, args.bad_user)\n+    )\n+    assert (\n+        args.tool_name\n+    ), "## Tool Factory expects a tool name - eg --tool_name=DESeq"\n+    assert (\n+        args.interpreter_name or args.exe_package\n+    ), "## Tool Factory wrapper expects an interpreter or an executable package"\n+    assert args.exe_package or (\n+        len(args.script_path) > 0 and os.path.isfile(args.script_path)\n+    ), "## Tool Factory wrapper expects a script path - eg --script_path=foo.R if no executable"\n+    args.input_files = [\n+        x.replace(\'"\', "").replace("\'", "") for x in args.input_files\n+    ]\n+    # remove quotes we need to deal with spaces in CL params\n+    for i, x in enumerate(args.additional_parameters):\n+        args.additional_parameters[i] = args.additional_parameters[i].replace(\n+            \'"\', ""\n+        )\n+    r = ScriptRunner(args)\n+    if args.make_Tool:\n+        r.writeShedyml()\n+        retcode = r.makeTooltar()\n+        if retcode == 0:\n+            if args.planemo_test == "yes":\n+                r.install_load()\n+    else:\n+        retcode = r.run()\n+    # if retcode:\n+        # sys.exit(retcode)  # indicate failure to job runner\n+\n+\n+if __name__ == "__main__":\n+    main()\n'
b
diff -r f8700bed1e17 -r e95d9fe5ab50 home/ross/galaxy/tools/tool_makers/toolfactory/rgToolFactory2.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/home/ross/galaxy/tools/tool_makers/toolfactory/rgToolFactory2.xml Sun Aug 23 21:02:03 2020 -0400
[
b'@@ -0,0 +1,476 @@\n+<tool id="rgTF2" name="toolfactory" version="2.00" profile="16.04" >\n+  <description>Scripts into tools</description>\n+  <macros>\n+     <xml name="io">\n+        <repeat name="history_inputs" title="Add a data file from your history to pass in to the script. Use the \'+\' button as needed"\n+             help="USE SMALL SAMPLES because these will be used for the new tool\'s test. The names will become a history item selector as input for users of the new tool you are making">\n+            <param name="input_files" type="data" format="data" label="Select an input file from your history" optional="true" multiple="false"\n+               help=""/>\n+            <param name="input_formats" type="select" multiple="true" label="Select the datatype(s) that your tool/script accepts as input"\n+              help="If your datatype is not listed here, it has to be added in galaxy\'s datatypes_conf.xml" value="tabular">\n+               <options from_parameter="tool.app.datatypes_registry.upload_file_formats">\n+                <column name="value" index="0"/>\n+               </options>\n+            </param>\n+            <param name="input_label" type="text" value="" label="This will become the user prompt for the form so please make it informative"\n+             help="Note that \'~~~\' is an internal delimiter so must not appear in this text field - please work around this technical limitation" >\n+            <sanitizer invalid_char="">\n+              <valid initial="string.printable"> <remove value=\'~~~\'/> </valid>\n+              <mapping initial="none"/>\n+            </sanitizer>\n+            </param>\n+            <param name="input_help" type="text" value="parameter_help" label="This will become help text on the form."\n+             help="Note that three consecutive ~ cannot be used in this text field - please work around this technical limitation">\n+            <sanitizer invalid_char="">\n+              <valid initial="string.printable"> <remove value=\'~~~\'/> </valid>\n+              <mapping initial="none"/>\n+            </sanitizer>\n+            </param>\n+            <param name="input_CL" type="text" label="Positional: ordinal integer. Argparse: argument name. STDIN if the executable/script expects it"\n+              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="">\n+            </param>\n+        </repeat>\n+        <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"\n+             help="The name will become a history item for users of the new tool you are making containing one of it\'s outputs">\n+            <param name="history_name" type="text" label="Name for this output to appear in new history" optional="false" help=""/>\n+            <param name="history_format" type="select" multiple="false" label="Select the datatype for this output"\n+              help="If your datatype is not listed here, it has to be added in galaxy\'s datatypes_conf.xml" value="tabular">\n+               <options from_parameter="tool.app.datatypes_registry.upload_file_formats">\n+                <column name="value" index="0"/>\n+               </options>\n+            </param>\n+            <param name="history_CL" type="text"  label="Positional: ordinal integer. Argparse: argument name expected for this output parameter. Use STDOUT if \'>\' required."\n+              help="If positional parameters, enter the integer ordinal expected for this parameter. If Argparse style, \'--\' will be prepended or \'-\' if single character" value=""/>\n+        </repeat>\n+     </xml>\n+     <xml name="additparam">\n+        <param name="edit_params" type="select" display="radio" label="Add any additional parameters to the generated tool form so they are user editable?"\n+             help="If no (default), users will NOT be able to alter any additional parameters.'..b'); o.close()"/>\n+    <output name="new_tool" file="toolfactory_pyrevpos_tgz_sample" compare="sim_size" delta="6000" />\n+    <!-- <output name="output" file="output2_sample" ftype="txt" compare="diff" lines_diff = "10" /> -->\n+</test>\n+</tests>\n+<help>\n+\n+.. class:: warningmark\n+\n+**Details and attribution**\n+(see GTF_)\n+\n+**Local Admins ONLY**\n+Only users whose IDs found in the local admin_user configuration setting in universe_wsgi.ini can run this tool.\n+\n+**If you find a bug**\n+Please raise an issue, or even better, submit a pull request fixing it, on the github repository GTF_\n+\n+**What it does**\n+This tool optionally generates normal workflow compatible first class Galaxy tools\n+\n+Generated tools can run existing binary packages that become requirements, existing scripts, or new scripts pasted into this tool form.\n+Pasted scripts are written so they are part of the new tool and cannot be adjusted by the downstream user.\n+Binary packages are managed by the dependency subsystem - conda usually, so anything in bioconda or conda_forge is available for example.\n+\n+Any number of parameters can be built into the new tool form for passing in to the script or executable at runtime.\n+These can be editable by the downstream user or baked in.\n+\n+When you run this tool, your executable or script and supplied parameter values will be run to produce a canonical\n+set of outputs - these are used to construct a test for the new tool.\n+\n+If tool generation is required, a new tarball compatible with any Galaxy toolshed is created.\n+It can be unpacked in your galaxy/tools directory and manually added to tool_conf.xml, or\n+installed into any toolshed from where it can be installed into your Galaxy.\n+\n+\n+.. class:: warningmark\n+\n+**Note to system administrators**\n+This tool offers *NO* built in protection against malicious scripts. It should only be installed on private/personnal Galaxy instances.\n+Admin_users will have the power to do anything they want as the Galaxy user if you install this tool.\n+\n+.. class:: warningmark\n+\n+**Use on public servers**  is STRONGLY discouraged for obvious reasons\n+\n+The tools generated by this tool will run just as securely as any other normal installed Galaxy tool but like any other new tools, should always be checked carefully before installation.\n+We recommend that you follow the good code hygiene practices associated with safe toolshed practices.\n+\n+Here\'s a sample python script that can be cut and pasted into the tool form, suitable for positional parameter passing:\n+\n+::\n+\n+    # reverse order of text by row\n+    import sys\n+    inp = sys.argv[1]\n+    outp = sys.argv[2]\n+    i = open(inp,\'r\').readlines()\n+    o = open(outp,\'w\')\n+    for row in i:\n+      rs = row.rstrip()\n+      rs = list(rs)\n+      rs.reverse()\n+      o.write(\'\'.join(rs))\n+      o.write(\'\\n\')\n+    o.close()\n+\n+With argparse style parameters:\n+\n+::\n+\n+    # reverse order of text by row\n+    import argparse\n+    parser = argparse.ArgumentParser()\n+    a = parser.add_argument\n+    a(\'--infile\',default=\'\')\n+    a(\'--outfile\',default=None)\n+    args = parser.parse_args()\n+    inp = args.infile\n+    outp = args.outfile\n+    i = open(inp,\'r\').readlines()\n+    o = open(outp,\'w\')\n+    for row in i:\n+      rs = row.rstrip()\n+      rs = list(rs)\n+      rs.reverse()\n+      o.write(\'\'.join(rs))\n+      o.write(\'\\n\')\n+    o.close()\n+\n+\n+Paper_ :\n+\n+Creating re-usable tools from scripts: The Galaxy Tool Factory\n+Ross Lazarus; Antony Kaspi; Mark Ziemann; The Galaxy Team\n+Bioinformatics 2012; doi: 10.1093/bioinformatics/bts573\n+\n+**Licensing**\n+\n+Copyright Ross Lazarus (ross period lazarus at gmail period com) May 2012\n+All rights reserved.\n+Licensed under the LGPL_\n+\n+.. _LGPL: http://www.gnu.org/copyleft/lesser.html\n+.. _GTF:  https://github.com/fubar2/toolfactory\n+.. _Paper: http://bioinformatics.oxfordjournals.org/cgi/reprint/bts573\n+\n+\n+</help>\n+<citations>\n+    <citation type="doi">10.1093/bioinformatics/bts573</citation>\n+</citations>\n+</tool>\n+\n+\n'
b
diff -r f8700bed1e17 -r e95d9fe5ab50 home/ross/galaxy/tools/tool_makers/toolfactory/test-data/input1_sample
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/home/ross/galaxy/tools/tool_makers/toolfactory/test-data/input1_sample Sun Aug 23 21:02:03 2020 -0400
b
@@ -0,0 +1,166 @@
+*WARNING before you start*
+
+ Install this tool on a private Galaxy ONLY
+ Please NEVER on a public or production instance

+Updated august 2014 by John Chilton adding citation support
+
+Updated august 8 2014 to fix bugs reported by Marius van den Beek
+
+Please cite the resource at
+http://bioinformatics.oxfordjournals.org/cgi/reprint/bts573?ijkey=lczQh1sWrMwdYWJ&keytype=ref
+if you use this tool in your published work.
+
+**Short Story**
+
+This is an unusual Galaxy tool capable of generating new Galaxy tools.
+It works by exposing *unrestricted* and therefore extremely dangerous scripting
+to all designated administrators of the host Galaxy server, allowing them to
+run scripts in R, python, sh and perl over multiple selected input data sets,
+writing a single new data set as output.
+
+*You have a working r/python/perl/bash script or any executable with positional or argparse style parameters*
+
+It can be turned into an ordinary Galaxy tool in minutes, using a Galaxy tool.
+
+
+**Automated generation of new Galaxy tools for installation into any Galaxy**
+
+A test is generated using small sample test data inputs and parameter settings you supply.
+Once the test case outputs have been produced, they can be used to build a
+new Galaxy tool. The supplied script or executable is baked as a requirement
+into a new, ordinary Galaxy tool, fully workflow compatible out of the box.
+Generated tools are installed via a tool shed by an administrator
+and work exactly like all other Galaxy tools for your users.
+
+**More Detail**
+
+To use the ToolFactory, you should have prepared a script to paste into a
+text box, or have a package in mind and a small test input example ready to select from your history
+to test your new script.
+
+```planemo test rgToolFactory2.xml --galaxy_root ~/galaxy --test_data ~/galaxy/tools/tool_makers/toolfactory/test-data``` works for me
+
+There is an example in each scripting language on the Tool Factory form. You
+can just cut and paste these to try it out - remember to select the right
+interpreter please. You'll also need to create a small test data set using
+the Galaxy history add new data tool.
+
+If the script fails somehow, use the "redo" button on the tool output in
+your history to recreate the form complete with broken script. Fix the bug
+and execute again. Rinse, wash, repeat.
+
+Once the script runs sucessfully, a new Galaxy tool that runs your script
+can be generated. Select the "generate" option and supply some help text and
+names. The new tool will be generated in the form of a new Galaxy datatype
+*toolshed.gz* - as the name suggests, it's an archive ready to upload to a
+Galaxy ToolShed as a new tool repository.
+
+Once it's in a ToolShed, it can be installed into any local Galaxy server
+from the server administrative interface.
+
+Once the new tool is installed, local users can run it - each time, the script
+that was supplied when it was built will be executed with the input chosen
+from the user's history. In other words, the tools you generate with the
+ToolFactory run just like any other Galaxy tool,but run your script every time.
+
+Tool factory tools are perfect for workflow components. One input, one output,
+no variables.
+
+*To fully and safely exploit the awesome power* of this tool,
+Galaxy and the ToolShed, you should be a developer installing this
+tool on a private/personal/scratch local instance where you are an
+admin_user. Then, if you break it, you get to keep all the pieces see
+https://bitbucket.org/fubar/galaxytoolfactory/wiki/Home
+
+**Installation**
+This is a Galaxy tool. You can install it most conveniently using the
+administrative "Search and browse tool sheds" link. Find the Galaxy Main
+toolshed at https://toolshed.g2.bx.psu.edu/ and search for the toolfactory
+repository. Open it and review the code and select the option to install it.
+
+If you can't get the tool that way, the xml and py files here need to be
+copied into a new tools
+subdirectory such as tools/toolfactory Your tool_conf.xml needs a new entry
+pointing to the xml
+file - something like::
+
+  <section name="Tool building tools" id="toolbuilders">
+    <tool file="toolfactory/rgToolFactory.xml"/>
+  </section>
+
+If not already there,
+please add:
+<datatype extension="toolshed.gz" type="galaxy.datatypes.binary:Binary"
+mimetype="multipart/x-gzip" subclass="True" />
+to your local data_types_conf.xml.
+
+
+**Restricted execution**
+
+The tool factory tool itself will then be usable ONLY by admin users -
+people with IDs in admin_users in universe_wsgi.ini **Yes, that's right. ONLY
+admin_users can run this tool** Think about it for a moment. If allowed to
+run any arbitrary script on your Galaxy server, the only thing that would
+impede a miscreant bent on destroying all your Galaxy data would probably
+be lack of appropriate technical skills.
+
+**What it does** 
+
+This is a tool factory for simple scripts in python, R and
+perl currently. Functional tests are automatically generated. How cool is that.
+
+LIMITED to simple scripts that read one input from the history. Optionally can
+write one new history dataset, and optionally collect any number of outputs
+into links on an autogenerated HTML index page for the user to navigate -
+useful if the script writes images and output files - pdf outputs are shown
+as thumbnails and R's bloated pdf's are shrunk with ghostscript so that and
+imagemagik need to be available.
+
+Generated tools can be edited and enhanced like any Galaxy tool, so start
+small and build up since a generated script gets you a serious leg up to a
+more complex one.
+
+**What you do**
+
+You paste and run your script, you fix the syntax errors and
+eventually it runs. You can use the redo button and edit the script before
+trying to rerun it as you debug - it works pretty well.
+
+Once the script works on some test data, you can generate a toolshed compatible
+gzip file containing your script ready to run as an ordinary Galaxy tool in
+a repository on your local toolshed. That means safe and largely automated
+installation in any production Galaxy configured to use your toolshed.
+
+**Generated tool Security**
+
+Once you install a generated tool, it's just
+another tool - assuming the script is safe. They just run normally and their
+user cannot do anything unusually insecure but please, practice safe toolshed.
+Read the code before you install any tool. Especially this one - it is really scary.
+
+**Send Code**
+
+Patches and suggestions welcome as bitbucket issues please?
+
+**Attribution**
+
+Creating re-usable tools from scripts: The Galaxy Tool Factory
+Ross Lazarus; Antony Kaspi; Mark Ziemann; The Galaxy Team
+Bioinformatics 2012; doi: 10.1093/bioinformatics/bts573
+
+http://bioinformatics.oxfordjournals.org/cgi/reprint/bts573?ijkey=lczQh1sWrMwdYWJ&keytype=ref
+
+**Licensing**
+
+Copyright Ross Lazarus 2010
+ross lazarus at g mail period com
+
+All rights reserved.
+
+Licensed under the LGPL
+
+**Obligatory screenshot**
+
+http://bitbucket.org/fubar/galaxytoolmaker/src/fda8032fe989/images/dynamicScriptTool.png
+
b
diff -r f8700bed1e17 -r e95d9fe5ab50 home/ross/galaxy/tools/tool_makers/toolfactory/test-data/output2_sample
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/home/ross/galaxy/tools/tool_makers/toolfactory/test-data/output2_sample Sun Aug 23 21:02:03 2020 -0400
b
@@ -0,0 +1,165 @@
+*trats uoy erofeb GNINRAW*
+
+YLNO yxalaG etavirp a no loot siht llatsnI 
+ecnatsni noitcudorp ro cilbup a no REVEN esaelP 
+
+troppus noitatic gnidda notlihC nhoJ yb 4102 tsugua detadpU
+
+keeB ned nav suiraM yb detroper sgub xif ot 4102 8 tsugua detadpU
+
+ta ecruoser eht etic esaelP
+fer=epytyek&JWYdwMrWs1hQzcl=yekji?375stb/tnirper/igc/gro.slanruojdrofxo.scitamrofnioib//:ptth
+.krow dehsilbup ruoy ni loot siht esu uoy fi
+
+**yrotS trohS**
+
+.sloot yxalaG wen gnitareneg fo elbapac loot yxalaG lausunu na si sihT
+gnitpircs suoregnad ylemertxe erofereht dna *detcirtsernu* gnisopxe yb skrow tI
+ot meht gniwolla ,revres yxalaG tsoh eht fo srotartsinimda detangised lla ot
+,stes atad tupni detceles elpitlum revo lrep dna hs ,nohtyp ,R ni stpircs nur
+.tuptuo sa tes atad wen elgnis a gnitirw
+
+*sretemarap elyts esrapgra ro lanoitisop htiw elbatucexe yna ro tpircs hsab/lrep/nohtyp/r gnikrow a evah uoY*
+
+.loot yxalaG a gnisu ,setunim ni loot yxalaG yranidro na otni denrut eb nac tI
+
+
+**yxalaG yna otni noitallatsni rof sloot yxalaG wen fo noitareneg detamotuA**
+
+.ylppus uoy sgnittes retemarap dna stupni atad tset elpmas llams gnisu detareneg si tset A
+a dliub ot desu eb nac yeht ,decudorp neeb evah stuptuo esac tset eht ecnO
+tnemeriuqer a sa dekab si elbatucexe ro tpircs deilppus ehT .loot yxalaG wen
+.xob eht fo tuo elbitapmoc wolfkrow ylluf ,loot yxalaG yranidro ,wen a otni
+rotartsinimda na yb dehs loot a aiv dellatsni era sloot detareneG
+.sresu ruoy rof sloot yxalaG rehto lla ekil yltcaxe krow dna
+
+**liateD eroM**
+
+a otni etsap ot tpircs a deraperp evah dluohs uoy ,yrotcaFlooT eht esu oT
+yrotsih ruoy morf tceles ot ydaer elpmaxe tupni tset llams a dna dnim ni egakcap a evah ro ,xob txet
+.tpircs wen ruoy tset ot
+
+em rof skrow ```atad-tset/yrotcafloot/srekam_loot/sloot/yxalag/~ atad_tset-- yxalag/~ toor_yxalag-- lmx.2yrotcaFlooTgr tset omenalp```
+
+uoY .mrof yrotcaF looT eht no egaugnal gnitpircs hcae ni elpmaxe na si erehT
+thgir eht tceles ot rebmemer - tuo ti yrt ot eseht etsap dna tuc tsuj nac
+gnisu tes atad tset llams a etaerc ot deen osla ll'uoY .esaelp reterpretni
+.loot atad wen dda yrotsih yxalaG eht
+
+ni tuptuo loot eht no nottub "oder" eht esu ,wohemos sliaf tpircs eht fI
+gub eht xiF .tpircs nekorb htiw etelpmoc mrof eht etaercer ot yrotsih ruoy
+.taeper ,hsaw ,esniR .niaga etucexe dna
+
+tpircs ruoy snur taht loot yxalaG wen a ,yllufssecus snur tpircs eht ecnO
+dna txet pleh emos ylppus dna noitpo "etareneg" eht tceleS .detareneg eb nac
+epytatad yxalaG wen a fo mrof eht ni detareneg eb lliw loot wen ehT .seman
+a ot daolpu ot ydaer evihcra na s'ti ,stseggus eman eht sa - *zg.dehsloot*
+.yrotisoper loot wen a sa dehSlooT yxalaG
+
+revres yxalaG lacol yna otni dellatsni eb nac ti ,dehSlooT a ni s'ti ecnO
+.ecafretni evitartsinimda revres eht morf
+
+tpircs eht ,emit hcae - ti nur nac sresu lacol ,dellatsni si loot wen eht ecnO
+nesohc tupni eht htiw detucexe eb lliw tliub saw ti nehw deilppus saw taht
+eht htiw etareneg uoy sloot eht ,sdrow rehto nI .yrotsih s'resu eht morf
+.emit yreve tpircs ruoy nur tub,loot yxalaG rehto yna ekil tsuj nur yrotcaFlooT
+
+,tuptuo eno ,tupni enO .stnenopmoc wolfkrow rof tcefrep era sloot yrotcaf looT
+.selbairav on
+
+,loot siht fo *rewop emosewa eht tiolpxe ylefas dna ylluf oT*
+siht gnillatsni repoleved a eb dluohs uoy ,dehSlooT eht dna yxalaG
+na era uoy erehw ecnatsni lacol hctarcs/lanosrep/etavirp a no loot
+ees seceip eht lla peek ot teg uoy ,ti kaerb uoy fi ,nehT .resu_nimda
+emoH/ikiw/yrotcaflootyxalag/rabuf/gro.tekcubtib//:sptth
+
+**noitallatsnI**
+eht gnisu yltneinevnoc tsom ti llatsni nac uoY .loot yxalaG a si sihT
+niaM yxalaG eht dniF .knil "sdehs loot esworb dna hcraeS" evitartsinimda
+yrotcafloot eht rof hcraes dna /ude.usp.xb.2g.dehsloot//:sptth ta dehsloot
+.ti llatsni ot noitpo eht tceles dna edoc eht weiver dna ti nepO .yrotisoper
+
+eb ot deen ereh selif yp dna lmx eht ,yaw taht loot eht teg t'nac uoy fI
+sloot wen a otni deipoc
+yrtne wen a sdeen lmx.fnoc_loot ruoY yrotcafloot/sloot sa hcus yrotceridbus
+lmx eht ot gnitniop
+::ekil gnihtemos - elif
+
+>"sredliubloot"=di "sloot gnidliub looT"=eman noitces<  
+>/"lmx.yrotcaFlooTgr/yrotcafloot"=elif loot<    
+>noitces/<  
+
+,ereht ydaerla ton fI
+:dda esaelp
+"yraniB:yranib.sepytatad.yxalag"=epyt "zg.dehsloot"=noisnetxe epytatad<
+>/ "eurT"=ssalcbus "pizg-x/trapitlum"=epytemim
+.lmx.fnoc_sepyt_atad lacol ruoy ot
+
+
+**noitucexe detcirtseR**
+
+- sresu nimda yb YLNO elbasu eb neht lliw flesti loot yrotcaf loot ehT
+YLNO .thgir s'taht ,seY** ini.igsw_esrevinu ni sresu_nimda ni sDI htiw elpoep
+ot dewolla fI .tnemom a rof ti tuoba knihT **loot siht nur nac sresu_nimda
+dluow taht gniht ylno eht ,revres yxalaG ruoy no tpircs yrartibra yna nur
+ylbaborp dluow atad yxalaG ruoy lla gniyortsed no tneb tnaercsim a edepmi
+.slliks lacinhcet etairporppa fo kcal eb
+
+**seod ti tahW**
+
+dna R ,nohtyp ni stpircs elpmis rof yrotcaf loot a si sihT
+.taht si looc woH .detareneg yllacitamotua era stset lanoitcnuF .yltnerruc lrep
+
+nac yllanoitpO .yrotsih eht morf tupni eno daer taht stpircs elpmis ot DETIMIL
+stuptuo fo rebmun yna tcelloc yllanoitpo dna ,tesatad yrotsih wen eno etirw
+- etagivan ot resu eht rof egap xedni LMTH detarenegotua na no sknil otni
+nwohs era stuptuo fdp - selif tuptuo dna segami setirw tpircs eht fi lufesu
+dna taht os tpircstsohg htiw knurhs era s'fdp detaolb s'R dna slianbmuht sa
+.elbaliava eb ot deen kigamegami
+
+trats os ,loot yxalaG yna ekil decnahne dna detide eb nac sloot detareneG
+a ot pu gel suoires a uoy steg tpircs detareneg a ecnis pu dliub dna llams
+.eno xelpmoc erom
+
+**od uoy tahW**
+
+dna srorre xatnys eht xif uoy ,tpircs ruoy nur dna etsap uoY
+erofeb tpircs eht tide dna nottub oder eht esu nac uoY .snur ti yllautneve
+.llew ytterp skrow ti - gubed uoy sa ti nurer ot gniyrt
+
+elbitapmoc dehsloot a etareneg nac uoy ,atad tset emos no skrow tpircs eht ecnO
+ni loot yxalaG yranidro na sa nur ot ydaer tpircs ruoy gniniatnoc elif pizg
+detamotua ylegral dna efas snaem tahT .dehsloot lacol ruoy no yrotisoper a
+.dehsloot ruoy esu ot derugifnoc yxalaG noitcudorp yna ni noitallatsni
+
+**ytiruceS loot detareneG**
+
+tsuj s'ti ,loot detareneg a llatsni uoy ecnO
+rieht dna yllamron nur tsuj yehT .efas si tpircs eht gnimussa - loot rehtona
+.dehsloot efas ecitcarp ,esaelp tub erucesni yllausunu gnihtyna od tonnac resu
+.yracs yllaer si ti - eno siht yllaicepsE .loot yna llatsni uoy erofeb edoc eht daeR
+
+**edoC dneS**
+
+?esaelp seussi tekcubtib sa emoclew snoitseggus dna sehctaP
+
+**noitubirttA**
+
+yrotcaF looT yxalaG ehT :stpircs morf sloot elbasu-er gnitaerC
+maeT yxalaG ehT ;nnameiZ kraM ;ipsaK ynotnA ;surazaL ssoR
+375stb/scitamrofnioib/3901.01 :iod ;2102 scitamrofnioiB
+
+fer=epytyek&JWYdwMrWs1hQzcl=yekji?375stb/tnirper/igc/gro.slanruojdrofxo.scitamrofnioib//:ptth
+
+**gnisneciL**
+
+0102 surazaL ssoR thgirypoC
+moc doirep liam g ta surazal ssor
+
+.devreser sthgir llA
+
+LPGL eht rednu desneciL
+
+**tohsneercs yrotagilbO**
+
+gnp.looTtpircScimanyd/segami/989ef2308adf/crs/rekamlootyxalag/rabuf/gro.tekcubtib//:ptth
b
diff -r f8700bed1e17 -r e95d9fe5ab50 home/ross/galaxy/tools/tool_makers/toolfactory/test-data/pyrevpos.python
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/home/ross/galaxy/tools/tool_makers/toolfactory/test-data/pyrevpos.python Sun Aug 23 21:02:03 2020 -0400
[
@@ -0,0 +1,13 @@
+# reverse order of text by row
+import sys
+inp = sys.argv[1]
+outp = sys.argv[2]
+i = open(inp,'r').readlines()
+o = open(outp,'w')
+for row in i:
+   rs = row.rstrip()
+   rs = list(rs)
+   rs.reverse()
+   o.write(''.join(rs))
+o.close() 
+
b
diff -r f8700bed1e17 -r e95d9fe5ab50 home/ross/galaxy/tools/tool_makers/toolfactory/test-data/test1_log.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/home/ross/galaxy/tools/tool_makers/toolfactory/test-data/test1_log.txt Sun Aug 23 21:02:03 2020 -0400
b
@@ -0,0 +1,1 @@
+## Executing Toolfactory generated command line = python /tmp/pyrevposq5dmcdy1.python /tmp/tmpqrksf8sd/files/5/b/9/dataset_5b952a86-87df-44ad-a415-ea549f3f0cee.dat output2
b
diff -r f8700bed1e17 -r e95d9fe5ab50 home/ross/galaxy/tools/tool_makers/toolfactory/test-data/toolfactory_pyrevpos_tgz_sample
b
Binary file home/ross/galaxy/tools/tool_makers/toolfactory/test-data/toolfactory_pyrevpos_tgz_sample has changed
b
diff -r f8700bed1e17 -r e95d9fe5ab50 toolfactory/.github/workflows/commit.yml
--- a/toolfactory/.github/workflows/commit.yml Tue Aug 18 08:25:43 2020 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
[
@@ -1,68 +0,0 @@
-name: Galaxy Tool Linting and Tests for PR
-# run planemo on a git repository containing a single tool
-# as a github action. Does NOT run flake8. So, bite me.
-# ross lazarus august 2020
-on: [pull_request,push]
-env:
-  GALAXY_REPO: https://github.com/galaxyproject/galaxy
-  GALAXY_RELEASE: release_20.05
-jobs:
-  setup:
-    name: setup environment and python
-    runs-on: ubuntu-latest
-    strategy:
-      matrix:
-        python-version: [3.7]
-    steps:
-    - name: Print github context properties
-      run: |
-        echo 'event: ${{ github.event_name }}'
-        echo 'sha: ${{ github.sha }}'
-        echo 'ref: ${{ github.ref }}'
-        echo 'head_ref: ${{ github.head_ref }}'
-        echo 'base_ref: ${{ github.base_ref }}'
-        echo 'event.before: ${{ github.event.before }}'
-        echo 'event.after: ${{ github.event.after }}'
-    - uses: actions/setup-python@v1
-      with:
-        python-version: ${{ matrix.python-version }}
-    - uses: actions/checkout@v2
-      with:
-    # planemo does not seem to want to install the requirement galaxyxml 
-    # into the venv it manages at tool testing so do it the old skool way
-        repository: 'galaxyproject/galaxy'
-        path: 'galaxy'
-    - name: make venv ready for this galaxy and planemo 
-      run:  |
-        python3 -m venv $GITHUB_WORKSPACE/galaxy/.venv
-        . $GITHUB_WORKSPACE/galaxy/.venv/bin/activate
-        pip install --upgrade pip
-        pip install wheel
-        pip install -r $GITHUB_WORKSPACE/galaxy/requirements.txt
-        # pip install galaxyxml # currently includes a patched working version awaiting PR merge
-    - name: Upgrade pip
-      run: pip install --upgrade pip
-    # Install the `wheel` package so that when installing other packages which
-    # are not available as wheels, pip will build a wheel for them, which can be cached.
-    - name: Install wheel
-      run: pip install wheel
-    - name: Install Planemo and flake8
-      run: pip install planemo flake8 flake8-import-order
-    # galaxyxml temporarily removed until PR accepted
-    - uses: actions/checkout@v2
-      with:
-        fetch-depth: 1
-    - name: flake8
-      run: flake8 --ignore=E2,E3,E4,E5,W3,W505
-    - name: Planemo lint
-      run: planemo lint .
-    - name: Planemo test tool
-      run: planemo test --galaxy_root $GITHUB_WORKSPACE/galaxy --test_output tool_test_output.html --skip_venv --test_output_json tool_test_output.json --galaxy_python_version ${{ matrix.python-version }}  .
-    - name: Copy artifacts into place
-      run: |
-        mkdir upload
-        mv tool_test_output.json tool_test_output.html upload/
-    - uses: actions/upload-artifact@v2.0.1
-      with:
-        name: 'All tool test results'
-        path: upload
b
diff -r f8700bed1e17 -r e95d9fe5ab50 toolfactory/.gitignore
--- a/toolfactory/.gitignore Tue Aug 18 08:25:43 2020 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
[
@@ -1,129 +0,0 @@
-# Byte-compiled / optimized / DLL files
-__pycache__/
-*.py[cod]
-*$py.class
-
-# C extensions
-*.so
-
-# Distribution / packaging
-.Python
-build/
-develop-eggs/
-dist/
-downloads/
-eggs/
-.eggs/
-lib/
-lib64/
-parts/
-sdist/
-var/
-wheels/
-pip-wheel-metadata/
-share/python-wheels/
-*.egg-info/
-.installed.cfg
-*.egg
-MANIFEST
-
-# PyInstaller
-#  Usually these files are written by a python script from a template
-#  before PyInstaller builds the exe, so as to inject date/other infos into it.
-*.manifest
-*.spec
-
-# Installer logs
-pip-log.txt
-pip-delete-this-directory.txt
-
-# Unit test / coverage reports
-htmlcov/
-.tox/
-.nox/
-.coverage
-.coverage.*
-.cache
-nosetests.xml
-coverage.xml
-*.cover
-*.py,cover
-.hypothesis/
-.pytest_cache/
-
-# Translations
-*.mo
-*.pot
-
-# Django stuff:
-*.log
-local_settings.py
-db.sqlite3
-db.sqlite3-journal
-
-# Flask stuff:
-instance/
-.webassets-cache
-
-# Scrapy stuff:
-.scrapy
-
-# Sphinx documentation
-docs/_build/
-
-# PyBuilder
-target/
-
-# Jupyter Notebook
-.ipynb_checkpoints
-
-# IPython
-profile_default/
-ipython_config.py
-
-# pyenv
-.python-version
-
-# pipenv
-#   According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
-#   However, in case of collaboration, if having platform-specific dependencies or dependencies
-#   having no cross-platform support, pipenv may install dependencies that don't work, or not
-#   install all needed dependencies.
-#Pipfile.lock
-
-# PEP 582; used by e.g. github.com/David-OConnor/pyflow
-__pypackages__/
-
-# Celery stuff
-celerybeat-schedule
-celerybeat.pid
-
-# SageMath parsed files
-*.sage.py
-
-# Environments
-.env
-.venv
-env/
-venv/
-ENV/
-env.bak/
-venv.bak/
-
-# Spyder project settings
-.spyderproject
-.spyproject
-
-# Rope project settings
-.ropeproject
-
-# mkdocs documentation
-/site
-
-# mypy
-.mypy_cache/
-.dmypy.json
-dmypy.json
-
-# Pyre type checker
-.pyre/
b
diff -r f8700bed1e17 -r e95d9fe5ab50 toolfactory/.shed.yml
--- a/toolfactory/.shed.yml Tue Aug 18 08:25:43 2020 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
b
@@ -1,13 +0,0 @@
-name: toolfactory
-owner: fubar
-description: ToolFactory - tool to make Galaxy tools ready for the toolshed
-homepage_url: https://github.com/fubar2/toolfactory
-long_description: |
-    ToolFactory - turn executable packages and R/python/perl/bash scripts into ordinary Galaxy tools
-
-    Creating re-usable tools from scripts: The Galaxy Tool Factory Ross Lazarus; Antony Kaspi; Mark Ziemann; The Galaxy Team 
-    Bioinformatics 2012; doi: 10.1093/bioinformatics/bts573
-remote_repository_url: https://github.com/fubar2/toolfactory
-type: tool_dependency_definition
-categories:
-- Tool Generators
b
diff -r f8700bed1e17 -r e95d9fe5ab50 toolfactory/LICENSE
--- a/toolfactory/LICENSE Tue Aug 18 08:25:43 2020 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
b
b"@@ -1,504 +0,0 @@\n-GNU LESSER GENERAL PUBLIC LICENSE\n-                       Version 2.1, February 1999\n-\n- Copyright (C) 1991, 1999 Free Software Foundation, Inc.\n- 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n- Everyone is permitted to copy and distribute verbatim copies\n- of this license document, but changing it is not allowed.\n-\n-(This is the first released version of the Lesser GPL.  It also counts\n- as the successor of the GNU Library Public License, version 2, hence\n- the version number 2.1.)\n-\n-                            Preamble\n-\n-  The licenses for most software are designed to take away your\n-freedom to share and change it.  By contrast, the GNU General Public\n-Licenses are intended to guarantee your freedom to share and change\n-free software--to make sure the software is free for all its users.\n-\n-  This license, the Lesser General Public License, applies to some\n-specially designated software packages--typically libraries--of the\n-Free Software Foundation and other authors who decide to use it.  You\n-can use it too, but we suggest you first think carefully about whether\n-this license or the ordinary General Public License is the better\n-strategy to use in any particular case, based on the explanations below.\n-\n-  When we speak of free software, we are referring to freedom of use,\n-not price.  Our General Public Licenses are designed to make sure that\n-you have the freedom to distribute copies of free software (and charge\n-for this service if you wish); that you receive source code or can get\n-it if you want it; that you can change the software and use pieces of\n-it in new free programs; and that you are informed that you can do\n-these things.\n-\n-  To protect your rights, we need to make restrictions that forbid\n-distributors to deny you these rights or to ask you to surrender these\n-rights.  These restrictions translate to certain responsibilities for\n-you if you distribute copies of the library or if you modify it.\n-\n-  For example, if you distribute copies of the library, whether gratis\n-or for a fee, you must give the recipients all the rights that we gave\n-you.  You must make sure that they, too, receive or can get the source\n-code.  If you link other code with the library, you must provide\n-complete object files to the recipients, so that they can relink them\n-with the library after making changes to the library and recompiling\n-it.  And you must show them these terms so they know their rights.\n-\n-  We protect your rights with a two-step method: (1) we copyright the\n-library, and (2) we offer you this license, which gives you legal\n-permission to copy, distribute and/or modify the library.\n-\n-  To protect each distributor, we want to make it very clear that\n-there is no warranty for the free library.  Also, if the library is\n-modified by someone else and passed on, the recipients should know\n-that what they have is not the original version, so that the original\n-author's reputation will not be affected by problems that might be\n-introduced by others.\n-\n-  Finally, software patents pose a constant threat to the existence of\n-any free program.  We wish to make sure that a company cannot\n-effectively restrict the users of a free program by obtaining a\n-restrictive license from a patent holder.  Therefore, we insist that\n-any patent license obtained for a version of the library must be\n-consistent with the full freedom of use specified in this license.\n-\n-  Most GNU software, including some libraries, is covered by the\n-ordinary GNU General Public License.  This license, the GNU Lesser\n-General Public License, applies to certain designated libraries, and\n-is quite different from the ordinary General Public License.  We use\n-this license for certain libraries in order to permit linking those\n-libraries into non-free programs.\n-\n-  When a program is linked with a library, whether statically or using\n-a shared library, the combination of the two is legally speaking a\n-combined work, a derivative "..b'oes not specify a\n-license version number, you may choose any version ever published by\n-the Free Software Foundation.\n-\n-  14. If you wish to incorporate parts of the Library into other free\n-programs whose distribution conditions are incompatible with these,\n-write to the author to ask for permission.  For software which is\n-copyrighted by the Free Software Foundation, write to the Free\n-Software Foundation; we sometimes make exceptions for this.  Our\n-decision will be guided by the two goals of preserving the free status\n-of all derivatives of our free software and of promoting the sharing\n-and reuse of software generally.\n-\n-                            NO WARRANTY\n-\n-  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO\n-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.\n-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR\n-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY\n-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE\n-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE\n-LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME\n-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n-\n-  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN\n-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY\n-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU\n-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR\n-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE\n-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING\n-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A\n-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF\n-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\n-DAMAGES.\n-\n-                     END OF TERMS AND CONDITIONS\n-\n-           How to Apply These Terms to Your New Libraries\n-\n-  If you develop a new library, and you want it to be of the greatest\n-possible use to the public, we recommend making it free software that\n-everyone can redistribute and change.  You can do so by permitting\n-redistribution under these terms (or, alternatively, under the terms of the\n-ordinary General Public License).\n-\n-  To apply these terms, attach the following notices to the library.  It is\n-safest to attach them to the start of each source file to most effectively\n-convey the exclusion of warranty; and each file should have at least the\n-"copyright" line and a pointer to where the full notice is found.\n-\n-    {description}\n-    Copyright (C) {year} {fullname}\n-\n-    This library is free software; you can redistribute it and/or\n-    modify it under the terms of the GNU Lesser General Public\n-    License as published by the Free Software Foundation; either\n-    version 2.1 of the License, or (at your option) any later version.\n-\n-    This library is distributed in the hope that it will be useful,\n-    but WITHOUT ANY WARRANTY; without even the implied warranty of\n-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n-    Lesser General Public License for more details.\n-\n-    You should have received a copy of the GNU Lesser General Public\n-    License along with this library; if not, write to the Free Software\n-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301\n-    USA\n-\n-Also add information on how to contact you by electronic and paper mail.\n-\n-You should also get your employer (if you work as a programmer) or your\n-school, if any, to sign a "copyright disclaimer" for the library, if\n-necessary.  Here is a sample; alter the names:\n-\n-  Yoyodyne, Inc., hereby disclaims all copyright interest in the\n-  library `Frob\' (a library for tweaking knobs) written by James Random\n-  Hacker.\n-\n-  {signature of Ty Coon}, 1 April 1990\n-  Ty Coon, President of Vice\n-\n-That\'s all there is to it!\n'
b
diff -r f8700bed1e17 -r e95d9fe5ab50 toolfactory/README.md
--- a/toolfactory/README.md Tue Aug 18 08:25:43 2020 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
b
@@ -1,165 +0,0 @@
-Note as at August 8 2020
-
-
-*WARNING before you start*
-
- Install this tool on a private Galaxy ONLY
- Please NEVER on a public or production instance

-Please cite the resource at
-http://bioinformatics.oxfordjournals.org/cgi/reprint/bts573?ijkey=lczQh1sWrMwdYWJ&keytype=ref
-if you use this tool in your published work.
-
-**Short Story**
-
-This is an unusual Galaxy tool capable of generating new Galaxy tools.
-It works by exposing *unrestricted* and therefore extremely dangerous scripting
-to all designated administrators of the host Galaxy server, allowing them to
-run scripts in R, python, sh and perl over multiple selected input data sets,
-writing a single new data set as output.
-
-*You have a working r/python/perl/bash script or any executable with positional or argparse style parameters*
-
-It can be turned into an ordinary Galaxy tool in minutes, using a Galaxy tool.
-
-**Automated generation of new Galaxy tools for installation into any Galaxy**
-
-A test is generated using small sample test data inputs and parameter settings you supply.
-Once the test case outputs have been produced, they can be used to build a
-new Galaxy tool. The supplied script or executable is baked as a requirement
-into a new, ordinary Galaxy tool, fully workflow compatible out of the box.
-Generated tools are installed via a tool shed by an administrator
-and work exactly like all other Galaxy tools for your users.
-
-**More Detail**
-
-To use the ToolFactory, you should have prepared a script to paste into a
-text box, or have a package in mind and a small test input example ready to select from your history
-to test your new script.
-
-```planemo test --no_cleanup --no_dependency_resolution --skip_venv --galaxy_root ~/galaxy ~/rossgit/toolfactory``` works for me
-
-There is an example in each scripting language on the Tool Factory form. You
-can just cut and paste these to try it out - remember to select the right
-interpreter please. You'll also need to create a small test data set using
-the Galaxy history add new data tool.
-
-If the script fails somehow, use the "redo" button on the tool output in
-your history to recreate the form complete with broken script. Fix the bug
-and execute again. Rinse, wash, repeat.
-
-Once the script runs sucessfully, a new Galaxy tool that runs your script
-can be generated. Select the "generate" option and supply some help text and
-names. The new tool will be generated in the form of a new Galaxy datatype
-*tgz* - as the name suggests, it's an archive ready to upload to a
-Galaxy ToolShed as a new tool repository.
-
-
-Once it's in a ToolShed, it can be installed into any local Galaxy server
-from the server administrative interface.
-
-Once the new tool is installed, local users can run it - each time, the script
-that was supplied when it was built will be executed with the input chosen
-from the user's history. In other words, the tools you generate with the
-ToolFactory run just like any other Galaxy tool,but run your script every time.
-
-Tool factory tools are perfect for workflow components. One input, one output,
-no variables.
-
-*To fully and safely exploit the awesome power* of this tool,
-Galaxy and the ToolShed, you should be a developer installing this
-tool on a private/personal/scratch local instance where you are an
-admin_user. Then, if you break it, you get to keep all the pieces see
-https://bitbucket.org/fubar/galaxytoolfactory/wiki/Home
-
-**Installation**
-This is a Galaxy tool. You can install it most conveniently using the
-administrative "Search and browse tool sheds" link. Find the Galaxy Main
-toolshed at https://toolshed.g2.bx.psu.edu/ and search for the toolfactory
-repository. Open it and review the code and select the option to install it.
-
-If you can't get the tool that way, the xml and py files here need to be
-copied into a new tools
-subdirectory such as tools/toolfactory Your tool_conf.xml needs a new entry
-pointing to the xml
-file - something like::
-
-  <section name="Tool building tools" id="toolbuilders">
-    <tool file="toolfactory/rgToolFactory.xml"/>
-  </section>
-
-If not already there,
-please add:
-<datatype extension="toolshed.gz" type="galaxy.datatypes.binary:Binary"
-mimetype="multipart/x-gzip" subclass="True" />
-to your local data_types_conf.xml.
-
-
-**Restricted execution**
-
-The tool factory tool itself will then be usable ONLY by admin users -
-people with IDs in admin_users in universe_wsgi.ini **Yes, that's right. ONLY
-admin_users can run this tool** Think about it for a moment. If allowed to
-run any arbitrary script on your Galaxy server, the only thing that would
-impede a miscreant bent on destroying all your Galaxy data would probably
-be lack of appropriate technical skills.
-
-**What it does** 
-
-This is a tool factory for simple scripts in python, R and
-perl currently. Functional tests are automatically generated. 
-
-LIMITED to simple scripts that read one input from the history. Optionally can
-write one new history dataset, and optionally collect any number of outputs
-into links on an autogenerated HTML index page for the user to navigate -
-useful if the script writes images and output files - pdf outputs are shown
-as thumbnails and R's bloated pdf's are shrunk with ghostscript so that and
-imagemagik need to be available.
-
-Generated tools can be edited and enhanced like any Galaxy tool, so start
-small and build up since a generated script gets you a serious leg up to a
-more complex one.
-
-**What you do**
-
-You paste and run your script, you fix the syntax errors and
-eventually it runs. You can use the redo button and edit the script before
-trying to rerun it as you debug - it works pretty well.
-
-Once the script works on some test data, you can generate a toolshed compatible
-gzip file containing your script ready to run as an ordinary Galaxy tool in
-a repository on your local toolshed. That means safe and largely automated
-installation in any production Galaxy configured to use your toolshed.
-
-**Generated tool Security**
-
-Once you install a generated tool, it's just
-another tool - assuming the script is safe. They just run normally and their
-user cannot do anything unusually insecure but please, practice safe toolshed.
-Read the code before you install any tool. Especially this one - it is really scary.
-
-**Send Code**
-
-Patches and suggestions welcome as bitbucket issues please?
-
-**Attribution**
-
-Creating re-usable tools from scripts: The Galaxy Tool Factory
-Ross Lazarus; Antony Kaspi; Mark Ziemann; The Galaxy Team
-Bioinformatics 2012; doi: 10.1093/bioinformatics/bts573
-
-http://bioinformatics.oxfordjournals.org/cgi/reprint/bts573?ijkey=lczQh1sWrMwdYWJ&keytype=ref
-
-**Licensing**
-
-Copyright Ross Lazarus 2010
-ross lazarus at g mail period com
-
-All rights reserved.
-
-Licensed under the LGPL
-
-**Obligatory screenshot**
-
-http://bitbucket.org/fubar/galaxytoolmaker/src/fda8032fe989/images/dynamicScriptTool.png
-
b
diff -r f8700bed1e17 -r e95d9fe5ab50 toolfactory/docker/Dockerfile
--- a/toolfactory/docker/Dockerfile Tue Aug 18 08:25:43 2020 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
[
@@ -1,52 +0,0 @@
-# Galaxy - Toolshed Docker image
-# Derived from bgruening stable galaxy 
-# VERSION       0.2
-# patches startup so the below will install a workflow dropped into $GALAXY_ROOT/workflows
-# use docker run -p 8080:80  -d -e GALAXY_AUTO_UPDATE_WORKFLOWS=/galaxy-central/workflows/TF_sample_wf.ga -v /home/ubuntu/galaxy_storage/:/export/  toolfactory
-FROM quay.io/bgruening/galaxy:20.05
-MAINTAINER Ross Lazarus ross.lazarus@gmail.com
-
-ENV GALAXY_CONFIG_BRAND=ToolFactory
-ENV GALAXY_LOGGING="full"
-ADD tfwelcome.html /export/welcome.html
-# RUN add-tool-shed --url 'http://testtoolshed.g2.bx.psu.edu/' --name 'Test Tool Shed'
-RUN mkdir -p /tftools \
-  && mkdir -p /tftools/toolfactory \
-  && mkdir -p /tftools/planemo_test
-
-ADD ./tftools/toolfactory /tftools/toolfactory
-ADD ./tftools/tf_tool_conf.xml /tftools/tf_tool_conf.xml
-ADD ./tftools/planemo_test /tftools/planemo_test
-ADD TF_example_wf.ga /tftools/TF_example_wf.ga
-
-ADD my_tool_list.yml /tftools/toolfactory_tools.yaml
-
-ENV GALAXY_AUTO_UPDATE_TOOLS=/tftools/toolfactory_tools.yaml
-# NOTE above does work but takes 1-2 minutes
-
-# ENV GALAXY_CONFIG_TOOL_CONFIG_FILE=config/tool_conf.xml.sample,config/tf_tool_conf.xml,config/shed_tool_conf.xml.sample
-#ENV GALAXY_CONFIG_TOOL_CONFIG_FILE=/tftools/tf_tool_conf.xml,config/tool_conf.xml.sample
-# works but does not install dependencies
-# Add workflows to the Docker image
-
-ENV $GALAXY_DEFAULT_ADMIN_USER="admin"
-# ensure triggering post-start-actions.sh
-
-ADD tftools/datatypes_conf.xml $GALAXY_ROOT/conf/datatypes_conf.xml.sample
-ADD post-start-actions.sh /export/post-start-actions.sh
-ADD post-start-actions.sh $GALAXY_ROOT/config/post-start-actions.sh
-
-RUN chmod a+xr /export/post-start-actions.sh \
- && chmod a+xr /tftools/TF_example_wf.ga \
- && chmod a+xr $GALAXY_ROOT/config/post-start-actions.sh
-# Add Galaxy interactive tours
-# ADD ./rna-workbench-tours/* $GALAXY_ROOT/config/plugins/tours/
-# Add data library definition file
-# ADD library_data.yaml $GALAXY_ROOT/library_data.yaml
-
-VOLUME ["/export/", "/data/", "/var/lib/docker"]
-EXPOSE :80
-EXPOSE :21
-EXPOSE :8800
-
-CMD ["/usr/bin/startup"]
b
diff -r f8700bed1e17 -r e95d9fe5ab50 toolfactory/docker/TF_example_wf.ga
--- a/toolfactory/docker/TF_example_wf.ga Tue Aug 18 08:25:43 2020 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
[
b'@@ -1,458 +0,0 @@\n-{\n-    "a_galaxy_workflow": "true",\n-    "annotation": "",\n-    "format-version": "0.1",\n-    "name": "TF examples",\n-    "steps": {\n-        "0": {\n-            "annotation": "a fasta file - gc ratio will be estimated",\n-            "content_id": null,\n-            "errors": null,\n-            "id": 0,\n-            "input_connections": {},\n-            "inputs": [\n-                {\n-                    "description": "a fasta file - gc ratio will be estimated",\n-                    "name": "phiX.fasta"\n-                }\n-            ],\n-            "label": "phiX.fasta",\n-            "name": "Input dataset",\n-            "outputs": [],\n-            "position": {\n-                "bottom": 231,\n-                "height": 61,\n-                "left": 393,\n-                "right": 593,\n-                "top": 170,\n-                "width": 200,\n-                "x": 393,\n-                "y": 170\n-            },\n-            "tool_id": null,\n-            "tool_state": "{\\"optional\\": false}",\n-            "tool_version": null,\n-            "type": "data_input",\n-            "uuid": "7e2e24c8-2327-4893-a5b3-6b696a6ecd33",\n-            "workflow_outputs": [\n-                {\n-                    "label": null,\n-                    "output_name": "output",\n-                    "uuid": "f5ce2386-b80c-4691-a0a7-abeec8854461"\n-                }\n-            ]\n-        },\n-        "1": {\n-            "annotation": "Any text file to be reversed lots of times and bjorked once.",\n-            "content_id": null,\n-            "errors": null,\n-            "id": 1,\n-            "input_connections": {},\n-            "inputs": [\n-                {\n-                    "description": "Any text file to be reversed lots of times and bjorked once.",\n-                    "name": "rgToolFactory2.py"\n-                }\n-            ],\n-            "label": "rgToolFactory2.py",\n-            "name": "Input dataset",\n-            "outputs": [],\n-            "position": {\n-                "bottom": 371,\n-                "height": 81,\n-                "left": 393,\n-                "right": 593,\n-                "top": 290,\n-                "width": 200,\n-                "x": 393,\n-                "y": 290\n-            },\n-            "tool_id": null,\n-            "tool_state": "{\\"optional\\": false}",\n-            "tool_version": null,\n-            "type": "data_input",\n-            "uuid": "f530b390-2424-4aae-8bd9-dd9d30277561",\n-            "workflow_outputs": [\n-                {\n-                    "label": null,\n-                    "output_name": "output",\n-                    "uuid": "3d2a1699-50af-46e1-8981-dc6c3de2cf6c"\n-                }\n-            ]\n-        },\n-        "2": {\n-            "annotation": "",\n-            "content_id": "rgTF2",\n-            "errors": null,\n-            "id": 2,\n-            "input_connections": {\n-                "ppass|history_inputs_0|input_files": {\n-                    "id": 0,\n-                    "output_name": "output"\n-                }\n-            },\n-            "inputs": [],\n-            "label": null,\n-            "name": "toolfactory",\n-            "outputs": [\n-                {\n-                    "name": "TF_run_report",\n-                    "type": "input"\n-                },\n-                {\n-                    "name": "new_tool",\n-                    "type": "tgz"\n-                }\n-            ],\n-            "position": {\n-                "bottom": 372,\n-                "height": 202,\n-                "left": 613,\n-                "right": 813,\n-                "top": 170,\n-                "width": 200,\n-                "x": 613,\n-                "y": 170\n-            },\n-            "post_job_actions": {},\n-            "tool_id": "rgTF2",\n-            "tool_state": "{\\"__input_ext\\": \\"input\\", \\"chromInfo\\": \\"/home/ross/galaxy/tool-data/shared/ucsc/chrom/?.len\\", \\"interexe\\": {\\"interpreter\\": \\"perl\\", \\"__current_case__\\": 4, \\"interpreter_version\\": \\"\\'..b'\n-                "height": 242,\n-                "left": 833,\n-                "right": 1033,\n-                "top": 170,\n-                "width": 200,\n-                "x": 833,\n-                "y": 170\n-            },\n-            "post_job_actions": {},\n-            "tool_id": "rgTF2",\n-            "tool_state": "{\\"__input_ext\\": \\"input\\", \\"chromInfo\\": \\"/home/ross/galaxy/tool-data/shared/ucsc/chrom/?.len\\", \\"interexe\\": {\\"interpreter\\": \\"python\\", \\"__current_case__\\": 2, \\"interpreter_version\\": \\"\\", \\"exe_package_version\\": \\"\\", \\"dynScript\\": \\"import argparse\\\\nimport tarfile\\\\nimport os\\\\nimport tempfile\\\\nimport subprocess\\\\n\\\\n\\\\\\"\\\\\\"\\\\\\"\\\\nplanemo test --no_cleanup --no_dependency_resolution --skip_venv --galaxy_root ~/galaxy ~/galaxy/tools/tool_makers/pyrevargparse/ &> pyrevargparse\\\\n\\\\\\"\\\\\\"\\\\\\"\\\\n\\\\nparser = argparse.ArgumentParser()\\\\na = parser.add_argument\\\\na(\'--tooltgz\',default=\'\')\\\\na(\'--report\',default=None)\\\\na(\'--toolout\',default=None)\\\\na(\'--galaxy_root\',default=None)\\\\nargs = parser.parse_args()\\\\ntoolname = args.toolout.split(os.sep)[-1]\\\\ntoolpath = os.path.join(args.galaxy_root,args.toolout)\\\\ntf = tarfile.open(args.tooltgz,\\\\\\"r:gz\\\\\\")\\\\ntf.extractall(toolpath)\\\\ncl = \\\\\\"planemo test --skip_venv --galaxy_root %s %s\\\\\\" % (args.galaxy_root,toolpath)\\\\ncll = cl.split(\' \')\\\\nsto = open(args.report, \'w\')\\\\np = subprocess.run(cll, shell=False, stdout=sto)\\\\nretval = p.returncode\\\\nsto.close()\\\\n\\"}, \\"makeMode\\": {\\"make_Tool\\": \\"yes\\", \\"__current_case__\\": 0, \\"tool_version\\": \\"0.01\\", \\"tool_desc\\": \\"Tool to test toolshed tool archives generated by the tool factory.\\", \\"help_text\\": \\"**What it Does**\\\\n\\\\nGiven a toolshed tgz file generated by a tool factory run, this will unpack it and run planemo test, returning the planemo stdout as a report\\\\nIt was generated using the tool factory.\\", \\"citations\\": []}, \\"ppass\\": {\\"parampass\\": \\"argparse\\", \\"__current_case__\\": 0, \\"history_inputs\\": [{\\"__index__\\": 0, \\"input_files\\": {\\"__class__\\": \\"ConnectedValue\\"}, \\"input_formats\\": [\\"tgz\\"], \\"input_label\\": \\"tool toolshed tgz archive from history\\", \\"input_help\\": \\"Run planemo test on a tool shed tool archive tgz format file generated by the ToolFactory or Planemo\\", \\"input_CL\\": \\"tooltgz\\"}], \\"history_outputs\\": [{\\"__index__\\": 0, \\"history_name\\": \\"report\\", \\"history_format\\": \\"txt\\", \\"history_CL\\": \\"report\\"}], \\"edit_params\\": \\"yes\\", \\"additional_parameters\\": [{\\"__index__\\": 0, \\"param_name\\": \\"toolout\\", \\"param_type\\": \\"text\\", \\"param_value\\": \\"tools/toolmakers/planemotest\\", \\"param_label\\": \\"output path under galaxy root\\", \\"param_help\\": \\"This is where the tgz file will be extracted and tested by planemo\\", \\"param_CL\\": \\"toolout\\", \\"param_CLprefixed\\": \\"\\"}, {\\"__index__\\": 1, \\"param_name\\": \\"galaxy_root\\", \\"param_type\\": \\"text\\", \\"param_value\\": \\"/home/ross/galaxy\\", \\"param_label\\": \\"Galaxy source root directory to use for running planemo\\", \\"param_help\\": \\"This will form the galaxy_root parameter for rnning planemo using an existing Galaxy source tree, and the tgz will be extracted at a path relative to that rootu\\", \\"param_CL\\": \\"galaxy_root\\", \\"param_CLprefixed\\": \\"\\"}]}, \\"tool_name\\": \\"planemotest\\", \\"__page__\\": null, \\"__rerun_remap_job_id__\\": null}",\n-            "tool_version": "2.00",\n-            "type": "tool",\n-            "uuid": "b9bfb1a4-4c0c-4d39-9e74-223da72f8abc",\n-            "workflow_outputs": [\n-                {\n-                    "label": null,\n-                    "output_name": "TF_run_report",\n-                    "uuid": "09ba44ea-4da8-46f5-a411-ca054ccedd3b"\n-                },\n-                {\n-                    "label": null,\n-                    "output_name": "new_tool",\n-                    "uuid": "50a8ff4a-702a-4983-8202-8a79c0a3c978"\n-                }\n-            ]\n-        }\n-    },\n-    "tags": [],\n-    "uuid": "321a7f9f-c287-453c-807a-43afd948770e",\n-    "version": 1\n-}\n'
b
diff -r f8700bed1e17 -r e95d9fe5ab50 toolfactory/docker/TF_example_wf2.ga
--- a/toolfactory/docker/TF_example_wf2.ga Tue Aug 18 08:25:43 2020 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
[
b'@@ -1,500 +0,0 @@\n-{\n-    "a_galaxy_workflow": "true",\n-    "annotation": "",\n-    "format-version": "0.1",\n-    "name": "TF examples (imported from uploaded file)",\n-    "steps": {\n-        "0": {\n-            "annotation": "a fasta file - gc ratio will be estimated",\n-            "content_id": null,\n-            "errors": null,\n-            "id": 0,\n-            "input_connections": {},\n-            "inputs": [\n-                {\n-                    "description": "a fasta file - gc ratio will be estimated",\n-                    "name": "phiX.fasta"\n-                }\n-            ],\n-            "label": "phiX.fasta",\n-            "name": "Input dataset",\n-            "outputs": [],\n-            "position": {\n-                "bottom": 231,\n-                "height": 61,\n-                "left": 393,\n-                "right": 593,\n-                "top": 170,\n-                "width": 200,\n-                "x": 393,\n-                "y": 170\n-            },\n-            "tool_id": null,\n-            "tool_state": "{\\"optional\\": false}",\n-            "tool_version": null,\n-            "type": "data_input",\n-            "uuid": "7e2e24c8-2327-4893-a5b3-6b696a6ecd33",\n-            "workflow_outputs": [\n-                {\n-                    "label": null,\n-                    "output_name": "output",\n-                    "uuid": "f5ce2386-b80c-4691-a0a7-abeec8854461"\n-                }\n-            ]\n-        },\n-        "1": {\n-            "annotation": "Any text file to be reversed lots of times and bjorked once.",\n-            "content_id": null,\n-            "errors": null,\n-            "id": 1,\n-            "input_connections": {},\n-            "inputs": [\n-                {\n-                    "description": "Any text file to be reversed lots of times and bjorked once.",\n-                    "name": "rgToolFactory2.py"\n-                }\n-            ],\n-            "label": "rgToolFactory2.py",\n-            "name": "Input dataset",\n-            "outputs": [],\n-            "position": {\n-                "bottom": 371,\n-                "height": 81,\n-                "left": 393,\n-                "right": 593,\n-                "top": 290,\n-                "width": 200,\n-                "x": 393,\n-                "y": 290\n-            },\n-            "tool_id": null,\n-            "tool_state": "{\\"optional\\": false}",\n-            "tool_version": null,\n-            "type": "data_input",\n-            "uuid": "f530b390-2424-4aae-8bd9-dd9d30277561",\n-            "workflow_outputs": [\n-                {\n-                    "label": null,\n-                    "output_name": "output",\n-                    "uuid": "3d2a1699-50af-46e1-8981-dc6c3de2cf6c"\n-                }\n-            ]\n-        },\n-        "2": {\n-            "annotation": "",\n-            "content_id": "toolshed.g2.bx.psu.edu/repos/fubar/tool_factory_2/rgTF2/2.00",\n-            "errors": null,\n-            "id": 2,\n-            "input_connections": {\n-                "ppass|history_inputs_0|input_files": {\n-                    "id": 0,\n-                    "output_name": "output"\n-                }\n-            },\n-            "inputs": [],\n-            "label": null,\n-            "name": "toolfactory",\n-            "outputs": [\n-                {\n-                    "name": "TF_run_report",\n-                    "type": "input"\n-                },\n-                {\n-                    "name": "new_tool",\n-                    "type": "tgz"\n-                }\n-            ],\n-            "position": {\n-                "bottom": 372,\n-                "height": 202,\n-                "left": 613,\n-                "right": 813,\n-                "top": 170,\n-                "width": 200,\n-                "x": 613,\n-                "y": 170\n-            },\n-            "post_job_actions": {},\n-            "tool_id": "toolshed.g2.bx.psu.edu/repos/fubar/tool_factory_2/rgTF2/2.00",\n-            "tool_shed_repository": {\n-                "changeset_revision": "51fa7'..b'bx.psu.edu/repos/fubar/tool_factory_2/rgTF2/2.00",\n-            "tool_shed_repository": {\n-                "changeset_revision": "51fa77152988",\n-                "name": "tool_factory_2",\n-                "owner": "fubar",\n-                "tool_shed": "toolshed.g2.bx.psu.edu"\n-            },\n-            "tool_state": "{\\"__input_ext\\": \\"input\\", \\"chromInfo\\": \\"/home/ross/galaxy/tool-data/shared/ucsc/chrom/?.len\\", \\"interexe\\": {\\"interpreter\\": \\"python\\", \\"__current_case__\\": 2, \\"interpreter_version\\": \\"\\", \\"exe_package_version\\": \\"\\", \\"dynScript\\": \\"import argparse\\\\nimport tarfile\\\\nimport os\\\\nimport tempfile\\\\nimport subprocess\\\\n\\\\n\\\\\\"\\\\\\"\\\\\\"\\\\nplanemo test --no_cleanup --no_dependency_resolution --skip_venv --galaxy_root ~/galaxy ~/galaxy/tools/tool_makers/pyrevargparse/ &> pyrevargparse\\\\n\\\\\\"\\\\\\"\\\\\\"\\\\n\\\\nparser = argparse.ArgumentParser()\\\\na = parser.add_argument\\\\na(\'--tooltgz\',default=\'\')\\\\na(\'--report\',default=None)\\\\na(\'--toolout\',default=None)\\\\na(\'--galaxy_root\',default=None)\\\\nargs = parser.parse_args()\\\\ntoolname = args.toolout.split(os.sep)[-1]\\\\ntoolpath = os.path.join(args.galaxy_root,args.toolout)\\\\ntf = tarfile.open(args.tooltgz,\\\\\\"r:gz\\\\\\")\\\\ntf.extractall(toolpath)\\\\ncl = \\\\\\"planemo test --skip_venv --galaxy_root %s %s\\\\\\" % (args.galaxy_root,toolpath)\\\\ncll = cl.split(\' \')\\\\nsto = open(args.report, \'w\')\\\\np = subprocess.run(cll, shell=False, stdout=sto)\\\\nretval = p.returncode\\\\nsto.close()\\\\n\\"}, \\"makeMode\\": {\\"make_Tool\\": \\"yes\\", \\"__current_case__\\": 0, \\"tool_version\\": \\"0.01\\", \\"tool_desc\\": \\"Tool to test toolshed tool archives generated by the tool factory.\\", \\"help_text\\": \\"**What it Does**\\\\n\\\\nGiven a toolshed tgz file generated by a tool factory run, this will unpack it and run planemo test, returning the planemo stdout as a report\\\\nIt was generated using the tool factory.\\", \\"citations\\": []}, \\"ppass\\": {\\"parampass\\": \\"argparse\\", \\"__current_case__\\": 0, \\"history_inputs\\": [{\\"__index__\\": 0, \\"input_files\\": {\\"__class__\\": \\"ConnectedValue\\"}, \\"input_formats\\": [\\"tgz\\"], \\"input_label\\": \\"tool toolshed tgz archive from history\\", \\"input_help\\": \\"Run planemo test on a tool shed tool archive tgz format file generated by the ToolFactory or Planemo\\", \\"input_CL\\": \\"tooltgz\\"}], \\"history_outputs\\": [{\\"__index__\\": 0, \\"history_name\\": \\"report\\", \\"history_format\\": \\"txt\\", \\"history_CL\\": \\"report\\"}], \\"edit_params\\": \\"yes\\", \\"additional_parameters\\": [{\\"__index__\\": 0, \\"param_name\\": \\"toolout\\", \\"param_type\\": \\"text\\", \\"param_value\\": \\"tools/toolmakers/planemotest\\", \\"param_label\\": \\"output path under galaxy root\\", \\"param_help\\": \\"This is where the tgz file will be extracted and tested by planemo\\", \\"param_CL\\": \\"toolout\\", \\"param_CLprefixed\\": \\"\\"}, {\\"__index__\\": 1, \\"param_name\\": \\"galaxy_root\\", \\"param_type\\": \\"text\\", \\"param_value\\": \\"/home/ross/galaxy\\", \\"param_label\\": \\"Galaxy source root directory to use for running planemo\\", \\"param_help\\": \\"This will form the galaxy_root parameter for rnning planemo using an existing Galaxy source tree, and the tgz will be extracted at a path relative to that rootu\\", \\"param_CL\\": \\"galaxy_root\\", \\"param_CLprefixed\\": \\"\\"}]}, \\"tool_name\\": \\"planemotest\\", \\"__page__\\": null, \\"__rerun_remap_job_id__\\": null}",\n-            "tool_version": "2.00",\n-            "type": "tool",\n-            "uuid": "b9bfb1a4-4c0c-4d39-9e74-223da72f8abc",\n-            "workflow_outputs": [\n-                {\n-                    "label": null,\n-                    "output_name": "TF_run_report",\n-                    "uuid": "09ba44ea-4da8-46f5-a411-ca054ccedd3b"\n-                },\n-                {\n-                    "label": null,\n-                    "output_name": "new_tool",\n-                    "uuid": "50a8ff4a-702a-4983-8202-8a79c0a3c978"\n-                }\n-            ]\n-        }\n-    },\n-    "tags": [],\n-    "uuid": "321a7f9f-c287-453c-807a-43afd948770e",\n-    "version": 0\n-}\n'
b
diff -r f8700bed1e17 -r e95d9fe5ab50 toolfactory/docker/dockerfile.seq
--- a/toolfactory/docker/dockerfile.seq Tue Aug 18 08:25:43 2020 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
b
@@ -1,25 +0,0 @@
-# Galaxy - Toolshed docker
-
-FROM quay.io/bgruening/galaxy:19.01
-
-MAINTAINER Björn A. Grüning, bjoern.gruening@gmail.com
-
-ENV GALAXY_CONFIG_BRAND ToolFactory
-ENV GALAXY_CONFIG_SANITIZE_ALL_HTML false
-
-# Install tools
-#ADD data_managers.yaml $GALAXY_ROOT/data_managers.yaml
-#RUN install-tools $GALAXY_ROOT/data_managers.yaml && \
-#    /tool_deps/_conda/bin/conda clean --tarballs && \
-#    rm /export/galaxy-central/ -rf
-ADD my_tool_list.yml $GALAXY_ROOT/tools1.yaml
-RUN install-tools $GALAXY_ROOT/tools1.yaml && \
-    /tool_deps/_conda/bin/conda clean --tarballs && \
-    rm /export/galaxy-central/ -rf
-
-ADD TF_example_wf.ga $GALAXY_HOME/workflows/TF_example_wf.ga
-
-ADD post-start-actions.sh /export/post-start-actions.sh
-RUN chmod a+x /export/post-start-actions.sh
-
-
b
diff -r f8700bed1e17 -r e95d9fe5ab50 toolfactory/docker/my_tool_list.yml
--- a/toolfactory/docker/my_tool_list.yml Tue Aug 18 08:25:43 2020 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
b
@@ -1,9 +0,0 @@
-install_resolver_dependencies: true
-install_tool_dependencies: false
-tools:
-- name: tool_factory_2
-  owner: fubar
-  tool_panel_section_label: 'Make new Tools'
-  tool_shed_url: https://toolshed.g2.bx.psu.edu


b
diff -r f8700bed1e17 -r e95d9fe5ab50 toolfactory/docker/post-start-actions.sh
--- a/toolfactory/docker/post-start-actions.sh Tue Aug 18 08:25:43 2020 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
b
@@ -1,5 +0,0 @@
-#!/bin/bash
-# hook to install tf demo workflow
-echo "#### post start actions.sh hook happening"
-chown $GALAXY_USER $GALAXY_ROOT/workflows/TF_example_wf.ga
-workflow-install -w $GALAXY_ROOT/workflows/TF_example_wf.ga -g http://localhost -a fakekey --publish_workflows
b
diff -r f8700bed1e17 -r e95d9fe5ab50 toolfactory/docker/postinstall.py
--- a/toolfactory/docker/postinstall.py Tue Aug 18 08:25:43 2020 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
b
@@ -1,6 +0,0 @@
-from bioblend import galaxy
-
-gi = galaxy.GalaxyInstance(url='http://127.0.0.1:8080', key='fbdd3c2eecd191e88939fffc02eeeaf8')
-
-hl = gi.histories.get_histories()
-h = get_most_recently_used_history()
b
diff -r f8700bed1e17 -r e95d9fe5ab50 toolfactory/docker/startgaldock.sh
--- a/toolfactory/docker/startgaldock.sh Tue Aug 18 08:25:43 2020 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
b
@@ -1,1 +0,0 @@
-docker run -d -p 8080:80 -v /home/ubuntu/galaxy_storage/:/export/  toolfactory
b
diff -r f8700bed1e17 -r e95d9fe5ab50 toolfactory/docker/startup
--- a/toolfactory/docker/startup Tue Aug 18 08:25:43 2020 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
[
b'@@ -1,460 +0,0 @@\n-#!/usr/bin/env bash\n-\n-# Migration path for old images that had the tool_deps under /export/galaxy-central/tool_deps/\n-\n-if [ -d "/export/galaxy-central/tool_deps/" ] && [ ! -L "/export/galaxy-central/tool_deps/" ]; then\n-    mkdir -p /export/tool_deps/\n-    mv /export/galaxy-central/tool_deps /export/\n-    ln -s /export/tool_deps/ $GALAXY_ROOT/\n-fi\n-\n-# This is needed for Docker compose to have a unified alias for the main container.\n-# Modifying /etc/hosts can only happen during runtime not during build-time\n-echo "127.0.0.1      galaxy" >> /etc/hosts\n-\n-# Set number of Galaxy handlers via GALAXY_HANDLER_NUMPROCS or default to 2\n-ansible localhost -m ini_file -a "dest=/etc/supervisor/conf.d/galaxy.conf section=program:handler option=numprocs value=${GALAXY_HANDLER_NUMPROCS:-2}" &> /dev/null\n-\n-# If the Galaxy config file is not in the expected place, copy from the sample\n-# and hope for the best (that the admin has done all the setup through env vars.)\n-if [ ! -f $GALAXY_CONFIG_FILE ]\n-  then\n-  # this should succesfully copy either .yml or .ini sample file to the expected location\n-  cp /export/config/galaxy${GALAXY_CONFIG_FILE: -4}.sample $GALAXY_CONFIG_FILE\n-fi\n-\n-# Configure proxy prefix filtering\n-if [[ ! -z $PROXY_PREFIX ]]\n-    then\n-    if [ ${GALAXY_CONFIG_FILE: -4} == ".ini" ]\n-        then\n-        ansible localhost -m ini_file -a "dest=${GALAXY_CONFIG_FILE} section=filter:proxy-prefix option=prefix value=${PROXY_PREFIX}" &> /dev/null\n-        ansible localhost -m ini_file -a "dest=${GALAXY_CONFIG_FILE} section=app:main option=filter-with value=proxy-prefix" &> /dev/null\n-    else\n-        ansible localhost -m lineinfile -a "path=${GALAXY_CONFIG_FILE} regexp=\'^  module:\' state=absent" &> /dev/null\n-        ansible localhost -m lineinfile -a "path=${GALAXY_CONFIG_FILE} regexp=\'^  socket:\' state=absent" &> /dev/null\n-        ansible localhost -m lineinfile -a "path=${GALAXY_CONFIG_FILE} regexp=\'^  mount:\' state=absent" &> /dev/null\n-        ansible localhost -m lineinfile -a "path=${GALAXY_CONFIG_FILE} regexp=\'^  manage-script-name:\' state=absent" &> /dev/null\n-        ansible localhost -m lineinfile -a "path=${GALAXY_CONFIG_FILE} insertafter=\'^uwsgi:\' line=\'  manage-script-name: true\'" &> /dev/null\n-        ansible localhost -m lineinfile -a "path=${GALAXY_CONFIG_FILE} insertafter=\'^uwsgi:\' line=\'  mount: ${PROXY_PREFIX}=galaxy.webapps.galaxy.buildapp:uwsgi_app()\'" &> /dev/null\n-        ansible localhost -m lineinfile -a "path=${GALAXY_CONFIG_FILE} insertafter=\'^uwsgi:\' line=\'  socket: unix:///srv/galaxy/var/uwsgi.sock\'" &> /dev/null\n-\n-        # Also set SCRIPT_NAME. It\'s not always necessary due to manage-script-name: true in galaxy.yml, but it makes life easier in this container + it does no harm\n-        ansible localhost -m lineinfile -a "path=/etc/nginx/conf.d/uwsgi.conf regexp=\'^    uwsgi_param SCRIPT_NAME\' state=absent" &> /dev/null\n-        ansible localhost -m lineinfile -a "path=/etc/nginx/conf.d/uwsgi.conf insertafter=\'^    include uwsgi_params\' line=\'    uwsgi_param SCRIPT_NAME ${PROXY_PREFIX};\'" &> /dev/null\n-    fi\n-\n-    ansible localhost -m ini_file -a "dest=${GALAXY_CONFIG_DIR}/reports_wsgi.ini section=filter:proxy-prefix option=prefix value=${PROXY_PREFIX}/reports" &> /dev/null\n-    ansible localhost -m ini_file -a "dest=${GALAXY_CONFIG_DIR}/reports_wsgi.ini section=app:main option=filter-with value=proxy-prefix" &> /dev/null\n-\n-    # Fix path to html assets\n-    ansible localhost -m replace -a "dest=$GALAXY_CONFIG_DIR/web/welcome.html regexp=\'(href=\\"|\\\')[/\\\\w]*(/static)\' replace=\'\\\\1${PROXY_PREFIX}\\\\2\'" &> /dev/null\n-\n-    # Set some other vars based on that prefix\n-    if [ "x$GALAXY_CONFIG_COOKIE_PATH" == "x" ]\n-        then\n-        export GALAXY_CONFIG_COOKIE_PATH="$PROXY_PREFIX"\n-    fi\n-    if [ "x$GALAXY_CONFIG_DYNAMIC_PROXY_PREFIX" == "x" ]\n-        then\n-        export GALAXY_CONFIG_DYNAMIC_PROXY_PREFIX="$PROXY_PREFIX/gie_proxy"\n-    fi\n-\n-    # Change the defaults '..b'recommends -y\n-    apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/*\n-else\n-    echo "Disable Galaxy Interactive Environments. Start with --privileged to enable IE\'s."\n-    export GALAXY_CONFIG_INTERACTIVE_ENVIRONMENT_PLUGINS_DIRECTORY=""\n-    start_supervisor\n-fi\n-\n-if [ "$USE_HTTPS_LETSENCRYPT" != "False" ]\n-then\n-    echo "Settting up letsencrypt"\n-    ansible-playbook -c local /ansible/provision.yml \\\n-    --extra-vars gather_facts=False \\\n-    --extra-vars galaxy_extras_config_ssl=True \\\n-    --extra-vars galaxy_extras_config_ssl_method=letsencrypt \\\n-    --extra-vars galaxy_extras_galaxy_domain="GALAXY_CONFIG_GALAXY_INFRASTRUCTURE_URL" \\\n-    --extra-vars galaxy_extras_config_nginx_upload=False \\\n-    --tags https\n-fi\n-if [ "$USE_HTTPS" != "False" ]\n-then\n-    if [ -f /export/server.key -a -f /export/server.crt ]\n-    then\n-        echo "Copying SSL keys"\n-        ansible-playbook -c local /ansible/provision.yml \\\n-        --extra-vars gather_facts=False \\\n-        --extra-vars galaxy_extras_config_ssl=True \\\n-        --extra-vars galaxy_extras_config_ssl_method=own \\\n-        --extra-vars src_nginx_ssl_certificate_key=/export/server.key \\\n-        --extra-vars src_nginx_ssl_certificate=/export/server.crt \\\n-        --extra-vars galaxy_extras_config_nginx_upload=False \\\n-        --tags https\n-    else\n-        echo "Setting up self-signed SSL keys"\n-        ansible-playbook -c local /ansible/provision.yml \\\n-        --extra-vars gather_facts=False \\\n-        --extra-vars galaxy_extras_config_ssl=True \\\n-        --extra-vars galaxy_extras_config_ssl_method=self-signed \\\n-        --extra-vars galaxy_extras_config_nginx_upload=False \\\n-        --tags https\n-    fi\n-fi\n-\n-# In case the user wants the default admin to be created, do so.\n-if [[ ! -z $GALAXY_DEFAULT_ADMIN_USER ]]\n-    then\n-        echo "Creating admin user $GALAXY_DEFAULT_ADMIN_USER with key $GALAXY_DEFAULT_ADMIN_KEY and password $GALAXY_DEFAULT_ADMIN_PASSWORD if not existing"\n-        python /usr/local/bin/create_galaxy_user.py --user "$GALAXY_DEFAULT_ADMIN_EMAIL" --password "$GALAXY_DEFAULT_ADMIN_PASSWORD" \\\n-        -c "$GALAXY_CONFIG_FILE" --username "$GALAXY_DEFAULT_ADMIN_USER" --key "$GALAXY_DEFAULT_ADMIN_KEY"\n-    # If there is a need to execute actions that would require a live galaxy instance, such as adding workflows, setting quotas, adding more users, etc.\n-    # then place a file with that logic named post-start-actions.sh on the /export/ directory, it should have access to all environment variables\n-    # visible here.\n-    # The file needs to be executable (chmod a+x post-start-actions.sh)\n-fi    \n-if [ -x /export/post-start-actions.sh ]\n-    then\n-   # uses ephemeris, present in docker-galaxy-stable, to wait for the local instance\n-   /tool_deps/_conda/bin/galaxy-wait -g http://127.0.0.1 -v --timeout 120 > $GALAXY_LOGS_DIR/post-start-actions.log &&\n-   /export/post-start-actions.sh >> $GALAXY_LOGS_DIR/post-start-actions.log &\n-fi\n-\n-\n-# Reinstall tools if the user want to\n-if [[ ! -z $GALAXY_AUTO_UPDATE_TOOLS ]]\n-    then\n-        /tool_deps/_conda/bin/galaxy-wait -g http://127.0.0.1 -v --timeout 120 > /home/galaxy/logs/post-start-actions.log &&\n-        OLDIFS=$IFS\n-        IFS=\',\'\n-        for TOOL_YML in `echo "$GALAXY_AUTO_UPDATE_TOOLS"`\n-        do\n-            echo "Installing tools from $TOOL_YML"\n-            /tool_deps/_conda/bin/shed-tools install -g "http://127.0.0.1" -a "$GALAXY_DEFAULT_ADMIN_KEY" -t "$TOOL_YML"\n-            /tool_deps/_conda/bin/conda clean --tarballs --yes\n-        done\n-        IFS=$OLDIFS\n-fi\n-\n-# migrate custom IEs or Visualisations (Galaxy plugins)\n-# this is needed for by the new client build system\n-python3 ${GALAXY_ROOT}/scripts/plugin_staging.py\n-\n-# Enable verbose output\n-if [ `echo ${GALAXY_LOGGING:-\'no\'} | tr [:upper:] [:lower:]` = "full" ]\n-    then\n-        tail -f /var/log/supervisor/* /var/log/nginx/* $GALAXY_LOGS_DIR/*.log\n-    else\n-        tail -f $GALAXY_LOGS_DIR/*.log\n-fi\n-\n'
b
diff -r f8700bed1e17 -r e95d9fe5ab50 toolfactory/docker/startup.sh
--- a/toolfactory/docker/startup.sh Tue Aug 18 08:25:43 2020 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
[
b'@@ -1,462 +0,0 @@\n-#!/usr/bin/env bash\n-\n-# Migration path for old images that had the tool_deps under /export/galaxy-central/tool_deps/\n-\n-if [ -d "/export/galaxy-central/tool_deps/" ] && [ ! -L "/export/galaxy-central/tool_deps/" ]; then\n-    mkdir -p /export/tool_deps/\n-    mv /export/galaxy-central/tool_deps /export/\n-    ln -s /export/tool_deps/ $GALAXY_ROOT/\n-fi\n-\n-# This is needed for Docker compose to have a unified alias for the main container.\n-# Modifying /etc/hosts can only happen during runtime not during build-time\n-echo "127.0.0.1      galaxy" >> /etc/hosts\n-\n-# Set number of Galaxy handlers via GALAXY_HANDLER_NUMPROCS or default to 2\n-ansible localhost -m ini_file -a "dest=/etc/supervisor/conf.d/galaxy.conf section=program:handler option=numprocs value=${GALAXY_HANDLER_NUMPROCS:-2}" &> /dev/null\n-\n-# If the Galaxy config file is not in the expected place, copy from the sample\n-# and hope for the best (that the admin has done all the setup through env vars.)\n-if [ ! -f $GALAXY_CONFIG_FILE ]\n-  then\n-  # this should succesfully copy either .yml or .ini sample file to the expected location\n-  cp /export/config/galaxy${GALAXY_CONFIG_FILE: -4}.sample $GALAXY_CONFIG_FILE\n-fi\n-\n-# Configure proxy prefix filtering\n-if [[ ! -z $PROXY_PREFIX ]]\n-    then\n-    if [ ${GALAXY_CONFIG_FILE: -4} == ".ini" ]\n-        then\n-        ansible localhost -m ini_file -a "dest=${GALAXY_CONFIG_FILE} section=filter:proxy-prefix option=prefix value=${PROXY_PREFIX}" &> /dev/null\n-        ansible localhost -m ini_file -a "dest=${GALAXY_CONFIG_FILE} section=app:main option=filter-with value=proxy-prefix" &> /dev/null\n-    else\n-        ansible localhost -m lineinfile -a "path=${GALAXY_CONFIG_FILE} regexp=\'^  module:\' state=absent" &> /dev/null\n-        ansible localhost -m lineinfile -a "path=${GALAXY_CONFIG_FILE} regexp=\'^  socket:\' state=absent" &> /dev/null\n-        ansible localhost -m lineinfile -a "path=${GALAXY_CONFIG_FILE} regexp=\'^  mount:\' state=absent" &> /dev/null\n-        ansible localhost -m lineinfile -a "path=${GALAXY_CONFIG_FILE} regexp=\'^  manage-script-name:\' state=absent" &> /dev/null\n-        ansible localhost -m lineinfile -a "path=${GALAXY_CONFIG_FILE} insertafter=\'^uwsgi:\' line=\'  manage-script-name: true\'" &> /dev/null\n-        ansible localhost -m lineinfile -a "path=${GALAXY_CONFIG_FILE} insertafter=\'^uwsgi:\' line=\'  mount: ${PROXY_PREFIX}=galaxy.webapps.galaxy.buildapp:uwsgi_app()\'" &> /dev/null\n-        ansible localhost -m lineinfile -a "path=${GALAXY_CONFIG_FILE} insertafter=\'^uwsgi:\' line=\'  socket: unix:///srv/galaxy/var/uwsgi.sock\'" &> /dev/null\n-\n-        # Also set SCRIPT_NAME. It\'s not always necessary due to manage-script-name: true in galaxy.yml, but it makes life easier in this container + it does no harm\n-        ansible localhost -m lineinfile -a "path=/etc/nginx/conf.d/uwsgi.conf regexp=\'^    uwsgi_param SCRIPT_NAME\' state=absent" &> /dev/null\n-        ansible localhost -m lineinfile -a "path=/etc/nginx/conf.d/uwsgi.conf insertafter=\'^    include uwsgi_params\' line=\'    uwsgi_param SCRIPT_NAME ${PROXY_PREFIX};\'" &> /dev/null\n-    fi\n-\n-    ansible localhost -m ini_file -a "dest=${GALAXY_CONFIG_DIR}/reports_wsgi.ini section=filter:proxy-prefix option=prefix value=${PROXY_PREFIX}/reports" &> /dev/null\n-    ansible localhost -m ini_file -a "dest=${GALAXY_CONFIG_DIR}/reports_wsgi.ini section=app:main option=filter-with value=proxy-prefix" &> /dev/null\n-\n-    # Fix path to html assets\n-    ansible localhost -m replace -a "dest=$GALAXY_CONFIG_DIR/web/welcome.html regexp=\'(href=\\"|\\\')[/\\\\w]*(/static)\' replace=\'\\\\1${PROXY_PREFIX}\\\\2\'" &> /dev/null\n-\n-    # Set some other vars based on that prefix\n-    if [ "x$GALAXY_CONFIG_COOKIE_PATH" == "x" ]\n-        then\n-        export GALAXY_CONFIG_COOKIE_PATH="$PROXY_PREFIX"\n-    fi\n-    if [ "x$GALAXY_CONFIG_DYNAMIC_PROXY_PREFIX" == "x" ]\n-        then\n-        export GALAXY_CONFIG_DYNAMIC_PROXY_PREFIX="$PROXY_PREFIX/gie_proxy"\n-    fi\n-\n-    # Change the defaults '..b'active Environments. Start with --privileged to enable IE\'s."\n-    export GALAXY_CONFIG_INTERACTIVE_ENVIRONMENT_PLUGINS_DIRECTORY=""\n-    start_supervisor\n-fi\n-\n-if [ "$USE_HTTPS_LETSENCRYPT" != "False" ]\n-then\n-    echo "Settting up letsencrypt"\n-    ansible-playbook -c local /ansible/provision.yml \\\n-    --extra-vars gather_facts=False \\\n-    --extra-vars galaxy_extras_config_ssl=True \\\n-    --extra-vars galaxy_extras_config_ssl_method=letsencrypt \\\n-    --extra-vars galaxy_extras_galaxy_domain="GALAXY_CONFIG_GALAXY_INFRASTRUCTURE_URL" \\\n-    --extra-vars galaxy_extras_config_nginx_upload=False \\\n-    --tags https\n-fi\n-if [ "$USE_HTTPS" != "False" ]\n-then\n-    if [ -f /export/server.key -a -f /export/server.crt ]\n-    then\n-        echo "Copying SSL keys"\n-        ansible-playbook -c local /ansible/provision.yml \\\n-        --extra-vars gather_facts=False \\\n-        --extra-vars galaxy_extras_config_ssl=True \\\n-        --extra-vars galaxy_extras_config_ssl_method=own \\\n-        --extra-vars src_nginx_ssl_certificate_key=/export/server.key \\\n-        --extra-vars src_nginx_ssl_certificate=/export/server.crt \\\n-        --extra-vars galaxy_extras_config_nginx_upload=False \\\n-        --tags https\n-    else\n-        echo "Setting up self-signed SSL keys"\n-        ansible-playbook -c local /ansible/provision.yml \\\n-        --extra-vars gather_facts=False \\\n-        --extra-vars galaxy_extras_config_ssl=True \\\n-        --extra-vars galaxy_extras_config_ssl_method=self-signed \\\n-        --extra-vars galaxy_extras_config_nginx_upload=False \\\n-        --tags https\n-    fi\n-fi\n-\n-# In case the user wants the default admin to be created, do so.\n-if [[ ! -z $GALAXY_DEFAULT_ADMIN_USER ]]\n-    then\n-        echo "Creating admin user $GALAXY_DEFAULT_ADMIN_USER with key $GALAXY_DEFAULT_ADMIN_KEY and password $GALAXY_DEFAULT_ADMIN_PASSWORD if not existing"\n-        python /usr/local/bin/create_galaxy_user.py --user "$GALAXY_DEFAULT_ADMIN_EMAIL" --password "$GALAXY_DEFAULT_ADMIN_PASSWORD" \\\n-        -c "$GALAXY_CONFIG_FILE" --username "$GALAXY_DEFAULT_ADMIN_USER" --key "$GALAXY_DEFAULT_ADMIN_KEY"\n-fi\n-# If there is a need to execute actions that would require a live galaxy instance, such as adding workflows, setting quotas, adding more users, etc.\n-# then place a file with that logic named post-start-actions.sh on the /export/ directory, it should have access to all environment variables\n-# visible here.\n-# The file needs to be executable (chmod a+x post-start-actions.sh)\n-# uses ephemeris, present in docker-galaxy-stable, to wait for the local instance\n-\n-if [[ -f /export/post-start-actions.sh ]] \n-    then \n-       /tool_deps/_conda/bin/galaxy-wait -g http://127.0.0.1 -v --timeout 120 > $GALAXY_LOGS_DIR/post-start-actions.log\n-       /export/post-start-actions.sh >> $GALAXY_LOGS_DIR/post-start-actions.log &\n-    else\n-       echo "No /export/post-start-actions.sh found or not executable so not running" >> $GALAXY_LOGS_DIR/post-start-actions.log\n-fi\n-\n-\n-# Reinstall tools if the user want to\n-if [[ ! -z $GALAXY_AUTO_UPDATE_TOOLS ]]\n-    then\n-        /tool_deps/_conda/bin/galaxy-wait -g http://127.0.0.1 -v --timeout 120 > /home/galaxy/logs/post-start-actions.log &&\n-        OLDIFS=$IFS\n-        IFS=\',\'\n-        for TOOL_YML in `echo "$GALAXY_AUTO_UPDATE_TOOLS"`\n-        do\n-            echo "Installing tools from $TOOL_YML"\n-            /tool_deps/_conda/bin/shed-tools install -g "http://127.0.0.1" -a "$GALAXY_DEFAULT_ADMIN_KEY" -t "$TOOL_YML"\n-            /tool_deps/_conda/bin/conda clean --tarballs --yes\n-        done\n-        IFS=$OLDIFS\n-fi\n-\n-# migrate custom IEs or Visualisations (Galaxy plugins)\n-# this is needed for by the new client build system\n-python3 ${GALAXY_ROOT}/scripts/plugin_staging.py\n-\n-# Enable verbose output\n-if [ `echo ${GALAXY_LOGGING:-\'no\'} | tr [:upper:] [:lower:]` = "full" ]\n-    then\n-        tail -f /var/log/supervisor/* /var/log/nginx/* $GALAXY_LOGS_DIR/*.log\n-    else\n-        tail -f $GALAXY_LOGS_DIR/*.log\n-fi\n'
b
diff -r f8700bed1e17 -r e95d9fe5ab50 toolfactory/docker/tfwelcome.html
--- a/toolfactory/docker/tfwelcome.html Tue Aug 18 08:25:43 2020 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
[
@@ -1,61 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-    <meta charset="utf-8">
-    <link rel="stylesheet" href="/static/style/base.css" type="text/css" />
-</head>
-<body style="margin: 0">
-
-    <div class="jumbotron">
-        <div class="container">
-            <table><tr><td>
-            <h2>Hello, your <strong>Galaxy ToolFactory Docker</strong> container is running!</h2>
-            <strong>If you have not already done so, </strong>
-            From a handy linux console, please use <br>
-            <code>docker ps</code><br>
-            to find this container's name then use<br>
-            <code>docker exec [container name] config/post-start-actions.sh</code>
-            <br>
-            to load the sample tool generators to fully populate this container.
-            until the Dockerfile for this container figures out how to load a workflow during the build correctly.<br>
-            To run the workflow you need two small datasets until I get them loaded<br>
-            phiX.fasta from the Galaxy test-sample directory, and any smallish text file you want such as a readme or script.<br>
-            When you run the workflow, feed the fasta where it says, and the text file where you see rgToolFactory.py<br>
-            Send it to the same history and let it run.<br>
-            With any luck, you will have a history of examples to play with - use the rerun button to repopulate the ToolFactory form to illustrate<br>
-            positional and argparse style parameter passing for python, a simple bash script using STDIN/STDOUT and the perl (ugh) example from planemo<br>
-            <a target="_blank" href="https://wiki.galaxyproject.org/Admin/Config" class="btn btn-primary btn-lg">Configuring Galaxy »</a>
-            <a target="_blank" href="https://wiki.galaxyproject.org/Admin/Tools/AddToolFromToolShedTutorial" class="btn btn-primary btn-lg">Installing Tools »</a>
-            <a target="_parent" href="/tours/core.galaxy_ui" class="btn btn-primary btn-lg">Guided Tour »</a>
-            </td><td>
-                <div align=center>
-                    <img src="./welcome_image.png" width="90%" height="90%" />
-                </div>
-
-        </td></tr></table>
-        </div>
-    </div>
-
-    <div class="container">
-
-        <p class="lead">
-            <a target="_blank" class="reference" href="http://galaxyproject.org/">
-            Galaxy</a> is an open platform for supporting data intensive
-            research. Galaxy is developed by <a target="_blank" class="reference" href="http://wiki.galaxyproject.org/GalaxyTeam">The Galaxy Team</a>
-            with the support of  <a target="_blank" class="reference" href="https://github.com/galaxyproject/galaxy/blob/dev/CONTRIBUTORS.md">many contributors</a>.
-            The Galaxy Docker project is supported by the University of Freiburg, part of de.NBI.
-        </p>
-
-        <footer>
-            The <a target="_blank" class="reference" href="http://galaxyproject.org/">Galaxy Project</a>
-            is supported in part by <a target="_blank" class="reference" href="http://www.genome.gov">NHGRI</a>,
-            <a target="_blank" class="reference" href="http://www.nsf.gov">NSF</a>,
-            <a target="_blank" class="reference" href="http://www.huck.psu.edu">The Huck Institutes of the Life Sciences</a>,
-            <a target="_blank" class="reference" href="http://www.ics.psu.edu">The Institute for CyberScience at Penn State</a>,
-            and <a target="_blank" class="reference" href="http://www.jhu.edu/">Johns Hopkins University</a>.
-        </footer>
-
-    </div>
-
-</body>
-</html>
b
diff -r f8700bed1e17 -r e95d9fe5ab50 toolfactory/html_dir.py
--- a/toolfactory/html_dir.py Tue Aug 18 08:25:43 2020 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
[
b'@@ -1,180 +0,0 @@\n-\n-class tooloutHTMLifyer(self):\n-\n-    def compressPDF(self,inpdf=None,thumbformat=\'png\'):\n-        """need absolute path to pdf\n-           note that GS gets confoozled if no $TMP or $TEMP\n-           so we set it\n-        """\n-        assert os.path.isfile(inpdf), "## Input %s supplied to %s compressPDF not found" % (inpdf,self.myName)\n-        hlog = os.path.join(self.opts.output_dir,"compress_%s.txt" % os.path.basename(inpdf))\n-        sto = open(hlog,\'a\')\n-        our_env = os.environ.copy()\n-        our_tmp = our_env.get(\'TMP\',None)\n-        if not our_tmp:\n-            our_tmp = our_env.get(\'TEMP\',None)\n-        if not (our_tmp and os.path.exists(our_tmp)):\n-            newtmp = os.path.join(self.opts.output_dir,\'tmp\')\n-            try:\n-                os.mkdir(newtmp)\n-            except:\n-                sto.write(\'## WARNING - cannot make %s - it may exist or permissions need fixing\\n\' % newtmp)\n-            our_env[\'TEMP\'] = newtmp\n-            if not self.temp_warned:\n-               sto.write(\'## WARNING - no $TMP or $TEMP!!! Please fix - using %s temporarily\\n\' % newtmp)\n-               self.temp_warned = True          \n-        outpdf = \'%s_compressed\' % inpdf\n-        cl = ["gs", "-sDEVICE=pdfwrite", "-dNOPAUSE", "-dUseCIEColor", "-dBATCH","-dPDFSETTINGS=/printer", "-sOutputFile=%s" % outpdf,inpdf]\n-        x = subprocess.Popen(cl,stdout=sto,stderr=sto,cwd=self.opts.output_dir,env=our_env)\n-        retval1 = x.wait()\n-        sto.close()\n-        if retval1 == 0:\n-            os.unlink(inpdf)\n-            shutil.move(outpdf,inpdf)\n-            os.unlink(hlog)\n-        hlog = os.path.join(self.opts.output_dir,"thumbnail_%s.txt" % os.path.basename(inpdf))\n-        sto = open(hlog,\'w\')\n-        outpng = \'%s.%s\' % (os.path.splitext(inpdf)[0],thumbformat)\n-        if self.useGM:        \n-            cl2 = [\'gm\', \'convert\', inpdf, outpng]\n-        else: # assume imagemagick\n-            cl2 = [\'convert\', inpdf, outpng]\n-        x = subprocess.Popen(cl2,stdout=sto,stderr=sto,cwd=self.opts.output_dir,env=our_env)\n-        retval2 = x.wait()\n-        sto.close()\n-        if retval2 == 0:\n-             os.unlink(hlog)\n-        retval = retval1 or retval2\n-        return retval\n-\n-\n-    def getfSize(self,fpath,outpath):\n-        """\n-        format a nice file size string\n-        """\n-        size = \'\'\n-        fp = os.path.join(outpath,fpath)\n-        if os.path.isfile(fp):\n-            size = \'0 B\'\n-            n = float(os.path.getsize(fp))\n-            if n > 2**20:\n-                size = \'%1.1f MB\' % (n/2**20)\n-            elif n > 2**10:\n-                size = \'%1.1f KB\' % (n/2**10)\n-            elif n > 0:\n-                size = \'%d B\' % (int(n))\n-        return size\n-\n-    def makeHtml(self):\n-        """ Create an HTML file content to list all the artifacts found in the output_dir\n-        """\n-\n-        galhtmlprefix = """<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> \n-        <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> \n-        <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> \n-        <meta name="generator" content="Galaxy %s tool output - see http://g2.trac.bx.psu.edu/" /> \n-        <title></title> \n-        <link rel="stylesheet" href="/static/style/base.css" type="text/css" /> \n-        </head> \n-        <body> \n-        <div class="toolFormBody"> \n-        """ \n-        galhtmlattr = """<hr/><div class="infomessage">This tool (%s) was generated by the <a href="https://bitbucket.org/fubar/galaxytoolfactory/overview">Galaxy Tool Factory</a></div><br/>""" \n-        galhtmlpostfix = """</div></body></html>\\n"""\n-\n-        flist = os.listdir(self.opts.output_dir)\n-        flist = [x for x in flist if x != \'Rplots.pdf\']\n-        flist.sort()\n-        html = []\n-        html.append(galhtmlprefix % progname)\n-        html.append(\'<div class="infomessage">Galaxy T'..b'% (fname,fname,sfsize))\n-                else:\n-                    fhtml.append(\'<tr><td><a href="%s">%s</a></td><td>%s</td></tr>\' % (fname,fname,sfsize))\n-            for logfname in logfiles: # expect at least tlog - if more\n-                if os.path.abspath(logfname) == os.path.abspath(self.tlog): # handled later\n-                    sectionname = \'All tool run\'\n-                    if (len(logfiles) > 1):\n-                        sectionname = \'Other\'\n-                    ourpdfs = pdflist\n-                else:\n-                    realname = os.path.basename(logfname)\n-                    sectionname = os.path.splitext(realname)[0].split(\'_\')[0] # break in case _ added to log\n-                    ourpdfs = [x for x in pdflist if os.path.basename(x[0]).split(\'_\')[0] == sectionname]\n-                    pdflist = [x for x in pdflist if os.path.basename(x[0]).split(\'_\')[0] != sectionname] # remove\n-                nacross = 1\n-                npdf = len(ourpdfs)\n-\n-                if npdf > 0:\n-                    nacross = math.sqrt(npdf) ## int(round(math.log(npdf,2)))\n-                    if int(nacross)**2 != npdf:\n-                        nacross += 1\n-                    nacross = int(nacross)\n-                    width = min(400,int(1200/nacross))\n-                    html.append(\'<div class="toolFormTitle">%s images and outputs</div>\' % sectionname)\n-                    html.append(\'(Click on a thumbnail image to download the corresponding original PDF image)<br/>\')\n-                    ntogo = nacross # counter for table row padding with empty cells\n-                    html.append(\'<div><table class="simple" cellpadding="2" cellspacing="2">\\n<tr>\')\n-                    for i,paths in enumerate(ourpdfs): \n-                        fname,thumb = paths\n-                        s= """<td><a href="%s"><img src="%s" title="Click to download a PDF of %s" hspace="5" width="%d" \n-                           alt="Image called %s"/></a></td>\\n""" % (fname,thumb,fname,width,fname)\n-                        if ((i+1) % nacross == 0):\n-                            s += \'</tr>\\n\'\n-                            ntogo = 0\n-                            if i < (npdf - 1): # more to come\n-                               s += \'<tr>\'\n-                               ntogo = nacross\n-                        else:\n-                            ntogo -= 1\n-                        html.append(s)\n-                    if html[-1].strip().endswith(\'</tr>\'):\n-                        html.append(\'</table></div>\\n\')\n-                    else:\n-                        if ntogo > 0: # pad\n-                           html.append(\'<td>&nbsp;</td>\'*ntogo)\n-                        html.append(\'</tr></table></div>\\n\')\n-                logt = open(logfname,\'r\').readlines()\n-                logtext = [x for x in logt if x.strip() > \'\']\n-                html.append(\'<div class="toolFormTitle">%s log output</div>\' % sectionname)\n-                if len(logtext) > 1:\n-                    html.append(\'\\n<pre>\\n\')\n-                    html += logtext\n-                    html.append(\'\\n</pre>\\n\')\n-                else:\n-                    html.append(\'%s is empty<br/>\' % logfname)\n-        if len(fhtml) > 0:\n-           fhtml.insert(0,\'<div><table class="colored" cellpadding="3" cellspacing="3"><tr><th>Output File Name (click to view)</th><th>Size</th></tr>\\n\')\n-           fhtml.append(\'</table></div><br/>\')\n-           html.append(\'<div class="toolFormTitle">All output files available for downloading</div>\\n\')\n-           html += fhtml # add all non-pdf files to the end of the display\n-        else:\n-            html.append(\'<div class="warningmessagelarge">### Error - %s returned no files - please confirm that parameters are sane</div>\' % self.opts.interpreter)\n-        html.append(galhtmlpostfix)\n-        htmlf = file(self.opts.output_html,\'w\')\n-        htmlf.write(\'\\n\'.join(html))\n-        htmlf.write(\'\\n\')\n-        htmlf.close()\n-        self.html = html\n-\n-\n'
b
diff -r f8700bed1e17 -r e95d9fe5ab50 toolfactory/images/dynamicScriptTool.png
b
Binary file toolfactory/images/dynamicScriptTool.png has changed
b
diff -r f8700bed1e17 -r e95d9fe5ab50 toolfactory/rgToolFactory2.py
--- a/toolfactory/rgToolFactory2.py Tue Aug 18 08:25:43 2020 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
[
b'@@ -1,764 +0,0 @@\n-#!/usr/bin/env python\n-# rgToolFactory.py\n-# see https://github.com/fubar2/toolfactory\n-#\n-# copyright ross lazarus (ross stop lazarus at gmail stop com) May 2012\n-#\n-# all rights reserved\n-# Licensed under the LGPL\n-# suggestions for improvement and bug fixes welcome at https://github.com/fubar2/toolfactory\n-#\n-# July 2020: BCC was fun and I feel like rip van winkle after 5 years.\n-# Decided to\n-# 1. Fix the toolfactory so it works - done for simplest case\n-# 2. Fix planemo so the toolfactory function works\n-# 3. Rewrite bits using galaxyxml functions where that makes sense - done\n-#\n-# removed all the old complications including making the new tool use this same script\n-# galaxyxml now generates the tool xml https://github.com/hexylena/galaxyxml\n-# No support for automatic HTML file creation from arbitrary outputs\n-# essential problem is to create two command lines - one for the tool xml and a different\n-# one to run the executable with the supplied test data and settings\n-# Be simpler to write the tool, then run it with planemo and soak up the test outputs.\n-\n-\n-\n-import argparse\n-import logging\n-import os\n-import re\n-import shutil\n-import subprocess\n-import sys\n-import tarfile\n-import tempfile\n-import time\n-\n-import galaxyxml.tool as gxt\n-import galaxyxml.tool.parameters as gxtp\n-\n-import lxml\n-\n-myversion = "V2.1 July 2020"\n-verbose = True\n-debug = True\n-toolFactoryURL = "https://github.com/fubar2/toolfactory"\n-ourdelim = "~~~"\n-\n-# --input_files="$input_files~~~$CL~~~$input_formats~~~$input_label\n-# ~~~$input_help"\n-IPATHPOS = 0\n-ICLPOS = 1\n-IFMTPOS = 2\n-ILABPOS = 3\n-IHELPOS = 4\n-IOCLPOS = 5\n-\n-# --output_files "$otab.history_name~~~$otab.history_format~~~$otab.CL\n-ONAMEPOS = 0\n-OFMTPOS = 1\n-OCLPOS = 2\n-OOCLPOS = 3\n-\n-# --additional_parameters="$i.param_name~~~$i.param_value~~~\n-# $i.param_label~~~$i.param_help~~~$i.param_type~~~$i.CL~~~i$.param_CLoverride"\n-ANAMEPOS = 0\n-AVALPOS = 1\n-ALABPOS = 2\n-AHELPPOS = 3\n-ATYPEPOS = 4\n-ACLPOS = 5\n-AOVERPOS = 6\n-AOCLPOS = 7\n-\n-\n-foo = len(lxml.__version__)\n-# fug you, flake8. Say my name!\n-\n-def timenow():\n-    """return current time as a string\n-    """\n-    return time.strftime("%d/%m/%Y %H:%M:%S", time.localtime(time.time()))\n-\n-\n-def quote_non_numeric(s):\n-    """return a prequoted string for non-numerics\n-    useful for perl and Rscript parameter passing?\n-    """\n-    try:\n-        _ = float(s)\n-        return s\n-    except ValueError:\n-        return \'"%s"\' % s\n-\n-\n-html_escape_table = {"&": "&amp;", ">": "&gt;", "<": "&lt;", "$": r"\\$"}\n-\n-\n-def html_escape(text):\n-    """Produce entities within text."""\n-    return "".join(html_escape_table.get(c, c) for c in text)\n-\n-\n-def html_unescape(text):\n-    """Revert entities within text. Multiple character targets so use replace"""\n-    t = text.replace("&amp;", "&")\n-    t = t.replace("&gt;", ">")\n-    t = t.replace("&lt;", "<")\n-    t = t.replace("\\\\$", "$")\n-    return t\n-\n-\n-def parse_citations(citations_text):\n-    """\n-    """\n-    citations = [c for c in citations_text.split("**ENTRY**") if c.strip()]\n-    citation_tuples = []\n-    for citation in citations:\n-        if citation.startswith("doi"):\n-            citation_tuples.append(("doi", citation[len("doi") :].strip()))\n-        else:\n-            citation_tuples.append(\n-                ("bibtex", citation[len("bibtex") :].strip())\n-            )\n-    return citation_tuples\n-\n-\n-class ScriptRunner:\n-    """Wrapper for an arbitrary script\n-    uses galaxyxml\n-\n-    """\n-\n-    def __init__(self, args=None):\n-        """\n-        prepare command line cl for running the tool here\n-        and prepare elements needed for galaxyxml tool generation\n-        """\n-\n-        self.infiles = [x.split(ourdelim) for x in args.input_files]\n-        self.outfiles = [x.split(ourdelim) for x in args.output_files]\n-        self.addpar = [x.split(ourdelim) for x in args.additional_parameters]\n-        self.args = args\n-        self.cleanuppar()\n-        self.lastclredir'..b'               )\n-                )\n-            sto.flush()\n-            p = subprocess.run(self.cl, shell=False, stdout=sto, stderr=ste)\n-            sto.close()\n-            ste.close()\n-            tmp_stderr = open(self.elog, "rb")\n-            err = ""\n-            buffsize = 1048576\n-            try:\n-                while True:\n-                    err += str(tmp_stderr.read(buffsize))\n-                    if not err or len(err) % buffsize != 0:\n-                        break\n-            except OverflowError:\n-                pass\n-            tmp_stderr.close()\n-            retval = p.returncode\n-        else:  # work around special case of simple scripts that take stdin and write to stdout\n-            sti = open(self.infiles[0][IPATHPOS], "rb")\n-            sto = open(self.outfiles[0][ONAMEPOS], "wb")\n-            # must use shell to redirect\n-            p = subprocess.run(self.cl, shell=False, stdout=sto, stdin=sti)\n-            retval = p.returncode\n-            sto.close()\n-            sti.close()\n-        if os.path.isfile(self.tlog) and os.stat(self.tlog).st_size == 0:\n-            os.unlink(self.tlog)\n-        if os.path.isfile(self.elog) and os.stat(self.elog).st_size == 0:\n-            os.unlink(self.elog)\n-        if p.returncode != 0 and err:  # problem\n-            sys.stderr.write(err)\n-        logging.debug("run done")\n-        return retval\n-\n-\n-def main():\n-    """\n-    This is a Galaxy wrapper. It expects to be called by a special purpose tool.xml as:\n-    <command interpreter="python">rgBaseScriptWrapper.py --script_path "$scriptPath" --tool_name "foo" --interpreter "Rscript"\n-    </command>\n-    """\n-    parser = argparse.ArgumentParser()\n-    a = parser.add_argument\n-    a("--script_path", default="")\n-    a("--dependencies", default="")\n-    a("--cl_override", default="")\n-    a("--tool_name", default=None)\n-    a("--interpreter_name", default=None)\n-    a("--interpreter_version", default=None)\n-    a("--exe_package", default=None)\n-    a("--exe_package_version", default=None)\n-    a("--input_files", default=[], action="append")\n-    a("--output_files", default=[], action="append")\n-    a("--user_email", default="Unknown")\n-    a("--bad_user", default=None)\n-    a("--make_Tool", default=None)\n-    a("--help_text", default=None)\n-    a("--tool_desc", default=None)\n-    a("--tool_version", default=None)\n-    a("--citations", default=None)\n-    a("--additional_parameters", action="append", default=[])\n-    a("--edit_additional_parameters", action="store_true", default=False)\n-    a("--parampass", default="positional")\n-    a("--tfout", default="./tfout")\n-    a("--new_tool", default="new_tool")\n-    a("--runmode", default=None)\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-        % (args.bad_user, args.bad_user)\n-    )\n-    assert (\n-        args.tool_name\n-    ), "## Tool Factory expects a tool name - eg --tool_name=DESeq"\n-    assert (\n-        args.interpreter_name or args.exe_package\n-    ), "## Tool Factory wrapper expects an interpreter or an executable package"\n-    assert args.exe_package or (\n-        len(args.script_path) > 0 and os.path.isfile(args.script_path)\n-    ), "## Tool Factory wrapper expects a script path - eg --script_path=foo.R if no executable"\n-    args.input_files = [\n-        x.replace(\'"\', "").replace("\'", "") for x in args.input_files\n-    ]\n-    # remove quotes we need to deal with spaces in CL params\n-    for i, x in enumerate(args.additional_parameters):\n-        args.additional_parameters[i] = args.additional_parameters[i].replace(\n-            \'"\', ""\n-        )\n-    r = ScriptRunner(args)\n-    if args.make_Tool:\n-        retcode = r.makeTooltar()\n-    else:\n-        retcode = r.run()\n-    if retcode:\n-        sys.exit(retcode)  # indicate failure to job runner\n-\n-\n-if __name__ == "__main__":\n-    main()\n'
b
diff -r f8700bed1e17 -r e95d9fe5ab50 toolfactory/rgToolFactory2.xml
--- a/toolfactory/rgToolFactory2.xml Tue Aug 18 08:25:43 2020 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
[
b'@@ -1,466 +0,0 @@\n-<tool id="rgTF2" name="toolfactory" version="2.00" profile="16.04" >\n-  <description>Scripts into tools</description>\n-  <macros>\n-     <xml name="io">\n-        <repeat name="history_inputs" title="Add a data file from your history to pass in to the script. Use the \'+\' button as needed"\n-             help="USE SMALL SAMPLES because these will be used for the new tool\'s test. The names will become a history item selector as input for users of the new tool you are making">\n-            <param name="input_files" type="data" format="data" label="Select an input file from your history" optional="true" multiple="false"\n-               help=""/>\n-            <param name="input_formats" type="select" multiple="true" label="Select the datatype(s) that your tool/script accepts as input"\n-              help="If your datatype is not listed here, it has to be added in galaxy\'s datatypes_conf.xml" value="tabular">\n-               <options from_parameter="tool.app.datatypes_registry.upload_file_formats">\n-                <column name="value" index="0"/>\n-               </options>\n-            </param>\n-            <param name="input_label" type="text" value="" label="This will become the user prompt for the form so please make it informative"\n-             help="Note that \'~~~\' is an internal delimiter so must not appear in this text field - please work around this technical limitation" >\n-            <sanitizer invalid_char="">\n-              <valid initial="string.printable"> <remove value=\'~~~\'/> </valid>\n-              <mapping initial="none"/>\n-            </sanitizer>\n-            </param>\n-            <param name="input_help" type="text" value="parameter_help" label="This will become help text on the form."\n-             help="Note that three consecutive ~ cannot be used in this text field - please work around this technical limitation">\n-            <sanitizer invalid_char="">\n-              <valid initial="string.printable"> <remove value=\'~~~\'/> </valid>\n-              <mapping initial="none"/>\n-            </sanitizer>\n-            </param>\n-            <param name="input_CL" type="text" label="Positional: ordinal integer. Argparse: argument name. STDIN if the executable/script expects it"\n-              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="">\n-            </param>\n-        </repeat>\n-        <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"\n-             help="The name will become a history item for users of the new tool you are making containing one of it\'s outputs">\n-            <param name="history_name" type="text" label="Name for this output to appear in new history" optional="false" help=""/>\n-            <param name="history_format" type="select" multiple="false" label="Select the datatype for this output"\n-              help="If your datatype is not listed here, it has to be added in galaxy\'s datatypes_conf.xml" value="tabular">\n-               <options from_parameter="tool.app.datatypes_registry.upload_file_formats">\n-                <column name="value" index="0"/>\n-               </options>\n-            </param>\n-            <param name="history_CL" type="text"  label="Positional: ordinal integer. Argparse: argument name expected for this output parameter. Use STDOUT if \'>\' required."\n-              help="If positional parameters, enter the integer ordinal expected for this parameter. If Argparse style, \'--\' will be prepended or \'-\' if single character" value=""/>\n-        </repeat>\n-     </xml>\n-     <xml name="additparam">\n-        <param name="edit_params" type="select" display="radio" label="Add any additional parameters to the generated tool form so they are user editable?"\n-             help="If no (default), users will NOT be able to alter any additional parameters.'..b'); o.close()"/>\n-    <output name="new_tool" file="toolfactory_pyrevpos_tgz_sample" compare="sim_size" delta="6000" />\n-    <!-- <output name="output" file="output2_sample" ftype="txt" compare="diff" lines_diff = "10" /> -->\n-</test>\n-</tests>\n-<help>\n-\n-.. class:: warningmark\n-\n-**Details and attribution**\n-(see GTF_)\n-\n-**Local Admins ONLY**\n-Only users whose IDs found in the local admin_user configuration setting in universe_wsgi.ini can run this tool.\n-\n-**If you find a bug**\n-Please raise an issue, or even better, submit a pull request fixing it, on the github repository GTF_\n-\n-**What it does**\n-This tool optionally generates normal workflow compatible first class Galaxy tools\n-\n-Generated tools can run existing binary packages that become requirements, existing scripts, or new scripts pasted into this tool form.\n-Pasted scripts are written so they are part of the new tool and cannot be adjusted by the downstream user.\n-Binary packages are managed by the dependency subsystem - conda usually, so anything in bioconda or conda_forge is available for example.\n-\n-Any number of parameters can be built into the new tool form for passing in to the script or executable at runtime.\n-These can be editable by the downstream user or baked in.\n-\n-When you run this tool, your executable or script and supplied parameter values will be run to produce a canonical\n-set of outputs - these are used to construct a test for the new tool.\n-\n-If tool generation is required, a new tarball compatible with any Galaxy toolshed is created.\n-It can be unpacked in your galaxy/tools directory and manually added to tool_conf.xml, or\n-installed into any toolshed from where it can be installed into your Galaxy.\n-\n-\n-.. class:: warningmark\n-\n-**Note to system administrators**\n-This tool offers *NO* built in protection against malicious scripts. It should only be installed on private/personnal Galaxy instances.\n-Admin_users will have the power to do anything they want as the Galaxy user if you install this tool.\n-\n-.. class:: warningmark\n-\n-**Use on public servers**  is STRONGLY discouraged for obvious reasons\n-\n-The tools generated by this tool will run just as securely as any other normal installed Galaxy tool but like any other new tools, should always be checked carefully before installation.\n-We recommend that you follow the good code hygiene practices associated with safe toolshed practices.\n-\n-Here\'s a sample python script that can be cut and pasted into the tool form, suitable for positional parameter passing:\n-\n-::\n-\n-    # reverse order of text by row\n-    import sys\n-    inp = sys.argv[1]\n-    outp = sys.argv[2]\n-    i = open(inp,\'r\').readlines()\n-    o = open(outp,\'w\')\n-    for row in i:\n-      rs = row.rstrip()\n-      rs = list(rs)\n-      rs.reverse()\n-      o.write(\'\'.join(rs))\n-      o.write(\'\\n\')\n-    o.close()\n-\n-With argparse style parameters:\n-\n-::\n-\n-    # reverse order of text by row\n-    import argparse\n-    parser = argparse.ArgumentParser()\n-    a = parser.add_argument\n-    a(\'--infile\',default=\'\')\n-    a(\'--outfile\',default=None)\n-    args = parser.parse_args()\n-    inp = args.infile\n-    outp = args.outfile\n-    i = open(inp,\'r\').readlines()\n-    o = open(outp,\'w\')\n-    for row in i:\n-      rs = row.rstrip()\n-      rs = list(rs)\n-      rs.reverse()\n-      o.write(\'\'.join(rs))\n-      o.write(\'\\n\')\n-    o.close()\n-\n-\n-Paper_ :\n-\n-Creating re-usable tools from scripts: The Galaxy Tool Factory\n-Ross Lazarus; Antony Kaspi; Mark Ziemann; The Galaxy Team\n-Bioinformatics 2012; doi: 10.1093/bioinformatics/bts573\n-\n-**Licensing**\n-\n-Copyright Ross Lazarus (ross period lazarus at gmail period com) May 2012\n-All rights reserved.\n-Licensed under the LGPL_\n-\n-.. _LGPL: http://www.gnu.org/copyleft/lesser.html\n-.. _GTF:  https://github.com/fubar2/toolfactory\n-.. _Paper: http://bioinformatics.oxfordjournals.org/cgi/reprint/bts573\n-\n-\n-</help>\n-<citations>\n-    <citation type="doi">10.1093/bioinformatics/bts573</citation>\n-</citations>\n-</tool>\n-\n-\n'
b
diff -r f8700bed1e17 -r e95d9fe5ab50 toolfactory/test-data/input1_sample
--- a/toolfactory/test-data/input1_sample Tue Aug 18 08:25:43 2020 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
b
@@ -1,166 +0,0 @@
-*WARNING before you start*
-
- Install this tool on a private Galaxy ONLY
- Please NEVER on a public or production instance

-Updated august 2014 by John Chilton adding citation support
-
-Updated august 8 2014 to fix bugs reported by Marius van den Beek
-
-Please cite the resource at
-http://bioinformatics.oxfordjournals.org/cgi/reprint/bts573?ijkey=lczQh1sWrMwdYWJ&keytype=ref
-if you use this tool in your published work.
-
-**Short Story**
-
-This is an unusual Galaxy tool capable of generating new Galaxy tools.
-It works by exposing *unrestricted* and therefore extremely dangerous scripting
-to all designated administrators of the host Galaxy server, allowing them to
-run scripts in R, python, sh and perl over multiple selected input data sets,
-writing a single new data set as output.
-
-*You have a working r/python/perl/bash script or any executable with positional or argparse style parameters*
-
-It can be turned into an ordinary Galaxy tool in minutes, using a Galaxy tool.
-
-
-**Automated generation of new Galaxy tools for installation into any Galaxy**
-
-A test is generated using small sample test data inputs and parameter settings you supply.
-Once the test case outputs have been produced, they can be used to build a
-new Galaxy tool. The supplied script or executable is baked as a requirement
-into a new, ordinary Galaxy tool, fully workflow compatible out of the box.
-Generated tools are installed via a tool shed by an administrator
-and work exactly like all other Galaxy tools for your users.
-
-**More Detail**
-
-To use the ToolFactory, you should have prepared a script to paste into a
-text box, or have a package in mind and a small test input example ready to select from your history
-to test your new script.
-
-```planemo test rgToolFactory2.xml --galaxy_root ~/galaxy --test_data ~/galaxy/tools/tool_makers/toolfactory/test-data``` works for me
-
-There is an example in each scripting language on the Tool Factory form. You
-can just cut and paste these to try it out - remember to select the right
-interpreter please. You'll also need to create a small test data set using
-the Galaxy history add new data tool.
-
-If the script fails somehow, use the "redo" button on the tool output in
-your history to recreate the form complete with broken script. Fix the bug
-and execute again. Rinse, wash, repeat.
-
-Once the script runs sucessfully, a new Galaxy tool that runs your script
-can be generated. Select the "generate" option and supply some help text and
-names. The new tool will be generated in the form of a new Galaxy datatype
-*toolshed.gz* - as the name suggests, it's an archive ready to upload to a
-Galaxy ToolShed as a new tool repository.
-
-Once it's in a ToolShed, it can be installed into any local Galaxy server
-from the server administrative interface.
-
-Once the new tool is installed, local users can run it - each time, the script
-that was supplied when it was built will be executed with the input chosen
-from the user's history. In other words, the tools you generate with the
-ToolFactory run just like any other Galaxy tool,but run your script every time.
-
-Tool factory tools are perfect for workflow components. One input, one output,
-no variables.
-
-*To fully and safely exploit the awesome power* of this tool,
-Galaxy and the ToolShed, you should be a developer installing this
-tool on a private/personal/scratch local instance where you are an
-admin_user. Then, if you break it, you get to keep all the pieces see
-https://bitbucket.org/fubar/galaxytoolfactory/wiki/Home
-
-**Installation**
-This is a Galaxy tool. You can install it most conveniently using the
-administrative "Search and browse tool sheds" link. Find the Galaxy Main
-toolshed at https://toolshed.g2.bx.psu.edu/ and search for the toolfactory
-repository. Open it and review the code and select the option to install it.
-
-If you can't get the tool that way, the xml and py files here need to be
-copied into a new tools
-subdirectory such as tools/toolfactory Your tool_conf.xml needs a new entry
-pointing to the xml
-file - something like::
-
-  <section name="Tool building tools" id="toolbuilders">
-    <tool file="toolfactory/rgToolFactory.xml"/>
-  </section>
-
-If not already there,
-please add:
-<datatype extension="toolshed.gz" type="galaxy.datatypes.binary:Binary"
-mimetype="multipart/x-gzip" subclass="True" />
-to your local data_types_conf.xml.
-
-
-**Restricted execution**
-
-The tool factory tool itself will then be usable ONLY by admin users -
-people with IDs in admin_users in universe_wsgi.ini **Yes, that's right. ONLY
-admin_users can run this tool** Think about it for a moment. If allowed to
-run any arbitrary script on your Galaxy server, the only thing that would
-impede a miscreant bent on destroying all your Galaxy data would probably
-be lack of appropriate technical skills.
-
-**What it does** 
-
-This is a tool factory for simple scripts in python, R and
-perl currently. Functional tests are automatically generated. How cool is that.
-
-LIMITED to simple scripts that read one input from the history. Optionally can
-write one new history dataset, and optionally collect any number of outputs
-into links on an autogenerated HTML index page for the user to navigate -
-useful if the script writes images and output files - pdf outputs are shown
-as thumbnails and R's bloated pdf's are shrunk with ghostscript so that and
-imagemagik need to be available.
-
-Generated tools can be edited and enhanced like any Galaxy tool, so start
-small and build up since a generated script gets you a serious leg up to a
-more complex one.
-
-**What you do**
-
-You paste and run your script, you fix the syntax errors and
-eventually it runs. You can use the redo button and edit the script before
-trying to rerun it as you debug - it works pretty well.
-
-Once the script works on some test data, you can generate a toolshed compatible
-gzip file containing your script ready to run as an ordinary Galaxy tool in
-a repository on your local toolshed. That means safe and largely automated
-installation in any production Galaxy configured to use your toolshed.
-
-**Generated tool Security**
-
-Once you install a generated tool, it's just
-another tool - assuming the script is safe. They just run normally and their
-user cannot do anything unusually insecure but please, practice safe toolshed.
-Read the code before you install any tool. Especially this one - it is really scary.
-
-**Send Code**
-
-Patches and suggestions welcome as bitbucket issues please?
-
-**Attribution**
-
-Creating re-usable tools from scripts: The Galaxy Tool Factory
-Ross Lazarus; Antony Kaspi; Mark Ziemann; The Galaxy Team
-Bioinformatics 2012; doi: 10.1093/bioinformatics/bts573
-
-http://bioinformatics.oxfordjournals.org/cgi/reprint/bts573?ijkey=lczQh1sWrMwdYWJ&keytype=ref
-
-**Licensing**
-
-Copyright Ross Lazarus 2010
-ross lazarus at g mail period com
-
-All rights reserved.
-
-Licensed under the LGPL
-
-**Obligatory screenshot**
-
-http://bitbucket.org/fubar/galaxytoolmaker/src/fda8032fe989/images/dynamicScriptTool.png
-
b
diff -r f8700bed1e17 -r e95d9fe5ab50 toolfactory/test-data/output2_sample
--- a/toolfactory/test-data/output2_sample Tue Aug 18 08:25:43 2020 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
b
@@ -1,165 +0,0 @@
-*trats uoy erofeb GNINRAW*
-
-YLNO yxalaG etavirp a no loot siht llatsnI 
-ecnatsni noitcudorp ro cilbup a no REVEN esaelP 
-
-troppus noitatic gnidda notlihC nhoJ yb 4102 tsugua detadpU
-
-keeB ned nav suiraM yb detroper sgub xif ot 4102 8 tsugua detadpU
-
-ta ecruoser eht etic esaelP
-fer=epytyek&JWYdwMrWs1hQzcl=yekji?375stb/tnirper/igc/gro.slanruojdrofxo.scitamrofnioib//:ptth
-.krow dehsilbup ruoy ni loot siht esu uoy fi
-
-**yrotS trohS**
-
-.sloot yxalaG wen gnitareneg fo elbapac loot yxalaG lausunu na si sihT
-gnitpircs suoregnad ylemertxe erofereht dna *detcirtsernu* gnisopxe yb skrow tI
-ot meht gniwolla ,revres yxalaG tsoh eht fo srotartsinimda detangised lla ot
-,stes atad tupni detceles elpitlum revo lrep dna hs ,nohtyp ,R ni stpircs nur
-.tuptuo sa tes atad wen elgnis a gnitirw
-
-*sretemarap elyts esrapgra ro lanoitisop htiw elbatucexe yna ro tpircs hsab/lrep/nohtyp/r gnikrow a evah uoY*
-
-.loot yxalaG a gnisu ,setunim ni loot yxalaG yranidro na otni denrut eb nac tI
-
-
-**yxalaG yna otni noitallatsni rof sloot yxalaG wen fo noitareneg detamotuA**
-
-.ylppus uoy sgnittes retemarap dna stupni atad tset elpmas llams gnisu detareneg si tset A
-a dliub ot desu eb nac yeht ,decudorp neeb evah stuptuo esac tset eht ecnO
-tnemeriuqer a sa dekab si elbatucexe ro tpircs deilppus ehT .loot yxalaG wen
-.xob eht fo tuo elbitapmoc wolfkrow ylluf ,loot yxalaG yranidro ,wen a otni
-rotartsinimda na yb dehs loot a aiv dellatsni era sloot detareneG
-.sresu ruoy rof sloot yxalaG rehto lla ekil yltcaxe krow dna
-
-**liateD eroM**
-
-a otni etsap ot tpircs a deraperp evah dluohs uoy ,yrotcaFlooT eht esu oT
-yrotsih ruoy morf tceles ot ydaer elpmaxe tupni tset llams a dna dnim ni egakcap a evah ro ,xob txet
-.tpircs wen ruoy tset ot
-
-em rof skrow ```atad-tset/yrotcafloot/srekam_loot/sloot/yxalag/~ atad_tset-- yxalag/~ toor_yxalag-- lmx.2yrotcaFlooTgr tset omenalp```
-
-uoY .mrof yrotcaF looT eht no egaugnal gnitpircs hcae ni elpmaxe na si erehT
-thgir eht tceles ot rebmemer - tuo ti yrt ot eseht etsap dna tuc tsuj nac
-gnisu tes atad tset llams a etaerc ot deen osla ll'uoY .esaelp reterpretni
-.loot atad wen dda yrotsih yxalaG eht
-
-ni tuptuo loot eht no nottub "oder" eht esu ,wohemos sliaf tpircs eht fI
-gub eht xiF .tpircs nekorb htiw etelpmoc mrof eht etaercer ot yrotsih ruoy
-.taeper ,hsaw ,esniR .niaga etucexe dna
-
-tpircs ruoy snur taht loot yxalaG wen a ,yllufssecus snur tpircs eht ecnO
-dna txet pleh emos ylppus dna noitpo "etareneg" eht tceleS .detareneg eb nac
-epytatad yxalaG wen a fo mrof eht ni detareneg eb lliw loot wen ehT .seman
-a ot daolpu ot ydaer evihcra na s'ti ,stseggus eman eht sa - *zg.dehsloot*
-.yrotisoper loot wen a sa dehSlooT yxalaG
-
-revres yxalaG lacol yna otni dellatsni eb nac ti ,dehSlooT a ni s'ti ecnO
-.ecafretni evitartsinimda revres eht morf
-
-tpircs eht ,emit hcae - ti nur nac sresu lacol ,dellatsni si loot wen eht ecnO
-nesohc tupni eht htiw detucexe eb lliw tliub saw ti nehw deilppus saw taht
-eht htiw etareneg uoy sloot eht ,sdrow rehto nI .yrotsih s'resu eht morf
-.emit yreve tpircs ruoy nur tub,loot yxalaG rehto yna ekil tsuj nur yrotcaFlooT
-
-,tuptuo eno ,tupni enO .stnenopmoc wolfkrow rof tcefrep era sloot yrotcaf looT
-.selbairav on
-
-,loot siht fo *rewop emosewa eht tiolpxe ylefas dna ylluf oT*
-siht gnillatsni repoleved a eb dluohs uoy ,dehSlooT eht dna yxalaG
-na era uoy erehw ecnatsni lacol hctarcs/lanosrep/etavirp a no loot
-ees seceip eht lla peek ot teg uoy ,ti kaerb uoy fi ,nehT .resu_nimda
-emoH/ikiw/yrotcaflootyxalag/rabuf/gro.tekcubtib//:sptth
-
-**noitallatsnI**
-eht gnisu yltneinevnoc tsom ti llatsni nac uoY .loot yxalaG a si sihT
-niaM yxalaG eht dniF .knil "sdehs loot esworb dna hcraeS" evitartsinimda
-yrotcafloot eht rof hcraes dna /ude.usp.xb.2g.dehsloot//:sptth ta dehsloot
-.ti llatsni ot noitpo eht tceles dna edoc eht weiver dna ti nepO .yrotisoper
-
-eb ot deen ereh selif yp dna lmx eht ,yaw taht loot eht teg t'nac uoy fI
-sloot wen a otni deipoc
-yrtne wen a sdeen lmx.fnoc_loot ruoY yrotcafloot/sloot sa hcus yrotceridbus
-lmx eht ot gnitniop
-::ekil gnihtemos - elif
-
->"sredliubloot"=di "sloot gnidliub looT"=eman noitces<  
->/"lmx.yrotcaFlooTgr/yrotcafloot"=elif loot<    
->noitces/<  
-
-,ereht ydaerla ton fI
-:dda esaelp
-"yraniB:yranib.sepytatad.yxalag"=epyt "zg.dehsloot"=noisnetxe epytatad<
->/ "eurT"=ssalcbus "pizg-x/trapitlum"=epytemim
-.lmx.fnoc_sepyt_atad lacol ruoy ot
-
-
-**noitucexe detcirtseR**
-
-- sresu nimda yb YLNO elbasu eb neht lliw flesti loot yrotcaf loot ehT
-YLNO .thgir s'taht ,seY** ini.igsw_esrevinu ni sresu_nimda ni sDI htiw elpoep
-ot dewolla fI .tnemom a rof ti tuoba knihT **loot siht nur nac sresu_nimda
-dluow taht gniht ylno eht ,revres yxalaG ruoy no tpircs yrartibra yna nur
-ylbaborp dluow atad yxalaG ruoy lla gniyortsed no tneb tnaercsim a edepmi
-.slliks lacinhcet etairporppa fo kcal eb
-
-**seod ti tahW**
-
-dna R ,nohtyp ni stpircs elpmis rof yrotcaf loot a si sihT
-.taht si looc woH .detareneg yllacitamotua era stset lanoitcnuF .yltnerruc lrep
-
-nac yllanoitpO .yrotsih eht morf tupni eno daer taht stpircs elpmis ot DETIMIL
-stuptuo fo rebmun yna tcelloc yllanoitpo dna ,tesatad yrotsih wen eno etirw
-- etagivan ot resu eht rof egap xedni LMTH detarenegotua na no sknil otni
-nwohs era stuptuo fdp - selif tuptuo dna segami setirw tpircs eht fi lufesu
-dna taht os tpircstsohg htiw knurhs era s'fdp detaolb s'R dna slianbmuht sa
-.elbaliava eb ot deen kigamegami
-
-trats os ,loot yxalaG yna ekil decnahne dna detide eb nac sloot detareneG
-a ot pu gel suoires a uoy steg tpircs detareneg a ecnis pu dliub dna llams
-.eno xelpmoc erom
-
-**od uoy tahW**
-
-dna srorre xatnys eht xif uoy ,tpircs ruoy nur dna etsap uoY
-erofeb tpircs eht tide dna nottub oder eht esu nac uoY .snur ti yllautneve
-.llew ytterp skrow ti - gubed uoy sa ti nurer ot gniyrt
-
-elbitapmoc dehsloot a etareneg nac uoy ,atad tset emos no skrow tpircs eht ecnO
-ni loot yxalaG yranidro na sa nur ot ydaer tpircs ruoy gniniatnoc elif pizg
-detamotua ylegral dna efas snaem tahT .dehsloot lacol ruoy no yrotisoper a
-.dehsloot ruoy esu ot derugifnoc yxalaG noitcudorp yna ni noitallatsni
-
-**ytiruceS loot detareneG**
-
-tsuj s'ti ,loot detareneg a llatsni uoy ecnO
-rieht dna yllamron nur tsuj yehT .efas si tpircs eht gnimussa - loot rehtona
-.dehsloot efas ecitcarp ,esaelp tub erucesni yllausunu gnihtyna od tonnac resu
-.yracs yllaer si ti - eno siht yllaicepsE .loot yna llatsni uoy erofeb edoc eht daeR
-
-**edoC dneS**
-
-?esaelp seussi tekcubtib sa emoclew snoitseggus dna sehctaP
-
-**noitubirttA**
-
-yrotcaF looT yxalaG ehT :stpircs morf sloot elbasu-er gnitaerC
-maeT yxalaG ehT ;nnameiZ kraM ;ipsaK ynotnA ;surazaL ssoR
-375stb/scitamrofnioib/3901.01 :iod ;2102 scitamrofnioiB
-
-fer=epytyek&JWYdwMrWs1hQzcl=yekji?375stb/tnirper/igc/gro.slanruojdrofxo.scitamrofnioib//:ptth
-
-**gnisneciL**
-
-0102 surazaL ssoR thgirypoC
-moc doirep liam g ta surazal ssor
-
-.devreser sthgir llA
-
-LPGL eht rednu desneciL
-
-**tohsneercs yrotagilbO**
-
-gnp.looTtpircScimanyd/segami/989ef2308adf/crs/rekamlootyxalag/rabuf/gro.tekcubtib//:ptth
b
diff -r f8700bed1e17 -r e95d9fe5ab50 toolfactory/test-data/pyrevpos.python
--- a/toolfactory/test-data/pyrevpos.python Tue Aug 18 08:25:43 2020 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
[
@@ -1,13 +0,0 @@
-# reverse order of text by row
-import sys
-inp = sys.argv[1]
-outp = sys.argv[2]
-i = open(inp,'r').readlines()
-o = open(outp,'w')
-for row in i:
-   rs = row.rstrip()
-   rs = list(rs)
-   rs.reverse()
-   o.write(''.join(rs))
-o.close() 
-
b
diff -r f8700bed1e17 -r e95d9fe5ab50 toolfactory/test-data/test1_log.txt
--- a/toolfactory/test-data/test1_log.txt Tue Aug 18 08:25:43 2020 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
b
@@ -1,1 +0,0 @@
-## Executing Toolfactory generated command line = python /tmp/pyrevposq5dmcdy1.python /tmp/tmpqrksf8sd/files/5/b/9/dataset_5b952a86-87df-44ad-a415-ea549f3f0cee.dat output2
b
diff -r f8700bed1e17 -r e95d9fe5ab50 toolfactory/test-data/toolfactory_pyrevpos_tgz_sample
b
Binary file toolfactory/test-data/toolfactory_pyrevpos_tgz_sample has changed
b
diff -r f8700bed1e17 -r e95d9fe5ab50 toolfactory/testtf.sh
--- a/toolfactory/testtf.sh Tue Aug 18 08:25:43 2020 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
b
@@ -1,2 +0,0 @@
-planemo test --no_cleanup --no_dependency_resolution --skip_venv --galaxy_root ~/galaxy ~/galaxy/tools/tool_makers/toolfactory &>foo
-