changeset 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 3dcda36b97b4
files jbrowse2.py
diffstat 1 files changed, 18 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/jbrowse2.py	Mon Apr 01 04:03:16 2024 +0000
+++ b/jbrowse2.py	Mon Apr 01 04:15:03 2024 +0000
@@ -1490,24 +1490,23 @@
             logging.debug("first contig=%s" % self.ass_first_contigs)
             [gnome, refName, end] = first_contig
             start = 0
-            if False or data.get("defaultLocation", ""):
-                loc_match = re.search(
-                    r"^([^:]+):([\d,]*)\.*([\d,]*)$", data["defaultLocation"]
-                )
-                # loc_match = re.search(r"^(\w+):(\d+)\.+(\d+)$", data["defaultLocation"])
-                if loc_match:
-                    refName = loc_match.group(1)
-                    start = int(loc_match.group(2))
-                    end = int(loc_match.group(3))
-            else:
-                if refName:
-                    view = {
-                        "assembly": gnome,
-                        "loc": "{}:{}-{}".format(refName, start, end),
-                        "type": "LinearGenomeView",
-                        "tracks": data[gnome]["tracks"],
-                    }
-                    session_spec["views"].append(view)
+            # if False or data.get("defaultLocation", ""):
+                # loc_match = re.search(
+                    # r"^([^:]+):([\d,]*)\.*([\d,]*)$", data["defaultLocation"]
+                # )
+                # # loc_match = re.search(r"^(\w+):(\d+)\.+(\d+)$", data["defaultLocation"])
+                # if loc_match:
+                    # refName = loc_match.group(1)
+                    # start = int(loc_match.group(2))
+                    # end = int(loc_match.group(3))
+            # else:
+            aview = {
+                "assembly": gnome,
+                "loc": "{}:{}..{}".format(refName, start, end),
+                "type": "LinearGenomeView",
+                "tracks": data[gnome]["tracks"],
+            }
+            session_spec["views"].append(aview)
         sess = json.dumps(session_spec, sort_keys=True, indent=2)
         new_index = INDEX_TEMPLATE.replace(
             "__SESSION_SPEC__", "&session=spec-{}".format(sess)
@@ -1753,6 +1752,6 @@
     jc.config_json["assemblies"] = assconf
     logging.debug("assemblies=%s, gnames=%s" % (assconf, jc.genome_names))
     jc.write_config()
-    jc.add_default_session(default_session_data)
+    # jc.add_default_session(default_session_data)
     jc.add_defsess_to_index(default_session_data)
     # jc.text_index() not sure what broke here.