annotate generate_macros.py @ 0:e2e9fae080ad draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
author iuc
date Thu, 01 Dec 2016 15:27:59 -0500
parents
children 6155fa39a899
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
1 #!/usr/bin/env python3
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
2
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
3 import ebeye_urllib
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
4
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
5
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
6 def add_option(value, name, selected=False):
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
7 to_write = '<option '
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
8 to_write += 'value="%s"' % (value)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
9 if selected:
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
10 to_write += ' selected="true"'
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
11 to_write += '>%s' % (name)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
12 to_write += '</option>\n'
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
13 return to_write
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
14
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
15
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
16 def add_select_parameter(name, label, multiple=False):
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
17 to_write = '<param '
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
18 to_write += 'name="%s" ' % (name)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
19 to_write += 'type="select" '
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
20 to_write += 'label="%s" ' % (label)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
21 if multiple:
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
22 to_write += 'multiple=\"true\"'
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
23 to_write += '>\n'
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
24 return to_write
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
25
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
26
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
27 def write_macros_file(macros_filepath, domains_fields):
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
28 spaces = ' '
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
29 to_write = '<macros>\n'
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
30
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
31 to_write += '%s<xml name="requirements">\n' % (spaces)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
32 to_write += '%s<requirements>\n' % (2 * spaces)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
33 to_write += '%s<requirement type="package" version="3.1.1">xmltramp2</requirement>\n' % (3 * spaces)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
34 to_write += '%s<requirement type="package" version="1.12">urllib3</requirement>\n' % (3 * spaces)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
35 to_write += '%s<yield/>\n' % (3 * spaces)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
36 to_write += '%s</requirements>\n' % (2 * spaces)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
37 to_write += '%s</xml>\n' % (spaces)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
38
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
39 to_write += '%s<xml name="inputs">\n' % (spaces)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
40
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
41 to_write += '%s<conditional name="searched_domain">\n' % (2 * spaces)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
42 to_write += '%s%s' % (3 * spaces, add_select_parameter(
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
43 'domain',
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
44 'Domain to query'))
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
45
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
46 sorted_domains = [(d, domains_fields[d]['name']) for d in domains_fields.keys()]
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
47 sorted_domains = sorted(sorted_domains, key=lambda tup: tup[1])
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
48 for domain in sorted_domains:
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
49 to_write += '%s%s' % (4 * spaces, add_option(
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
50 domain[0],
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
51 domain[1]))
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
52
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
53 to_write += '%s</param>\n\n' % (3 * spaces)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
54
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
55 for d in sorted_domains:
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
56 domain = d[0]
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
57 to_write += '%s<when value="%s">\n' % (3 * spaces, domain)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
58
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
59 to_write += '%s%s' % (4 * spaces, add_select_parameter(
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
60 'fields',
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
61 'Fields to extract',
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
62 multiple=True))
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
63 for field in domains_fields[domain]['retrievable_fields']:
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
64 to_write += '%s%s' % (5 * spaces, add_option(
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
65 field,
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
66 field,
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
67 selected=True))
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
68 to_write += '%s<validator type="no_options" message="Please select at least one field" />\n' % (5 * spaces)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
69 to_write += '%s</param>\n' % (4 * spaces)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
70
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
71 to_write += '%s<repeat name="queries" title="Add a query">\n' % (
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
72 4 * spaces)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
73
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
74 to_write += '%s%s' % (5 * spaces, add_select_parameter(
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
75 'combination_operation',
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
76 'Combination operation'))
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
77 to_write += '%s%s' % (6 * spaces, add_option('AND', 'AND'))
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
78 to_write += '%s%s' % (6 * spaces, add_option('OR', 'OR'))
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
79 to_write += '%s%s' % (6 * spaces, add_option('NOT', 'NOT'))
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
80 to_write += '%s</param>\n' % (5 * spaces)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
81
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
82 to_write += '%s%s' % (5 * spaces, add_select_parameter(
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
83 'query_field',
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
84 'Fields'))
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
85 for field in domains_fields[domain]['searchable_fields']:
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
86 to_write += '%s%s' % (6 * spaces, add_option(field, field))
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
87 to_write += '%s</param>\n' % (5 * spaces)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
88
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
89 to_write += '%s<conditional name="comp_operation">\n' % (5 * spaces)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
90 to_write += '%s%s' % (6 * spaces, add_select_parameter(
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
91 'operation',
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
92 'Comparison operation'))
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
93 to_write += '%s%s' % (7 * spaces, add_option('equal', 'equal'))
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
94 to_write += '%s%s' % (7 * spaces, add_option('not', 'not'))
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
95 to_write += '%s%s' % (7 * spaces, add_option('range', 'range'))
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
96 to_write += '%s</param>\n' % (6 * spaces)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
97
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
98 to_write += '%s<when value="equal">\n' % (6 * spaces)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
99 to_write += '%s<param name="query_text" type="text" label="Searched term"/>\n' % (7 * spaces)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
100 to_write += '%s</when>\n' % (6 * spaces)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
101
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
102 to_write += '%s<when value="not">\n' % (6 * spaces)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
103 to_write += '%s<param name="query_text" type="text" label="Searched term"/>\n' % (7 * spaces)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
104 to_write += '%s<param name="not_query_text" type="text" label="Limiting term"/>\n' % (7 * spaces)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
105 to_write += '%s</when>\n' % (6 * spaces)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
106
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
107 to_write += '%s<when value="range">\n' % (6 * spaces)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
108 to_write += '%s<param name="min" type="text" label="From"/>\n' % (7 * spaces)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
109 to_write += '%s<param name="max" type="text" label="To"/>\n' % (
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
110 7 * spaces)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
111 to_write += '%s</when>\n' % (6 * spaces)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
112
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
113 to_write += '%s</conditional>\n' % (5 * spaces)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
114
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
115 to_write += '%s</repeat>\n' % (4 * spaces)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
116
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
117 to_write += '%s</when>\n\n' % (3 * spaces)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
118
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
119 to_write += '%s</conditional>\n' % (2 * spaces)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
120 to_write += '%s</xml>\n' % (spaces)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
121
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
122 to_write += '%s<xml name="citations">\n' % (spaces)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
123 to_write += '%s<citations>\n' % (2 * spaces)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
124 to_write += '%s<citation type="doi">10.1093/bib/bbp065</citation>\n' % (3 * spaces)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
125 to_write += '%s<citation type="doi">10.1093/nar/gkv316</citation>\n' % (3 * spaces)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
126 to_write += '%s</citations>\n' % (2 * spaces)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
127 to_write += '%s</xml>\n' % (spaces)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
128
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
129 to_write += '</macros>\n'
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
130
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
131 with open(macros_filepath, 'w') as macros_file:
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
132 macros_file.write(to_write)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
133
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
134
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
135 def generate_macros():
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
136 domains_fields = ebeye_urllib.getDomainHierarchy()
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
137 write_macros_file('macros.xml', domains_fields)
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
138
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
139
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
140 if __name__ == '__main__':
e2e9fae080ad planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 7a9c88c1c80b80aaa63e55e9d9125b6a4dd695ac
iuc
parents:
diff changeset
141 generate_macros()