Mercurial > repos > gga > jbrowse_to_container
annotate jbrowse_to_container.py @ 0:11033bdad2ca draft
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/jbrowse commit f745b23c84a615bf434d717c8c0e553a012f0268
| author | gga | 
|---|---|
| date | Mon, 11 Sep 2017 05:49:16 -0400 | 
| parents | |
| children | 4065bcff8e85 | 
| rev | line source | 
|---|---|
| 0 
11033bdad2ca
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/jbrowse commit f745b23c84a615bf434d717c8c0e553a012f0268
 gga parents: diff
changeset | 1 #!/usr/bin/env python | 
| 
11033bdad2ca
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/jbrowse commit f745b23c84a615bf434d717c8c0e553a012f0268
 gga parents: diff
changeset | 2 from __future__ import print_function | 
| 
11033bdad2ca
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/jbrowse commit f745b23c84a615bf434d717c8c0e553a012f0268
 gga parents: diff
changeset | 3 | 
| 
11033bdad2ca
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/jbrowse commit f745b23c84a615bf434d717c8c0e553a012f0268
 gga parents: diff
changeset | 4 import argparse | 
| 
11033bdad2ca
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/jbrowse commit f745b23c84a615bf434d717c8c0e553a012f0268
 gga parents: diff
changeset | 5 import base64 | 
| 
11033bdad2ca
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/jbrowse commit f745b23c84a615bf434d717c8c0e553a012f0268
 gga parents: diff
changeset | 6 | 
| 
11033bdad2ca
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/jbrowse commit f745b23c84a615bf434d717c8c0e553a012f0268
 gga parents: diff
changeset | 7 | 
| 
11033bdad2ca
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/jbrowse commit f745b23c84a615bf434d717c8c0e553a012f0268
 gga parents: diff
changeset | 8 if __name__ == '__main__': | 
| 
11033bdad2ca
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/jbrowse commit f745b23c84a615bf434d717c8c0e553a012f0268
 gga parents: diff
changeset | 9 parser = argparse.ArgumentParser(description='Generates an iframe to access a jbrowse instance') | 
| 
11033bdad2ca
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/jbrowse commit f745b23c84a615bf434d717c8c0e553a012f0268
 gga parents: diff
changeset | 10 parser.add_argument('external_jbrowse_url', help='Jbrowse full URL') | 
| 
11033bdad2ca
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/jbrowse commit f745b23c84a615bf434d717c8c0e553a012f0268
 gga parents: diff
changeset | 11 | 
| 
11033bdad2ca
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/jbrowse commit f745b23c84a615bf434d717c8c0e553a012f0268
 gga parents: diff
changeset | 12 args = parser.parse_args() | 
| 
11033bdad2ca
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/jbrowse commit f745b23c84a615bf434d717c8c0e553a012f0268
 gga parents: diff
changeset | 13 | 
| 
11033bdad2ca
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/jbrowse commit f745b23c84a615bf434d717c8c0e553a012f0268
 gga parents: diff
changeset | 14 # This is base64 encoded to get past the toolshed's filters. | 
| 
11033bdad2ca
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/jbrowse commit f745b23c84a615bf434d717c8c0e553a012f0268
 gga parents: diff
changeset | 15 HTML_TPL = """ | 
| 
11033bdad2ca
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/jbrowse commit f745b23c84a615bf434d717c8c0e553a012f0268
 gga parents: diff
changeset | 16 PGh0bWw+PGhlYWQ+PHRpdGxlPkVtYmVkZGVkIEpCcm93c2UgQWNjZXNzPC90aXRsZT48c3R5bGUg | 
| 
11033bdad2ca
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/jbrowse commit f745b23c84a615bf434d717c8c0e553a012f0268
 gga parents: diff
changeset | 17 dHlwZT0idGV4dC9jc3MiPmJvZHkge3ttYXJnaW46IDA7fX0gaWZyYW1lIHt7Ym9yZGVyOiAwO3dp | 
| 
11033bdad2ca
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/jbrowse commit f745b23c84a615bf434d717c8c0e553a012f0268
 gga parents: diff
changeset | 18 ZHRoOiAxMDAlO2hlaWdodDogMTAwJX19PC9zdHlsZT48L2hlYWQ+PGJvZHk+PGlmcmFtZSBzcmM9 | 
| 
11033bdad2ca
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/jbrowse commit f745b23c84a615bf434d717c8c0e553a012f0268
 gga parents: diff
changeset | 19 IntiYXNlX3VybH0iPjwvaWZyYW1lPjwvYm9keT48L2h0bWw+DQo= | 
| 
11033bdad2ca
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/jbrowse commit f745b23c84a615bf434d717c8c0e553a012f0268
 gga parents: diff
changeset | 20 """ | 
| 
11033bdad2ca
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/jbrowse commit f745b23c84a615bf434d717c8c0e553a012f0268
 gga parents: diff
changeset | 21 HTML_TPL = base64.b64decode(HTML_TPL.replace('\n', '')) | 
| 
11033bdad2ca
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/jbrowse commit f745b23c84a615bf434d717c8c0e553a012f0268
 gga parents: diff
changeset | 22 | 
| 
11033bdad2ca
planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/jbrowse commit f745b23c84a615bf434d717c8c0e553a012f0268
 gga parents: diff
changeset | 23 print(HTML_TPL.format(base_url=args.external_jbrowse_url)) | 
