Mercurial > repos > gga > apollo_create_account
comparison json2iframe.py @ 9:0c3a940da13d draft
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/apollo commit 49fe23e3fb330234900946352fbc3a86deeeb639
author | gga |
---|---|
date | Mon, 29 Jul 2019 10:10:43 -0400 |
parents | f889e757ca93 |
children | 115d5e5c88d4 |
comparison
equal
deleted
inserted
replaced
8:e80d29fd2a33 | 9:0c3a940da13d |
---|---|
8 if __name__ == '__main__': | 8 if __name__ == '__main__': |
9 parser = argparse.ArgumentParser(description='Sample script to add an attribute to a feature via web services') | 9 parser = argparse.ArgumentParser(description='Sample script to add an attribute to a feature via web services') |
10 parser.add_argument('apollo', help='Complete Apollo URL') | 10 parser.add_argument('apollo', help='Complete Apollo URL') |
11 parser.add_argument('json', type=argparse.FileType("r"), help='JSON Data') | 11 parser.add_argument('json', type=argparse.FileType("r"), help='JSON Data') |
12 parser.add_argument('external_apollo_url') | 12 parser.add_argument('external_apollo_url') |
13 parser.add_argument('--tracklist', action='store_true') | |
13 | 14 |
14 args = parser.parse_args() | 15 args = parser.parse_args() |
15 | 16 |
16 # https://fqdn/apollo/annotator/loadLink?loc=NC_005880:0..148317&organism=326&tracks= | 17 # https://fqdn/apollo/annotator/loadLink?loc=NC_005880:0..148317&organism=326 |
17 data = json.load(args.json) | 18 data = json.load(args.json) |
18 | 19 |
19 # This is base64 encoded to get past the toolshed's filters. | 20 # This is base64 encoded to get past the toolshed's filters. |
20 HTML_TPL = """ | 21 HTML_TPL = """ |
21 <html> | 22 <html> |
22 <head> | 23 <head> |
23 <title>Embedded Apollo Access</title> | 24 <title>Embedded Apollo Access</title> |
24 <style type="text/css">body {{margin: 0;}} iframe {{border: 0;width: 100%;height: 100%}}</style> | 25 <style type="text/css">body {{margin: 0;}} iframe {{border: 0;width: 100%;height: 100%}}</style> |
25 </head> | 26 </head> |
26 <body> | 27 <body> |
27 <iframe src="{base_url}/annotator/loadLink?loc={chrom}&organism={orgId}&tracklist=1"></iframe> | 28 <iframe src="{base_url}/annotator/loadLink?loc={chrom}&organism={orgId}{tracklist}"></iframe> |
28 </body> | 29 </body> |
29 </html> | 30 </html> |
30 """ | 31 """ |
31 | 32 |
32 print(HTML_TPL.format(base_url=args.external_apollo_url, chrom="", orgId=data[0]['id'])) | 33 print(HTML_TPL.format(base_url=args.external_apollo_url, chrom="", orgId=data[0]['id'], tracklist='&tracklist=1' if args.tracklist else '')) |