changeset 77:3dcda36b97b4 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:35:23 +0000
parents 9e3eb6b26f85
children 7bb6259ea52f
files autogenJB2.py
diffstat 1 files changed, 18 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/autogenJB2.py	Mon Apr 01 04:15:03 2024 +0000
+++ b/autogenJB2.py	Mon Apr 01 04:35:23 2024 +0000
@@ -43,6 +43,7 @@
     parser.add_argument("--version", "-V", action="version", version="%(prog)s 2.10.2")
     args = parser.parse_args()
     sessName = args.sessName
+    default_session_data = {}
     # --trackmeta $jbrowseme[$key],$jbrowseme[$key].ext,'$key'
     trackList = [x.strip().split(",") for x in args.trackmeta if x > ""]
     refList = [x.strip().split(",") for x in args.referencemeta if x > ""]
@@ -76,16 +77,18 @@
                     for i, x in enumerate(genome_paths)
                 ],
             )
-            logging.debug("#!!! paths=%s, genomes=%s" % (genome_paths, genomes))
+            logging.debug("@@@ paths=%s, genomes=%s" % (genome_paths, genomes))
             assref_name = jc.process_genomes(genomes[0])
-            default_session_data = {
-                "visibility": {
-                    "default_on": [],
-                    "default_off": [],
-                },
-                "style": {},
-                "style_labels": {},
-            }
+            if not default_session_data.get(assref_name, None):
+                default_session_data[assref_name] = {
+                    "tracks": [],
+                    "style": {},
+                    "style_labels": {},
+                    "visibility": {
+                        "default_on": [],
+                        "default_off": [],
+                    },
+                }
             listtracks = trackList
             # foo.paf must have a foo_paf.fasta or fasta.gz to match
             tnames = [x[2] for x in listtracks]
@@ -178,9 +181,9 @@
                             "bed",
                             "hic"
                         ]:
-                            default_session_data["visibility"]["default_on"].append(key)
+                            default_session_data[assref_name]["visibility"]["default_on"].append(key)
                         else:
-                            default_session_data["visibility"]["default_off"].append(
+                            default_session_data[assref_name]["visibility"]["default_off"].append(
                                 key
                             )
                         if trext in ["gff", "gff3", "bed", "vcf", "maf", "blastxml"]:
@@ -192,7 +195,8 @@
                                 "trackShowLabels": False,
                                 "trackShowDescriptions": False,
                             }
-                            default_session_data["style"][key] = style_json
+                            default_session_data[assref_name]["style"][key] = style_json
+                            default_session_data[assref_name]["tracks"].append(key)
             # general_data = {
             # "analytics": root.find("metadata/general/analytics").text,
             # "primary_color": root.find("metadata/general/primary_color").text,
@@ -216,7 +220,8 @@
             jc.write_config()
             default_session_data.update({"session_name": sessName})
             track_conf.update(default_session_data)
-            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.
     else:
         sys.stderr.write(