Mercurial > repos > fubar > jbrowse2
comparison jbrowse2.py @ 65:c81902830900 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 6dac6d6debf44c68eae2785e926fb8420f76958e
author | fubar |
---|---|
date | Thu, 28 Mar 2024 10:31:07 +0000 |
parents | 497fd2d27aa2 |
children | c4eb6a85db70 |
comparison
equal
deleted
inserted
replaced
64:497fd2d27aa2 | 65:c81902830900 |
---|---|
13 import tempfile | 13 import tempfile |
14 import urllib.request | 14 import urllib.request |
15 import xml.etree.ElementTree as ET | 15 import xml.etree.ElementTree as ET |
16 from collections import defaultdict | 16 from collections import defaultdict |
17 | 17 |
18 logging.basicConfig(level=logging.INFO) | 18 logging.basicConfig(level=logging.DEBUG) |
19 log = logging.getLogger("jbrowse") | 19 log = logging.getLogger("jbrowse") |
20 | 20 |
21 JB2VER = "v2.10.3" | 21 JB2VER = "v2.10.3" |
22 # version pinned for cloning | 22 # version pinned for cloning |
23 | 23 |
1341 "displays": [style_data], | 1341 "displays": [style_data], |
1342 } | 1342 } |
1343 ) | 1343 ) |
1344 # The view for the assembly we're adding | 1344 # The view for the assembly we're adding |
1345 view_json = {"type": "LinearGenomeView", "tracks": tracks_data} | 1345 view_json = {"type": "LinearGenomeView", "tracks": tracks_data} |
1346 refName = None | 1346 refName = self.assmeta[gnome][0].get("genome_firstcontig", None) |
1347 drdict = { | 1347 drdict = { |
1348 "reversed": False, | 1348 "reversed": False, |
1349 "assemblyName": gnome, | 1349 "assemblyName": gnome, |
1350 "start": 1, | 1350 "start": 1, |
1351 "end": 100000, | 1351 "end": 100000, |
1352 "refName": "x", | 1352 "refName": refName |
1353 } | 1353 } |
1354 | 1354 ddl = default_data.get("defaultLocation", None) |
1355 if default_data.get("defaultLocation", ""): | 1355 if ddl: |
1356 ddl = default_data["defaultLocation"] | |
1357 loc_match = re.search(r"^([^:]+):([\d,]*)\.*([\d,]*)$", ddl) | 1356 loc_match = re.search(r"^([^:]+):([\d,]*)\.*([\d,]*)$", ddl) |
1358 # allow commas like 100,000 but ignore as integer | 1357 # allow commas like 100,000 but ignore as integer |
1359 if loc_match: | 1358 if loc_match: |
1360 refName = loc_match.group(1) | 1359 refName = loc_match.group(1) |
1361 drdict["refName"] = refName | 1360 drdict["refName"] = refName |
1366 else: | 1365 else: |
1367 logging.info( | 1366 logging.info( |
1368 "@@@ regexp could not match contig:start..end in the supplied location %s - please fix" | 1367 "@@@ regexp could not match contig:start..end in the supplied location %s - please fix" |
1369 % ddl | 1368 % ddl |
1370 ) | 1369 ) |
1371 else: | |
1372 drdict["refName"] = gnome | |
1373 if drdict.get("refName", None): | 1370 if drdict.get("refName", None): |
1374 # TODO displayedRegions is not just zooming to the region, it hides the rest of the chromosome | 1371 # TODO displayedRegions is not just zooming to the region, it hides the rest of the chromosome |
1375 view_json["displayedRegions"] = [ | 1372 view_json["displayedRegions"] = [ |
1376 drdict, | 1373 drdict, |
1377 ] | 1374 ] |