Mercurial > repos > sanbi-uwc > build_ctb_explorer
annotate build_ctb_explorer.py @ 1:0819302402d3 draft
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
| author | sanbi-uwc |
|---|---|
| date | Fri, 10 Jun 2016 05:01:56 -0400 |
| parents | e80a66932a1e |
| children | 4af7d0144c82 |
| rev | line source |
|---|---|
|
0
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
1 #!/usr/bin/env python |
|
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
2 from __future__ import print_function |
|
1
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
3 |
|
0
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
4 import argparse |
|
1
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
5 import datetime |
|
0
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
6 import glob |
|
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
7 import shutil |
|
1
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
8 |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
9 import os |
|
0
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
10 |
|
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
11 try: |
|
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
12 from urllib.parse import urlparse |
|
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
13 except ImportError: |
|
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
14 from urlparse import urlparse |
|
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
15 import logging |
|
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
16 |
|
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
17 log = logging.getLogger(__name__) |
|
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
18 |
|
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
19 |
|
1
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
20 def copy_output_file_to_dataset(dir_name, input_dir, dt_type=None): |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
21 """ |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
22 Copy the datasets file to the news dataset cbt_browser |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
23 :param dir_name: the target output directory for the ctb_explorer dataset |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
24 :param input_dir: the input files |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
25 :param dt_type: the type of input dataset (neo4jdb, jbrowse - default to None) |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
26 :return: boolean |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
27 """ |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
28 dt_loc = input_dir.rpartition('/')[2].replace(".dat", "_files") |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
29 if dt_type: |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
30 if dt_type == "neo4jdb": |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
31 src_files = glob.glob(os.path.dirname(input_dir) + '/{}/{}'.format(dt_loc, dt_type) + "/*" ) |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
32 else: |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
33 src_files = glob.glob(os.path.dirname(input_dir) + '/{}'.format(dt_loc) + "/*" ) |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
34 else: |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
35 return False |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
36 for file_name in src_files: |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
37 if os.path.isfile(file_name): |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
38 shutil.copy2(file_name, dir_name) |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
39 elif os.path.isdir(file_name): |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
40 # create the parent dir before copytree |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
41 os.chdir(dir_name) |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
42 shutil.copytree(file_name, file_name.rsplit('/', 1)[-1]) |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
43 return True |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
44 |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
45 |
|
0
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
46 class BuildCtbExplorerRunner(object): |
|
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
47 def __init__(self, args=None): |
|
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
48 """ |
|
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
49 Initializes an object to run CtbRunner in Galaxy. |
|
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
50 """ |
|
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
51 # Check whether the options are specified and saves them into the object |
|
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
52 self.args = args |
|
1
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
53 self.output_neo4jdb = args.output_neo4jdb |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
54 self.output_jbrowser = args.output_jbrowser |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
55 self.input_neo4jdb = args.input_neo4jdb |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
56 self.input_jbrowser = args.input_jbrowser |
|
0
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
57 |
|
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
58 def build_ctb_explorer(self): |
|
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
59 """ |
|
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
60 :rtype: boolean |
|
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
61 """ |
|
1
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
62 if copy_output_file_to_dataset(self.output_neo4jdb, self.input_neo4jdb, dt_type="neo4jdb") and \ |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
63 copy_output_file_to_dataset(self.output_jbrowser, self.input_jbrowser, dt_type="jbrowser"): |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
64 print("CTB Report run time: %s" % str(datetime.date.today())) |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
65 print("Neo4jDB - Input: %s" % str(self.args.input_neo4jdb)) |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
66 print("JBrowser - Input: %s" % str(self.args.input_jbrowser)) |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
67 else: |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
68 return False |
|
0
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
69 return True |
|
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
70 |
|
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
71 |
|
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
72 def main(): |
|
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
73 parser = argparse.ArgumentParser(description="Tool used to build a combat-tb explorer dataset") |
|
1
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
74 parser.add_argument('--output_neo4jdb') |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
75 parser.add_argument('--output_jbrowser') |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
76 parser.add_argument('--input_neo4jdb') |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
77 parser.add_argument('--input_jbrowser') |
|
0
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
78 args = parser.parse_args() |
|
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
79 |
|
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
80 ctb_explorer_runner = BuildCtbExplorerRunner(args) |
|
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
81 |
|
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
82 # make the output directory (neo4j) |
|
1
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
83 if not os.path.exists(args.output_neo4jdb): |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
84 os.makedirs(args.output_neo4jdb) |
|
0
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
85 |
|
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
86 # make the output directory (jbrowser) |
|
1
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
87 if not os.path.exists(args.output_jbrowser): |
|
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
88 os.makedirs(args.output_jbrowser) |
|
0
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
89 |
|
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
90 status = ctb_explorer_runner.build_ctb_explorer() |
|
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
91 |
|
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
92 if status is None: |
|
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
93 exit(1) |
|
e80a66932a1e
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit a955714f2385d7b35f795cf1442a15492ecacb8f
sanbi-uwc
parents:
diff
changeset
|
94 |
|
1
0819302402d3
planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit ea7fb439a8f9fbb055af51db4aa3dd3469f273b0
sanbi-uwc
parents:
0
diff
changeset
|
95 if __name__ == "__main__": main() |
