Previous changeset 103:dc3fe98e7b37 (2024-06-22) Next changeset 105:33b73d16537a (2024-06-23) |
Commit message:
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a1537aea75fc902d0e38c0b7c698830a939648b1-dirty |
modified:
__pycache__/jbrowse2.cpython-312.pyc jbrowse2.py |
b |
diff -r dc3fe98e7b37 -r 9e3f69d9fed1 __pycache__/jbrowse2.cpython-312.pyc |
b |
Binary file __pycache__/jbrowse2.cpython-312.pyc has changed |
b |
diff -r dc3fe98e7b37 -r 9e3f69d9fed1 jbrowse2.py --- a/jbrowse2.py Sat Jun 22 06:17:01 2024 +0000 +++ b/jbrowse2.py Sun Jun 23 00:13:57 2024 +0000 |
[ |
b'@@ -2,6 +2,7 @@\n \n import argparse\n import binascii\n+import copy\n import datetime\n # import hashlib\n import json\n@@ -679,8 +680,8 @@\n ],\n "adapter": {"type": "HicAdapter", "hicLocation": {"uri": uri}},\n }\n- self.tracksToAdd[trackData["assemblyNames"]].append(trackDict)\n- self.trackIdlist.append(tId)\n+ self.tracksToAdd[trackData["assemblyNames"]].append(copy.copy(trackDict))\n+ self.trackIdlist.append(copy.copy(tId))\n \n def add_maf(self, data, trackData):\n """\n@@ -753,8 +754,8 @@\n }\n style_json = self._prepare_track_style(trackDict)\n trackDict["style"] = style_json\n- self.tracksToAdd[gname].append(trackDict)\n- self.trackIdlist.append(tId)\n+ self.tracksToAdd[gname].append(copy.copy(trackDict))\n+ self.trackIdlist.append(copy.copy(tId))\n if self.config_json.get("plugins", None):\n self.config_json["plugins"].append(mafPlugin[0])\n else:\n@@ -827,8 +828,8 @@\n }\n style_json = self._prepare_track_style(trackDict)\n trackDict["style"] = style_json\n- self.tracksToAdd[trackData["assemblyNames"]].append(trackDict)\n- self.trackIdlist.append(tId)\n+ self.tracksToAdd[trackData["assemblyNames"]].append(copy.copy(trackDict))\n+ self.trackIdlist.append(copy.copy(tId))\n \n def add_bam(self, data, trackData, bam_indexes=None, **kwargs):\n tId = trackData["label"]\n@@ -884,8 +885,8 @@\n }\n style_json = self._prepare_track_style(trackDict)\n trackDict["style"] = style_json\n- self.tracksToAdd[trackData["assemblyNames"]].append(trackDict)\n- self.trackIdlist.append(tId)\n+ self.tracksToAdd[trackData["assemblyNames"]].append(copy.copy(trackDict))\n+ self.trackIdlist.append(copy.copy(tId))\n \n def add_cram(self, data, trackData, cram_indexes=None, **kwargs):\n tId = trackData["label"]\n@@ -950,8 +951,8 @@\n }\n style_json = self._prepare_track_style(trackDict)\n trackDict["style"] = style_json\n- self.tracksToAdd[trackData["assemblyNames"]].append(trackDict)\n- self.trackIdlist.append(tId)\n+ self.tracksToAdd[trackData["assemblyNames"]].append(copy.copy(trackDict))\n+ self.trackIdlist.append(copy.copy(tId))\n \n def add_vcf(self, data, trackData):\n tId = trackData["label"]\n@@ -1000,8 +1001,8 @@\n }\n style_json = self._prepare_track_style(trackDict)\n trackDict["style"] = style_json\n- self.tracksToAdd[trackData["assemblyNames"]].append(trackDict)\n- self.trackIdlist.append(tId)\n+ self.tracksToAdd[trackData["assemblyNames"]].append(copy.copy(trackDict))\n+ self.trackIdlist.append(copy.copy(tId))\n \n def _sort_gff(self, data, dest):\n # Only index if not already done\n@@ -1063,8 +1064,8 @@\n }\n style_json = self._prepare_track_style(trackDict)\n trackDict["style"] = style_json\n- self.tracksToAdd[trackData["assemblyNames"]].append(trackDict)\n- self.trackIdlist.append(tId)\n+ self.tracksToAdd[trackData["assemblyNames"]].append(copy.copy(trackDict))\n+ self.trackIdlist.append(copy.copy(tId))\n \n def add_bed(self, data, ext, trackData):\n tId = trackData["label"]\n@@ -1112,8 +1113,8 @@\n }\n style_json = self._prepare_track_style(trackDict)\n trackDict["style"] = style_json\n- self.tracksToAdd[trackData["assemblyNames"]].append(trackDict)\n- self.trackIdlist.append(tId)\n+ self.tracksToAdd[trackData["assemblyNames"]].append(copy.copy(trackDict))\n+ self.trackIdlist.append(copy.copy(tId))\n \n def add_paf(self, data, trackData, pafOpts, **kwargs):\n tname = trackData["name"]\n@@ -1147,10 +1148,10 @@\n if gname not in self.genome_names:\n # ignore if already there - eg for duplicates among pafs.\n asstrack, first_contig = self.make_assembly(gpa'..b' track_conf["dataset_id"] = metadata.get(\n- "dataset_id", "None"\n+ metadata = metadata_from_node(x.find("metadata"))\n+ track_conf["dataset_id"] = metadata.get(\n+ "dataset_id", "None"\n+ )\n+ if x.attrib["useuri"].lower() == "yes":\n+ tfa = (\n+ x.attrib["path"],\n+ x.attrib["ext"],\n+ x.attrib["useuri"],\n+ track_conf["label"],\n+ metadata,\n )\n- if x.attrib["useuri"].lower() == "yes":\n- tfa = (\n- x.attrib["path"],\n- x.attrib["ext"],\n- x.attrib["useuri"],\n- track_conf["label"],\n- metadata,\n- )\n- else:\n- tfa = (\n- os.path.realpath(x.attrib["path"]),\n- x.attrib["ext"],\n- x.attrib["useuri"],\n- track_conf["label"],\n- metadata,\n- )\n- track_conf["trackfiles"].append(tfa)\n+ else:\n+ tfa = (\n+ os.path.realpath(x.attrib["path"]),\n+ x.attrib["ext"],\n+ x.attrib["useuri"],\n+ track_conf["label"],\n+ metadata,\n+ )\n+ track_conf["trackfiles"].append(tfa)\n \n if is_multi_bigwig:\n metadata = metadata_from_node(x.find("metadata"))\n@@ -1670,7 +1679,6 @@\n track_conf["category"] = track.attrib["cat"]\n track_conf["format"] = track.attrib["format"]\n track_conf["conf"] = etree_to_dict(track.find("options"))\n- logging\n keys = jc.process_annotations(track_conf)\n if keys:\n for key in keys:\n@@ -1684,11 +1692,10 @@\n if trak["trackId"] == key:\n stile = trak.get("style", {})\n if track.find("options/style"):\n- supdate = {\n- item.tag: parse_style_conf(item)\n- for item in track.find("options/style")\n- }\n- stile.update(supdate)\n+ for item in track.find("options/style"):\n+ if item.text:\n+ stile[item.tag] = parse_style_conf(item)\n+ logging.debug("stile=%s" % stile)\n default_session_data[primaryGenome]["style"][key] = stile\n if track.find("options/style_labels"):\n default_session_data[primaryGenome]["style_labels"][key] = {\n@@ -1714,6 +1721,7 @@\n "font_size": root.find("metadata/general/font_size").text,\n }\n jc.add_general_configuration(general_data)\n+ jc.add_default_session(default_session_data)\n trackconf = jc.config_json.get("tracks", [])\n for gnome in jc.genome_names:\n gtracks = jc.tracksToAdd[gnome]\n@@ -1739,7 +1747,6 @@\n )\n )\n jc.write_config()\n- jc.add_default_session(default_session_data)\n # note that this can be left in the config.json but has NO EFFECT if add_defsess_to_index is called.\n # jc.add_defsess_to_index(default_session_data)\n # jc.text_index() not sure what broke here.\n' |