Repository 'jbrowse2'
hg clone https://toolshed.g2.bx.psu.edu/repos/fubar/jbrowse2

Changeset 15:cce8dacb240f (2024-01-25)
Previous changeset 14:7c2e28e144f3 (2024-01-22) Next changeset 16:1fe91657bfd6 (2024-01-25)
Commit message:
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 1a20cf06627d429a211427753f223467188dbe7f-dirty
modified:
jbrowse2.py
jbrowse2.xml
macros.xml
readme.rst
removed:
Galaxy-History-jbrowse2samples.tar.gz
abjbrowse2.py
abjbrowse2.xml
config.json.sample
b
diff -r 7c2e28e144f3 -r cce8dacb240f Galaxy-History-jbrowse2samples.tar.gz
b
Binary file Galaxy-History-jbrowse2samples.tar.gz has changed
b
diff -r 7c2e28e144f3 -r cce8dacb240f abjbrowse2.py
--- a/abjbrowse2.py Mon Jan 22 12:05:09 2024 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
[
b'@@ -1,1272 +0,0 @@\n-#!/usr/bin/env python\n-import argparse\n-import binascii\n-import datetime\n-import hashlib\n-import json\n-import logging\n-import os\n-import re\n-import shutil\n-import struct\n-import subprocess\n-import tempfile\n-import xml.etree.ElementTree as ET\n-from collections import defaultdict\n-\n-logging.basicConfig(level=logging.INFO)\n-log = logging.getLogger("jbrowse")\n-TODAY = datetime.datetime.now().strftime("%Y-%m-%d")\n-GALAXY_INFRASTRUCTURE_URL = None\n-\n-\n-class ColorScaling(object):\n-\n-    COLOR_FUNCTION_TEMPLATE = """\n-    function(feature, variableName, glyphObject, track) {{\n-        var score = {score};\n-        {opacity}\n-        return \'rgba({red}, {green}, {blue}, \' + opacity + \')\';\n-    }}\n-    """\n-\n-    COLOR_FUNCTION_TEMPLATE_QUAL = r"""\n-    function(feature, variableName, glyphObject, track) {{\n-        var search_up = function self(sf, attr){{\n-            if(sf.get(attr) !== undefined){{\n-                return sf.get(attr);\n-            }}\n-            if(sf.parent() === undefined) {{\n-                return;\n-            }}else{{\n-                return self(sf.parent(), attr);\n-            }}\n-        }};\n-\n-        var search_down = function self(sf, attr){{\n-            if(sf.get(attr) !== undefined){{\n-                return sf.get(attr);\n-            }}\n-            if(sf.children() === undefined) {{\n-                return;\n-            }}else{{\n-                var kids = sf.children();\n-                for(var child_idx in kids){{\n-                    var x = self(kids[child_idx], attr);\n-                    if(x !== undefined){{\n-                        return x;\n-                    }}\n-                }}\n-                return;\n-            }}\n-        }};\n-\n-        var color = ({user_spec_color} || search_up(feature, \'color\') || search_down(feature, \'color\') || {auto_gen_color});\n-        var score = (search_up(feature, \'score\') || search_down(feature, \'score\'));\n-        {opacity}\n-        if(score === undefined){{ opacity = 1; }}\n-        var result = /^#?([a-f\\d]{{2}})([a-f\\d]{{2}})([a-f\\d]{{2}})$/i.exec(color);\n-        var red = parseInt(result[1], 16);\n-        var green = parseInt(result[2], 16);\n-        var blue = parseInt(result[3], 16);\n-        if(isNaN(opacity) || opacity < 0){{ opacity = 0; }}\n-        return \'rgba(\' + red + \',\' + green + \',\' + blue + \',\' + opacity + \')\';\n-    }}\n-    """\n-\n-    OPACITY_MATH = {\n-        "linear": """\n-            var opacity = (score - ({min})) / (({max}) - ({min}));\n-        """,\n-        "logarithmic": """\n-            var opacity = Math.log10(score - ({min})) / Math.log10(({max}) - ({min}));\n-        """,\n-        "blast": """\n-            var opacity = 0;\n-            if(score == 0.0) {{\n-                opacity = 1;\n-            }} else {{\n-                opacity = (20 - Math.log10(score)) / 180;\n-            }}\n-        """,\n-    }\n-\n-    BREWER_COLOUR_IDX = 0\n-    BREWER_COLOUR_SCHEMES = [\n-        (166, 206, 227),\n-        (31, 120, 180),\n-        (178, 223, 138),\n-        (51, 160, 44),\n-        (251, 154, 153),\n-        (227, 26, 28),\n-        (253, 191, 111),\n-        (255, 127, 0),\n-        (202, 178, 214),\n-        (106, 61, 154),\n-        (255, 255, 153),\n-        (177, 89, 40),\n-        (228, 26, 28),\n-        (55, 126, 184),\n-        (77, 175, 74),\n-        (152, 78, 163),\n-        (255, 127, 0),\n-    ]\n-\n-    BREWER_DIVERGING_PALLETES = {\n-        "BrBg": ("#543005", "#003c30"),\n-        "PiYg": ("#8e0152", "#276419"),\n-        "PRGn": ("#40004b", "#00441b"),\n-        "PuOr": ("#7f3b08", "#2d004b"),\n-        "RdBu": ("#67001f", "#053061"),\n-        "RdGy": ("#67001f", "#1a1a1a"),\n-        "RdYlBu": ("#a50026", "#313695"),\n-        "RdYlGn": ("#a50026", "#006837"),\n-        "Spectral": ("#9e0142", "#5e4fa2"),\n-    }\n-\n-    def __init__(self):\n-        self.brewer_colour_idx = 0\n-\n-    def rgb_from_hex(self, hexstr):\n-        # http://stackoverflow.com/questions/4296249/how-do-i-convert-a-hex-triplet-to-an-rgb-tuple-and-'..b'tree = ET.parse(args.xml.name)\n-    root = tree.getroot()\n-\n-    # This should be done ASAP\n-    GALAXY_INFRASTRUCTURE_URL = root.find("metadata/galaxyUrl").text\n-    # Sometimes this comes as `localhost` without a protocol\n-    if not GALAXY_INFRASTRUCTURE_URL.startswith("http"):\n-        # so we\'ll prepend `http://` and hope for the best. Requests *should*\n-        # be GET and not POST so it should redirect OK\n-        GALAXY_INFRASTRUCTURE_URL = "http://" + GALAXY_INFRASTRUCTURE_URL\n-\n-    jc = JbrowseConnector(\n-        jbrowse=args.jbrowse,\n-        outdir=args.outdir,\n-        genomes=[\n-            {\n-                "path": os.path.realpath(x.attrib["path"]),\n-                "meta": metadata_from_node(x.find("metadata")),\n-                "label": x.attrib["label"],\n-            }\n-            for x in root.findall("metadata/genomes/genome")\n-        ],\n-    )\n-\n-    default_session_data = {\n-        "visibility": {\n-            "default_on": [],\n-            "default_off": [],\n-        },\n-        "style": {},\n-        "style_labels": {},\n-    }\n-\n-    # TODO add metadata to tracks\n-    for track in root.findall("tracks/track"):\n-        track_conf = {}\n-        track_conf["trackfiles"] = []\n-\n-        trackfiles = track.findall("files/trackFile")\n-        if trackfiles:\n-            for x in track.findall("files/trackFile"):\n-                if trackfiles:\n-                    metadata = metadata_from_node(x.find("metadata"))\n-\n-                    track_conf["trackfiles"].append(\n-                        (\n-                            os.path.realpath(x.attrib["path"]),\n-                            x.attrib["ext"],\n-                            x.attrib["label"],\n-                            metadata,\n-                        )\n-                    )\n-        else:\n-            # For tracks without files (rest, sparql)\n-            track_conf["trackfiles"].append(\n-                (\n-                    "",  # N/A, no path for rest or sparql\n-                    track.attrib["format"],\n-                    track.find("options/label").text,\n-                    {},\n-                )\n-            )\n-\n-        track_conf["category"] = track.attrib["cat"]\n-        track_conf["format"] = track.attrib["format"]\n-        track_conf["style"] = {\n-            item.tag: parse_style_conf(item) for item in track.find("options/style")\n-        }\n-\n-        track_conf["style"] = {\n-            item.tag: parse_style_conf(item) for item in track.find("options/style")\n-        }\n-\n-        track_conf["style_labels"] = {\n-            item.tag: parse_style_conf(item)\n-            for item in track.find("options/style_labels")\n-        }\n-\n-        track_conf["conf"] = etree_to_dict(track.find("options"))\n-        keys = jc.process_annotations(track_conf)\n-\n-        for key in keys:\n-            default_session_data["visibility"][\n-                track.attrib.get("visibility", "default_off")\n-            ].append(key)\n-\n-        default_session_data["style"][key] = track_conf[\n-            "style"\n-        ]  # TODO do we need this anymore?\n-        default_session_data["style_labels"][key] = track_conf["style_labels"]\n-\n-    default_session_data["defaultLocation"] = root.find(\n-        "metadata/general/defaultLocation"\n-    ).text\n-    default_session_data["session_name"] = root.find(\n-        "metadata/general/session_name"\n-    ).text\n-\n-    general_data = {\n-        "analytics": root.find("metadata/general/analytics").text,\n-        "primary_color": root.find("metadata/general/primary_color").text,\n-        "secondary_color": root.find("metadata/general/secondary_color").text,\n-        "tertiary_color": root.find("metadata/general/tertiary_color").text,\n-        "quaternary_color": root.find("metadata/general/quaternary_color").text,\n-        "font_size": root.find("metadata/general/font_size").text,\n-    }\n-\n-    jc.add_default_session(default_session_data)\n-    jc.add_general_configuration(general_data)\n-    jc.text_index()\n'
b
diff -r 7c2e28e144f3 -r cce8dacb240f abjbrowse2.xml
--- a/abjbrowse2.xml Mon Jan 22 12:05:09 2024 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
[
b'@@ -1,1295 +0,0 @@\n-<tool id="jbrowse2" name="JBrowse2" version="@TOOL_VERSION@+@WRAPPER_VERSION@">\n-    <description>genome browser</description>\n-    <macros>\n-        <import>macros.xml</import>\n-    </macros>\n-    <edam_topics>\n-        <edam_topic>topic_3307</edam_topic>\n-        <edam_topic>topic_0092</edam_topic>\n-    </edam_topics>\n-    <edam_operations>\n-        <edam_operation>operation_0573</edam_operation>\n-        <edam_operation>operation_0564</edam_operation>\n-    </edam_operations>\n-    <xrefs>\n-        <xref type="bio.tools">jbrowse</xref>\n-    </xrefs>\n-    <expand macro="requirements"/>\n-    <version_command>python \'${__tool_directory__}/jbrowse2.py\' --version</version_command>\n-    <command detect_errors="aggressive"><![CDATA[\n-mkdir -p $output.files_path &&\n-#if $action.action_select != "create":\n-    cp -R $action.update_jbrowse.extra_files_path/data $output.files_path/data &&\n-#end if\n-\n-## Copy the XML file into the directory, mostly for debugging\n-## but nice if users want to reproduce locally\n-cp $trackxml $output.files_path/galaxy.xml &&\n-\n-export JBROWSE2_SOURCE_DIR=\\$(dirname \\$(which jbrowse))/../opt/jbrowse2  &&\n-\n-## Once that\'s done, we run the python script to handle the real work\n-python \'$__tool_directory__/jbrowse2.py\'\n-\n---jbrowse \\${JBROWSE2_SOURCE_DIR}\n-\n---outdir $output.files_path\n-$trackxml &&\n-\n-cp $output.files_path/index.html $output;\n-\n-## Ugly testing hack since I cannot get <extra_files> to test the files I want to test. Hmph.\n-#if str($uglyTestingHack) == "enabled":\n-    cp $trackxml $output\n-#end if\n-  ]]></command>\n-  <configfiles>\n-      <configfile name="trackxml"><![CDATA[<?xml version="1.0"?>\n-<root>\n-    <metadata>\n-        <genomes>\n-            #if str($reference_genome.genome_type_select) == "indexed":\n-              <genome path="${reference_genome.genomes.fields.path}" label="${reference_genome.genomes.fields.name}">\n-                  <metadata />\n-              </genome>s\n-            #else\n-              <genome path="$reference_genome.genome" label="${reference_genome.genome.element_identifier}">\n-                <metadata>\n-                  <dataset id="${__app__.security.encode_id($reference_genome.genome.id)}" hid="${reference_genome.genome.hid}"\n-                      size="${reference_genome.genome.get_size(nice_size=True)}"\n-                      edam_format="${reference_genome.genome.datatype.edam_format}"\n-                      file_ext="${reference_genome.genome.ext}" />\n-                  <history id="${__app__.security.encode_id($reference_genome.genome.history_id)}"\n-                      #if $reference_genome.genome.history.user:\n-                      user_email="${reference_genome.genome.history.user.email}"\n-                      user_id="${reference_genome.genome.history.user_id}"\n-                      display_name="${reference_genome.genome.history.get_display_name()}"/>\n-                      #else\n-                      user_email="anonymous"\n-                      user_id="-1"\n-                      display_name="Unnamed History"/>\n-                      #end if\n-                  <metadata\n-                      #for (key, value) in $reference_genome.genome.get_metadata().items():\n-                      #if "_types" not in $key:\n-                        #if isinstance($value, list):\n-                          #set value_str = "[%s]" % \',\'.join([str(val) for val in value])\n-                          ${key}="$value_str"\n-                        #else\n-                          ${key}="${value}"\n-                        #end if\n-                      #end if\n-                      #end for\n-                      />\n-                  <tool\n-                      tool_id="${reference_genome.genome.creating_job.tool_id}"\n-                      tool_version="${reference_genome.genome.creating_job.tool_version}"\n-                      />\n-                </metadata>\n-              </genome>\n-            #end if\n-        </genomes>\n-        <gen'..b've upon this and provide more colour\n-scales. The Opacity option maps the highest scoring features to full\n-opacity, and everything else to lower ones.\n-\n-BAM Pileups\n-~~~~~~~~~~~\n-\n-We support BAM files and can automatically generate SNP tracks based on\n-that bam data.\n-\n-.. image:: bam.png\n-\n-This is *strongly discouraged* for high coverage density datasets.\n-Unfortunately there are no other configuration options exposed for bam\n-files.\n-\n-BlastXML\n-~~~~~~~~\n-\n-.. image:: blast.png\n-\n-JiG now supports both blastn and blastp datasets. JiG internally uses a\n-blastXML to gapped GFF3 tool to convert your blastxml datasets into a\n-format amenable to visualization in JBrowse. This tool is also\n-available separately from the IUC on the toolshed.\n-\n-**Minimum Gap Size** reflects how long a gap must be before it becomes a\n-real gap in the processed gff3 file. In the picture above, various sizes\n-of gaps can be seen. If the minimum gap size was set much higher, say\n-100nt, many of the smaller gaps would disappear, and the features on\n-both sides would be merged into one, longer feature. This setting is\n-inversely proportional to runtime and output file size. *Do not set this\n-to a low value for large datasets*. By setting this number lower, you\n-will have extremely large outputs and extremely long runtimes. The\n-default was configured based off of the author\'s experience, but the\n-author only works on small viruses. It is *strongly* recommended that\n-you filter your blast results before display, e.g. picking out the top\n-10 hits or so.\n-\n-**Protein blast search** option merely informs underlying tools that\n-they should adjust feature locations by 3x.\n-\n-Styling Options\n-^^^^^^^^^^^^^^^\n-\n-Please see the styling options for GFF3 datasets, they are identical.\n-\n-Feature Score Scaling & Coloring Options\n-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n-\n-Please see the score scaling and colouring options for GFF3 datasets,\n-they are identical. Remember to set your score scaling to "blast" method\n-if you do use it.\n-\n-Bigwig XY\n-~~~~~~~~~\n-\n-.. image:: bigwig.png\n-\n-**XYPlot**\n-\n-BigWig tracks can be displayed as a "density" plot which is continuous\n-line which varies in colour, or as an "XYplot." XYplots are preferable\n-for users to visually identify specific features in a bigwig track,\n-however density tracks are more visually compact.\n-\n-**Variance Band** is an option available to XYPlots, and can be seen in\n-the third and fourth tracks in the above picture. This overlays a mean\n-line, and 1 and 2 standard deviation areas.\n-\n-**Track Scaling** is different from colour scaling, instead it\n-configures how the track behaves inside of JBrowse. **Autoscaling\n-globally** means that JBrowse will determine the minimum and maximum for\n-the track, and fix the bounds of the viewport to that. E.g. if your\n-track ranges from 1-1000, and the region you\'re currently zoomed to only\n-goes from 0-50, then the viewport range will still show 1-1000. This is\n-good for global genomic context. However you may wish to consider\n-**autoscaling locally** instead. In the example of a region which varies\n-from 0-50, autoscaling locally would cause the individual track\'s\n-viewport to re-adjust and show just the 0-50 region. If neither of these\n-options are palatable, you may manually hardcode the minimum and\n-maximums for the track to scale to.\n-\n-Colour Options\n-^^^^^^^^^^^^^^\n-\n-BigWig tracks have two colours in JBrowse, a positive and a negative\n-colour.\n-\n-As always you may manually choose a colour, or let JiG choose for you.\n-\n-One of the more interesting options is the **Bicolor pivot**. This\n-option allows you to control the point at which JBrowse switches from\n-the positive colour to the negative. In the above graphic, you can see\n-this has been configured to "mean" for the first two (orange and blue)\n-tracks.\n-\n-VCFs/SNPs\n-~~~~~~~~~\n-\n-These tracks do not support any special configuration.\n-\n-@ATTRIBUTION@\n-]]></help>\n-    <expand macro="citations"/>\n-</tool>\n-\n'
b
diff -r 7c2e28e144f3 -r cce8dacb240f config.json.sample
--- a/config.json.sample Mon Jan 22 12:05:09 2024 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
[
@@ -1,22 +0,0 @@
-{
-  "configuration": {
-    "rpc": {
-      "defaultDriver": "WebWorkerRpcDriver",
-      "drivers": {
-        "MainThreadRpcDriver": {},
-        "WebWorkerRpcDriver": {}
-      }
-    },
-    "logoPath": {
-      "locationType": "UriLocation",
-      "uri": ""
-    }
-  },
-  "plugins": [],
-  "assemblies": [],
-  "tracks": [],
-  "internetAccounts": [],
-  "aggregateTextSearchAdapters": [],
-  "connections": [],
-  "defaultSession": {}
-}
b
diff -r 7c2e28e144f3 -r cce8dacb240f jbrowse2.py
--- a/jbrowse2.py Mon Jan 22 12:05:09 2024 +0000
+++ b/jbrowse2.py Thu Jan 25 07:39:41 2024 +0000
[
@@ -18,7 +18,7 @@
 logging.basicConfig(level=logging.INFO)
 log = logging.getLogger("jbrowse")
 
-JB2VER = "v2.10.0"
+JB2VER = "v2.10.1"
 # version pinned for cloning
 
 TODAY = datetime.datetime.now().strftime("%Y-%m-%d")
@@ -458,10 +458,10 @@
                 self.genome_name = (
                     genome_name  # first one for all tracks - other than paf
                 )
-            if self.config_json.get("assemblies", None):
-                self.config_json["assemblies"] += assemblies
-            else:
-                self.config_json["assemblies"] = assemblies
+        if self.config_json.get("assemblies", None):
+            self.config_json["assemblies"] += assemblies
+        else:
+            self.config_json["assemblies"] = assemblies
 
     def make_assembly(self, fapath, gname):
         hashData = [
@@ -727,6 +727,14 @@
         os.unlink(gff3)
 
     def add_bigwig(self, data, trackData):
+        """ "type": "LinearWiggleDisplay",
+        "configuration": {},
+        "selectedRendering": "",
+        "resolution": 1,
+        "posColor": "rgb(228, 26, 28)",
+        "negColor": "rgb(255, 255, 51)",
+        "constraints": {}
+        """
         url = "%s.bigwig" % trackData["label"]
         # slashes in names cause path trouble
         dest = os.path.join(self.outdir, url)
@@ -756,7 +764,7 @@
         trackDict["style"] = style_json
         self.tracksToAdd.append(trackDict)
         self.trackIdlist.append(tId)
-        logging.debug("#### wig trackData=%s" % str(trackData))
+        logging.info("#### wig trackData=%s" % str(trackData))
 
     def add_bam(self, data, trackData, bamOpts, bam_index=None, **kwargs):
         tId = trackData["label"]
@@ -949,11 +957,11 @@
         tname = trackData["name"]
         tId = trackData["label"]
         pgname = pafOpts["genome_label"]
-        if len(pgname.split() > 1):
+        if len(pgname.split()) > 1:
             pgname = pgname.split()[
                 0
             ]  # trouble from spacey names in command lines avoidance
-        asstrack, gname = self.make_assembly(pafOpts["genome"], pgname)
+        asstrack = self.make_assembly(pafOpts["genome"], pgname)
         self.genome_names.append(pgname)
         if self.config_json.get("assemblies", None):
             self.config_json["assemblies"].append(asstrack)
@@ -961,7 +969,6 @@
             self.config_json["assemblies"] = [
                 asstrack,
             ]
-
         url = "%s.paf" % (trackData["label"])
         dest = "%s/%s" % (self.outdir, url)
         self.symlink_or_copy(os.path.realpath(data), dest)
@@ -975,6 +982,16 @@
                 "pafLocation": {"uri": url},
                 "assemblyNames": [self.genome_name, pgname],
             },
+            # "displays": [
+                # {
+                    # "type": "LinearSyntenyDisplay",
+                    # "displayId": "%s-LinearSyntenyDisplay" % tId,
+                # },
+                # {
+                    # "type": "DotPlotDisplay",
+                    # "displayId": "%s-DotPlotDisplay" % tId,
+                # },
+            # ],
         }
         style_json = self._prepare_track_style(trackDict)
         trackDict["style"] = style_json
@@ -1130,6 +1147,10 @@
                 )
             elif dataset_ext == "vcf":
                 self.add_vcf(dataset_path, outputTrackConfig)
+            elif dataset_ext == "paf":
+                self.add_paf(
+                    dataset_path, outputTrackConfig, track["conf"]["options"]["synteny"]
+                )
             else:
                 log.warn("Do not know how to handle %s", dataset_ext)
             # Return non-human label for use in other fields
@@ -1177,7 +1198,7 @@
             ddl = data["defaultLocation"]
             loc_match = re.search(
                 r"^([^:]+):(\d+)\.+(\d+)$", ddl
-            )  # was re.search(r"^(\w.+):(\d+)\.+(\d+)$"
+            )
             if loc_match:
                 refName = loc_match.group(1)
                 start = int(loc_match.group(2))
@@ -1407,6 +1428,15 @@
             }
 
         track_conf["conf"] = etree_to_dict(track.find("options"))
+        track_conf["category"] = track.attrib["cat"]
+        track_conf["format"] = track.attrib["format"]
+        try:
+            # Only pertains to gff3 + blastxml. TODO?
+            track_conf["style"] = {t.tag: t.text for t in track.find("options/style")}
+        except TypeError:
+            track_conf["style"] = {}
+            pass
+        track_conf["conf"] = etree_to_dict(track.find("options"))
         keys = jc.process_annotations(track_conf)
 
         if keys:
@@ -1422,34 +1452,26 @@
                     default_session_data["style_labels"][key] = track_conf.get(
                         "style_labels", None
                     )
-
-        default_session_data["defaultLocation"] = root.find(
-            "metadata/general/defaultLocation"
-        ).text
-        default_session_data["session_name"] = root.find(
-            "metadata/general/session_name"
-        ).text
-
-        general_data = {
-            "analytics": root.find("metadata/general/analytics").text,
-            "primary_color": root.find("metadata/general/primary_color").text,
-            "secondary_color": root.find("metadata/general/secondary_color").text,
-            "tertiary_color": root.find("metadata/general/tertiary_color").text,
-            "quaternary_color": root.find("metadata/general/quaternary_color").text,
-            "font_size": root.find("metadata/general/font_size").text,
-        }
-        track_conf["category"] = track.attrib["cat"]
-        track_conf["format"] = track.attrib["format"]
-        try:
-            # Only pertains to gff3 + blastxml. TODO?
-            track_conf["style"] = {t.tag: t.text for t in track.find("options/style")}
-        except TypeError:
-            track_conf["style"] = {}
-            pass
-        track_conf["conf"] = etree_to_dict(track.find("options"))
-        jc.add_general_configuration(general_data)
-    jc.config_json["tracks"] = jc.tracksToAdd
+    default_session_data["defaultLocation"] = root.find(
+        "metadata/general/defaultLocation"
+    ).text
+    default_session_data["session_name"] = root.find(
+        "metadata/general/session_name"
+    ).text
+    general_data = {
+        "analytics": root.find("metadata/general/analytics").text,
+        "primary_color": root.find("metadata/general/primary_color").text,
+        "secondary_color": root.find("metadata/general/secondary_color").text,
+        "tertiary_color": root.find("metadata/general/tertiary_color").text,
+        "quaternary_color": root.find("metadata/general/quaternary_color").text,
+        "font_size": root.find("metadata/general/font_size").text,
+    }
+    jc.add_general_configuration(general_data)
+    trackconf = jc.config_json.get("tracks", None)
+    if trackconf:
+        jc.config_json["tracks"].update(jc.tracksToAdd)
+    else:
+        jc.config_json["tracks"] = jc.tracksToAdd
     jc.write_config()
     jc.add_default_session(default_session_data)
-
     # jc.text_index() not sure what broke here.
b
diff -r 7c2e28e144f3 -r cce8dacb240f jbrowse2.xml
--- a/jbrowse2.xml Mon Jan 22 12:05:09 2024 +0000
+++ b/jbrowse2.xml Thu Jan 25 07:39:41 2024 +0000
b
@@ -33,7 +33,7 @@
             #if str($reference_genome.genome_type_select) == "indexed":
               <genome path="${reference_genome.genomes.fields.path}" label="${reference_genome.genomes.fields.name}">
                   <metadata />
-              </genome>s
+              </genome>
             #else
               <genome path="$reference_genome.genome" label="${reference_genome.genome.element_identifier}">
                 <metadata>
@@ -297,12 +297,12 @@
                     </when>
 
                     <when value="synteny">
-                        <param label="Other genome sequence"
+                        <param label="Comparison genome sequence" help="Paf must use this as the reference to map the real reference sequence"
                             format="fasta"
                             name="synteny_genome"
                             type="data" />
 
-                        <expand macro="input_conditional" label="Synteny data" format="paf" />
+                        <expand macro="input_conditional" label="Synteny data" format="paf" help="Make paf with minimap2 mapping real reference onto desired syntenic reference"/>
                         <expand macro="track_visibility" />
                     </when>
 
b
diff -r 7c2e28e144f3 -r cce8dacb240f macros.xml
--- a/macros.xml Mon Jan 22 12:05:09 2024 +0000
+++ b/macros.xml Thu Jan 25 07:39:41 2024 +0000
b
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <macros>
-    <token name="@TOOL_VERSION@">2.10.0</token>
+    <token name="@TOOL_VERSION@">2.10.1</token>
     <xml name = "edamInc">
         <edam_topics>
             <edam_topic>topic_3307</edam_topic>
b
diff -r 7c2e28e144f3 -r cce8dacb240f readme.rst
--- a/readme.rst Mon Jan 22 12:05:09 2024 +0000
+++ b/readme.rst Thu Jan 25 07:39:41 2024 +0000
b
@@ -38,11 +38,15 @@
 - 2.10.0+galaxy2
 
     - UPDATED existing JBrowse1.16.11 code to JBrowse 2.10.0
+    - was working well enough for VGP when previous PR discovered
+        - too late to backport all the fixes
+        - working default session and some other ideas copied instead.
     - seems to work well with defaults.
     - need to document and implement track settings by running the browser locally.
     - works well enough to be useful in workflows such as TreeValGal.
     - JB2 seems to set defaults wisely.
     - not yet ideal for users who need fine grained track control.
+    - synteny works.
 
 
 Wrapper License (MIT/BSD Style)