6
|
1 import argparse
|
|
2 import urllib.request
|
|
3
|
|
4 from bioblend import galaxy
|
|
5
|
|
6 WF = "https://drive.google.com/uc?export=download&id=13xE8o7tucHGNA0qYkEP98FfUGl2wdOU5"
|
|
7 HIST = (
|
|
8 "https://zenodo.org/record/4686436/files/TFdemo_wf_april13_planemo.ga?download=1"
|
|
9 )
|
|
10 WF_FILE = "tf_workflow.ga"
|
|
11 HIST_FILE = "tf_history.tgz"
|
|
12
|
|
13
|
|
14 def _parser():
|
|
15 parser = argparse.ArgumentParser()
|
|
16 parser.add_argument(
|
|
17 "-g", "--galaxy", help="URL of target galaxy", default="http://localhost:8080"
|
|
18 )
|
|
19 parser.add_argument("-a", "--key", help="Galaxy admin key", default="8993d65865e6d6d1773c2c34a1cc207d")
|
|
20 return parser
|
|
21
|
|
22
|
|
23 def main():
|
|
24 """
|
|
25 load the planemo tool_factory demonstration history and tool generating workflow
|
|
26 fails in planemo served galaxies because there seems to be no user in trans?
|
|
27 """
|
|
28 args = _parser().parse_args()
|
|
29 urllib.request.urlretrieve(WF, WF_FILE)
|
|
30 urllib.request.urlretrieve(HIST, HIST_FILE)
|
|
31 assert args.key, "Need an administrative key for the target Galaxy supplied please"
|
|
32 gi = galaxy.GalaxyInstance(
|
|
33 url=args.galaxy, key=args.key, email="planemo@galaxyproject.org"
|
|
34 )
|
|
35 x = gi.workflows.import_workflow_from_local_path(WF_FILE, publish=True)
|
|
36 print(f"installed {WF_FILE} Returned = {x}\n")
|
|
37 x = gi.histories.import_history(file_path=HIST_FILE)
|
|
38 print(f"installed {HIST_FILE} Returned = {x}\n")
|
|
39
|
|
40
|
|
41 if __name__ == "__main__":
|
|
42 main()
|