Mercurial > repos > ggricourt > data_manager_bigg
annotate data_manager/bigg_model_sbml_fetcher.py @ 5:5e6f76507721 draft
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
author | ggricourt |
---|---|
date | Thu, 24 Feb 2022 10:56:46 +0000 |
parents | 2f837e65b33c |
children | 65589e7476b6 |
rev | line source |
---|---|
0
262b8d79bc08
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 19ad973add8651c1a18c1bda789e9296a57044b1"
ggricourt
parents:
diff
changeset
|
1 import argparse |
5
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
2 import ast |
0
262b8d79bc08
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 19ad973add8651c1a18c1bda789e9296a57044b1"
ggricourt
parents:
diff
changeset
|
3 import json |
262b8d79bc08
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 19ad973add8651c1a18c1bda789e9296a57044b1"
ggricourt
parents:
diff
changeset
|
4 import os |
262b8d79bc08
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 19ad973add8651c1a18c1bda789e9296a57044b1"
ggricourt
parents:
diff
changeset
|
5 import sys |
5
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
6 import time |
0
262b8d79bc08
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 19ad973add8651c1a18c1bda789e9296a57044b1"
ggricourt
parents:
diff
changeset
|
7 try: |
262b8d79bc08
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 19ad973add8651c1a18c1bda789e9296a57044b1"
ggricourt
parents:
diff
changeset
|
8 # For Python 3.0 and later |
262b8d79bc08
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 19ad973add8651c1a18c1bda789e9296a57044b1"
ggricourt
parents:
diff
changeset
|
9 from urllib.request import Request, urlopen |
262b8d79bc08
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 19ad973add8651c1a18c1bda789e9296a57044b1"
ggricourt
parents:
diff
changeset
|
10 except ImportError: |
262b8d79bc08
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 19ad973add8651c1a18c1bda789e9296a57044b1"
ggricourt
parents:
diff
changeset
|
11 # Fall back to Python 2 imports |
262b8d79bc08
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 19ad973add8651c1a18c1bda789e9296a57044b1"
ggricourt
parents:
diff
changeset
|
12 from urllib2 import Request, urlopen |
262b8d79bc08
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 19ad973add8651c1a18c1bda789e9296a57044b1"
ggricourt
parents:
diff
changeset
|
13 |
5
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
14 |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
15 MODEL_URL = 'http://bigg.ucsd.edu/static/models/' |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
16 MODEL_DETAIL_URL = 'http://bigg.ucsd.edu/api/v2/models/' |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
17 |
0
262b8d79bc08
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 19ad973add8651c1a18c1bda789e9296a57044b1"
ggricourt
parents:
diff
changeset
|
18 |
5
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
19 def url_download(url, path): |
0
262b8d79bc08
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 19ad973add8651c1a18c1bda789e9296a57044b1"
ggricourt
parents:
diff
changeset
|
20 try: |
5
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
21 with urlopen(Request(url)) as fod: |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
22 with open(path, 'wb') as dst: |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
23 while True: |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
24 chunk = fod.read(2**10) |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
25 if chunk: |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
26 dst.write(chunk) |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
27 else: |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
28 break |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
29 except Exception as e: |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
30 sys.exit(str(e)) |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
31 |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
32 |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
33 def url_json(url): |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
34 data = {} |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
35 try: |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
36 with urlopen(Request(url)) as fod: |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
37 data = fod.read().encode('utf-8') |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
38 data = ast.literal_evals(data) |
0
262b8d79bc08
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 19ad973add8651c1a18c1bda789e9296a57044b1"
ggricourt
parents:
diff
changeset
|
39 except Exception as e: |
262b8d79bc08
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 19ad973add8651c1a18c1bda789e9296a57044b1"
ggricourt
parents:
diff
changeset
|
40 sys.exit(str(e)) |
5
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
41 return data |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
42 |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
43 |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
44 def get_model_organism(model_id): |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
45 data = url_json(MODEL_DETAIL_URL + model_id) |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
46 org = data.get('organism', 'undefined') |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
47 res = "(%s) %s" (model_id, org) |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
48 return res |
0
262b8d79bc08
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 19ad973add8651c1a18c1bda789e9296a57044b1"
ggricourt
parents:
diff
changeset
|
49 |
262b8d79bc08
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 19ad973add8651c1a18c1bda789e9296a57044b1"
ggricourt
parents:
diff
changeset
|
50 |
5
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
51 def download_entries(model_ids, workdir): |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
52 for model_id in model_ids: |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
53 model_filename = model_id + '.xml' |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
54 path = os.path.abspath(os.path.join(workdir, model_filename)) |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
55 |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
56 url_download(MODEL_DETAIL_URL + model_filename, path) |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
57 data_manager_entry = {} |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
58 data_manager_entry['value'] = model_id |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
59 data_manager_entry['name'] = get_model_organism(model_id) |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
60 data_manager_entry['path'] = path |
0
262b8d79bc08
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 19ad973add8651c1a18c1bda789e9296a57044b1"
ggricourt
parents:
diff
changeset
|
61 |
5
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
62 # Make sure that less than 10 requests per second, as required by host (http://bigg.ucsd.edu/data_access) |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
63 time.sleep(1) |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
64 yield data_manager_entry |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
65 |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
66 |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
67 if __name__ == '__main__': |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
68 parser = argparse.ArgumentParser() |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
69 pinput = parser.add_mutually_exclusive_group(required=True) |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
70 pinput.add_argument('--model-id', help='Model BIGG id') |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
71 pinput.add_argument('--model-all', action='store_true', help='Download all models') |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
72 parser.add_argument('--out-file', help='JSON output file') |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
73 args = parser.parse_args() |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
74 |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
75 # Init. |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
76 data_manager_json = {'data_tables': {}} |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
77 with open(args.out_file) as fh: |
0
262b8d79bc08
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 19ad973add8651c1a18c1bda789e9296a57044b1"
ggricourt
parents:
diff
changeset
|
78 params = json.load(fh) |
262b8d79bc08
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 19ad973add8651c1a18c1bda789e9296a57044b1"
ggricourt
parents:
diff
changeset
|
79 |
262b8d79bc08
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 19ad973add8651c1a18c1bda789e9296a57044b1"
ggricourt
parents:
diff
changeset
|
80 workdir = params['output_data'][0]['extra_files_path'] |
262b8d79bc08
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 19ad973add8651c1a18c1bda789e9296a57044b1"
ggricourt
parents:
diff
changeset
|
81 os.makedirs(workdir) |
262b8d79bc08
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 19ad973add8651c1a18c1bda789e9296a57044b1"
ggricourt
parents:
diff
changeset
|
82 |
5
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
83 model_ids = [] |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
84 if args.model_id: |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
85 model_ids.append(args.model_id) |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
86 else: |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
87 data = url_json(MODEL_DETAIL_URL) |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
88 for result in data.get("results", []): |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
89 model_ids.append(result.get("bigg_id")) |
0
262b8d79bc08
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 19ad973add8651c1a18c1bda789e9296a57044b1"
ggricourt
parents:
diff
changeset
|
90 |
5
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
91 entries = list(download_entries(model_ids, workdir)) |
0
262b8d79bc08
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 19ad973add8651c1a18c1bda789e9296a57044b1"
ggricourt
parents:
diff
changeset
|
92 |
5
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
93 # Write data. |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
94 data_manager_json['data_tables']['bigg_model_sbml'] = entries |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
95 with open(args.out_file, 'w') as fh: |
5e6f76507721
"planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit 47caed1dd87e80ae226fabb584e9d63d7c86a436-dirty"
ggricourt
parents:
3
diff
changeset
|
96 json.dump(data_manager_json, fh, sort_keys=True) |