Mercurial > repos > fubar > jbrowse2
annotate jbrowse2.py @ 135:21bb464c1d53 draft default tip
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 78bf7abb931bf3d348837c7211cd3cff32486691
author | fubar |
---|---|
date | Sun, 15 Dec 2024 23:47:40 +0000 |
parents | ed3a21033188 |
children |
rev | line source |
---|---|
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1 #!/usr/bin/env python |
60
81d535970196
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 403a35e1245fa5e62f4be6116a725b9e4d9c353a
fubar
parents:
59
diff
changeset
|
2 |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
3 import argparse |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
4 import binascii |
104
9e3f69d9fed1
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
102
diff
changeset
|
5 import copy |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
6 import datetime |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
7 import json |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
8 import logging |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
9 import os |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
10 import re |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
11 import shutil |
73
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
12 import ssl |
120
af482048ca1a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 59fe39774d791bc684811b6ce03e13ef093d074e
fubar
parents:
118
diff
changeset
|
13 import string |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
14 import struct |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
15 import subprocess |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
16 import urllib.request |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
17 import xml.etree.ElementTree as ET |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
18 from collections import defaultdict |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
19 |
65
c81902830900
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 6dac6d6debf44c68eae2785e926fb8420f76958e
fubar
parents:
64
diff
changeset
|
20 logging.basicConfig(level=logging.DEBUG) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
21 log = logging.getLogger("jbrowse") |
7
b04fd993b31e
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 53a108d8153c955044ae7eb8cb06bdcfd0036717
fubar
parents:
6
diff
changeset
|
22 |
122
ae07c55ab96b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a9124072bc71dd670ee58ff8e4846e14d6d603ec
fubar
parents:
121
diff
changeset
|
23 JB2VER = "v2.15.4" |
99
990291e918c7
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
98
diff
changeset
|
24 # version pinned if cloning - but not cloning now |
89
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
25 logCommands = True |
98
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
26 # useful for seeing what's being written but not for production setups |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
27 TODAY = datetime.datetime.now().strftime("%Y-%m-%d") |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
28 SELF_LOCATION = os.path.dirname(os.path.realpath(__file__)) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
29 GALAXY_INFRASTRUCTURE_URL = None |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
30 mapped_chars = { |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
31 ">": "__gt__", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
32 "<": "__lt__", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
33 "'": "__sq__", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
34 '"': "__dq__", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
35 "[": "__ob__", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
36 "]": "__cb__", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
37 "{": "__oc__", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
38 "}": "__cc__", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
39 "@": "__at__", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
40 "#": "__pd__", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
41 "": "__cn__", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
42 } |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
43 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
44 |
98
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
45 INDEX_TEMPLATE = """<!doctype html> |
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
46 <html lang="en" style="height:100%"> |
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
47 <head> |
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
48 <meta charset="utf-8"/> |
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
49 <link rel="shortcut icon" href="./favicon.ico"/> |
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
50 <meta name="viewport" content="width=device-width,initial-scale=1"/> |
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
51 <meta name="theme-color" content="#000000"/> |
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
52 <meta name="description" content="A fast and flexible genome browser"/> |
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
53 <link rel="manifest" href="./manifest.json"/> |
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
54 <title>JBrowse</title> |
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
55 </script> |
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
56 </head> |
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
57 <body style="overscroll-behavior:none; height:100%; margin: 0;"> |
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
58 <iframe |
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
59 id="jbframe" |
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
60 title="JBrowse2" |
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
61 frameborder="0" |
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
62 width="100%" |
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
63 height="100%" |
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
64 src='index_noview.html?config=config.json__SESSION_SPEC__'> |
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
65 </iframe> |
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
66 </body> |
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
67 </html> |
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
68 """ |
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
69 |
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
70 |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
71 class ColorScaling(object): |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
72 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
73 COLOR_FUNCTION_TEMPLATE = """ |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
74 function(feature, variableName, glyphObject, track) {{ |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
75 var score = {score}; |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
76 {opacity} |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
77 return 'rgba({red}, {green}, {blue}, ' + opacity + ')'; |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
78 }} |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
79 """ |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
80 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
81 COLOR_FUNCTION_TEMPLATE_QUAL = r""" |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
82 function(feature, variableName, glyphObject, track) {{ |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
83 var search_up = function self(sf, attr){{ |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
84 if(sf.get(attr) !== undefined){{ |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
85 return sf.get(attr); |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
86 }} |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
87 if(sf.parent() === undefined) {{ |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
88 return; |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
89 }}else{{ |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
90 return self(sf.parent(), attr); |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
91 }} |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
92 }}; |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
93 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
94 var search_down = function self(sf, attr){{ |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
95 if(sf.get(attr) !== undefined){{ |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
96 return sf.get(attr); |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
97 }} |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
98 if(sf.children() === undefined) {{ |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
99 return; |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
100 }}else{{ |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
101 var kids = sf.children(); |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
102 for(var child_idx in kids){{ |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
103 var x = self(kids[child_idx], attr); |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
104 if(x !== undefined){{ |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
105 return x; |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
106 }} |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
107 }} |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
108 return; |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
109 }} |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
110 }}; |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
111 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
112 var color = ({user_spec_color} || search_up(feature, 'color') || search_down(feature, 'color') || {auto_gen_color}); |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
113 var score = (search_up(feature, 'score') || search_down(feature, 'score')); |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
114 {opacity} |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
115 if(score === undefined){{ opacity = 1; }} |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
116 var result = /^#?([a-f\d]{{2}})([a-f\d]{{2}})([a-f\d]{{2}})$/i.exec(color); |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
117 var red = parseInt(result[1], 16); |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
118 var green = parseInt(result[2], 16); |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
119 var blue = parseInt(result[3], 16); |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
120 if(isNaN(opacity) || opacity < 0){{ opacity = 0; }} |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
121 return 'rgba(' + red + ',' + green + ',' + blue + ',' + opacity + ')'; |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
122 }} |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
123 """ |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
124 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
125 OPACITY_MATH = { |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
126 "linear": """ |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
127 var opacity = (score - ({min})) / (({max}) - ({min})); |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
128 """, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
129 "logarithmic": """ |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
130 var opacity = Math.log10(score - ({min})) / Math.log10(({max}) - ({min})); |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
131 """, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
132 "blast": """ |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
133 var opacity = 0; |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
134 if(score == 0.0) {{ |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
135 opacity = 1; |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
136 }} else {{ |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
137 opacity = (20 - Math.log10(score)) / 180; |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
138 }} |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
139 """, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
140 } |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
141 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
142 BREWER_COLOUR_IDX = 0 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
143 BREWER_COLOUR_SCHEMES = [ |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
144 (166, 206, 227), |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
145 (31, 120, 180), |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
146 (178, 223, 138), |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
147 (51, 160, 44), |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
148 (251, 154, 153), |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
149 (227, 26, 28), |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
150 (253, 191, 111), |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
151 (255, 127, 0), |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
152 (202, 178, 214), |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
153 (106, 61, 154), |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
154 (255, 255, 153), |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
155 (177, 89, 40), |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
156 (228, 26, 28), |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
157 (55, 126, 184), |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
158 (77, 175, 74), |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
159 (152, 78, 163), |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
160 (255, 127, 0), |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
161 ] |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
162 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
163 BREWER_DIVERGING_PALLETES = { |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
164 "BrBg": ("#543005", "#003c30"), |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
165 "PiYg": ("#8e0152", "#276419"), |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
166 "PRGn": ("#40004b", "#00441b"), |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
167 "PuOr": ("#7f3b08", "#2d004b"), |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
168 "RdBu": ("#67001f", "#053061"), |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
169 "RdGy": ("#67001f", "#1a1a1a"), |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
170 "RdYlBu": ("#a50026", "#313695"), |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
171 "RdYlGn": ("#a50026", "#006837"), |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
172 "Spectral": ("#9e0142", "#5e4fa2"), |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
173 } |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
174 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
175 def __init__(self): |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
176 self.brewer_colour_idx = 0 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
177 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
178 def rgb_from_hex(self, hexstr): |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
179 # http://stackoverflow.com/questions/4296249/how-do-i-convert-a-hex-triplet-to-an-rgb-tuple-and-back |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
180 return struct.unpack("BBB", binascii.unhexlify(hexstr)) |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
181 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
182 def min_max_gff(self, gff_file): |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
183 min_val = None |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
184 max_val = None |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
185 with open(gff_file, "r") as handle: |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
186 for line in handle: |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
187 try: |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
188 value = float(line.split("\t")[5]) |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
189 min_val = min(value, (min_val or value)) |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
190 max_val = max(value, (max_val or value)) |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
191 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
192 if value < min_val: |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
193 min_val = value |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
194 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
195 if value > max_val: |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
196 max_val = value |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
197 except Exception: |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
198 pass |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
199 return min_val, max_val |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
200 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
201 def hex_from_rgb(self, r, g, b): |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
202 return "#%02x%02x%02x" % (r, g, b) |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
203 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
204 def _get_colours(self): |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
205 r, g, b = self.BREWER_COLOUR_SCHEMES[ |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
206 self.brewer_colour_idx % len(self.BREWER_COLOUR_SCHEMES) |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
207 ] |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
208 self.brewer_colour_idx += 1 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
209 return r, g, b |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
210 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
211 def parse_menus(self, track): |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
212 trackConfig = {"menuTemplate": [{}, {}, {}, {}]} |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
213 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
214 if "menu" in track["menus"]: |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
215 menu_list = [track["menus"]["menu"]] |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
216 if isinstance(track["menus"]["menu"], list): |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
217 menu_list = track["menus"]["menu"] |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
218 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
219 for m in menu_list: |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
220 tpl = { |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
221 "action": m["action"], |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
222 "label": m.get("label", "{name}"), |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
223 "iconClass": m.get("iconClass", "dijitIconBookmark"), |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
224 } |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
225 if "url" in m: |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
226 tpl["url"] = m["url"] |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
227 if "content" in m: |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
228 tpl["content"] = m["content"] |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
229 if "title" in m: |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
230 tpl["title"] = m["title"] |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
231 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
232 trackConfig["menuTemplate"].append(tpl) |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
233 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
234 return trackConfig |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
235 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
236 def parse_colours(self, track, trackFormat, gff3=None): |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
237 # Wiggle tracks have a bicolor pallete |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
238 trackConfig = {"style": {}} |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
239 if trackFormat == "wiggle": |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
240 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
241 trackConfig["style"]["pos_color"] = track["wiggle"]["color_pos"] |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
242 trackConfig["style"]["neg_color"] = track["wiggle"]["color_neg"] |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
243 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
244 if trackConfig["style"]["pos_color"] == "__auto__": |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
245 trackConfig["style"]["neg_color"] = self.hex_from_rgb( |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
246 *self._get_colours() |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
247 ) |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
248 trackConfig["style"]["pos_color"] = self.hex_from_rgb( |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
249 *self._get_colours() |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
250 ) |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
251 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
252 # Wiggle tracks can change colour at a specified place |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
253 bc_pivot = track["wiggle"]["bicolor_pivot"] |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
254 if bc_pivot not in ("mean", "zero"): |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
255 # The values are either one of those two strings |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
256 # or a number |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
257 bc_pivot = float(bc_pivot) |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
258 trackConfig["bicolor_pivot"] = bc_pivot |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
259 elif "scaling" in track: |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
260 if track["scaling"]["method"] == "ignore": |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
261 if track["scaling"]["scheme"]["color"] != "__auto__": |
23
39b717d934a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit be2268f4c11d54bdd44789dd88dd9017cad27887-dirty
fubar
parents:
19
diff
changeset
|
262 trackConfig["style"]["color"] = track["scaling"]["scheme"]["color"] |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
263 else: |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
264 trackConfig["style"]["color"] = self.hex_from_rgb( |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
265 *self._get_colours() |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
266 ) |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
267 else: |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
268 # Scored method |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
269 algo = track["scaling"]["algo"] |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
270 # linear, logarithmic, blast |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
271 scales = track["scaling"]["scales"] |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
272 # type __auto__, manual (min, max) |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
273 scheme = track["scaling"]["scheme"] |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
274 # scheme -> (type (opacity), color) |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
275 # ================================== |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
276 # GENE CALLS OR BLAST |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
277 # ================================== |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
278 if trackFormat == "blast": |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
279 red, green, blue = self._get_colours() |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
280 color_function = self.COLOR_FUNCTION_TEMPLATE.format( |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
281 **{ |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
282 "score": "feature._parent.get('score')", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
283 "opacity": self.OPACITY_MATH["blast"], |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
284 "red": red, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
285 "green": green, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
286 "blue": blue, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
287 } |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
288 ) |
23
39b717d934a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit be2268f4c11d54bdd44789dd88dd9017cad27887-dirty
fubar
parents:
19
diff
changeset
|
289 trackConfig["style"]["color"] = color_function.replace("\n", "") |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
290 elif trackFormat == "gene_calls": |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
291 # Default values, based on GFF3 spec |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
292 min_val = 0 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
293 max_val = 1000 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
294 # Get min/max and build a scoring function since JBrowse doesn't |
23
39b717d934a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit be2268f4c11d54bdd44789dd88dd9017cad27887-dirty
fubar
parents:
19
diff
changeset
|
295 if scales["type"] == "automatic" or scales["type"] == "__auto__": |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
296 min_val, max_val = self.min_max_gff(gff3) |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
297 else: |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
298 min_val = scales.get("min", 0) |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
299 max_val = scales.get("max", 1000) |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
300 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
301 if scheme["color"] == "__auto__": |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
302 user_color = "undefined" |
23
39b717d934a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit be2268f4c11d54bdd44789dd88dd9017cad27887-dirty
fubar
parents:
19
diff
changeset
|
303 auto_color = "'%s'" % self.hex_from_rgb(*self._get_colours()) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
304 elif scheme["color"].startswith("#"): |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
305 user_color = "'%s'" % self.hex_from_rgb( |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
306 *self.rgb_from_hex(scheme["color"][1:]) |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
307 ) |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
308 auto_color = "undefined" |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
309 else: |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
310 user_color = "undefined" |
23
39b717d934a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit be2268f4c11d54bdd44789dd88dd9017cad27887-dirty
fubar
parents:
19
diff
changeset
|
311 auto_color = "'%s'" % self.hex_from_rgb(*self._get_colours()) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
312 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
313 color_function = self.COLOR_FUNCTION_TEMPLATE_QUAL.format( |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
314 **{ |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
315 "opacity": self.OPACITY_MATH[algo].format( |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
316 **{"max": max_val, "min": min_val} |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
317 ), |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
318 "user_spec_color": user_color, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
319 "auto_gen_color": auto_color, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
320 } |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
321 ) |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
322 |
23
39b717d934a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit be2268f4c11d54bdd44789dd88dd9017cad27887-dirty
fubar
parents:
19
diff
changeset
|
323 trackConfig["style"]["color"] = color_function.replace("\n", "") |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
324 return trackConfig |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
325 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
326 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
327 def etree_to_dict(t): |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
328 if t is None: |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
329 return {} |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
330 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
331 d = {t.tag: {} if t.attrib else None} |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
332 children = list(t) |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
333 if children: |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
334 dd = defaultdict(list) |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
335 for dc in map(etree_to_dict, children): |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
336 for k, v in dc.items(): |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
337 dd[k].append(v) |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
338 d = {t.tag: {k: v[0] if len(v) == 1 else v for k, v in dd.items()}} |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
339 if t.attrib: |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
340 d[t.tag].update(("@" + k, v) for k, v in t.attrib.items()) |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
341 if t.text: |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
342 text = t.text.strip() |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
343 if children or t.attrib: |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
344 if text: |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
345 d[t.tag]["#text"] = text |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
346 else: |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
347 d[t.tag] = text |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
348 return d |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
349 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
350 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
351 INSTALLED_TO = os.path.dirname(os.path.realpath(__file__)) |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
352 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
353 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
354 def metadata_from_node(node): |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
355 metadata = {} |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
356 try: |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
357 if len(node.findall("dataset")) != 1: |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
358 # exit early |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
359 return metadata |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
360 except Exception: |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
361 return {} |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
362 |
127
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
363 for key, value in node.findall("dataset")[0].attrib.items(): |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
364 metadata["dataset_%s" % key] = value |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
365 |
19
bde6b1d09f7d
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1290bf486bc55c02fecd0327de10a28655a18e81-dirty
fubar
parents:
17
diff
changeset
|
366 if node.findall("history"): |
127
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
367 for key, value in node.findall("history")[0].attrib.items(): |
19
bde6b1d09f7d
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1290bf486bc55c02fecd0327de10a28655a18e81-dirty
fubar
parents:
17
diff
changeset
|
368 metadata["history_%s" % key] = value |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
369 |
19
bde6b1d09f7d
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1290bf486bc55c02fecd0327de10a28655a18e81-dirty
fubar
parents:
17
diff
changeset
|
370 if node.findall("metadata"): |
127
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
371 for key, value in node.findall("metadata")[0].attrib.items(): |
19
bde6b1d09f7d
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1290bf486bc55c02fecd0327de10a28655a18e81-dirty
fubar
parents:
17
diff
changeset
|
372 metadata["metadata_%s" % key] = value |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
373 # Additional Mappings applied: |
127
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
374 metadata["dataset_edam_format"] = ( |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
375 '<a target="_blank" href="http://edamontology.org/{0}">{1}</a>'.format( |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
376 metadata["dataset_edam_format"], metadata["dataset_file_ext"] |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
377 ) |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
378 ) |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
379 metadata["history_user_email"] = '<a href="mailto:{0}">{0}</a>'.format( |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
380 metadata["history_user_email"] |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
381 ) |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
382 metadata["hist_name"] = metadata["history_display_name"] |
127
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
383 metadata["history_display_name"] = ( |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
384 '<a target="_blank" href="{galaxy}/history/view/{encoded_hist_id}">{hist_name}</a>'.format( |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
385 galaxy=GALAXY_INFRASTRUCTURE_URL, |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
386 encoded_hist_id=metadata.get("history_id", "not available"), |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
387 hist_name=metadata.get("history_display_name", "not available"), |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
388 ) |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
389 ) |
19
bde6b1d09f7d
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1290bf486bc55c02fecd0327de10a28655a18e81-dirty
fubar
parents:
17
diff
changeset
|
390 if node.findall("tool"): |
127
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
391 for key, value in node.findall("tool")[0].attrib.items(): |
19
bde6b1d09f7d
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1290bf486bc55c02fecd0327de10a28655a18e81-dirty
fubar
parents:
17
diff
changeset
|
392 metadata["tool_%s" % key] = value |
127
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
393 metadata["tool_tool"] = ( |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
394 '<a target="_blank" href="{galaxy}/datasets/{encoded_id}/show_params">{tool_id}{tool_version}</a>'.format( |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
395 galaxy=GALAXY_INFRASTRUCTURE_URL, |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
396 encoded_id=metadata.get("dataset_id", ""), |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
397 tool_id=metadata.get("tool_tool_id", ""), |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
398 tool_version=metadata.get("tool_tool_version", ""), |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
399 ) |
19
bde6b1d09f7d
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1290bf486bc55c02fecd0327de10a28655a18e81-dirty
fubar
parents:
17
diff
changeset
|
400 ) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
401 return metadata |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
402 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
403 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
404 class JbrowseConnector(object): |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
405 def __init__(self, outdir, jbrowse2path): |
101
e4ba5f1da6ef
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
99
diff
changeset
|
406 self.bpPerPx = 50 |
80
dff27c9f6d72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7bb0fa234bdbc42768b30e426472a47b2523297f
fubar
parents:
79
diff
changeset
|
407 self.trackCounter = 0 # to avoid name clashes |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
408 self.assemblies = [] # these require more than a few line diff. |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
409 self.assmeta = {} |
79
14ecbe46ae9f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit d03454f949af9f3fff638f6a3e52fe42bc96be3b-dirty
fubar
parents:
78
diff
changeset
|
410 self.ass_first_contigs = ( |
14ecbe46ae9f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit d03454f949af9f3fff638f6a3e52fe42bc96be3b-dirty
fubar
parents:
78
diff
changeset
|
411 [] |
14ecbe46ae9f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit d03454f949af9f3fff638f6a3e52fe42bc96be3b-dirty
fubar
parents:
78
diff
changeset
|
412 ) # for default session - these are read as first line of the assembly .fai |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
413 self.giURL = GALAXY_INFRASTRUCTURE_URL |
118
794aecef8327
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7b6920fd88a86cdb48dc4af2c6be77161eb85699-dirty
fubar
parents:
112
diff
changeset
|
414 self.outdir = os.path.abspath(outdir) |
38
07849bf248e3
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit a74e469a81b38c7142f63de510ae31d3754d1767
fubar
parents:
37
diff
changeset
|
415 self.jbrowse2path = jbrowse2path |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
416 os.makedirs(self.outdir, exist_ok=True) |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
417 self.genome_names = [] |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
418 self.trackIdlist = [] |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
419 self.tracksToAdd = {} |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
420 self.config_json = {} |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
421 self.config_json_file = os.path.join(outdir, "config.json") |
123
160f33c6ba85
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a9124072bc71dd670ee58ff8e4846e14d6d603ec-dirty
fubar
parents:
122
diff
changeset
|
422 self.clone_jbrowse(realclone=False) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
423 |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
424 def get_cwd(self, cwd): |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
425 if cwd: |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
426 return self.outdir |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
427 else: |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
428 return subprocess.check_output(["pwd"]).decode("utf-8").strip() |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
429 |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
430 def subprocess_check_call(self, command, output=None, cwd=True): |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
431 if output: |
89
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
432 if logCommands: |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
433 log.debug( |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
434 "cd %s && %s > %s", self.get_cwd(cwd), " ".join(command), output |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
435 ) |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
436 subprocess.check_call(command, cwd=self.get_cwd(cwd), stdout=output) |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
437 else: |
89
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
438 if logCommands: |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
439 log.debug("cd %s && %s", self.get_cwd(cwd), " ".join(command)) |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
440 subprocess.check_call(command, cwd=self.get_cwd(cwd)) |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
441 |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
442 def subprocess_popen(self, command, cwd=True): |
89
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
443 if logCommands: |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
444 log.debug(command) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
445 p = subprocess.Popen( |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
446 command, |
118
794aecef8327
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7b6920fd88a86cdb48dc4af2c6be77161eb85699-dirty
fubar
parents:
112
diff
changeset
|
447 cwd=self.outdir, |
134
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
448 shell=True, |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
449 stdin=subprocess.PIPE, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
450 stdout=subprocess.PIPE, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
451 stderr=subprocess.PIPE, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
452 ) |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
453 output, err = p.communicate() |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
454 retcode = p.returncode |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
455 if retcode != 0: |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
456 log.error(command) |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
457 log.error(output) |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
458 log.error(err) |
99
990291e918c7
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
98
diff
changeset
|
459 raise RuntimeError("Command failed with exit code %s" % (retcode)) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
460 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
461 def subprocess_check_output(self, command): |
89
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
462 if logCommands: |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
463 log.debug(" ".join(command)) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
464 return subprocess.check_output(command, cwd=self.outdir) |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
465 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
466 def symlink_or_copy(self, src, dest): |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
467 if "GALAXY_JBROWSE_SYMLINKS" in os.environ and bool( |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
468 os.environ["GALAXY_JBROWSE_SYMLINKS"] |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
469 ): |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
470 cmd = ["ln", "-s", src, dest] |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
471 else: |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
472 cmd = ["cp", src, dest] |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
473 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
474 return self.subprocess_check_call(cmd) |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
475 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
476 def _prepare_track_style(self, trackDict): |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
477 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
478 style_data = { |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
479 "type": "LinearBasicDisplay", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
480 "displayId": "%s-LinearBasicDisplay" % trackDict["trackId"], |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
481 } |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
482 |
5
efc64d8f4b72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 79e81bef99f582680d9aa4eec88980c675f3fae9
fubar
parents:
3
diff
changeset
|
483 if trackDict.get("displays", None): # use first if multiple like bed |
efc64d8f4b72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 79e81bef99f582680d9aa4eec88980c675f3fae9
fubar
parents:
3
diff
changeset
|
484 style_data["type"] = trackDict["displays"][0]["type"] |
efc64d8f4b72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 79e81bef99f582680d9aa4eec88980c675f3fae9
fubar
parents:
3
diff
changeset
|
485 style_data["displayId"] = trackDict["displays"][0]["displayId"] |
85
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
486 return style_data |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
487 |
80
dff27c9f6d72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7bb0fa234bdbc42768b30e426472a47b2523297f
fubar
parents:
79
diff
changeset
|
488 def getNrow(self, url): |
dff27c9f6d72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7bb0fa234bdbc42768b30e426472a47b2523297f
fubar
parents:
79
diff
changeset
|
489 useuri = url.startswith("https://") or url.startswith("http://") |
dff27c9f6d72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7bb0fa234bdbc42768b30e426472a47b2523297f
fubar
parents:
79
diff
changeset
|
490 if not useuri: |
dff27c9f6d72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7bb0fa234bdbc42768b30e426472a47b2523297f
fubar
parents:
79
diff
changeset
|
491 fl = open(url, "r").readlines() |
dff27c9f6d72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7bb0fa234bdbc42768b30e426472a47b2523297f
fubar
parents:
79
diff
changeset
|
492 nrow = len(fl) |
dff27c9f6d72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7bb0fa234bdbc42768b30e426472a47b2523297f
fubar
parents:
79
diff
changeset
|
493 else: |
dff27c9f6d72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7bb0fa234bdbc42768b30e426472a47b2523297f
fubar
parents:
79
diff
changeset
|
494 try: |
97
74074746ccd8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1c04ea76330d0148a7682b3c26846e5a5df21f99
fubar
parents:
93
diff
changeset
|
495 scontext = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) |
74074746ccd8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1c04ea76330d0148a7682b3c26846e5a5df21f99
fubar
parents:
93
diff
changeset
|
496 scontext.check_hostname = False |
80
dff27c9f6d72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7bb0fa234bdbc42768b30e426472a47b2523297f
fubar
parents:
79
diff
changeset
|
497 scontext.verify_mode = ssl.VerifyMode.CERT_NONE |
dff27c9f6d72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7bb0fa234bdbc42768b30e426472a47b2523297f
fubar
parents:
79
diff
changeset
|
498 with urllib.request.urlopen(url, context=scontext) as f: |
dff27c9f6d72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7bb0fa234bdbc42768b30e426472a47b2523297f
fubar
parents:
79
diff
changeset
|
499 fl = f.readlines() |
dff27c9f6d72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7bb0fa234bdbc42768b30e426472a47b2523297f
fubar
parents:
79
diff
changeset
|
500 nrow = len(fl) |
dff27c9f6d72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7bb0fa234bdbc42768b30e426472a47b2523297f
fubar
parents:
79
diff
changeset
|
501 except Exception: |
dff27c9f6d72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7bb0fa234bdbc42768b30e426472a47b2523297f
fubar
parents:
79
diff
changeset
|
502 nrow = 0 |
98
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
503 logging.debug("getNrow %s returning %d" % (url, nrow)) |
80
dff27c9f6d72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7bb0fa234bdbc42768b30e426472a47b2523297f
fubar
parents:
79
diff
changeset
|
504 return nrow |
73
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
505 |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
506 def process_genomes(self, genomes): |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
507 assembly = [] |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
508 assmeta = [] |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
509 useuri = False |
89
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
510 primaryGenome = None |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
511 for i, genome_node in enumerate(genomes): |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
512 this_genome = {} |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
513 if genome_node["useuri"] == "yes": |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
514 useuri = True |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
515 genome_name = genome_node["label"].strip() |
80
dff27c9f6d72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7bb0fa234bdbc42768b30e426472a47b2523297f
fubar
parents:
79
diff
changeset
|
516 if len(genome_name) == 0: |
dff27c9f6d72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7bb0fa234bdbc42768b30e426472a47b2523297f
fubar
parents:
79
diff
changeset
|
517 genome_name = os.path.splitext(os.path.basename(genome_node["path"]))[0] |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
518 if len(genome_name.split()) > 1: |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
519 genome_name = genome_name.split()[0] |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
520 # spaces and cruft break scripts when substituted |
89
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
521 if not primaryGenome: |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
522 primaryGenome = genome_name |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
523 if genome_name not in self.genome_names: |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
524 self.genome_names.append(genome_name) |
31
cb4b32ca9968
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919-dirty
fubar
parents:
30
diff
changeset
|
525 fapath = genome_node["path"] |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
526 if not useuri: |
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
527 fapath = os.path.realpath(fapath) |
73
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
528 assem, first_contig = self.make_assembly(fapath, genome_name, useuri) |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
529 assembly.append(assem) |
73
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
530 self.ass_first_contigs.append(first_contig) |
89
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
531 if genome_name == primaryGenome: # first one |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
532 this_genome["genome_name"] = genome_name # first one for all tracks |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
533 this_genome["genome_sequence_adapter"] = assem["sequence"][ |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
534 "adapter" |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
535 ] |
93
4c517a0041a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit aeef2fbc0f90a9366851941ff51baeba410c56e4
fubar
parents:
92
diff
changeset
|
536 this_genome["genome_firstcontig"] = first_contig |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
537 assmeta.append(this_genome) |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
538 self.assemblies += assembly |
89
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
539 self.assmeta[primaryGenome] = assmeta |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
540 self.tracksToAdd[primaryGenome] = [] |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
541 return primaryGenome |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
542 |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
543 def make_assembly(self, fapath, gname, useuri): |
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
544 if useuri: |
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
545 faname = fapath |
97
74074746ccd8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1c04ea76330d0148a7682b3c26846e5a5df21f99
fubar
parents:
93
diff
changeset
|
546 scontext = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) |
74074746ccd8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1c04ea76330d0148a7682b3c26846e5a5df21f99
fubar
parents:
93
diff
changeset
|
547 scontext.check_hostname = False |
73
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
548 scontext.verify_mode = ssl.VerifyMode.CERT_NONE |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
549 with urllib.request.urlopen(url=faname + ".fai", context=scontext) as f: |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
550 fl = f.readline() |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
551 contig = fl.decode("utf8").strip() |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
552 # Merlin 172788 8 60 61 |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
553 else: |
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
554 faname = gname + ".fa.gz" |
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
555 fadest = os.path.realpath(os.path.join(self.outdir, faname)) |
134
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
556 cmd = "bgzip -k -i -c -I '%s.gzi' '%s' > '%s'" % (fadest, fapath, fadest) |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
557 subprocess.run(cmd, shell=True) |
133
cec274db51c0
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7d28252954cae9f8db5f8a85d8f29cb2865b504b-dirty
fubar
parents:
132
diff
changeset
|
558 cmd = ["samtools", "faidx", fadest] |
cec274db51c0
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7d28252954cae9f8db5f8a85d8f29cb2865b504b-dirty
fubar
parents:
132
diff
changeset
|
559 self.subprocess_check_call(cmd) |
73
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
560 contig = open(fadest + ".fai", "r").readline().strip() |
93
4c517a0041a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit aeef2fbc0f90a9366851941ff51baeba410c56e4
fubar
parents:
92
diff
changeset
|
561 adapter = { |
4c517a0041a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit aeef2fbc0f90a9366851941ff51baeba410c56e4
fubar
parents:
92
diff
changeset
|
562 "type": "BgzipFastaAdapter", |
4c517a0041a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit aeef2fbc0f90a9366851941ff51baeba410c56e4
fubar
parents:
92
diff
changeset
|
563 "fastaLocation": { |
4c517a0041a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit aeef2fbc0f90a9366851941ff51baeba410c56e4
fubar
parents:
92
diff
changeset
|
564 "uri": faname, |
4c517a0041a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit aeef2fbc0f90a9366851941ff51baeba410c56e4
fubar
parents:
92
diff
changeset
|
565 }, |
4c517a0041a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit aeef2fbc0f90a9366851941ff51baeba410c56e4
fubar
parents:
92
diff
changeset
|
566 "faiLocation": { |
4c517a0041a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit aeef2fbc0f90a9366851941ff51baeba410c56e4
fubar
parents:
92
diff
changeset
|
567 "uri": faname + ".fai", |
4c517a0041a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit aeef2fbc0f90a9366851941ff51baeba410c56e4
fubar
parents:
92
diff
changeset
|
568 }, |
4c517a0041a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit aeef2fbc0f90a9366851941ff51baeba410c56e4
fubar
parents:
92
diff
changeset
|
569 "gziLocation": { |
4c517a0041a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit aeef2fbc0f90a9366851941ff51baeba410c56e4
fubar
parents:
92
diff
changeset
|
570 "uri": faname + ".gzi", |
4c517a0041a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit aeef2fbc0f90a9366851941ff51baeba410c56e4
fubar
parents:
92
diff
changeset
|
571 }, |
4c517a0041a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit aeef2fbc0f90a9366851941ff51baeba410c56e4
fubar
parents:
92
diff
changeset
|
572 } |
73
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
573 first_contig = contig.split()[:2] |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
574 first_contig.insert(0, gname) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
575 trackDict = { |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
576 "name": gname, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
577 "sequence": { |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
578 "type": "ReferenceSequenceTrack", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
579 "trackId": gname, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
580 "adapter": adapter, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
581 }, |
57
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
582 "displays": [ |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
583 { |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
584 "type": "LinearReferenceSequenceDisplay", |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
585 "displayId": "%s-LinearReferenceSequenceDisplay" % gname, |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
586 }, |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
587 { |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
588 "type": "LinearGCContentDisplay", |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
589 "displayId": "%s-LinearGCContentDisplay" % gname, |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
590 }, |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
591 ], |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
592 } |
73
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
593 return (trackDict, first_contig) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
594 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
595 def add_default_view(self): |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
596 cmd = [ |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
597 "jbrowse", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
598 "set-default-session", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
599 "-s", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
600 self.config_json_file, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
601 "-t", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
602 ",".join(self.trackIdlist), |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
603 "-n", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
604 "JBrowse2 in Galaxy", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
605 "--target", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
606 self.config_json_file, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
607 "-v", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
608 " LinearGenomeView", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
609 ] |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
610 self.subprocess_check_call(cmd) |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
611 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
612 def write_config(self): |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
613 with open(self.config_json_file, "w") as fp: |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
614 json.dump(self.config_json, fp, indent=2) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
615 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
616 def text_index(self): |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
617 # Index tracks |
135
21bb464c1d53
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 78bf7abb931bf3d348837c7211cd3cff32486691
fubar
parents:
134
diff
changeset
|
618 e = os.environ |
21bb464c1d53
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 78bf7abb931bf3d348837c7211cd3cff32486691
fubar
parents:
134
diff
changeset
|
619 e["SHELL"] = "/bin/sh" |
21bb464c1d53
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 78bf7abb931bf3d348837c7211cd3cff32486691
fubar
parents:
134
diff
changeset
|
620 cmd = ["jbrowse", "text-index"] |
21bb464c1d53
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 78bf7abb931bf3d348837c7211cd3cff32486691
fubar
parents:
134
diff
changeset
|
621 subprocess.run(cmd, env=e, shell=True) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
622 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
623 def add_hic(self, data, trackData): |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
624 """ |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
625 HiC adapter. |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
626 https://github.com/aidenlab/hic-format/blob/master/HiCFormatV9.md |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
627 for testing locally, these work: |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
628 HiC data is from https://s3.amazonaws.com/igv.broadinstitute.org/data/hic/intra_nofrag_30.hic |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
629 using hg19 reference track as a |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
630 'BgzipFastaAdapter' |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
631 fastaLocation: |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
632 uri: 'https://s3.amazonaws.com/jbrowse.org/genomes/GRCh38/fasta/GRCh38.fa.gz', |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
633 faiLocation: |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
634 uri: 'https://s3.amazonaws.com/jbrowse.org/genomes/GRCh38/fasta/GRCh38.fa.gz.fai', |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
635 gziLocation: |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
636 uri: 'https://s3.amazonaws.com/jbrowse.org/genomes/GRCh38/fasta/GRCh38.fa.gz.gzi', |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
637 Cool will not be likely to be a good fit - see discussion at https://github.com/GMOD/jbrowse-components/issues/2438 |
60
81d535970196
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 403a35e1245fa5e62f4be6116a725b9e4d9c353a
fubar
parents:
59
diff
changeset
|
638 |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
639 """ |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
640 tId = trackData["label"] |
85
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
641 wasCool = trackData["wasCool"] |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
642 # can be served - if public. |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
643 # dsId = trackData["metadata"]["dataset_id"] |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
644 # url = "%s/api/datasets/%s/display?to_ext=hic " % (self.giURL, dsId) |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
645 useuri = trackData["useuri"].lower() == "yes" |
85
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
646 logging.debug("wasCool=%s, data=%s, tId=%s" % (wasCool, data, tId)) |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
647 if useuri: |
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
648 uri = data |
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
649 else: |
85
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
650 uri = tId + ".hic" |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
651 if not wasCool: |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
652 dest = os.path.join(self.outdir, uri) |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
653 if not os.path.exists(dest): |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
654 cmd = ["cp", data, dest] |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
655 self.subprocess_check_call(cmd) |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
656 else: |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
657 logging.error("not wasCool but %s exists" % dest) |
57
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
658 categ = trackData["category"] |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
659 trackDict = { |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
660 "type": "HicTrack", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
661 "trackId": tId, |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
662 "name": trackData["name"], |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
663 "assemblyNames": [trackData["assemblyNames"]], |
109
27e9ddaaf325
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf-dirty
fubar
parents:
108
diff
changeset
|
664 "displays": [ |
27e9ddaaf325
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf-dirty
fubar
parents:
108
diff
changeset
|
665 { |
27e9ddaaf325
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf-dirty
fubar
parents:
108
diff
changeset
|
666 "type": "LinearHicDisplay", |
27e9ddaaf325
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf-dirty
fubar
parents:
108
diff
changeset
|
667 "displayId": "%s-LinearHicDisplay" % tId, |
27e9ddaaf325
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf-dirty
fubar
parents:
108
diff
changeset
|
668 } |
27e9ddaaf325
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf-dirty
fubar
parents:
108
diff
changeset
|
669 ], |
57
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
670 "category": [ |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
671 categ, |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
672 ], |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
673 "adapter": {"type": "HicAdapter", "hicLocation": {"uri": uri}}, |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
674 } |
104
9e3f69d9fed1
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
102
diff
changeset
|
675 self.tracksToAdd[trackData["assemblyNames"]].append(copy.copy(trackDict)) |
109
27e9ddaaf325
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf-dirty
fubar
parents:
108
diff
changeset
|
676 self.trackIdlist.append(tId) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
677 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
678 def add_maf(self, data, trackData): |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
679 """ |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
680 from https://github.com/cmdcolin/maf2bed |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
681 Note: Both formats start with a MAF as input, and note that your MAF file should contain the species name and chromosome name |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
682 e.g. hg38.chr1 in the sequence identifiers. |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
683 need the reference id - eg hg18, for maf2bed.pl as the first parameter |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
684 """ |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
685 tId = trackData["label"] |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
686 mafPlugin = { |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
687 "plugins": [ |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
688 { |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
689 "name": "MafViewer", |
23
39b717d934a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit be2268f4c11d54bdd44789dd88dd9017cad27887-dirty
fubar
parents:
19
diff
changeset
|
690 "url": "https://unpkg.com/jbrowse-plugin-mafviewer/dist/jbrowse-plugin-mafviewer.umd.production.min.js", |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
691 } |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
692 ] |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
693 } |
57
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
694 categ = trackData["category"] |
99
990291e918c7
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
98
diff
changeset
|
695 fname = tId |
112
56f9a6e0fe80
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 566509061b742b73c8dd1a1db6813fbf6a7a3792
bgruening
parents:
110
diff
changeset
|
696 dest = os.path.join(self.outdir, fname) |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
697 gname = trackData["assemblyNames"] |
61
e7a6f7a7148d
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 6dde5ad41d63730085116ab2c9a9d3e500a760e4-dirty
fubar
parents:
60
diff
changeset
|
698 |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
699 cmd = [ |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
700 "bash", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
701 os.path.join(INSTALLED_TO, "convertMAF.sh"), |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
702 data, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
703 gname, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
704 INSTALLED_TO, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
705 dest, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
706 ] |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
707 self.subprocess_check_call(cmd) |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
708 mafs = open(data, "r").readlines() |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
709 mafss = [x for x in mafs if (x.startswith("s\t") or x.startswith("s "))] |
61
e7a6f7a7148d
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 6dde5ad41d63730085116ab2c9a9d3e500a760e4-dirty
fubar
parents:
60
diff
changeset
|
710 samp = [x.split()[1] for x in mafss if len(x.split()) > 0] |
e7a6f7a7148d
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 6dde5ad41d63730085116ab2c9a9d3e500a760e4-dirty
fubar
parents:
60
diff
changeset
|
711 sampu = list(dict.fromkeys(samp)) |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
712 samples = [x.split(".")[0] for x in sampu] |
61
e7a6f7a7148d
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 6dde5ad41d63730085116ab2c9a9d3e500a760e4-dirty
fubar
parents:
60
diff
changeset
|
713 samples.sort() |
89
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
714 if logCommands: |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
715 logging.debug( |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
716 "$$$$ cmd=%s, mafss=%s samp=%s samples=%s" |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
717 % (" ".join(cmd), mafss, samp, samples) |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
718 ) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
719 trackDict = { |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
720 "type": "MafTrack", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
721 "trackId": tId, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
722 "name": trackData["name"], |
57
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
723 "category": [ |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
724 categ, |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
725 ], |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
726 "adapter": { |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
727 "type": "MafTabixAdapter", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
728 "samples": samples, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
729 "bedGzLocation": { |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
730 "uri": fname + ".sorted.bed.gz", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
731 }, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
732 "index": { |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
733 "location": { |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
734 "uri": fname + ".sorted.bed.gz.tbi", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
735 }, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
736 }, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
737 }, |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
738 "assemblyNames": [trackData["assemblyNames"]], |
5
efc64d8f4b72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 79e81bef99f582680d9aa4eec88980c675f3fae9
fubar
parents:
3
diff
changeset
|
739 "displays": [ |
efc64d8f4b72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 79e81bef99f582680d9aa4eec88980c675f3fae9
fubar
parents:
3
diff
changeset
|
740 { |
efc64d8f4b72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 79e81bef99f582680d9aa4eec88980c675f3fae9
fubar
parents:
3
diff
changeset
|
741 "type": "LinearBasicDisplay", |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
742 "displayId": "%s-LinearBasicDisplay" % tId, |
5
efc64d8f4b72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 79e81bef99f582680d9aa4eec88980c675f3fae9
fubar
parents:
3
diff
changeset
|
743 }, |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
744 {"type": "LinearArcDisplay", "displayId": "%s-LinearArcDisplay" % tId}, |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
745 ], |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
746 } |
59
f807e219cec3
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit faada92caf5aaabe58e52b161687a30d542a07b9
fubar
parents:
57
diff
changeset
|
747 style_json = self._prepare_track_style(trackDict) |
f807e219cec3
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit faada92caf5aaabe58e52b161687a30d542a07b9
fubar
parents:
57
diff
changeset
|
748 trackDict["style"] = style_json |
104
9e3f69d9fed1
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
102
diff
changeset
|
749 self.tracksToAdd[gname].append(copy.copy(trackDict)) |
109
27e9ddaaf325
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf-dirty
fubar
parents:
108
diff
changeset
|
750 self.trackIdlist.append(tId) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
751 if self.config_json.get("plugins", None): |
108
5d1259b88c27
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
107
diff
changeset
|
752 self.config_json["plugins"].append(mafPlugin["plugins"][0]) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
753 else: |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
754 self.config_json.update(mafPlugin) |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
755 |
134
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
756 def _sort_gff(self, data, dest): |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
757 # Only index if not already done |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
758 if not os.path.exists(dest): |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
759 e = os.environ |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
760 e["SHELL"] = "/bin/sh" |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
761 cmd = "jbrowse sort-gff %s | bgzip -c > %s" % (data, dest) |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
762 subprocess.run(cmd, env=e, shell=True) |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
763 self.subprocess_check_call(["tabix", "-f", "-p", "gff", dest]) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
764 |
134
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
765 def add_gff(self, data, trackData): |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
766 tId = trackData["label"] |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
767 useuri = trackData["useuri"].lower() == "yes" |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
768 if useuri: |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
769 url = trackData["path"] |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
770 else: |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
771 url = tId + ".gz" |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
772 dest = os.path.join(self.outdir, url) |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
773 self._sort_gff(data, dest) |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
774 categ = trackData["category"] |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
775 trackDict = { |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
776 "type": "FeatureTrack", |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
777 "trackId": tId, |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
778 "name": trackData["name"], |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
779 "assemblyNames": [trackData["assemblyNames"]], |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
780 "category": [ |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
781 categ, |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
782 ], |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
783 "adapter": { |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
784 "type": "Gff3TabixAdapter", |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
785 "gffGzLocation": { |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
786 "uri": url, |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
787 }, |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
788 "index": { |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
789 "location": { |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
790 "uri": url + ".tbi", |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
791 } |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
792 }, |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
793 }, |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
794 "displays": [ |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
795 { |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
796 "type": "LinearBasicDisplay", |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
797 "displayId": "%s-LinearBasicDisplay" % tId, |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
798 }, |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
799 { |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
800 "type": "LinearArcDisplay", |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
801 "displayId": "%s-LinearArcDisplay" % tId, |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
802 }, |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
803 ], |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
804 } |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
805 style_json = self._prepare_track_style(trackDict) |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
806 trackDict["style"] = style_json |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
807 self.tracksToAdd[trackData["assemblyNames"]].append(copy.copy(trackDict)) |
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
808 self.trackIdlist.append(tId) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
809 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
810 def add_bigwig(self, data, trackData): |
80
dff27c9f6d72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7bb0fa234bdbc42768b30e426472a47b2523297f
fubar
parents:
79
diff
changeset
|
811 tId = trackData["label"] |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
812 useuri = trackData["useuri"].lower() == "yes" |
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
813 if useuri: |
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
814 url = data |
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
815 else: |
80
dff27c9f6d72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7bb0fa234bdbc42768b30e426472a47b2523297f
fubar
parents:
79
diff
changeset
|
816 url = tId |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
817 # slashes in names cause path trouble |
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
818 dest = os.path.join(self.outdir, url) |
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
819 cmd = ["cp", data, dest] |
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
820 self.subprocess_check_call(cmd) |
50
f350467f9433
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 44df75b3714aa9e02983e0b67ef43fc0eee4a8d4
fubar
parents:
49
diff
changeset
|
821 bwloc = {"uri": url} |
57
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
822 categ = trackData["category"] |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
823 trackDict = { |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
824 "type": "QuantitativeTrack", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
825 "trackId": tId, |
7
b04fd993b31e
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 53a108d8153c955044ae7eb8cb06bdcfd0036717
fubar
parents:
6
diff
changeset
|
826 "name": trackData["name"], |
57
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
827 "category": [ |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
828 categ, |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
829 ], |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
830 "assemblyNames": [trackData["assemblyNames"]], |
50
f350467f9433
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 44df75b3714aa9e02983e0b67ef43fc0eee4a8d4
fubar
parents:
49
diff
changeset
|
831 "adapter": { |
f350467f9433
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 44df75b3714aa9e02983e0b67ef43fc0eee4a8d4
fubar
parents:
49
diff
changeset
|
832 "type": "BigWigAdapter", |
f350467f9433
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 44df75b3714aa9e02983e0b67ef43fc0eee4a8d4
fubar
parents:
49
diff
changeset
|
833 "bigWigLocation": bwloc, |
f350467f9433
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 44df75b3714aa9e02983e0b67ef43fc0eee4a8d4
fubar
parents:
49
diff
changeset
|
834 }, |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
835 "displays": [ |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
836 { |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
837 "type": "LinearWiggleDisplay", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
838 "displayId": "%s-LinearWiggleDisplay" % tId, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
839 } |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
840 ], |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
841 } |
59
f807e219cec3
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit faada92caf5aaabe58e52b161687a30d542a07b9
fubar
parents:
57
diff
changeset
|
842 style_json = self._prepare_track_style(trackDict) |
f807e219cec3
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit faada92caf5aaabe58e52b161687a30d542a07b9
fubar
parents:
57
diff
changeset
|
843 trackDict["style"] = style_json |
104
9e3f69d9fed1
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
102
diff
changeset
|
844 self.tracksToAdd[trackData["assemblyNames"]].append(copy.copy(trackDict)) |
109
27e9ddaaf325
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf-dirty
fubar
parents:
108
diff
changeset
|
845 self.trackIdlist.append(tId) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
846 |
85
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
847 def add_bam(self, data, trackData, bam_indexes=None, **kwargs): |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
848 tId = trackData["label"] |
92
3c4db8203fad
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit f2fba2e6b169256dc9adfa141e3bd59665f08f78
fubar
parents:
89
diff
changeset
|
849 realFName = trackData["path"] |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
850 useuri = trackData["useuri"].lower() == "yes" |
57
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
851 categ = trackData["category"] |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
852 if useuri: |
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
853 url = data |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
854 else: |
80
dff27c9f6d72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7bb0fa234bdbc42768b30e426472a47b2523297f
fubar
parents:
79
diff
changeset
|
855 fname = tId |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
856 dest = "%s/%s" % (self.outdir, fname) |
92
3c4db8203fad
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit f2fba2e6b169256dc9adfa141e3bd59665f08f78
fubar
parents:
89
diff
changeset
|
857 self.subprocess_check_call(["cp", data, dest]) |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
858 url = fname |
57
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
859 bindex = fname + ".bai" |
92
3c4db8203fad
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit f2fba2e6b169256dc9adfa141e3bd59665f08f78
fubar
parents:
89
diff
changeset
|
860 bi = bam_indexes.split(",") |
85
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
861 bam_index = [ |
134
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
862 x.split("~~~")[1].strip() |
85
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
863 for x in bi |
134
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
864 if "~~~" in x and x.split("~~~")[0].strip() == realFName |
85
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
865 ] |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
866 logging.debug( |
92
3c4db8203fad
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit f2fba2e6b169256dc9adfa141e3bd59665f08f78
fubar
parents:
89
diff
changeset
|
867 "===realFName=%s got %s as bam_indexes %s as bi, %s for bam_index" |
3c4db8203fad
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit f2fba2e6b169256dc9adfa141e3bd59665f08f78
fubar
parents:
89
diff
changeset
|
868 % (realFName, bam_indexes, bi, bam_index) |
85
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
869 ) |
92
3c4db8203fad
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit f2fba2e6b169256dc9adfa141e3bd59665f08f78
fubar
parents:
89
diff
changeset
|
870 if len(bam_index) > 0 and os.path.exists(os.path.realpath(bam_index[0])): |
3c4db8203fad
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit f2fba2e6b169256dc9adfa141e3bd59665f08f78
fubar
parents:
89
diff
changeset
|
871 self.subprocess_check_call(["cp", bam_index[0], bindex]) |
3c4db8203fad
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit f2fba2e6b169256dc9adfa141e3bd59665f08f78
fubar
parents:
89
diff
changeset
|
872 else: |
3c4db8203fad
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit f2fba2e6b169256dc9adfa141e3bd59665f08f78
fubar
parents:
89
diff
changeset
|
873 cmd = ["samtools", "index", "-b", "-o", bindex, data] |
3c4db8203fad
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit f2fba2e6b169256dc9adfa141e3bd59665f08f78
fubar
parents:
89
diff
changeset
|
874 self.subprocess_check_call(cmd) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
875 trackDict = { |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
876 "type": "AlignmentsTrack", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
877 "trackId": tId, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
878 "name": trackData["name"], |
57
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
879 "category": [ |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
880 categ, |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
881 ], |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
882 "assemblyNames": [trackData["assemblyNames"]], |
50
f350467f9433
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 44df75b3714aa9e02983e0b67ef43fc0eee4a8d4
fubar
parents:
49
diff
changeset
|
883 "adapter": { |
f350467f9433
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 44df75b3714aa9e02983e0b67ef43fc0eee4a8d4
fubar
parents:
49
diff
changeset
|
884 "type": "BamAdapter", |
f350467f9433
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 44df75b3714aa9e02983e0b67ef43fc0eee4a8d4
fubar
parents:
49
diff
changeset
|
885 "bamLocation": {"uri": url}, |
f350467f9433
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 44df75b3714aa9e02983e0b67ef43fc0eee4a8d4
fubar
parents:
49
diff
changeset
|
886 "index": { |
f350467f9433
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 44df75b3714aa9e02983e0b67ef43fc0eee4a8d4
fubar
parents:
49
diff
changeset
|
887 "location": { |
f350467f9433
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 44df75b3714aa9e02983e0b67ef43fc0eee4a8d4
fubar
parents:
49
diff
changeset
|
888 "uri": bindex, |
f350467f9433
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 44df75b3714aa9e02983e0b67ef43fc0eee4a8d4
fubar
parents:
49
diff
changeset
|
889 } |
f350467f9433
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 44df75b3714aa9e02983e0b67ef43fc0eee4a8d4
fubar
parents:
49
diff
changeset
|
890 }, |
f350467f9433
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 44df75b3714aa9e02983e0b67ef43fc0eee4a8d4
fubar
parents:
49
diff
changeset
|
891 }, |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
892 "displays": [ |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
893 { |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
894 "type": "LinearAlignmentsDisplay", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
895 "displayId": "%s-LinearAlignmentsDisplay" % tId, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
896 }, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
897 ], |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
898 } |
59
f807e219cec3
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit faada92caf5aaabe58e52b161687a30d542a07b9
fubar
parents:
57
diff
changeset
|
899 style_json = self._prepare_track_style(trackDict) |
f807e219cec3
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit faada92caf5aaabe58e52b161687a30d542a07b9
fubar
parents:
57
diff
changeset
|
900 trackDict["style"] = style_json |
104
9e3f69d9fed1
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
102
diff
changeset
|
901 self.tracksToAdd[trackData["assemblyNames"]].append(copy.copy(trackDict)) |
109
27e9ddaaf325
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf-dirty
fubar
parents:
108
diff
changeset
|
902 self.trackIdlist.append(tId) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
903 |
85
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
904 def add_cram(self, data, trackData, cram_indexes=None, **kwargs): |
19
bde6b1d09f7d
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1290bf486bc55c02fecd0327de10a28655a18e81-dirty
fubar
parents:
17
diff
changeset
|
905 tId = trackData["label"] |
92
3c4db8203fad
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit f2fba2e6b169256dc9adfa141e3bd59665f08f78
fubar
parents:
89
diff
changeset
|
906 realFName = trackData["path"] |
57
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
907 categ = trackData["category"] |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
908 useuri = trackData["useuri"].lower() == "yes" |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
909 gsa = self.assmeta.get(trackData["assemblyNames"], None) |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
910 if gsa: |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
911 genseqad = gsa[0]["genome_sequence_adapter"] |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
912 else: |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
913 genseqad = "Not found" |
97
74074746ccd8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1c04ea76330d0148a7682b3c26846e5a5df21f99
fubar
parents:
93
diff
changeset
|
914 logging.warning("No adapter found for cram %s in gsa=%s" % (tId, gsa)) |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
915 if useuri: |
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
916 url = data |
19
bde6b1d09f7d
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1290bf486bc55c02fecd0327de10a28655a18e81-dirty
fubar
parents:
17
diff
changeset
|
917 else: |
80
dff27c9f6d72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7bb0fa234bdbc42768b30e426472a47b2523297f
fubar
parents:
79
diff
changeset
|
918 fname = tId |
dff27c9f6d72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7bb0fa234bdbc42768b30e426472a47b2523297f
fubar
parents:
79
diff
changeset
|
919 dest = os.path.join(self.outdir, fname) |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
920 url = fname |
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
921 self.subprocess_check_call(["cp", data, dest]) |
92
3c4db8203fad
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit f2fba2e6b169256dc9adfa141e3bd59665f08f78
fubar
parents:
89
diff
changeset
|
922 ci = cram_indexes.split(",") |
85
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
923 cram_index = [ |
134
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
924 x.split("~~~")[1].strip() |
85
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
925 for x in ci |
134
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
926 if "~~~" in x and x.split("~~~")[0].strip() == realFName |
85
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
927 ] |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
928 logging.debug( |
92
3c4db8203fad
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit f2fba2e6b169256dc9adfa141e3bd59665f08f78
fubar
parents:
89
diff
changeset
|
929 "===realFName=%s got %s as cram_indexes %s as ci, %s for cram_index" |
3c4db8203fad
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit f2fba2e6b169256dc9adfa141e3bd59665f08f78
fubar
parents:
89
diff
changeset
|
930 % (realFName, cram_indexes, ci, cram_index) |
85
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
931 ) |
92
3c4db8203fad
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit f2fba2e6b169256dc9adfa141e3bd59665f08f78
fubar
parents:
89
diff
changeset
|
932 if len(cram_index) > 0 and os.path.exists(cram_index[0]): |
57
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
933 if not os.path.exists(dest + ".crai"): |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
934 # most probably made by galaxy and stored in galaxy dirs, need to copy it to dest |
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
935 self.subprocess_check_call( |
92
3c4db8203fad
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit f2fba2e6b169256dc9adfa141e3bd59665f08f78
fubar
parents:
89
diff
changeset
|
936 ["cp", os.path.realpath(cram_index[0]), dest + ".crai"] |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
937 ) |
53
bdfa6a7c4543
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 44df75b3714aa9e02983e0b67ef43fc0eee4a8d4-dirty
fubar
parents:
50
diff
changeset
|
938 else: |
57
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
939 cpath = os.path.realpath(dest) + ".crai" |
53
bdfa6a7c4543
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 44df75b3714aa9e02983e0b67ef43fc0eee4a8d4-dirty
fubar
parents:
50
diff
changeset
|
940 cmd = ["samtools", "index", "-c", "-o", cpath, os.path.realpath(dest)] |
bdfa6a7c4543
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 44df75b3714aa9e02983e0b67ef43fc0eee4a8d4-dirty
fubar
parents:
50
diff
changeset
|
941 self.subprocess_check_call(cmd) |
19
bde6b1d09f7d
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1290bf486bc55c02fecd0327de10a28655a18e81-dirty
fubar
parents:
17
diff
changeset
|
942 trackDict = { |
bde6b1d09f7d
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1290bf486bc55c02fecd0327de10a28655a18e81-dirty
fubar
parents:
17
diff
changeset
|
943 "type": "AlignmentsTrack", |
bde6b1d09f7d
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1290bf486bc55c02fecd0327de10a28655a18e81-dirty
fubar
parents:
17
diff
changeset
|
944 "trackId": tId, |
bde6b1d09f7d
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1290bf486bc55c02fecd0327de10a28655a18e81-dirty
fubar
parents:
17
diff
changeset
|
945 "name": trackData["name"], |
57
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
946 "category": [ |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
947 categ, |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
948 ], |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
949 "assemblyNames": [trackData["assemblyNames"]], |
50
f350467f9433
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 44df75b3714aa9e02983e0b67ef43fc0eee4a8d4
fubar
parents:
49
diff
changeset
|
950 "adapter": { |
f350467f9433
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 44df75b3714aa9e02983e0b67ef43fc0eee4a8d4
fubar
parents:
49
diff
changeset
|
951 "type": "CramAdapter", |
f350467f9433
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 44df75b3714aa9e02983e0b67ef43fc0eee4a8d4
fubar
parents:
49
diff
changeset
|
952 "cramLocation": {"uri": url}, |
f350467f9433
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 44df75b3714aa9e02983e0b67ef43fc0eee4a8d4
fubar
parents:
49
diff
changeset
|
953 "craiLocation": { |
57
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
954 "uri": url + ".crai", |
50
f350467f9433
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 44df75b3714aa9e02983e0b67ef43fc0eee4a8d4
fubar
parents:
49
diff
changeset
|
955 }, |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
956 "sequenceAdapter": genseqad, |
50
f350467f9433
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 44df75b3714aa9e02983e0b67ef43fc0eee4a8d4
fubar
parents:
49
diff
changeset
|
957 }, |
19
bde6b1d09f7d
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1290bf486bc55c02fecd0327de10a28655a18e81-dirty
fubar
parents:
17
diff
changeset
|
958 "displays": [ |
bde6b1d09f7d
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1290bf486bc55c02fecd0327de10a28655a18e81-dirty
fubar
parents:
17
diff
changeset
|
959 { |
bde6b1d09f7d
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1290bf486bc55c02fecd0327de10a28655a18e81-dirty
fubar
parents:
17
diff
changeset
|
960 "type": "LinearAlignmentsDisplay", |
bde6b1d09f7d
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1290bf486bc55c02fecd0327de10a28655a18e81-dirty
fubar
parents:
17
diff
changeset
|
961 "displayId": "%s-LinearAlignmentsDisplay" % tId, |
bde6b1d09f7d
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1290bf486bc55c02fecd0327de10a28655a18e81-dirty
fubar
parents:
17
diff
changeset
|
962 }, |
bde6b1d09f7d
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1290bf486bc55c02fecd0327de10a28655a18e81-dirty
fubar
parents:
17
diff
changeset
|
963 ], |
bde6b1d09f7d
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1290bf486bc55c02fecd0327de10a28655a18e81-dirty
fubar
parents:
17
diff
changeset
|
964 } |
59
f807e219cec3
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit faada92caf5aaabe58e52b161687a30d542a07b9
fubar
parents:
57
diff
changeset
|
965 style_json = self._prepare_track_style(trackDict) |
f807e219cec3
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit faada92caf5aaabe58e52b161687a30d542a07b9
fubar
parents:
57
diff
changeset
|
966 trackDict["style"] = style_json |
104
9e3f69d9fed1
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
102
diff
changeset
|
967 self.tracksToAdd[trackData["assemblyNames"]].append(copy.copy(trackDict)) |
109
27e9ddaaf325
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf-dirty
fubar
parents:
108
diff
changeset
|
968 self.trackIdlist.append(tId) |
19
bde6b1d09f7d
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1290bf486bc55c02fecd0327de10a28655a18e81-dirty
fubar
parents:
17
diff
changeset
|
969 |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
970 def add_vcf(self, data, trackData): |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
971 tId = trackData["label"] |
57
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
972 categ = trackData["category"] |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
973 useuri = trackData["useuri"].lower() == "yes" |
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
974 if useuri: |
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
975 url = data |
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
976 else: |
80
dff27c9f6d72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7bb0fa234bdbc42768b30e426472a47b2523297f
fubar
parents:
79
diff
changeset
|
977 url = tId |
97
74074746ccd8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1c04ea76330d0148a7682b3c26846e5a5df21f99
fubar
parents:
93
diff
changeset
|
978 dest = os.path.join(self.outdir, url) |
133
cec274db51c0
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7d28252954cae9f8db5f8a85d8f29cb2865b504b-dirty
fubar
parents:
132
diff
changeset
|
979 cmd = ["bgzip", "-c", data] |
cec274db51c0
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7d28252954cae9f8db5f8a85d8f29cb2865b504b-dirty
fubar
parents:
132
diff
changeset
|
980 with open(dest, "wb") as fout: |
cec274db51c0
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7d28252954cae9f8db5f8a85d8f29cb2865b504b-dirty
fubar
parents:
132
diff
changeset
|
981 subprocess.run(cmd, stdout=fout) |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
982 cmd = ["tabix", "-f", "-p", "vcf", dest] |
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
983 self.subprocess_check_call(cmd) |
50
f350467f9433
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 44df75b3714aa9e02983e0b67ef43fc0eee4a8d4
fubar
parents:
49
diff
changeset
|
984 trackDict = { |
f350467f9433
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 44df75b3714aa9e02983e0b67ef43fc0eee4a8d4
fubar
parents:
49
diff
changeset
|
985 "type": "VariantTrack", |
f350467f9433
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 44df75b3714aa9e02983e0b67ef43fc0eee4a8d4
fubar
parents:
49
diff
changeset
|
986 "trackId": tId, |
f350467f9433
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 44df75b3714aa9e02983e0b67ef43fc0eee4a8d4
fubar
parents:
49
diff
changeset
|
987 "name": trackData["name"], |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
988 "assemblyNames": [trackData["assemblyNames"]], |
57
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
989 "category": [ |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
990 categ, |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
991 ], |
50
f350467f9433
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 44df75b3714aa9e02983e0b67ef43fc0eee4a8d4
fubar
parents:
49
diff
changeset
|
992 "adapter": { |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
993 "type": "VcfTabixAdapter", |
57
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
994 "vcfGzLocation": {"uri": url}, |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
995 "index": { |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
996 "location": { |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
997 "uri": url + ".tbi", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
998 } |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
999 }, |
50
f350467f9433
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 44df75b3714aa9e02983e0b67ef43fc0eee4a8d4
fubar
parents:
49
diff
changeset
|
1000 }, |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1001 "displays": [ |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1002 { |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1003 "type": "LinearVariantDisplay", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1004 "displayId": "%s-LinearVariantDisplay" % tId, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1005 }, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1006 { |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1007 "type": "ChordVariantDisplay", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1008 "displayId": "%s-ChordVariantDisplay" % tId, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1009 }, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1010 { |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1011 "type": "LinearPairedArcDisplay", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1012 "displayId": "%s-LinearPairedArcDisplay" % tId, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1013 }, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1014 ], |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1015 } |
59
f807e219cec3
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit faada92caf5aaabe58e52b161687a30d542a07b9
fubar
parents:
57
diff
changeset
|
1016 style_json = self._prepare_track_style(trackDict) |
f807e219cec3
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit faada92caf5aaabe58e52b161687a30d542a07b9
fubar
parents:
57
diff
changeset
|
1017 trackDict["style"] = style_json |
104
9e3f69d9fed1
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
102
diff
changeset
|
1018 self.tracksToAdd[trackData["assemblyNames"]].append(copy.copy(trackDict)) |
109
27e9ddaaf325
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf-dirty
fubar
parents:
108
diff
changeset
|
1019 self.trackIdlist.append(tId) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1020 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1021 def _sort_bed(self, data, dest): |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1022 # Only index if not already done |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1023 if not os.path.exists(dest): |
133
cec274db51c0
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7d28252954cae9f8db5f8a85d8f29cb2865b504b-dirty
fubar
parents:
132
diff
changeset
|
1024 cmd = ["sort", "-k1,1", "-k2,2n", data] |
cec274db51c0
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7d28252954cae9f8db5f8a85d8f29cb2865b504b-dirty
fubar
parents:
132
diff
changeset
|
1025 ps = subprocess.run(cmd, check=True, capture_output=True) |
cec274db51c0
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7d28252954cae9f8db5f8a85d8f29cb2865b504b-dirty
fubar
parents:
132
diff
changeset
|
1026 cmd = ["bgzip", "-c"] |
cec274db51c0
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7d28252954cae9f8db5f8a85d8f29cb2865b504b-dirty
fubar
parents:
132
diff
changeset
|
1027 with open(dest, "wb") as fout: |
cec274db51c0
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7d28252954cae9f8db5f8a85d8f29cb2865b504b-dirty
fubar
parents:
132
diff
changeset
|
1028 subprocess.run(cmd, input=ps.stdout, stdout=fout) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1029 cmd = ["tabix", "-f", "-p", "bed", dest] |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1030 self.subprocess_check_call(cmd) |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1031 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1032 def add_bed(self, data, ext, trackData): |
112
56f9a6e0fe80
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 566509061b742b73c8dd1a1db6813fbf6a7a3792
bgruening
parents:
110
diff
changeset
|
1033 bedPlugin = {"name": "BedScorePlugin", "umdLoc": {"uri": "bedscoreplugin.js"}} |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1034 tId = trackData["label"] |
57
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
1035 categ = trackData["category"] |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
1036 useuri = trackData["useuri"].lower() == "yes" |
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
1037 if useuri: |
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
1038 url = data |
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
1039 else: |
85
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1040 url = tId + ".gz" |
97
74074746ccd8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1c04ea76330d0148a7682b3c26846e5a5df21f99
fubar
parents:
93
diff
changeset
|
1041 dest = os.path.join(self.outdir, url) |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
1042 self._sort_bed(data, dest) |
112
56f9a6e0fe80
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 566509061b742b73c8dd1a1db6813fbf6a7a3792
bgruening
parents:
110
diff
changeset
|
1043 if True or trackData.get("usebedscore", None): |
108
5d1259b88c27
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
107
diff
changeset
|
1044 bedgzlocation = { |
112
56f9a6e0fe80
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 566509061b742b73c8dd1a1db6813fbf6a7a3792
bgruening
parents:
110
diff
changeset
|
1045 "uri": url, |
56f9a6e0fe80
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 566509061b742b73c8dd1a1db6813fbf6a7a3792
bgruening
parents:
110
diff
changeset
|
1046 "columnNames": ["chr", "start", "end", "name", "score"], |
56f9a6e0fe80
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 566509061b742b73c8dd1a1db6813fbf6a7a3792
bgruening
parents:
110
diff
changeset
|
1047 "scoreColumn": "score", |
56f9a6e0fe80
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 566509061b742b73c8dd1a1db6813fbf6a7a3792
bgruening
parents:
110
diff
changeset
|
1048 } |
108
5d1259b88c27
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
107
diff
changeset
|
1049 else: |
5d1259b88c27
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
107
diff
changeset
|
1050 bedgzlocation = { |
112
56f9a6e0fe80
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 566509061b742b73c8dd1a1db6813fbf6a7a3792
bgruening
parents:
110
diff
changeset
|
1051 "uri": url, |
56f9a6e0fe80
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 566509061b742b73c8dd1a1db6813fbf6a7a3792
bgruening
parents:
110
diff
changeset
|
1052 } |
50
f350467f9433
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 44df75b3714aa9e02983e0b67ef43fc0eee4a8d4
fubar
parents:
49
diff
changeset
|
1053 trackDict = { |
f350467f9433
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 44df75b3714aa9e02983e0b67ef43fc0eee4a8d4
fubar
parents:
49
diff
changeset
|
1054 "type": "FeatureTrack", |
f350467f9433
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 44df75b3714aa9e02983e0b67ef43fc0eee4a8d4
fubar
parents:
49
diff
changeset
|
1055 "trackId": tId, |
f350467f9433
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 44df75b3714aa9e02983e0b67ef43fc0eee4a8d4
fubar
parents:
49
diff
changeset
|
1056 "name": trackData["name"], |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1057 "assemblyNames": [trackData["assemblyNames"]], |
50
f350467f9433
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 44df75b3714aa9e02983e0b67ef43fc0eee4a8d4
fubar
parents:
49
diff
changeset
|
1058 "adapter": { |
57
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
1059 "category": [ |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
1060 categ, |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
1061 ], |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1062 "type": "BedTabixAdapter", |
108
5d1259b88c27
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
107
diff
changeset
|
1063 "bedGzLocation": bedgzlocation, |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1064 "index": { |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1065 "location": { |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1066 "uri": url + ".tbi", |
108
5d1259b88c27
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
107
diff
changeset
|
1067 }, |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1068 }, |
50
f350467f9433
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 44df75b3714aa9e02983e0b67ef43fc0eee4a8d4
fubar
parents:
49
diff
changeset
|
1069 }, |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1070 "displays": [ |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1071 { |
9
a26c41e304c3
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 1b7e6ba50013775621cbdfdc101152a7f5c5e15b
fubar
parents:
7
diff
changeset
|
1072 "type": "LinearBasicDisplay", |
a26c41e304c3
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 1b7e6ba50013775621cbdfdc101152a7f5c5e15b
fubar
parents:
7
diff
changeset
|
1073 "displayId": "%s-LinearBasicDisplay" % tId, |
108
5d1259b88c27
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
107
diff
changeset
|
1074 "renderer": { |
5d1259b88c27
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
107
diff
changeset
|
1075 "type": "SvgFeatureRenderer", |
5d1259b88c27
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
107
diff
changeset
|
1076 "color1": "jexl:customColor(feature)", |
112
56f9a6e0fe80
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 566509061b742b73c8dd1a1db6813fbf6a7a3792
bgruening
parents:
110
diff
changeset
|
1077 }, |
9
a26c41e304c3
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 1b7e6ba50013775621cbdfdc101152a7f5c5e15b
fubar
parents:
7
diff
changeset
|
1078 }, |
a26c41e304c3
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 1b7e6ba50013775621cbdfdc101152a7f5c5e15b
fubar
parents:
7
diff
changeset
|
1079 { |
5
efc64d8f4b72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 79e81bef99f582680d9aa4eec88980c675f3fae9
fubar
parents:
3
diff
changeset
|
1080 "type": "LinearPileupDisplay", |
efc64d8f4b72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 79e81bef99f582680d9aa4eec88980c675f3fae9
fubar
parents:
3
diff
changeset
|
1081 "displayId": "%s-LinearPileupDisplay" % tId, |
efc64d8f4b72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 79e81bef99f582680d9aa4eec88980c675f3fae9
fubar
parents:
3
diff
changeset
|
1082 }, |
17
4c201a3d4755
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit a37bfdfc108501b11c7b2aa15efb1bd16f0c4b66
fubar
parents:
15
diff
changeset
|
1083 { |
4c201a3d4755
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit a37bfdfc108501b11c7b2aa15efb1bd16f0c4b66
fubar
parents:
15
diff
changeset
|
1084 "type": "LinearArcDisplay", |
4c201a3d4755
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit a37bfdfc108501b11c7b2aa15efb1bd16f0c4b66
fubar
parents:
15
diff
changeset
|
1085 "displayId": "%s-LinearArcDisplay" % tId, |
4c201a3d4755
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit a37bfdfc108501b11c7b2aa15efb1bd16f0c4b66
fubar
parents:
15
diff
changeset
|
1086 }, |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1087 ], |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1088 } |
59
f807e219cec3
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit faada92caf5aaabe58e52b161687a30d542a07b9
fubar
parents:
57
diff
changeset
|
1089 style_json = self._prepare_track_style(trackDict) |
f807e219cec3
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit faada92caf5aaabe58e52b161687a30d542a07b9
fubar
parents:
57
diff
changeset
|
1090 trackDict["style"] = style_json |
108
5d1259b88c27
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
107
diff
changeset
|
1091 if self.config_json.get("plugins", None): |
5d1259b88c27
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
107
diff
changeset
|
1092 self.config_json["plugins"].append(bedPlugin) |
5d1259b88c27
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
107
diff
changeset
|
1093 else: |
127
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1094 self.config_json["plugins"] = [ |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1095 bedPlugin, |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1096 ] |
104
9e3f69d9fed1
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
102
diff
changeset
|
1097 self.tracksToAdd[trackData["assemblyNames"]].append(copy.copy(trackDict)) |
109
27e9ddaaf325
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf-dirty
fubar
parents:
108
diff
changeset
|
1098 self.trackIdlist.append(tId) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1099 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1100 def add_paf(self, data, trackData, pafOpts, **kwargs): |
133
cec274db51c0
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7d28252954cae9f8db5f8a85d8f29cb2865b504b-dirty
fubar
parents:
132
diff
changeset
|
1101 canPIF = True |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1102 tname = trackData["name"] |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1103 tId = trackData["label"] |
80
dff27c9f6d72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7bb0fa234bdbc42768b30e426472a47b2523297f
fubar
parents:
79
diff
changeset
|
1104 url = tId |
132
1efcc387bef4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b76c8cc45b31e105e6bb51abc5a5728cfd3e3f99
bgruening
parents:
130
diff
changeset
|
1105 usePIF = False # much faster if indexed remotely or locally but broken in biocontainer. |
72
2bdb748df098
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9d5e563dde653450723415b0fccd2ebb4b82477e
fubar
parents:
71
diff
changeset
|
1106 useuri = data.startswith("http://") or data.startswith("https://") |
2bdb748df098
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9d5e563dde653450723415b0fccd2ebb4b82477e
fubar
parents:
71
diff
changeset
|
1107 if not useuri: |
132
1efcc387bef4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b76c8cc45b31e105e6bb51abc5a5728cfd3e3f99
bgruening
parents:
130
diff
changeset
|
1108 if canPIF: |
134
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
1109 fakeName = os.path.join(self.outdir, "%s.paf" % tId) |
132
1efcc387bef4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b76c8cc45b31e105e6bb51abc5a5728cfd3e3f99
bgruening
parents:
130
diff
changeset
|
1110 url = "%s.pif.gz" % tId |
1efcc387bef4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b76c8cc45b31e105e6bb51abc5a5728cfd3e3f99
bgruening
parents:
130
diff
changeset
|
1111 cmd = ["cp", data, fakeName] |
1efcc387bef4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b76c8cc45b31e105e6bb51abc5a5728cfd3e3f99
bgruening
parents:
130
diff
changeset
|
1112 self.subprocess_check_call(cmd) |
135
21bb464c1d53
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 78bf7abb931bf3d348837c7211cd3cff32486691
fubar
parents:
134
diff
changeset
|
1113 e = os.environ |
21bb464c1d53
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 78bf7abb931bf3d348837c7211cd3cff32486691
fubar
parents:
134
diff
changeset
|
1114 e["SHELL"] = "/bin/sh" |
133
cec274db51c0
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7d28252954cae9f8db5f8a85d8f29cb2865b504b-dirty
fubar
parents:
132
diff
changeset
|
1115 cmd = [ |
cec274db51c0
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7d28252954cae9f8db5f8a85d8f29cb2865b504b-dirty
fubar
parents:
132
diff
changeset
|
1116 "jbrowse", |
cec274db51c0
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7d28252954cae9f8db5f8a85d8f29cb2865b504b-dirty
fubar
parents:
132
diff
changeset
|
1117 "make-pif", |
cec274db51c0
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7d28252954cae9f8db5f8a85d8f29cb2865b504b-dirty
fubar
parents:
132
diff
changeset
|
1118 fakeName, |
134
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
1119 ] |
135
21bb464c1d53
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 78bf7abb931bf3d348837c7211cd3cff32486691
fubar
parents:
134
diff
changeset
|
1120 subprocess.run(cmd, env=e, shell=True) |
132
1efcc387bef4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b76c8cc45b31e105e6bb51abc5a5728cfd3e3f99
bgruening
parents:
130
diff
changeset
|
1121 usePIF = True |
1efcc387bef4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b76c8cc45b31e105e6bb51abc5a5728cfd3e3f99
bgruening
parents:
130
diff
changeset
|
1122 else: |
1efcc387bef4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b76c8cc45b31e105e6bb51abc5a5728cfd3e3f99
bgruening
parents:
130
diff
changeset
|
1123 dest = os.path.join(self.outdir, url) |
1efcc387bef4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b76c8cc45b31e105e6bb51abc5a5728cfd3e3f99
bgruening
parents:
130
diff
changeset
|
1124 self.symlink_or_copy(os.path.realpath(data), dest) |
72
2bdb748df098
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9d5e563dde653450723415b0fccd2ebb4b82477e
fubar
parents:
71
diff
changeset
|
1125 else: |
2bdb748df098
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9d5e563dde653450723415b0fccd2ebb4b82477e
fubar
parents:
71
diff
changeset
|
1126 url = data |
127
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1127 if data.endswith(".pif.gz") or data.endswith(".paf.gz"): # is tabix |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1128 usePIF = True |
57
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
1129 categ = trackData["category"] |
89
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1130 pg = pafOpts["genome"].split(",") |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1131 pgc = [x.strip() for x in pg if x.strip() > ""] |
134
ed3a21033188
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
bgruening
parents:
133
diff
changeset
|
1132 gnomes = [x.split("~~~") for x in pgc] |
93
4c517a0041a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit aeef2fbc0f90a9366851941ff51baeba410c56e4
fubar
parents:
92
diff
changeset
|
1133 logging.debug("pg=%s, gnomes=%s" % (pg, gnomes)) |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1134 passnames = [trackData["assemblyNames"]] # always first |
89
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1135 for i, (gpath, gname) in enumerate(gnomes): |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1136 # may have been forgotten by user for uri |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1137 if len(gname) == 0: |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1138 gn = os.path.basename(gpath) |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1139 gname = os.path.splitext(gn)[0] |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1140 # trouble from spacey names in command lines avoidance |
31
cb4b32ca9968
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919-dirty
fubar
parents:
30
diff
changeset
|
1141 if len(gname.split()) > 1: |
cb4b32ca9968
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919-dirty
fubar
parents:
30
diff
changeset
|
1142 gname = gname.split()[0] |
89
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1143 if gname not in passnames: |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1144 passnames.append(gname) |
93
4c517a0041a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit aeef2fbc0f90a9366851941ff51baeba410c56e4
fubar
parents:
92
diff
changeset
|
1145 useuri = pafOpts["useuri"] == "true" |
59
f807e219cec3
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit faada92caf5aaabe58e52b161687a30d542a07b9
fubar
parents:
57
diff
changeset
|
1146 if gname not in self.genome_names: |
f807e219cec3
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit faada92caf5aaabe58e52b161687a30d542a07b9
fubar
parents:
57
diff
changeset
|
1147 # ignore if already there - eg for duplicates among pafs. |
89
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1148 asstrack, first_contig = self.make_assembly(gpath, gname, useuri) |
112
56f9a6e0fe80
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 566509061b742b73c8dd1a1db6813fbf6a7a3792
bgruening
parents:
110
diff
changeset
|
1149 self.genome_names.append(gname) |
68
c4eb6a85db70
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bd958a96352bf8dbd1fdb5a2e994d57a42446f33-dirty
fubar
parents:
65
diff
changeset
|
1150 self.tracksToAdd[gname] = [] |
104
9e3f69d9fed1
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
102
diff
changeset
|
1151 self.assemblies.append(copy.copy(asstrack)) |
9e3f69d9fed1
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
102
diff
changeset
|
1152 self.ass_first_contigs.append(copy.copy(first_contig)) |
7
b04fd993b31e
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 53a108d8153c955044ae7eb8cb06bdcfd0036717
fubar
parents:
6
diff
changeset
|
1153 trackDict = { |
b04fd993b31e
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 53a108d8153c955044ae7eb8cb06bdcfd0036717
fubar
parents:
6
diff
changeset
|
1154 "type": "SyntenyTrack", |
b04fd993b31e
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 53a108d8153c955044ae7eb8cb06bdcfd0036717
fubar
parents:
6
diff
changeset
|
1155 "trackId": tId, |
31
cb4b32ca9968
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919-dirty
fubar
parents:
30
diff
changeset
|
1156 "assemblyNames": passnames, |
57
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
1157 "category": [ |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
1158 categ, |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
1159 ], |
7
b04fd993b31e
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 53a108d8153c955044ae7eb8cb06bdcfd0036717
fubar
parents:
6
diff
changeset
|
1160 "name": tname, |
64
497fd2d27aa2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit f450a9a7bec7ae695a85a061bf59956b73196976-dirty
fubar
parents:
63
diff
changeset
|
1161 "displays": [ |
68
c4eb6a85db70
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bd958a96352bf8dbd1fdb5a2e994d57a42446f33-dirty
fubar
parents:
65
diff
changeset
|
1162 { |
c4eb6a85db70
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bd958a96352bf8dbd1fdb5a2e994d57a42446f33-dirty
fubar
parents:
65
diff
changeset
|
1163 "type": "LGVSyntenyDisplay", |
72
2bdb748df098
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9d5e563dde653450723415b0fccd2ebb4b82477e
fubar
parents:
71
diff
changeset
|
1164 "displayId": "%s-LGVSyntenyDisplay" % tId, |
68
c4eb6a85db70
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bd958a96352bf8dbd1fdb5a2e994d57a42446f33-dirty
fubar
parents:
65
diff
changeset
|
1165 }, |
72
2bdb748df098
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9d5e563dde653450723415b0fccd2ebb4b82477e
fubar
parents:
71
diff
changeset
|
1166 { |
2bdb748df098
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9d5e563dde653450723415b0fccd2ebb4b82477e
fubar
parents:
71
diff
changeset
|
1167 "type": "DotplotDisplay", |
2bdb748df098
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9d5e563dde653450723415b0fccd2ebb4b82477e
fubar
parents:
71
diff
changeset
|
1168 "displayId": "%s-DotplotDisplay" % tId, |
2bdb748df098
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9d5e563dde653450723415b0fccd2ebb4b82477e
fubar
parents:
71
diff
changeset
|
1169 }, |
64
497fd2d27aa2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit f450a9a7bec7ae695a85a061bf59956b73196976-dirty
fubar
parents:
63
diff
changeset
|
1170 { |
497fd2d27aa2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit f450a9a7bec7ae695a85a061bf59956b73196976-dirty
fubar
parents:
63
diff
changeset
|
1171 "type": "LinearComparativeDisplay", |
72
2bdb748df098
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9d5e563dde653450723415b0fccd2ebb4b82477e
fubar
parents:
71
diff
changeset
|
1172 "displayId": "%s-LinearComparativeDisplay" % tId, |
64
497fd2d27aa2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit f450a9a7bec7ae695a85a061bf59956b73196976-dirty
fubar
parents:
63
diff
changeset
|
1173 }, |
497fd2d27aa2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit f450a9a7bec7ae695a85a061bf59956b73196976-dirty
fubar
parents:
63
diff
changeset
|
1174 { |
80
dff27c9f6d72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7bb0fa234bdbc42768b30e426472a47b2523297f
fubar
parents:
79
diff
changeset
|
1175 "type": "LinearBasicDisplay", |
72
2bdb748df098
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9d5e563dde653450723415b0fccd2ebb4b82477e
fubar
parents:
71
diff
changeset
|
1176 "displayId": "%s-LinearSyntenyDisplay" % tId, |
64
497fd2d27aa2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit f450a9a7bec7ae695a85a061bf59956b73196976-dirty
fubar
parents:
63
diff
changeset
|
1177 }, |
497fd2d27aa2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit f450a9a7bec7ae695a85a061bf59956b73196976-dirty
fubar
parents:
63
diff
changeset
|
1178 ], |
7
b04fd993b31e
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 53a108d8153c955044ae7eb8cb06bdcfd0036717
fubar
parents:
6
diff
changeset
|
1179 } |
127
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1180 if usePIF: |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1181 trackDict["adapter"] = { |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1182 "type": "PairwiseIndexedPAFAdapter", |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1183 "pifGzLocation": {"uri": url}, |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1184 "assemblyNames": passnames, |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1185 "index": { |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1186 "location": { |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1187 "uri": url + ".tbi", |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1188 } |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1189 }, |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1190 } |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1191 else: |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1192 trackDict["adapter"] = { |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1193 "type": "PAFAdapter", |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1194 "pafLocation": {"uri": url}, |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1195 "assemblyNames": passnames, |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1196 } |
130
e188a9d25ed2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9662f852d6eaf19a1bfa06f8a4263fd972afd6ba
bgruening
parents:
128
diff
changeset
|
1197 if not usePIF: |
80
dff27c9f6d72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7bb0fa234bdbc42768b30e426472a47b2523297f
fubar
parents:
79
diff
changeset
|
1198 style_json = { |
85
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1199 "type": "LGVSyntenyDisplay", |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1200 "displayId": "%s-LGVSyntenyDisplay" % tId, |
80
dff27c9f6d72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7bb0fa234bdbc42768b30e426472a47b2523297f
fubar
parents:
79
diff
changeset
|
1201 } |
dff27c9f6d72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7bb0fa234bdbc42768b30e426472a47b2523297f
fubar
parents:
79
diff
changeset
|
1202 else: |
dff27c9f6d72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7bb0fa234bdbc42768b30e426472a47b2523297f
fubar
parents:
79
diff
changeset
|
1203 style_json = { |
85
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1204 "type": "LinearBasicDisplay", |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1205 "displayId": "%s-LinearBasicDisplay" % tId, |
80
dff27c9f6d72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7bb0fa234bdbc42768b30e426472a47b2523297f
fubar
parents:
79
diff
changeset
|
1206 } |
59
f807e219cec3
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit faada92caf5aaabe58e52b161687a30d542a07b9
fubar
parents:
57
diff
changeset
|
1207 trackDict["style"] = style_json |
104
9e3f69d9fed1
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
102
diff
changeset
|
1208 self.tracksToAdd[trackData["assemblyNames"]].append(copy.copy(trackDict)) |
109
27e9ddaaf325
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf-dirty
fubar
parents:
108
diff
changeset
|
1209 self.trackIdlist.append(tId) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1210 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1211 def process_annotations(self, track): |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1212 category = track["category"].replace("__pd__date__pd__", TODAY) |
99
990291e918c7
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
98
diff
changeset
|
1213 tt1 = ",/ :;\\" |
990291e918c7
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
98
diff
changeset
|
1214 tt2 = "______" |
112
56f9a6e0fe80
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 566509061b742b73c8dd1a1db6813fbf6a7a3792
bgruening
parents:
110
diff
changeset
|
1215 labttab = str.maketrans(tt1, tt2) |
80
dff27c9f6d72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7bb0fa234bdbc42768b30e426472a47b2523297f
fubar
parents:
79
diff
changeset
|
1216 for trackIndex, ( |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1217 dataset_path, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1218 dataset_ext, |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
1219 useuri, |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1220 track_human_label, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1221 extra_metadata, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1222 ) in enumerate(track["trackfiles"]): |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
1223 if not dataset_path.strip().startswith("http"): |
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
1224 # Unsanitize labels (element_identifiers are always sanitized by Galaxy) |
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
1225 for key, value in mapped_chars.items(): |
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
1226 track_human_label = track_human_label.replace(value, key) |
99
990291e918c7
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
98
diff
changeset
|
1227 track_human_label = track_human_label.translate(labttab) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1228 outputTrackConfig = { |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1229 "category": category, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1230 "style": {}, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1231 } |
98
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
1232 |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1233 outputTrackConfig["assemblyNames"] = track["assemblyNames"] |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1234 outputTrackConfig["key"] = track_human_label |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
1235 outputTrackConfig["useuri"] = useuri |
48
460d5b6c5d98
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a-dirty
fubar
parents:
47
diff
changeset
|
1236 outputTrackConfig["path"] = dataset_path |
460d5b6c5d98
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a-dirty
fubar
parents:
47
diff
changeset
|
1237 outputTrackConfig["ext"] = dataset_ext |
7
b04fd993b31e
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 53a108d8153c955044ae7eb8cb06bdcfd0036717
fubar
parents:
6
diff
changeset
|
1238 outputTrackConfig["trackset"] = track.get("trackset", {}) |
89
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1239 outputTrackConfig["label"] = track["label"] |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1240 outputTrackConfig["metadata"] = extra_metadata |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1241 outputTrackConfig["name"] = track_human_label |
89
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1242 if track["label"] in self.trackIdlist: |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1243 logging.error( |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1244 "### not adding %s already in %s" |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1245 % (track["label"], self.trackIdlist) |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1246 ) |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1247 yield None |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1248 if dataset_ext in ("gff", "gff3"): |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1249 self.add_gff( |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1250 dataset_path, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1251 outputTrackConfig, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1252 ) |
34
2893ef33fba9
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd
fubar
parents:
32
diff
changeset
|
1253 elif dataset_ext in ("hic", "juicebox_hic"): |
85
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1254 outputTrackConfig["wasCool"] = False |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1255 self.add_hic( |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1256 dataset_path, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1257 outputTrackConfig, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1258 ) |
23
39b717d934a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit be2268f4c11d54bdd44789dd88dd9017cad27887-dirty
fubar
parents:
19
diff
changeset
|
1259 elif dataset_ext in ("cool", "mcool", "scool"): |
80
dff27c9f6d72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7bb0fa234bdbc42768b30e426472a47b2523297f
fubar
parents:
79
diff
changeset
|
1260 hic_url = outputTrackConfig["label"] |
85
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1261 hic_path = os.path.join(self.outdir, hic_url) + ".hic" |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1262 outputTrackConfig["wasCool"] = True |
23
39b717d934a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit be2268f4c11d54bdd44789dd88dd9017cad27887-dirty
fubar
parents:
19
diff
changeset
|
1263 self.subprocess_check_call( |
39b717d934a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit be2268f4c11d54bdd44789dd88dd9017cad27887-dirty
fubar
parents:
19
diff
changeset
|
1264 [ |
39b717d934a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit be2268f4c11d54bdd44789dd88dd9017cad27887-dirty
fubar
parents:
19
diff
changeset
|
1265 "hictk", |
39b717d934a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit be2268f4c11d54bdd44789dd88dd9017cad27887-dirty
fubar
parents:
19
diff
changeset
|
1266 "convert", |
39b717d934a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit be2268f4c11d54bdd44789dd88dd9017cad27887-dirty
fubar
parents:
19
diff
changeset
|
1267 "-f", |
39b717d934a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit be2268f4c11d54bdd44789dd88dd9017cad27887-dirty
fubar
parents:
19
diff
changeset
|
1268 "--output-fmt", |
39b717d934a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit be2268f4c11d54bdd44789dd88dd9017cad27887-dirty
fubar
parents:
19
diff
changeset
|
1269 "hic", |
39b717d934a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit be2268f4c11d54bdd44789dd88dd9017cad27887-dirty
fubar
parents:
19
diff
changeset
|
1270 dataset_path, |
39b717d934a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit be2268f4c11d54bdd44789dd88dd9017cad27887-dirty
fubar
parents:
19
diff
changeset
|
1271 hic_path, |
39b717d934a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit be2268f4c11d54bdd44789dd88dd9017cad27887-dirty
fubar
parents:
19
diff
changeset
|
1272 ] |
39b717d934a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit be2268f4c11d54bdd44789dd88dd9017cad27887-dirty
fubar
parents:
19
diff
changeset
|
1273 ) |
39b717d934a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit be2268f4c11d54bdd44789dd88dd9017cad27887-dirty
fubar
parents:
19
diff
changeset
|
1274 self.add_hic( |
85
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1275 hic_path, |
23
39b717d934a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit be2268f4c11d54bdd44789dd88dd9017cad27887-dirty
fubar
parents:
19
diff
changeset
|
1276 outputTrackConfig, |
39b717d934a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit be2268f4c11d54bdd44789dd88dd9017cad27887-dirty
fubar
parents:
19
diff
changeset
|
1277 ) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1278 elif dataset_ext in ("bed",): |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1279 self.add_bed( |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1280 dataset_path, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1281 dataset_ext, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1282 outputTrackConfig, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1283 ) |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1284 elif dataset_ext in ("maf",): |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1285 self.add_maf( |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1286 dataset_path, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1287 outputTrackConfig, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1288 ) |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1289 elif dataset_ext == "bigwig": |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1290 self.add_bigwig( |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1291 dataset_path, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1292 outputTrackConfig, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1293 ) |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1294 elif dataset_ext == "bam": |
37
7adde511daa1
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd-dirty
fubar
parents:
35
diff
changeset
|
1295 real_indexes = track["conf"]["options"]["bam"]["bam_index"] |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1296 self.add_bam( |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1297 dataset_path, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1298 outputTrackConfig, |
85
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1299 bam_indexes=real_indexes, |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1300 ) |
19
bde6b1d09f7d
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1290bf486bc55c02fecd0327de10a28655a18e81-dirty
fubar
parents:
17
diff
changeset
|
1301 elif dataset_ext == "cram": |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
1302 real_indexes = track["conf"]["options"]["cram"]["cram_index"] |
19
bde6b1d09f7d
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1290bf486bc55c02fecd0327de10a28655a18e81-dirty
fubar
parents:
17
diff
changeset
|
1303 self.add_cram( |
bde6b1d09f7d
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1290bf486bc55c02fecd0327de10a28655a18e81-dirty
fubar
parents:
17
diff
changeset
|
1304 dataset_path, |
bde6b1d09f7d
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1290bf486bc55c02fecd0327de10a28655a18e81-dirty
fubar
parents:
17
diff
changeset
|
1305 outputTrackConfig, |
85
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1306 cram_indexes=real_indexes, |
19
bde6b1d09f7d
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1290bf486bc55c02fecd0327de10a28655a18e81-dirty
fubar
parents:
17
diff
changeset
|
1307 ) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1308 elif dataset_ext == "vcf": |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1309 self.add_vcf(dataset_path, outputTrackConfig) |
15
cce8dacb240f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 1a20cf06627d429a211427753f223467188dbe7f-dirty
fubar
parents:
14
diff
changeset
|
1310 elif dataset_ext == "paf": |
cce8dacb240f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 1a20cf06627d429a211427753f223467188dbe7f-dirty
fubar
parents:
14
diff
changeset
|
1311 self.add_paf( |
17
4c201a3d4755
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit a37bfdfc108501b11c7b2aa15efb1bd16f0c4b66
fubar
parents:
15
diff
changeset
|
1312 dataset_path, |
4c201a3d4755
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit a37bfdfc108501b11c7b2aa15efb1bd16f0c4b66
fubar
parents:
15
diff
changeset
|
1313 outputTrackConfig, |
27
4ff1ed2065cc
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit d733fb18a02929c9e9959ad30bd0f1368118e924-dirty
fubar
parents:
25
diff
changeset
|
1314 track["conf"]["options"]["paf"], |
15
cce8dacb240f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 1a20cf06627d429a211427753f223467188dbe7f-dirty
fubar
parents:
14
diff
changeset
|
1315 ) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1316 else: |
98
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
1317 logging.warning("Do not know how to handle %s", dataset_ext) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1318 # Return non-human label for use in other fields |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1319 yield outputTrackConfig["label"] |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1320 |
57
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
1321 def add_default_session(self, default_data): |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1322 """ |
60
81d535970196
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 403a35e1245fa5e62f4be6116a725b9e4d9c353a
fubar
parents:
59
diff
changeset
|
1323 default session settings are hard and fragile. |
81d535970196
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 403a35e1245fa5e62f4be6116a725b9e4d9c353a
fubar
parents:
59
diff
changeset
|
1324 .add_default_view() and other configuration code adapted from |
81d535970196
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 403a35e1245fa5e62f4be6116a725b9e4d9c353a
fubar
parents:
59
diff
changeset
|
1325 https://github.com/abretaud/tools-iuc/blob/jbrowse2/tools/jbrowse2/jbrowse2.py |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1326 """ |
112
56f9a6e0fe80
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 566509061b742b73c8dd1a1db6813fbf6a7a3792
bgruening
parents:
110
diff
changeset
|
1327 # TODO using the default session for now, but check out session specs in the future https://github.com/GMOD/jbrowse-components/issues/2708 |
127
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1328 bpPerPx = ( |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1329 self.bpPerPx |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1330 ) # Browser window width is unknown and default session cannot be used to figure it out in JB2 code so could be 200-2000+ pixels. |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1331 track_types = {} |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1332 with open(self.config_json_file, "r") as config_file: |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1333 config_json = json.load(config_file) |
10
c60b17456297
planemo upload commit 740eeca506257070c95f4e9f1a75911c31db5a04
fubar
parents:
9
diff
changeset
|
1334 if self.config_json: |
c60b17456297
planemo upload commit 740eeca506257070c95f4e9f1a75911c31db5a04
fubar
parents:
9
diff
changeset
|
1335 config_json.update(self.config_json) |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1336 if "defaultSession" in config_json: |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1337 session_json = config_json["defaultSession"] |
78
7bb6259ea52f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit d03454f949af9f3fff638f6a3e52fe42bc96be3b-dirty
fubar
parents:
76
diff
changeset
|
1338 session_views = [] |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1339 else: |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1340 session_json = {} |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1341 session_views = [] |
85
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1342 for gnome in self.assmeta.keys(): # assemblies have their own tracks |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1343 tracks_data = [] |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1344 for track_conf in self.tracksToAdd[gnome]: |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1345 tId = track_conf["trackId"] |
85
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1346 if tId in default_data[gnome]["visibility"]["default_on"]: |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1347 track_types[tId] = track_conf["type"] |
110
c017111e976a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf-dirty
fubar
parents:
109
diff
changeset
|
1348 style_data = default_data[gnome]["style"].get(tId, {}) |
c017111e976a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf-dirty
fubar
parents:
109
diff
changeset
|
1349 if not style_data: |
c017111e976a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf-dirty
fubar
parents:
109
diff
changeset
|
1350 logging.debug( |
c017111e976a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf-dirty
fubar
parents:
109
diff
changeset
|
1351 "No style data for %s in available default data %s" |
c017111e976a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf-dirty
fubar
parents:
109
diff
changeset
|
1352 % (tId, default_data) |
c017111e976a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf-dirty
fubar
parents:
109
diff
changeset
|
1353 ) |
c017111e976a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf-dirty
fubar
parents:
109
diff
changeset
|
1354 else: |
127
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1355 logging.debug("style data for %s = %s" % (tId, style_data)) |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1356 if style_data.get("type", None) is None: |
110
c017111e976a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf-dirty
fubar
parents:
109
diff
changeset
|
1357 style_data["type"] = "LinearBasicDisplay" |
c017111e976a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf-dirty
fubar
parents:
109
diff
changeset
|
1358 if "displays" in track_conf: |
c017111e976a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf-dirty
fubar
parents:
109
diff
changeset
|
1359 disp = track_conf["displays"][0]["type"] |
c017111e976a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf-dirty
fubar
parents:
109
diff
changeset
|
1360 style_data["type"] = disp |
109
27e9ddaaf325
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf-dirty
fubar
parents:
108
diff
changeset
|
1361 if track_conf.get("displays", None): |
127
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1362 style_data["configuration"] = track_conf["displays"][0][ |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1363 "displayId" |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1364 ] |
109
27e9ddaaf325
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf-dirty
fubar
parents:
108
diff
changeset
|
1365 else: |
27e9ddaaf325
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf-dirty
fubar
parents:
108
diff
changeset
|
1366 logging.debug("no display in track_conf for %s" % tId) |
85
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1367 if track_conf.get("style_labels", None): |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1368 # TODO fix this: it should probably go in a renderer block (SvgFeatureRenderer) but still does not work |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1369 # TODO move this to per track displays? |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1370 style_data["labels"] = track_conf["style_labels"] |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1371 tracks_data.append( |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1372 { |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1373 "type": track_types[tId], |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1374 "configuration": tId, |
110
c017111e976a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf-dirty
fubar
parents:
109
diff
changeset
|
1375 "displays": [style_data], |
85
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1376 } |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1377 ) |
85
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1378 first = [x for x in self.ass_first_contigs if x[0] == gnome] |
99
990291e918c7
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
98
diff
changeset
|
1379 drdict = { |
112
56f9a6e0fe80
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 566509061b742b73c8dd1a1db6813fbf6a7a3792
bgruening
parents:
110
diff
changeset
|
1380 "reversed": False, |
56f9a6e0fe80
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 566509061b742b73c8dd1a1db6813fbf6a7a3792
bgruening
parents:
110
diff
changeset
|
1381 "assemblyName": gnome, |
56f9a6e0fe80
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 566509061b742b73c8dd1a1db6813fbf6a7a3792
bgruening
parents:
110
diff
changeset
|
1382 } |
99
990291e918c7
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
98
diff
changeset
|
1383 if len(first) > 0: |
990291e918c7
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
98
diff
changeset
|
1384 [gnome, refName, end] = first[0] |
990291e918c7
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
98
diff
changeset
|
1385 drdict["refName"] = refName |
990291e918c7
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
98
diff
changeset
|
1386 drdict["start"] = 0 |
990291e918c7
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
98
diff
changeset
|
1387 end = int(end) |
112
56f9a6e0fe80
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 566509061b742b73c8dd1a1db6813fbf6a7a3792
bgruening
parents:
110
diff
changeset
|
1388 drdict["end"] = end |
85
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1389 else: |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1390 ddl = default_data.get("defaultLocation", None) |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1391 if ddl: |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1392 loc_match = re.search(r"^([^:]+):([\d,]*)\.*([\d,]*)$", ddl) |
112
56f9a6e0fe80
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 566509061b742b73c8dd1a1db6813fbf6a7a3792
bgruening
parents:
110
diff
changeset
|
1393 # allow commas like 100,000 but ignore as integer |
85
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1394 if loc_match: |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1395 refName = loc_match.group(1) |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1396 drdict["refName"] = refName |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1397 if loc_match.group(2) > "": |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1398 drdict["start"] = int(loc_match.group(2).replace(",", "")) |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1399 if loc_match.group(3) > "": |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1400 drdict["end"] = int(loc_match.group(3).replace(",", "")) |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1401 else: |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1402 logging.info( |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1403 "@@@ regexp could not match contig:start..end in the supplied location %s - please fix" |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1404 % ddl |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1405 ) |
99
990291e918c7
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
98
diff
changeset
|
1406 view_json = { |
990291e918c7
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
98
diff
changeset
|
1407 "type": "LinearGenomeView", |
990291e918c7
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
98
diff
changeset
|
1408 "offsetPx": 0, |
112
56f9a6e0fe80
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 566509061b742b73c8dd1a1db6813fbf6a7a3792
bgruening
parents:
110
diff
changeset
|
1409 "bpPerPx": bpPerPx, |
99
990291e918c7
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
98
diff
changeset
|
1410 "minimized": False, |
127
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1411 "tracks": tracks_data, |
99
990291e918c7
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
98
diff
changeset
|
1412 } |
85
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1413 if drdict.get("refName", None): |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1414 # TODO displayedRegions is not just zooming to the region, it hides the rest of the chromosome |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1415 view_json["displayedRegions"] = [ |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1416 drdict, |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1417 ] |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1418 logging.info("@@@ defaultlocation %s for default session" % drdict) |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1419 else: |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1420 logging.info( |
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1421 "@@@ no track location for default session - please add one!" |
79
14ecbe46ae9f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit d03454f949af9f3fff638f6a3e52fe42bc96be3b-dirty
fubar
parents:
78
diff
changeset
|
1422 ) |
85
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1423 session_views.append(view_json) |
57
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
56
diff
changeset
|
1424 session_name = default_data.get("session_name", "New session") |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1425 session_json["name"] = session_name |
98
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
1426 |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1427 if "views" not in session_json: |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1428 session_json["views"] = session_views |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1429 else: |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1430 session_json["views"] += session_views |
98
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
1431 |
72
2bdb748df098
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9d5e563dde653450723415b0fccd2ebb4b82477e
fubar
parents:
71
diff
changeset
|
1432 pp = json.dumps(session_views, indent=2) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1433 config_json["defaultSession"] = session_json |
10
c60b17456297
planemo upload commit 740eeca506257070c95f4e9f1a75911c31db5a04
fubar
parents:
9
diff
changeset
|
1434 self.config_json.update(config_json) |
72
2bdb748df098
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9d5e563dde653450723415b0fccd2ebb4b82477e
fubar
parents:
71
diff
changeset
|
1435 logging.debug("defaultSession=%s" % (pp)) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1436 with open(self.config_json_file, "w") as config_file: |
10
c60b17456297
planemo upload commit 740eeca506257070c95f4e9f1a75911c31db5a04
fubar
parents:
9
diff
changeset
|
1437 json.dump(self.config_json, config_file, indent=2) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1438 |
73
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1439 def add_defsess_to_index(self, data): |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1440 """ |
97
74074746ccd8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1c04ea76330d0148a7682b3c26846e5a5df21f99
fubar
parents:
93
diff
changeset
|
1441 ---------------------------------------------------------- |
73
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1442 Add some default session settings: set some assemblies/tracks on/off |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1443 |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1444 This allows to select a default view: |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1445 - jb type (Linear, Circular, etc) |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1446 - default location on an assembly |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1447 - default tracks |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1448 - ... |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1449 |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1450 Different methods to do that were tested/discussed: |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1451 - using a defaultSession item in config.json: this proved to be difficult: |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1452 forced to write a full session block, including hard-coded/hard-to-guess items, |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1453 no good way to let Jbrowse2 display a scaffold without knowing its size |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1454 - using JBrowse2 as an embedded React component in a tool-generated html file: |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1455 it works but it requires generating js code to actually do what we want = chosing default view, assembly, tracks, ... |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1456 - writing a session-spec inside the config.json file: this is not yet supported as of 2.10.2 (see PR 4148 below) |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1457 a session-spec is a kind of simplified defaultSession where you don't need to specify every aspect of the session |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1458 - passing a session-spec through URL params by embedding the JBrowse2 index.html inside an iframe |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1459 we selected this option |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1460 |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1461 Xrefs to understand the choices: |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1462 https://github.com/GMOD/jbrowse-components/issues/2708 |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1463 https://github.com/GMOD/jbrowse-components/discussions/3568 |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1464 https://github.com/GMOD/jbrowse-components/pull/4148 |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1465 """ |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1466 new_index = "Nothing written" |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1467 session_spec = {"views": []} |
74
13ede71c3a4b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit d03454f949af9f3fff638f6a3e52fe42bc96be3b
fubar
parents:
73
diff
changeset
|
1468 logging.debug("def ass_first=%s\ndata=%s" % (self.ass_first_contigs, data)) |
73
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1469 for first_contig in self.ass_first_contigs: |
75
9c8459ce7d88
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit d03454f949af9f3fff638f6a3e52fe42bc96be3b-dirty
fubar
parents:
74
diff
changeset
|
1470 logging.debug("first contig=%s" % self.ass_first_contigs) |
9c8459ce7d88
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit d03454f949af9f3fff638f6a3e52fe42bc96be3b-dirty
fubar
parents:
74
diff
changeset
|
1471 [gnome, refName, end] = first_contig |
73
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1472 start = 0 |
76
9e3eb6b26f85
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit d03454f949af9f3fff638f6a3e52fe42bc96be3b-dirty
fubar
parents:
75
diff
changeset
|
1473 aview = { |
9e3eb6b26f85
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit d03454f949af9f3fff638f6a3e52fe42bc96be3b-dirty
fubar
parents:
75
diff
changeset
|
1474 "assembly": gnome, |
9e3eb6b26f85
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit d03454f949af9f3fff638f6a3e52fe42bc96be3b-dirty
fubar
parents:
75
diff
changeset
|
1475 "loc": "{}:{}..{}".format(refName, start, end), |
9e3eb6b26f85
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit d03454f949af9f3fff638f6a3e52fe42bc96be3b-dirty
fubar
parents:
75
diff
changeset
|
1476 "type": "LinearGenomeView", |
9e3eb6b26f85
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit d03454f949af9f3fff638f6a3e52fe42bc96be3b-dirty
fubar
parents:
75
diff
changeset
|
1477 "tracks": data[gnome]["tracks"], |
9e3eb6b26f85
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit d03454f949af9f3fff638f6a3e52fe42bc96be3b-dirty
fubar
parents:
75
diff
changeset
|
1478 } |
9e3eb6b26f85
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit d03454f949af9f3fff638f6a3e52fe42bc96be3b-dirty
fubar
parents:
75
diff
changeset
|
1479 session_spec["views"].append(aview) |
73
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1480 sess = json.dumps(session_spec, sort_keys=True, indent=2) |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1481 new_index = INDEX_TEMPLATE.replace( |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1482 "__SESSION_SPEC__", "&session=spec-{}".format(sess) |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1483 ) |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1484 |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1485 os.rename( |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1486 os.path.join(self.outdir, "index.html"), |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1487 os.path.join(self.outdir, "index_noview.html"), |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1488 ) |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1489 |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1490 with open(os.path.join(self.outdir, "index.html"), "w") as nind: |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1491 nind.write(new_index) |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1492 logging.debug( |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1493 "#### add_defsession gnome=%s refname=%s\nsession_spec=%s\nnew_index=%s" |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1494 % (gnome, refName, sess, new_index) |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1495 ) |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1496 |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1497 def add_general_configuration(self, data): |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1498 """ |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1499 Add some general configuration to the config.json file |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1500 """ |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1501 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1502 config_path = self.config_json_file |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1503 if os.path.exists(config_path): |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1504 with open(config_path, "r") as config_file: |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1505 config_json = json.load(config_file) |
10
c60b17456297
planemo upload commit 740eeca506257070c95f4e9f1a75911c31db5a04
fubar
parents:
9
diff
changeset
|
1506 else: |
c60b17456297
planemo upload commit 740eeca506257070c95f4e9f1a75911c31db5a04
fubar
parents:
9
diff
changeset
|
1507 config_json = {} |
c60b17456297
planemo upload commit 740eeca506257070c95f4e9f1a75911c31db5a04
fubar
parents:
9
diff
changeset
|
1508 if self.config_json: |
c60b17456297
planemo upload commit 740eeca506257070c95f4e9f1a75911c31db5a04
fubar
parents:
9
diff
changeset
|
1509 config_json.update(self.config_json) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1510 config_data = {} |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1511 |
23
39b717d934a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit be2268f4c11d54bdd44789dd88dd9017cad27887-dirty
fubar
parents:
19
diff
changeset
|
1512 config_data["disableAnalytics"] = data.get("analytics", "false") == "true" |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1513 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1514 config_data["theme"] = { |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1515 "palette": { |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1516 "primary": {"main": data.get("primary_color", "#0D233F")}, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1517 "secondary": {"main": data.get("secondary_color", "#721E63")}, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1518 "tertiary": {"main": data.get("tertiary_color", "#135560")}, |
23
39b717d934a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit be2268f4c11d54bdd44789dd88dd9017cad27887-dirty
fubar
parents:
19
diff
changeset
|
1519 "quaternary": {"main": data.get("quaternary_color", "#FFB11D")}, |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1520 }, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1521 "typography": {"fontSize": int(data.get("font_size", 10))}, |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1522 } |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1523 if not config_json.get("configuration", None): |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1524 config_json["configuration"] = {} |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1525 config_json["configuration"].update(config_data) |
10
c60b17456297
planemo upload commit 740eeca506257070c95f4e9f1a75911c31db5a04
fubar
parents:
9
diff
changeset
|
1526 self.config_json.update(config_json) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1527 with open(config_path, "w") as config_file: |
10
c60b17456297
planemo upload commit 740eeca506257070c95f4e9f1a75911c31db5a04
fubar
parents:
9
diff
changeset
|
1528 json.dump(self.config_json, config_file, indent=2) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1529 |
73
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1530 def clone_jbrowse(self, realclone=False): |
98
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
1531 """ |
127
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1532 Clone a JBrowse directory into a destination directory. |
98
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
1533 |
127
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1534 `realclone=true` will use the `jbrowse create` command. |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1535 To allow running on internet-less compute and for reproducibility |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1536 use frozen code with `realclone=false |
98
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
1537 |
60
81d535970196
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 403a35e1245fa5e62f4be6116a725b9e4d9c353a
fubar
parents:
59
diff
changeset
|
1538 """ |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1539 dest = self.outdir |
122
ae07c55ab96b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a9124072bc71dd670ee58ff8e4846e14d6d603ec
fubar
parents:
121
diff
changeset
|
1540 if (not os.path.exists(self.jbrowse2path)) or realclone: |
135
21bb464c1d53
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 78bf7abb931bf3d348837c7211cd3cff32486691
fubar
parents:
134
diff
changeset
|
1541 e = os.environ |
21bb464c1d53
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 78bf7abb931bf3d348837c7211cd3cff32486691
fubar
parents:
134
diff
changeset
|
1542 e["SHELL"] = "/bin/sh" |
21bb464c1d53
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 78bf7abb931bf3d348837c7211cd3cff32486691
fubar
parents:
134
diff
changeset
|
1543 cmd = ["jbrowse", "create", dest, "-f", "--tag", f"{JB2VER}"] |
21bb464c1d53
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 78bf7abb931bf3d348837c7211cd3cff32486691
fubar
parents:
134
diff
changeset
|
1544 subprocess.run(cmd, env=e, shell=True) |
56
c0097a584a8a
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674
fubar
parents:
55
diff
changeset
|
1545 else: |
c0097a584a8a
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674
fubar
parents:
55
diff
changeset
|
1546 shutil.copytree(self.jbrowse2path, dest, dirs_exist_ok=True) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1547 for fn in [ |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1548 "asset-manifest.json", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1549 "favicon.ico", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1550 "robots.txt", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1551 "umd_plugin.js", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1552 "version.txt", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1553 "test_data", |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1554 ]: |
97
74074746ccd8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1c04ea76330d0148a7682b3c26846e5a5df21f99
fubar
parents:
93
diff
changeset
|
1555 try: |
74074746ccd8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1c04ea76330d0148a7682b3c26846e5a5df21f99
fubar
parents:
93
diff
changeset
|
1556 path = os.path.join(dest, fn) |
74074746ccd8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1c04ea76330d0148a7682b3c26846e5a5df21f99
fubar
parents:
93
diff
changeset
|
1557 if os.path.isdir(path): |
74074746ccd8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1c04ea76330d0148a7682b3c26846e5a5df21f99
fubar
parents:
93
diff
changeset
|
1558 shutil.rmtree(path) |
74074746ccd8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1c04ea76330d0148a7682b3c26846e5a5df21f99
fubar
parents:
93
diff
changeset
|
1559 else: |
74074746ccd8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1c04ea76330d0148a7682b3c26846e5a5df21f99
fubar
parents:
93
diff
changeset
|
1560 os.remove(path) |
74074746ccd8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1c04ea76330d0148a7682b3c26846e5a5df21f99
fubar
parents:
93
diff
changeset
|
1561 except OSError as e: |
74074746ccd8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1c04ea76330d0148a7682b3c26846e5a5df21f99
fubar
parents:
93
diff
changeset
|
1562 log.error("Error: %s - %s." % (e.filename, e.strerror)) |
108
5d1259b88c27
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
107
diff
changeset
|
1563 for neededfile in ["jb2_webserver.py", "bedscoreplugin.js"]: |
127
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1564 shutil.copyfile( |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1565 os.path.join(INSTALLED_TO, neededfile), os.path.join(dest, neededfile) |
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1566 ) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1567 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1568 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1569 def parse_style_conf(item): |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1570 if item.text.lower() in ["false", "true", "yes", "no"]: |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1571 return item.text.lower in ("yes", "true") |
104
9e3f69d9fed1
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
102
diff
changeset
|
1572 elif item.text.isdigit(): |
9e3f69d9fed1
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
102
diff
changeset
|
1573 return int(item.text) |
9e3f69d9fed1
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
102
diff
changeset
|
1574 return item.text |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1575 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1576 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1577 if __name__ == "__main__": |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1578 parser = argparse.ArgumentParser(description="", epilog="") |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1579 parser.add_argument("--xml", help="Track Configuration") |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
1580 parser.add_argument( |
97
74074746ccd8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1c04ea76330d0148a7682b3c26846e5a5df21f99
fubar
parents:
93
diff
changeset
|
1581 "--jbrowse2path", help="Path to JBrowse2 directory in BioContainer or Conda" |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
44
diff
changeset
|
1582 ) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1583 parser.add_argument("--outdir", help="Output directory", default="out") |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1584 parser.add_argument("--version", "-V", action="version", version=JB2VER) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1585 args = parser.parse_args() |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1586 tree = ET.parse(args.xml) |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1587 root = tree.getroot() |
127
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1588 removeMe = string.punctuation.replace(".", " ").replace("/", "").replace("-", "") |
121
478ee3e780de
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a6f013087aa66546a843298e2584604668f9e140
fubar
parents:
120
diff
changeset
|
1589 # first is a space because space needs to be added here for removal from labels as paths. |
120
af482048ca1a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 59fe39774d791bc684811b6ce03e13ef093d074e
fubar
parents:
118
diff
changeset
|
1590 nopunct = str.maketrans(dict.fromkeys(removeMe)) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1591 # This should be done ASAP |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1592 GALAXY_INFRASTRUCTURE_URL = root.find("metadata/galaxyUrl").text |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1593 # Sometimes this comes as `localhost` without a protocol |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1594 if not GALAXY_INFRASTRUCTURE_URL.startswith("http"): |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1595 # so we'll prepend `http://` and hope for the best. Requests *should* |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1596 # be GET and not POST so it should redirect OK |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1597 GALAXY_INFRASTRUCTURE_URL = "http://" + GALAXY_INFRASTRUCTURE_URL |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1598 |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1599 jc = JbrowseConnector(outdir=args.outdir, jbrowse2path=args.jbrowse2path) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1600 |
73
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1601 default_session_data = {} |
89
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1602 trackI = 0 |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1603 for ass in root.findall("assembly"): |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1604 genomes = [ |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1605 { |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1606 "path": x.attrib["path"], |
120
af482048ca1a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 59fe39774d791bc684811b6ce03e13ef093d074e
fubar
parents:
118
diff
changeset
|
1607 "label": x.attrib["label"].split(" ")[0].translate(nopunct), |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1608 "useuri": x.attrib["useuri"], |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1609 "meta": metadata_from_node(x.find("metadata")), |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1610 } |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1611 for x in ass.findall("metadata/genomes/genome") |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1612 ] |
89
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1613 primaryGenome = jc.process_genomes(genomes) |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1614 if not default_session_data.get(primaryGenome, None): |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1615 default_session_data[primaryGenome] = { |
73
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1616 "tracks": [], |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1617 "style": {}, |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1618 "style_labels": {}, |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1619 "visibility": { |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1620 "default_on": [], |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1621 "default_off": [], |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1622 }, |
3b2815efa5d9
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b361309b05a861da9b64e1324157a8c32767e0bf
fubar
parents:
72
diff
changeset
|
1623 } |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1624 for track in ass.find("tracks"): |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1625 track_conf = {} |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1626 track_conf["trackfiles"] = [] |
89
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1627 track_conf["assemblyNames"] = primaryGenome |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1628 is_multi_bigwig = False |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1629 try: |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1630 if track.find("options/wiggle/multibigwig") and ( |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1631 track.find("options/wiggle/multibigwig").text == "True" |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1632 ): |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1633 is_multi_bigwig = True |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1634 multi_bigwig_paths = [] |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1635 except KeyError: |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1636 pass |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1637 |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1638 trackfiles = track.findall("files/trackFile") |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1639 if trackfiles: |
85
3b2ff9864995
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 264a3d6c7a29f396d359f33164ddf2cb1d9903f8-dirty
fubar
parents:
83
diff
changeset
|
1640 for x in trackfiles: |
108
5d1259b88c27
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
107
diff
changeset
|
1641 isBed = False |
127
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1642 if x.attrib["ext"] == "bed": |
112
56f9a6e0fe80
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 566509061b742b73c8dd1a1db6813fbf6a7a3792
bgruening
parents:
110
diff
changeset
|
1643 isBed = True |
93
4c517a0041a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit aeef2fbc0f90a9366851941ff51baeba410c56e4
fubar
parents:
92
diff
changeset
|
1644 track_conf["label"] = "%s_%d" % ( |
120
af482048ca1a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 59fe39774d791bc684811b6ce03e13ef093d074e
fubar
parents:
118
diff
changeset
|
1645 x.attrib["label"].translate(nopunct), |
93
4c517a0041a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit aeef2fbc0f90a9366851941ff51baeba410c56e4
fubar
parents:
92
diff
changeset
|
1646 trackI, |
4c517a0041a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit aeef2fbc0f90a9366851941ff51baeba410c56e4
fubar
parents:
92
diff
changeset
|
1647 ) |
89
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1648 trackI += 1 |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1649 track_conf["useuri"] = x.attrib["useuri"] |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1650 if is_multi_bigwig: |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1651 multi_bigwig_paths.append( |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1652 ( |
120
af482048ca1a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 59fe39774d791bc684811b6ce03e13ef093d074e
fubar
parents:
118
diff
changeset
|
1653 track_conf["label"].translate(nopunct), |
89
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1654 track_conf["useuri"], |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1655 os.path.realpath(x.attrib["path"]), |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1656 ) |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1657 ) |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1658 else: |
104
9e3f69d9fed1
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
102
diff
changeset
|
1659 metadata = metadata_from_node(x.find("metadata")) |
127
fbabf7498471
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 116b1a4bbd62251ad552306df2dc8aa8f46c6721
fubar
parents:
123
diff
changeset
|
1660 track_conf["dataset_id"] = metadata.get("dataset_id", "None") |
104
9e3f69d9fed1
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
102
diff
changeset
|
1661 if x.attrib["useuri"].lower() == "yes": |
9e3f69d9fed1
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
102
diff
changeset
|
1662 tfa = ( |
9e3f69d9fed1
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
102
diff
changeset
|
1663 x.attrib["path"], |
9e3f69d9fed1
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
102
diff
changeset
|
1664 x.attrib["ext"], |
9e3f69d9fed1
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
102
diff
changeset
|
1665 x.attrib["useuri"], |
9e3f69d9fed1
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
102
diff
changeset
|
1666 track_conf["label"], |
9e3f69d9fed1
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
102
diff
changeset
|
1667 metadata, |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1668 ) |
104
9e3f69d9fed1
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
102
diff
changeset
|
1669 else: |
9e3f69d9fed1
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
102
diff
changeset
|
1670 tfa = ( |
9e3f69d9fed1
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
102
diff
changeset
|
1671 os.path.realpath(x.attrib["path"]), |
9e3f69d9fed1
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
102
diff
changeset
|
1672 x.attrib["ext"], |
9e3f69d9fed1
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
102
diff
changeset
|
1673 x.attrib["useuri"], |
9e3f69d9fed1
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
102
diff
changeset
|
1674 track_conf["label"], |
9e3f69d9fed1
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
102
diff
changeset
|
1675 metadata, |
9e3f69d9fed1
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
102
diff
changeset
|
1676 ) |
9e3f69d9fed1
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
102
diff
changeset
|
1677 track_conf["trackfiles"].append(tfa) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1678 |
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1679 if is_multi_bigwig: |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1680 metadata = metadata_from_node(x.find("metadata")) |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1681 |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1682 track_conf["trackfiles"].append( |
17
4c201a3d4755
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit a37bfdfc108501b11c7b2aa15efb1bd16f0c4b66
fubar
parents:
15
diff
changeset
|
1683 ( |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1684 multi_bigwig_paths, # Passing an array of paths to represent as one track |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1685 "bigwig_multiple", |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1686 "MultiBigWig", # Giving an hardcoded name for now |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1687 {}, # No metadata for multiple bigwig |
17
4c201a3d4755
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit a37bfdfc108501b11c7b2aa15efb1bd16f0c4b66
fubar
parents:
15
diff
changeset
|
1688 ) |
0
d78175596286
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cd77dffaad652cfb75b98bde5231beaa6d63cd5b-dirty
fubar
parents:
diff
changeset
|
1689 ) |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1690 track_conf["category"] = track.attrib["cat"] |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1691 track_conf["format"] = track.attrib["format"] |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1692 track_conf["conf"] = etree_to_dict(track.find("options")) |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1693 keys = jc.process_annotations(track_conf) |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1694 if keys: |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1695 for key in keys: |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1696 vis = track.attrib.get("visibility", "default_off") |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1697 if not vis: |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1698 vis = "default_off" |
89
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1699 default_session_data[primaryGenome]["visibility"][vis].append(key) |
110
c017111e976a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf-dirty
fubar
parents:
109
diff
changeset
|
1700 trakdat = jc.tracksToAdd[primaryGenome] |
c017111e976a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf-dirty
fubar
parents:
109
diff
changeset
|
1701 stile = {} |
c017111e976a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf-dirty
fubar
parents:
109
diff
changeset
|
1702 for trak in trakdat: |
c017111e976a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf-dirty
fubar
parents:
109
diff
changeset
|
1703 if trak["trackId"] == key: |
c017111e976a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf-dirty
fubar
parents:
109
diff
changeset
|
1704 stile = trak.get("style", {}) |
128
fce4ed3b1702
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a46026a5ea4f075b9053448616f22e8a83fa699a
bgruening
parents:
127
diff
changeset
|
1705 if len(track.find("options/style")) > 0: |
110
c017111e976a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf-dirty
fubar
parents:
109
diff
changeset
|
1706 for item in track.find("options/style"): |
c017111e976a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf-dirty
fubar
parents:
109
diff
changeset
|
1707 if item.text: |
c017111e976a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf-dirty
fubar
parents:
109
diff
changeset
|
1708 stile[item.tag] = parse_style_conf(item) |
c017111e976a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf-dirty
fubar
parents:
109
diff
changeset
|
1709 logging.debug("stile=%s" % stile) |
c017111e976a
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf-dirty
fubar
parents:
109
diff
changeset
|
1710 default_session_data[primaryGenome]["style"][key] = stile |
89
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1711 default_session_data[primaryGenome]["tracks"].append(key) |
15
cce8dacb240f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 1a20cf06627d429a211427753f223467188dbe7f-dirty
fubar
parents:
14
diff
changeset
|
1712 default_session_data["defaultLocation"] = root.find( |
cce8dacb240f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 1a20cf06627d429a211427753f223467188dbe7f-dirty
fubar
parents:
14
diff
changeset
|
1713 "metadata/general/defaultLocation" |
cce8dacb240f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 1a20cf06627d429a211427753f223467188dbe7f-dirty
fubar
parents:
14
diff
changeset
|
1714 ).text |
cce8dacb240f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 1a20cf06627d429a211427753f223467188dbe7f-dirty
fubar
parents:
14
diff
changeset
|
1715 default_session_data["session_name"] = root.find( |
cce8dacb240f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 1a20cf06627d429a211427753f223467188dbe7f-dirty
fubar
parents:
14
diff
changeset
|
1716 "metadata/general/session_name" |
cce8dacb240f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 1a20cf06627d429a211427753f223467188dbe7f-dirty
fubar
parents:
14
diff
changeset
|
1717 ).text |
89
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1718 logging.debug("default_session=%s" % (json.dumps(default_session_data, indent=2))) |
34
2893ef33fba9
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd
fubar
parents:
32
diff
changeset
|
1719 jc.zipOut = root.find("metadata/general/zipOut").text == "true" |
102
099370690407
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
101
diff
changeset
|
1720 jc.bpPerPx = int(root.find("metadata/general/bpPerPx").text) |
15
cce8dacb240f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 1a20cf06627d429a211427753f223467188dbe7f-dirty
fubar
parents:
14
diff
changeset
|
1721 general_data = { |
cce8dacb240f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 1a20cf06627d429a211427753f223467188dbe7f-dirty
fubar
parents:
14
diff
changeset
|
1722 "analytics": root.find("metadata/general/analytics").text, |
cce8dacb240f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 1a20cf06627d429a211427753f223467188dbe7f-dirty
fubar
parents:
14
diff
changeset
|
1723 "primary_color": root.find("metadata/general/primary_color").text, |
cce8dacb240f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 1a20cf06627d429a211427753f223467188dbe7f-dirty
fubar
parents:
14
diff
changeset
|
1724 "secondary_color": root.find("metadata/general/secondary_color").text, |
cce8dacb240f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 1a20cf06627d429a211427753f223467188dbe7f-dirty
fubar
parents:
14
diff
changeset
|
1725 "tertiary_color": root.find("metadata/general/tertiary_color").text, |
23
39b717d934a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit be2268f4c11d54bdd44789dd88dd9017cad27887-dirty
fubar
parents:
19
diff
changeset
|
1726 "quaternary_color": root.find("metadata/general/quaternary_color").text, |
15
cce8dacb240f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 1a20cf06627d429a211427753f223467188dbe7f-dirty
fubar
parents:
14
diff
changeset
|
1727 "font_size": root.find("metadata/general/font_size").text, |
cce8dacb240f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 1a20cf06627d429a211427753f223467188dbe7f-dirty
fubar
parents:
14
diff
changeset
|
1728 } |
cce8dacb240f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 1a20cf06627d429a211427753f223467188dbe7f-dirty
fubar
parents:
14
diff
changeset
|
1729 jc.add_general_configuration(general_data) |
104
9e3f69d9fed1
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty
fubar
parents:
102
diff
changeset
|
1730 jc.add_default_session(default_session_data) |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1731 trackconf = jc.config_json.get("tracks", []) |
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1732 for gnome in jc.genome_names: |
89
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1733 gtracks = jc.tracksToAdd[gnome] |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1734 if len(gtracks) > 0: |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1735 logging.debug( |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1736 "for genome %s adding gtracks %s" |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1737 % (gnome, json.dumps(gtracks, indent=2)) |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1738 ) |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1739 trackconf += gtracks |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
61
diff
changeset
|
1740 jc.config_json["tracks"] = trackconf |
68
c4eb6a85db70
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bd958a96352bf8dbd1fdb5a2e994d57a42446f33-dirty
fubar
parents:
65
diff
changeset
|
1741 assconf = jc.config_json.get("assemblies", []) |
c4eb6a85db70
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bd958a96352bf8dbd1fdb5a2e994d57a42446f33-dirty
fubar
parents:
65
diff
changeset
|
1742 assconf += jc.assemblies |
c4eb6a85db70
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bd958a96352bf8dbd1fdb5a2e994d57a42446f33-dirty
fubar
parents:
65
diff
changeset
|
1743 jc.config_json["assemblies"] = assconf |
89
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1744 logging.debug( |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1745 "assmeta=%s, first_contigs=%s, assemblies=%s, gnames=%s, trackidlist=%s, tracks=%s" |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1746 % ( |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1747 jc.assmeta, |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1748 jc.ass_first_contigs, |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1749 json.dumps(assconf, indent=2), |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1750 jc.genome_names, |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1751 jc.trackIdlist, |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1752 json.dumps(trackconf, indent=2), |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1753 ) |
408781c080fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 03400b3f71140ce62dba0db266a1f7b94b6c1a11
fubar
parents:
85
diff
changeset
|
1754 ) |
9
a26c41e304c3
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 1b7e6ba50013775621cbdfdc101152a7f5c5e15b
fubar
parents:
7
diff
changeset
|
1755 jc.write_config() |
79
14ecbe46ae9f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit d03454f949af9f3fff638f6a3e52fe42bc96be3b-dirty
fubar
parents:
78
diff
changeset
|
1756 # note that this can be left in the config.json but has NO EFFECT if add_defsess_to_index is called. |
80
dff27c9f6d72
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7bb0fa234bdbc42768b30e426472a47b2523297f
fubar
parents:
79
diff
changeset
|
1757 # jc.add_defsess_to_index(default_session_data) |
121
478ee3e780de
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a6f013087aa66546a843298e2584604668f9e140
fubar
parents:
120
diff
changeset
|
1758 # this command line tool appears currently broken - or at least not working here. |
478ee3e780de
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a6f013087aa66546a843298e2584604668f9e140
fubar
parents:
120
diff
changeset
|
1759 # jc.text_index() |