annotate data_manager/interproscan.py @ 3:0df47f8552f6 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 01e8e726d711c0685f46d3146e4fe0f2a1306036
author iuc
date Wed, 07 Dec 2022 13:41:38 +0000
parents 0db4f153d86d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
1 #!/usr/bin/env python
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
2
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
3 import argparse
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
4 import hashlib
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
5 import json
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
6 import operator
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
7 import os
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
8 import re
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
9 import shutil
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
10 import subprocess
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
11 import sys
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
12 import tarfile
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
13
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
14 import requests
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
15
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
16
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
17 GH_REPO_API = 'https://api.github.com/repos/ebi-pf-team/interproscan/'
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
18 MD5_URL = 'http://ftp.ebi.ac.uk/pub/software/unix/iprscan/5/{version}/interproscan-{version}-64-bit.tar.gz.md5'
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
19 DATA_URL = 'http://ftp.ebi.ac.uk/pub/software/unix/iprscan/5/{version}/interproscan-{version}-64-bit.tar.gz'
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
20
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
21 # For tests: download a smaller archive containing *some* data
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
22 PARTIAL_URL = 'https://github.com/ebi-pf-team/interproscan/archive/{version}.tar.gz'
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
23
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
24
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
25 def list_tags(url=None):
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
26
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
27 if not url:
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
28 url = GH_REPO_API + 'tags'
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
29
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
30 resp = requests.get(url=url)
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
31 data = resp.json()
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
32
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
33 tags = []
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
34 for tag in data:
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
35 if re.match(r"^[0-9]\.[0-9]{2}-[0-9]{2}\.[0-9]$", tag['name']):
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
36 tags.append(tag['name'])
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
37
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
38 if 'next' in resp.links:
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
39 tags += list_tags(resp.links['next']['url'])
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
40
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
41 return sorted(tags)
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
42
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
43
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
44 def download_file(url, dest):
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
45 with requests.get(url, stream=True) as r:
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
46 r.raise_for_status()
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
47 with open(dest, 'wb') as f:
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
48 for chunk in r.iter_content(chunk_size=8192):
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
49 f.write(chunk)
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
50
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
51
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
52 def main():
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
53 parser = argparse.ArgumentParser(description='Download data for InterProScan')
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
54 parser.add_argument('--partial', dest='partial', action='store_true', help='Only download a small subset of data (for testing)')
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
55 parser.add_argument('-v', '--version', help='Specify an InterProScan version (default: latest)')
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
56 parser.add_argument("datatable_name")
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
57 parser.add_argument("galaxy_datamanager_filename")
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
58
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
59 args = parser.parse_args()
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
60
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
61 with open(args.galaxy_datamanager_filename) as fh:
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
62 config = json.load(fh)
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
63
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
64 output_directory = config.get("output_data", [{}])[0].get("extra_files_path", None)
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
65 data_manager_dict = {}
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
66 data_manager_dict["data_tables"] = config.get("data_tables", {})
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
67 data_manager_dict["data_tables"][args.datatable_name] = data_manager_dict[
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
68 "data_tables"
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
69 ].get(args.datatable_name, [])
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
70
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
71 os.mkdir(output_directory)
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
72
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
73 all_tags = list_tags()
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
74
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
75 if args.version:
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
76 if args.version not in all_tags:
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
77 raise RuntimeError("Version '%s' is not valid" % args.version)
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
78 tag = args.version
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
79 else:
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
80 tag = all_tags[-1]
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
81
3
0df47f8552f6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 01e8e726d711c0685f46d3146e4fe0f2a1306036
iuc
parents: 1
diff changeset
82 setup_script = 'initial_setup.py'
0df47f8552f6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 01e8e726d711c0685f46d3146e4fe0f2a1306036
iuc
parents: 1
diff changeset
83 sub_version = re.match(r"^[0-9]\.([0-9]{2})-[0-9]{2}\.[0-9]$", tag)
0df47f8552f6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 01e8e726d711c0685f46d3146e4fe0f2a1306036
iuc
parents: 1
diff changeset
84 if sub_version and len(sub_version.groups()) == 1 and int(sub_version.group(1)) >= 58:
0df47f8552f6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 01e8e726d711c0685f46d3146e4fe0f2a1306036
iuc
parents: 1
diff changeset
85 # The setup script was renamed in 5.58
0df47f8552f6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 01e8e726d711c0685f46d3146e4fe0f2a1306036
iuc
parents: 1
diff changeset
86 setup_script = 'setup.py'
0df47f8552f6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 01e8e726d711c0685f46d3146e4fe0f2a1306036
iuc
parents: 1
diff changeset
87 else:
0df47f8552f6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 01e8e726d711c0685f46d3146e4fe0f2a1306036
iuc
parents: 1
diff changeset
88 raise RuntimeError("Sorry, this data manager can only download data for InterProScan >= 5.58-91.0. Use the 0.0.2 version for older versions of InterProScan.")
0df47f8552f6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 01e8e726d711c0685f46d3146e4fe0f2a1306036
iuc
parents: 1
diff changeset
89
0
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
90 print("Will download data for InterProScan version: %s" % tag)
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
91
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
92 print("Getting MD5 checksum:")
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
93 md5 = requests.get(url=MD5_URL.format(version=tag)).text
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
94 if not re.match(r"^([a-fA-F\d]{32}) interproscan-[0-9]\.[0-9]{2}-[0-9]{2}\.[0-9]-64-bit.tar.gz$", md5):
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
95 raise RuntimeError("Got invalid MD5 from the InterProScan FTP server: '%s'" % md5)
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
96 print("%s" % md5)
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
97
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
98 if args.partial:
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
99 print("Downloading partial data tarball...")
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
100 dest_tar = os.path.join(output_directory, PARTIAL_URL.format(version=tag).split('/')[-1])
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
101 download_file(PARTIAL_URL.format(version=tag), dest_tar)
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
102 else:
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
103 print("Downloading data tarball...")
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
104 dest_tar = os.path.join(output_directory, DATA_URL.format(version=tag).split('/')[-1])
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
105 download_file(DATA_URL.format(version=tag), dest_tar)
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
106
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
107 print("Finished, now checking md5...")
1
0db4f153d86d "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 7fbeae66de8617e525cd968a2ef89b0be448a618"
iuc
parents: 0
diff changeset
108 m = hashlib.md5()
0db4f153d86d "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 7fbeae66de8617e525cd968a2ef89b0be448a618"
iuc
parents: 0
diff changeset
109 blocksize = 2**20
0db4f153d86d "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 7fbeae66de8617e525cd968a2ef89b0be448a618"
iuc
parents: 0
diff changeset
110 with open(dest_tar, 'rb') as tarball:
0db4f153d86d "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 7fbeae66de8617e525cd968a2ef89b0be448a618"
iuc
parents: 0
diff changeset
111 while True:
0db4f153d86d "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 7fbeae66de8617e525cd968a2ef89b0be448a618"
iuc
parents: 0
diff changeset
112 buf = tarball.read(blocksize)
0db4f153d86d "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 7fbeae66de8617e525cd968a2ef89b0be448a618"
iuc
parents: 0
diff changeset
113 if not buf:
0db4f153d86d "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 7fbeae66de8617e525cd968a2ef89b0be448a618"
iuc
parents: 0
diff changeset
114 break
0db4f153d86d "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 7fbeae66de8617e525cd968a2ef89b0be448a618"
iuc
parents: 0
diff changeset
115 m.update(buf)
0db4f153d86d "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 7fbeae66de8617e525cd968a2ef89b0be448a618"
iuc
parents: 0
diff changeset
116 md5_computed = m.hexdigest()
0
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
117 if not md5.startswith(md5_computed):
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
118 raise RuntimeError("MD5 check failed: computed '%s', expected '%s'" % (md5_computed, md5))
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
119
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
120 print("Ok, now extracting data...")
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
121 tar = tarfile.open(dest_tar, "r:gz")
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
122 tar.extractall(output_directory)
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
123 tar.close()
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
124
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
125 if args.partial:
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
126 print("Moving partial data files around...")
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
127 shutil.move(os.path.join(output_directory, 'interproscan-%s' % tag, 'core/jms-implementation/support-mini-x86-32/data/'), os.path.join(output_directory, 'data'))
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
128 else:
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
129 print("Moving data files around...")
1
0db4f153d86d "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 7fbeae66de8617e525cd968a2ef89b0be448a618"
iuc
parents: 0
diff changeset
130 shutil.move(os.path.join(output_directory, 'interproscan-%s' % tag, 'data'), os.path.join(output_directory, 'data'))
0
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
131
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
132 print("Done, removing tarball and unneeded files...")
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
133 os.remove(dest_tar)
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
134 shutil.rmtree(os.path.join(output_directory, 'interproscan-%s' % tag))
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
135
3
0df47f8552f6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 01e8e726d711c0685f46d3146e4fe0f2a1306036
iuc
parents: 1
diff changeset
136 print("Running {} (index hmm models)...".format(setup_script))
0
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
137 # Write a temp properties file in work dir
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
138 prop_file_src = os.path.join(os.path.dirname(os.path.realpath(shutil.which("interproscan.sh"))), 'interproscan.properties')
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
139 with open(prop_file_src, 'r') as prop:
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
140 prop_content = prop.read()
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
141 prop_content = re.sub(r'^data\.directory=.*$', 'data.directory=%s' % os.path.join(output_directory, 'data'), prop_content, flags=re.M)
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
142 with open('interproscan.properties', 'w') as prop:
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
143 prop.write(prop_content)
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
144 # Run the index command
3
0df47f8552f6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 01e8e726d711c0685f46d3146e4fe0f2a1306036
iuc
parents: 1
diff changeset
145 cmd_args = [os.path.join(os.path.dirname(os.path.realpath(shutil.which("interproscan.sh"))), setup_script), 'interproscan.properties']
0
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
146 proc = subprocess.Popen(args=cmd_args, shell=False)
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
147 out, err = proc.communicate()
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
148 print(out)
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
149 print(err, file=sys.stderr)
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
150 return_code = proc.wait()
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
151 if return_code:
3
0df47f8552f6 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 01e8e726d711c0685f46d3146e4fe0f2a1306036
iuc
parents: 1
diff changeset
152 print("Error running {}.".format(setup_script), file=sys.stderr)
0
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
153 sys.exit(return_code)
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
154
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
155 data_manager_dict["data_tables"][args.datatable_name].append(
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
156 dict(
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
157 value=tag,
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
158 description="InterProScan %s" % tag,
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
159 interproscan_version=tag,
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
160 path=output_directory,
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
161 )
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
162 )
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
163
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
164 print("Saving data table content...")
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
165
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
166 data_manager_dict["data_tables"][args.datatable_name].sort(
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
167 key=operator.itemgetter("value"), reverse=True
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
168 )
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
169 with open(args.galaxy_datamanager_filename, "w") as fh:
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
170 json.dump(data_manager_dict, fh, indent=2, sort_keys=True)
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
171
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
172 print("Finished.")
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
173
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
174
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
175 if __name__ == "__main__":
e93e32359b67 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_interproscan commit 2f5d27a375fcc2e8d77914b3d9e402a9e2df2d97"
iuc
parents:
diff changeset
176 main()