comparison jbrowse2.py @ 76:9e3eb6b26f85 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit d03454f949af9f3fff638f6a3e52fe42bc96be3b-dirty
author fubar
date Mon, 01 Apr 2024 04:15:03 +0000
parents 9c8459ce7d88
children 7bb6259ea52f
comparison
equal deleted inserted replaced
75:9c8459ce7d88 76:9e3eb6b26f85
1488 logging.debug("def ass_first=%s\ndata=%s" % (self.ass_first_contigs, data)) 1488 logging.debug("def ass_first=%s\ndata=%s" % (self.ass_first_contigs, data))
1489 for first_contig in self.ass_first_contigs: 1489 for first_contig in self.ass_first_contigs:
1490 logging.debug("first contig=%s" % self.ass_first_contigs) 1490 logging.debug("first contig=%s" % self.ass_first_contigs)
1491 [gnome, refName, end] = first_contig 1491 [gnome, refName, end] = first_contig
1492 start = 0 1492 start = 0
1493 if False or data.get("defaultLocation", ""): 1493 # if False or data.get("defaultLocation", ""):
1494 loc_match = re.search( 1494 # loc_match = re.search(
1495 r"^([^:]+):([\d,]*)\.*([\d,]*)$", data["defaultLocation"] 1495 # r"^([^:]+):([\d,]*)\.*([\d,]*)$", data["defaultLocation"]
1496 ) 1496 # )
1497 # loc_match = re.search(r"^(\w+):(\d+)\.+(\d+)$", data["defaultLocation"]) 1497 # # loc_match = re.search(r"^(\w+):(\d+)\.+(\d+)$", data["defaultLocation"])
1498 if loc_match: 1498 # if loc_match:
1499 refName = loc_match.group(1) 1499 # refName = loc_match.group(1)
1500 start = int(loc_match.group(2)) 1500 # start = int(loc_match.group(2))
1501 end = int(loc_match.group(3)) 1501 # end = int(loc_match.group(3))
1502 else: 1502 # else:
1503 if refName: 1503 aview = {
1504 view = { 1504 "assembly": gnome,
1505 "assembly": gnome, 1505 "loc": "{}:{}..{}".format(refName, start, end),
1506 "loc": "{}:{}-{}".format(refName, start, end), 1506 "type": "LinearGenomeView",
1507 "type": "LinearGenomeView", 1507 "tracks": data[gnome]["tracks"],
1508 "tracks": data[gnome]["tracks"], 1508 }
1509 } 1509 session_spec["views"].append(aview)
1510 session_spec["views"].append(view)
1511 sess = json.dumps(session_spec, sort_keys=True, indent=2) 1510 sess = json.dumps(session_spec, sort_keys=True, indent=2)
1512 new_index = INDEX_TEMPLATE.replace( 1511 new_index = INDEX_TEMPLATE.replace(
1513 "__SESSION_SPEC__", "&session=spec-{}".format(sess) 1512 "__SESSION_SPEC__", "&session=spec-{}".format(sess)
1514 ) 1513 )
1515 1514
1751 assconf = jc.config_json.get("assemblies", []) 1750 assconf = jc.config_json.get("assemblies", [])
1752 assconf += jc.assemblies 1751 assconf += jc.assemblies
1753 jc.config_json["assemblies"] = assconf 1752 jc.config_json["assemblies"] = assconf
1754 logging.debug("assemblies=%s, gnames=%s" % (assconf, jc.genome_names)) 1753 logging.debug("assemblies=%s, gnames=%s" % (assconf, jc.genome_names))
1755 jc.write_config() 1754 jc.write_config()
1756 jc.add_default_session(default_session_data) 1755 # jc.add_default_session(default_session_data)
1757 jc.add_defsess_to_index(default_session_data) 1756 jc.add_defsess_to_index(default_session_data)
1758 # jc.text_index() not sure what broke here. 1757 # jc.text_index() not sure what broke here.