# HG changeset patch # User fubar # Date 1709721469 0 # Node ID 460d5b6c5d9827ad95cdf0d675ee117e79ba422b # Parent 3e53204c2419f9fc5add24e87857e03f547e689c planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a-dirty diff -r 3e53204c2419 -r 460d5b6c5d98 autogenJB2.py --- a/autogenJB2.py Wed Mar 06 00:23:02 2024 +0000 +++ b/autogenJB2.py Wed Mar 06 10:37:49 2024 +0000 @@ -90,13 +90,14 @@ "style": {}, "style_labels": {}, } - + track_conf = {} listtracks = trackList # foo.paf must have a foo_paf.fasta or fasta.gz to match tnames = [x[2] for x in listtracks] texts = [x[1] for x in listtracks] for i, track in enumerate(listtracks): tpath, trext, trackname = track[:3] + track_conf["dataset_id"] = trackname if trext == "paf": refname = trackname + "_paf.fasta" refdat = [x[2] for x in listtracks if x[2] == refname] @@ -107,13 +108,13 @@ ) sys.exit(3) else: - track_conf = { + track_conf.update({ "conf": { "options": { "paf": {"genome": refdat, "genome_label": trackname} } } - } + }) elif trext == "bam": ipath = track[3] if not os.path.exists(ipath): @@ -121,7 +122,7 @@ cmd = ["samtools", "index", "-b", "-o", ipath, os.path.realpath(track[0])] sys.stdout.write('#### calling %s' % ' '.join(cmd)) jc.subprocess_check_call(cmd) - track_conf = {"conf": {"options": {"bam": {"bam_index": ipath}}}} + track_conf.update({"conf": {"options": {"bam": {"bam_index": ipath}}}}) elif trext == "cram": ipath = track[3] if not os.path.exists(ipath): @@ -130,9 +131,8 @@ cmd = ["samtools", "index", "-c", "-o", ipath, os.path.realpath(track[0])] sys.stdout.write('#### calling %s' % ' '.join(cmd)) jc.subprocess_check_call(cmd) - track_conf = {"conf": {"options": {"cram": {"cram_index": ipath}}}} - else: - track_conf = {} + track_conf.update({"conf": {"options": {"cram": {"cram_index": ipath}}}}) + track_conf["path"] = tpath track_conf["format"] = trext track_conf["name"] = trackname track_conf["label"] = trackname @@ -140,9 +140,9 @@ useuri = 'no' if useu: useuri = 'yes' - track_conf["trackfiles"] = [ - (tpath, trext, useuri, trackname, {}), - ] + track_conf["trackfiles"] = [ + (tpath, trext, useuri, trackname, {}), + ] track_conf["category"] = "Autogenerated" keys = jc.process_annotations(track_conf) diff -r 3e53204c2419 -r 460d5b6c5d98 cert.pem --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cert.pem Wed Mar 06 10:37:49 2024 +0000 @@ -0,0 +1,22 @@ +-----BEGIN CERTIFICATE----- +MIIDkzCCAnugAwIBAgIUPkTIC1+gbjdym20znN2BGDFoqywwDQYJKoZIhvcNAQEL +BQAwWTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM +GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDESMBAGA1UEAwwJMTI3LjAuMC4xMB4X +DTI0MDMwNjAxMjk0NVoXDTI1MDMwNjAxMjk0NVowWTELMAkGA1UEBhMCQVUxEzAR +BgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5 +IEx0ZDESMBAGA1UEAwwJMTI3LjAuMC4xMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEAz3FqW3iKpF7PhAwPXL7H6EvkbGgI5yoYhKqFmBHSjR2CC9sGCx62 +U/PZKkckFZO5gwYyrZ5DVYFjMlQjw7XsekuDGkHhCRWU7iLQDj+7KZZM+kjIfzb7 +LXcmkq5MnbsxdaSZrJ9rr+stczVqTdmY/WSdwz9areNsziSugiuk3G6IwqONgrW+ +uFVByiC6SDp3Wfk7X5KooI/iWVYZlDkO4lDFJ1je3g/MutCQ8pNh7q/XxYcnjonH +bWR/01HXuwrUI2cyzPS3Ngk9J6RRCxRlfurf5bgh5m0H4ThA8krEULR1xAoFjCGZ +Zw/1p2CtoaqRMsaemuUx/kjfXov9bCD45wIDAQABo1MwUTAdBgNVHQ4EFgQUXblV +0dWUZEBKMrR9POoZaP3THGEwHwYDVR0jBBgwFoAUXblV0dWUZEBKMrR9POoZaP3T +HGEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAlTkK79w3db8H +7h0AvKs+rQxECjG3jgMvnFTUvFc6UBULIgnHmLcBUgeSQGWByo7bMildtcEbV1uk +rvPlNaferhgIilzKi6L9Enk7ji3sSkmFYLJWZitf2n0tx1uK5I3udxRQQDa8Ah65 +6HNOr3Cfz9bY2rUfVuYjRYvtQq/m4a9WFSG+ZzCpRU87H9EcPU3DymJt8hBD+f++ +WgPXRRrIslUB/h/MnUxK5tFQwHxk+gj9nOyvGXdG64kUZxhKMzc9Gk5iaXplG3hY +RfFo47gsuFh2ycHLapKavYbuELYpjziSj9rn/GdnT6RmWQ7ay5j8vmoEElg0bLDx +xG190t5wBQ== +-----END CERTIFICATE----- diff -r 3e53204c2419 -r 460d5b6c5d98 jb2_urlconf.py --- a/jb2_urlconf.py Wed Mar 06 00:23:02 2024 +0000 +++ b/jb2_urlconf.py Wed Mar 06 10:37:49 2024 +0000 @@ -1,6 +1,6 @@ inconf = open('config.json', 'r').readlines() with open('config.json.local', 'w') as bak: - bak.write('\n'.join(inconf)) + bak.write(''.join(inconf)) urlbase = "https://galaxy.genomicsvl-students.cloud.edu.au/jbrowse/hum/" utag = '"uri":' for i, row in enumerate(inconf): @@ -10,7 +10,7 @@ parth = row.split(utag)[1].strip() inconf[i] = '%s%s' % (urlbase, parth) with open('config.json', 'w') as outconf: - outconf.write('\n'.join(inconf)) + outconf.write(''.join(inconf)) diff -r 3e53204c2419 -r 460d5b6c5d98 jb2_webserver.py --- a/jb2_webserver.py Wed Mar 06 00:23:02 2024 +0000 +++ b/jb2_webserver.py Wed Mar 06 10:37:49 2024 +0000 @@ -38,11 +38,12 @@ import os import re import socketserver +import ssl import webbrowser from http.server import SimpleHTTPRequestHandler -DEFAULT_PORT = 8081 +DEFAULT_PORT = 8443 def copy_byte_range(infile, outfile, start=None, stop=None, bufsize=16 * 1024): @@ -153,6 +154,17 @@ class ThreadedTCPServer(socketserver.ThreadingMixIn, socketserver.TCPServer): allow_reuse_address = True + def server_bind(self): + ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) + ctx.load_cert_chain('cert.pem', 'key.pem') + socketserver.TCPServer.server_bind(self) + self.socket = ctx.wrap_socket( self.socket, server_hostname = "127.0.0.1", server_side=False,) + + + def get_request(self): + (socket, addr) = socketserver.TCPServer.get_request(self) + socket.do_handshake() + return (socket, addr) if __name__ == "__main__": parser = argparse.ArgumentParser( @@ -171,17 +183,17 @@ ) parser.add_argument( "--bind", - default="0.0.0.0", - help="IP address to bind to (default: 0.0.0.0)", + default="127.0.0.1", + help="IP address to bind to (default: 127.0.0.1)", ) args = parser.parse_args() handler = functools.partial(RangeRequestHandler, directory=args.root) - webbrowser.open(f"http://{args.bind}:{args.port}") + webbrowser.open(f"https://{args.bind}:{args.port}") with ThreadedTCPServer((args.bind, args.port), handler) as httpd: print( - f"Serving HTTP on {args.bind} port {args.port} (http://{args.bind}:{args.port}/)" + f"Serving HTTPS on {args.bind} port {args.port} (https://{args.bind}:{args.port}/)" ) httpd.serve_forever() diff -r 3e53204c2419 -r 460d5b6c5d98 jbrowse2.py --- a/jbrowse2.py Wed Mar 06 00:23:02 2024 +0000 +++ b/jbrowse2.py Wed Mar 06 10:37:49 2024 +0000 @@ -1148,6 +1148,8 @@ outputTrackConfig["key"] = track_human_label outputTrackConfig["useuri"] = useuri + outputTrackConfig["path"] = dataset_path + outputTrackConfig["ext"] = dataset_ext outputTrackConfig["trackset"] = track.get("trackset", {}) outputTrackConfig["label"] = "%s_%i_%s" % ( diff -r 3e53204c2419 -r 460d5b6c5d98 jbrowse2.xml --- a/jbrowse2.xml Wed Mar 06 00:23:02 2024 +0000 +++ b/jbrowse2.xml Wed Mar 06 10:37:49 2024 +0000 @@ -138,7 +138,18 @@ #for $tg in $track_groups: #for $track in $tg.data_tracks: - #if $track.data_format.useuri.insource == "history": + #if $track.data_format.useuri.insource == "uri": + + + + + + + + + + + #else if $track.data_format.useuri.insource == "history": #if $track.data_format.useuri.annotation: @@ -204,7 +215,7 @@ ${track.data_format.is_protein} ${track.data_format.min_gap} - #else if str($track.data_format.data_format_select) == "gene_calls": + #else if str($track.data_format.data_format_select) == "gff": #if $track.data_format.match_part.match_part_select == "true": ${track.data_format.match_part.name} @@ -229,6 +240,9 @@ #else if str($track.data_format.data_format_select) == "cool": + #else if str($track.data_format.data_format_select) == "bed": + + #else if str($track.data_format.data_format_select) == "sparql": @@ -240,17 +254,6 @@ #end if - #else if track.data_format.useuri.annouri: - - - - - - - - - - #end if #end for #end for @@ -312,11 +315,12 @@ + - + @@ -350,8 +354,8 @@ - - + + @@ -373,6 +377,10 @@ + + + + @@ -497,7 +505,7 @@ - + @@ -525,7 +533,7 @@ - + @@ -549,7 +557,7 @@ - + @@ -574,7 +582,7 @@ - + @@ -601,7 +609,7 @@ - + @@ -629,7 +637,7 @@ - + @@ -658,7 +666,7 @@ - + @@ -692,7 +700,7 @@ - + @@ -712,7 +720,7 @@ - + @@ -755,7 +763,7 @@ - + @@ -790,7 +798,7 @@ - + @@ -815,7 +823,7 @@ - + diff -r 3e53204c2419 -r 460d5b6c5d98 key.pem --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/key.pem Wed Mar 06 10:37:49 2024 +0000 @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDPcWpbeIqkXs+E +DA9cvsfoS+RsaAjnKhiEqoWYEdKNHYIL2wYLHrZT89kqRyQVk7mDBjKtnkNVgWMy +VCPDtex6S4MaQeEJFZTuItAOP7splkz6SMh/NvstdyaSrkyduzF1pJmsn2uv6y1z +NWpN2Zj9ZJ3DP1qt42zOJK6CK6TcbojCo42Ctb64VUHKILpIOndZ+Ttfkqigj+JZ +VhmUOQ7iUMUnWN7eD8y60JDyk2Hur9fFhyeOicd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iP +ZELFouFq8ETCqL3B43l0Gt5C3UK7/GdTs0aaZ0qUAuZ7F6cE66zHq7qz+p1HnLVD +Ai8wHOBpbNPe3kuCscPvY4lCbRSost7GvlETxRUCgYEA2MBujMY9zGTMbxkJX0YT +d1qRr24vD+81rsmjg08XYxBf8GgApH/IdSF73JOyUTxpHJA1lFRWgtrE9+jsKuhS +HsghgDZZ8a0Qh4qqPgRq0cd5PqZbuE3eX+ox/dh5K9LHWu22IqjabGt6n2SPlWgr +wmJiknbrsHBnrnsPNIUweM0= +-----END PRIVATE KEY----- diff -r 3e53204c2419 -r 460d5b6c5d98 macros.xml --- a/macros.xml Wed Mar 06 00:23:02 2024 +0000 +++ b/macros.xml Wed Mar 06 10:37:49 2024 +0000 @@ -528,7 +528,7 @@ - +