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

Changeset 59:f807e219cec3 (2024-03-22)
Previous changeset 58:0e592dcaeb7f (2024-03-21) Next changeset 60:81d535970196 (2024-03-25)
Commit message:
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit faada92caf5aaabe58e52b161687a30d542a07b9
modified:
jbrowse2.py
jbrowse2.xml
macros.xml
b
diff -r 0e592dcaeb7f -r f807e219cec3 jbrowse2.py
--- a/jbrowse2.py Thu Mar 21 09:06:52 2024 +0000
+++ b/jbrowse2.py Fri Mar 22 22:04:08 2024 +0000
[
b'@@ -439,11 +439,13 @@\n         if trackDict.get("displays", None):  # use first if multiple like bed\n             style_data["type"] = trackDict["displays"][0]["type"]\n             style_data["displayId"] = trackDict["displays"][0]["displayId"]\n-        return {\n+        wstyle = {\n             "displays": [\n                 style_data,\n             ]\n         }\n+        logging.warn("style=%s" % (wstyle))\n+        return wstyle\n \n     def process_genomes(self):\n         assemblies = []\n@@ -496,16 +498,16 @@\n                 "type": "BgzipFastaAdapter",\n                 "fastaLocation": {\n                     "uri": faname,\n-                    "locationType": "UriLocation",\n+                    "locationType": "UriLocation"\n                 },\n                 "faiLocation": {\n                     "uri": faname + ".fai",\n-                    "locationType": "UriLocation",\n+                    "locationType": "UriLocation"\n                 },\n                 "gziLocation": {\n                     "uri": faname + ".gzi",\n-                    "locationType": "UriLocation",\n-                },\n+                    "locationType": "UriLocation"\n+                }\n             }\n         else:\n             faname = gname + ".fa.gz"\n@@ -528,7 +530,7 @@\n                 },\n                 "gziLocation": {\n                     "uri": faname + ".gzi",\n-                },\n+                }\n             }\n \n         trackDict = {\n@@ -538,7 +540,6 @@\n                 "trackId": gname,\n                 "adapter": adapter,\n             },\n-            "rendering": {"type": "DivSequenceRenderer"},\n             "displays": [\n                 {\n                     "type": "LinearReferenceSequenceDisplay",\n@@ -548,7 +549,7 @@\n                     "type": "LinearGCContentDisplay",\n                     "displayId": "%s-LinearGCContentDisplay" % gname,\n                 },\n-            ],\n+            ]\n         }\n         return trackDict\n \n@@ -635,6 +636,8 @@\n                 },\n             ],\n         }\n+        style_json = self._prepare_track_style(trackDict)\n+        trackDict["style"] = style_json\n         self.tracksToAdd.append(trackDict)\n         self.trackIdlist.append(tId)\n \n@@ -708,6 +711,8 @@\n                 },\n             ],\n         }\n+        style_json = self._prepare_track_style(trackDict)\n+        trackDict["style"] = style_json\n         self.tracksToAdd.append(trackDict)\n         self.trackIdlist.append(tId)\n         if self.config_json.get("plugins", None):\n@@ -781,6 +786,8 @@\n                 },\n             ],\n         }\n+        style_json = self._prepare_track_style(trackDict)\n+        trackDict["style"] = style_json\n         self.tracksToAdd.append(trackDict)\n         self.trackIdlist.append(tId)\n         os.unlink(gff3)\n@@ -827,6 +834,8 @@\n                 }\n             ],\n         }\n+        style_json = self._prepare_track_style(trackDict)\n+        trackDict["style"] = style_json\n         self.tracksToAdd.append(trackDict)\n         self.trackIdlist.append(tId)\n \n@@ -880,6 +889,8 @@\n                 },\n             ],\n         }\n+        style_json = self._prepare_track_style(trackDict)\n+        trackDict["style"] = style_json\n         self.tracksToAdd.append(trackDict)\n         self.trackIdlist.append(tId)\n \n@@ -928,6 +939,8 @@\n                 },\n             ],\n         }\n+        style_json = self._prepare_track_style(trackDict)\n+        trackDict["style"] = style_json\n         self.tracksToAdd.append(trackDict)\n         self.trackIdlist.append(tId)\n \n@@ -980,6 +993,8 @@\n                 },\n             ],\n         }\n+        style_json = self._prepare_track_style(trackDict)\n+        trackDict["style"] = style_json\n         self.tracksToAdd.append(trackDict)\n         self.trackIdlist.append(tId)\n \n@@ -1041,6 +1056,8 @@\n                 },\n             ],\n         }\n+        style_json = self._prepare_track_style(trackDict)\n+        trackDict["style"] = style_json\n         self.tracksToAdd.append(trackDict)\n '..b'-                # trouble from spacey names in command lines avoidance\n-                if gname not in self.genome_names:\n-                    # ignore if already there - eg for duplicates among pafs.\n-                    useuri = pgpaths[i].startswith("http://") or pgpaths[i].startswith(\n-                        "https://"\n-                    )\n-                    asstrack = self.make_assembly(pgpaths[i], gname, useuri)\n-                    self.genome_names.append(gname)\n-                    if self.config_json.get("assemblies", None):\n-                        self.config_json["assemblies"].append(asstrack)\n-                    else:\n-                        self.config_json["assemblies"] = [\n-                            asstrack,\n-                        ]\n+            passnames.append(gname)\n+            # trouble from spacey names in command lines avoidance\n+            if gname not in self.genome_names:\n+                # ignore if already there - eg for duplicates among pafs.\n+                useuri = pgpaths[i].startswith("http://") or pgpaths[i].startswith(\n+                    "https://"\n+                )\n+                asstrack = self.make_assembly(pgpaths[i], gname, useuri)\n+                self.genome_names.append(gname)\n+                if self.config_json.get("assemblies", None):\n+                    self.config_json["assemblies"].append(asstrack)\n+                else:\n+                    self.config_json["assemblies"] = [\n+                        asstrack,\n+                    ]\n         url = "%s.paf" % (trackData["label"])\n         dest = "%s/%s" % (self.outdir, url)\n         self.symlink_or_copy(os.path.realpath(data), dest)\n@@ -1131,18 +1151,16 @@\n                 "type": "PAFAdapter",\n                 "pafLocation": {"uri": url},\n                 "assemblyNames": passnames,\n-            },\n-            "displays": [\n-                {\n-                    "type": "LinearSyntenyDisplay",\n-                    "displayId": "%s-LinearSyntenyDisplay" % tId,\n-                },\n-                {\n-                    "type": "DotPlotDisplay",\n-                    "displayId": "%s-DotPlotDisplay" % tId,\n-                },\n-            ],\n+            }\n         }\n+        style_json = {\n+        "displays": [\n+            { "type": "LinearBasicDisplay",\n+            "displayId": "%s-LinearBasicyDisplay" % trackDict["trackId"]\n+            }\n+            ]\n+        }\n+        trackDict["style"] = style_json\n         self.tracksToAdd.append(trackDict)\n         self.trackIdlist.append(tId)\n \n@@ -1284,7 +1302,6 @@\n             if "displays" in track_conf:\n                 disp = track_conf["displays"][0]["type"]\n                 style_data["type"] = disp\n-                style_data["configuration"] = "%s-%s" % (tId, disp)\n             if track_conf.get("style_labels", None):\n                 # TODO fix this: it should probably go in a renderer block (SvgFeatureRenderer) but still does not work\n                 # TODO move this to per track displays?\n@@ -1296,7 +1313,6 @@\n                     "displays": [style_data],\n                 }\n             )\n-\n         # The view for the assembly we\'re adding\n         view_json = {"type": "LinearGenomeView", "tracks": tracks_data}\n \n@@ -1534,9 +1550,6 @@\n             }\n         else:\n             track_conf["style"] = {}\n-        tst = track_conf["style"].get("type", None)\n-        if tst:\n-            track_conf["style"]["configuration"] = "%s-%s" % (track_conf["label"], tst)\n         if track.find("options/style_labels"):\n             track_conf["style_labels"] = {\n                 item.tag: parse_style_conf(item)\n@@ -1565,6 +1578,7 @@\n     default_session_data["session_name"] = root.find(\n         "metadata/general/session_name"\n     ).text\n+    logging.warn("default_session=%s" % (default_session_data))\n     jc.zipOut = root.find("metadata/general/zipOut").text == "true"\n     general_data = {\n         "analytics": root.find("metadata/general/analytics").text,\n'
b
diff -r 0e592dcaeb7f -r f807e219cec3 jbrowse2.xml
--- a/jbrowse2.xml Thu Mar 21 09:06:52 2024 +0000
+++ b/jbrowse2.xml Fri Mar 22 22:04:08 2024 +0000
[
@@ -139,16 +139,17 @@
         #for $tg in $track_groups:
             #for $track in $tg.data_tracks:
                 #if $track.data_format.useuri.insource == "uri":
-                   <track cat="${tg.category}" format="${track.data_format.data_format_select}" visibility="${track.data_format.track_visibility}">
-                      <files>
-                        <trackFile path="${track.data_format.useuri.annouri}" ext="${track.data_format.data_format_select}" label="${track.data_format.useuri.annoname}" useuri="yes">
-                            <metadata>
-                            <dataset id = "${track.data_format.useuri.annouri}" />
-                            </metadata>
-                         </trackFile>
-                     </files>
-                    <options/>
-                </track>
+                    <track cat="${tg.category}" format="paf" visibility="${track.data_format.track_visibility}">
+                        <files>
+                             <trackFile path="${ $track.data_format.useuri.insource.annouri}" ext="paf"
+                                label="${track.data_format.useuri.insource.annoname}" useuri="yes">
+                                <metadata>
+                                <dataset id = "${track.data_format.useuri.insource.annouri}" />
+                                </metadata>
+                             </trackFile>
+                        </files>
+                        <options/>
+                    </track>
                 #else if $track.data_format.useuri.insource == "history":
                     #if $track.data_format.useuri.annotation:
                     <track cat="${tg.category}" format="${track.data_format.data_format_select}" visibility="${track.data_format.track_visibility}">
@@ -203,7 +204,10 @@
                             #end if
                         #end if
                         #if str($track.data_format.data_format_select) in ["bam", "cram"]:
-                            <type>"LinearAlignmentsDisplay"</type>
+                            <type>LinearAlignmentsDisplay</type>
+                        #end if
+                        #if str($track.data_format.data_format_select) in ["paf"]:
+                            <type>LinearBasicDisplay</type>
                         #end if
                         </style>
                     #if str($track.data_format.data_format_select) == "bam":
@@ -235,13 +239,13 @@
                     #else if str($track.data_format.data_format_select) == "paf":
                         <paf>
                             <genome>
-                            #for gnome in $track.data_format.synteny_genome:
-                                $gnome,
+                            #for refgenome in $track.data_format.pafuseuri.refgenomes:
+                                $refgenome.annotation,
                             #end for
                             </genome>
                             <genome_label>
-                            #for gnome in $track.data_format.synteny_genome:
-                                $gnome.name,
+                            #for refgenome in $track.data_format.pafuseuri.refgenomes:
+                                $refgenome.annoname,
                             #end for
                             </genome_label>
                         </paf>
@@ -327,17 +331,17 @@
             <repeat name="data_tracks" title="Annotation Track">
                 <conditional name="data_format" label="Track Data Selection Options">
                     <param type="select" label="Track Type" name="data_format_select">
-                        <option value="bam">BAM Pileup track</option>
+                        <option value="bam">BAM track. Recommend convert to faster BED unless mapping annotation needed</option>
                         <option value="bed">BED track</option>
                         <option value="bigwig">BigWig track</option>
-                        <option value="blastxml">Blast XML track - converted to GFF</option>
+                        <option value="blastxml">Blast XML track (as GFF3)</option>
+                        <option value="cram">CRAM track. Currently not advantageous over BAM in Galaxy. Convert to BED like BAM.</option>
+                        <option value="gff">GFF/GFF3 track</option>
                         <option value="cool">HiC as cool/mcool/scool format files</option>
-                        <option value="cram">CRAM</option>
-                        <option value="gff">GFF/GFF3 feature track</option>
                         <option value="hic">HiC as juicebox_hic format file. Tabular hic_matrix will NOT work.</option>
                         <option value="maf">Multiple alignment format. Reference name must match the MAF name exactly to work correctly</option>
                         <option value="paf">PAF - approximate mapping positions between two set of sequences</option>
-                       <option value="vcf">VCF SNP</option>
+                       <option value="vcf">VCF SNP track</option>
                     </param>
                     <when value="blastxml">
                         <expand macro="input_conditional" label="BlastXML Track Data" format="blastxml" />
@@ -411,12 +415,10 @@
                         <expand macro="track_visibility" />
                     </when>
                     <when value="paf">
-                        <param label="Comparison genome sequence" help="Paf from these as the reference(s), using the common reference as the reads to map"
-                            format="fasta"
-                            name="synteny_genome"
-                            type="data"
-                            multiple="True"/>
-                        <expand macro="input_conditional" label="Synteny data" format="paf" help="Make paf with mashmap or minimap2 mapping real reference onto desired syntenic references"/>
+                        <expand macro="input_conditional" label="PAF format synteny mapping data" format="paf"
+                             help="PAF made with mashmap or minimap2 mapping the real reference as a query on the comparison genomes as references"/>
+                        <expand macro="pafref_conditional"  label="Comparison genome sequence(s)"
+                            format="fasta" help="Paf from these as the reference(s), using the common reference as the reads to map"/>
                         <expand macro="track_visibility" />
                     </when>
 
b
diff -r 0e592dcaeb7f -r f807e219cec3 macros.xml
--- a/macros.xml Thu Mar 21 09:06:52 2024 +0000
+++ b/macros.xml Fri Mar 22 22:04:08 2024 +0000
b
@@ -522,7 +522,7 @@
                 <param name="insource" type="select" label="Define track data as a history file or an internet URI"
                     help="A public URI implies that all the associated tabix files are also in place. They are created for history files">
                     <option value="history" selected="true">Track data from a history file</option>
-                    <option value="uri" selected="true">Tabix data URI - index files must be available at corresponding URI</option>
+                    <option value="uri" >Tabix data URI - index files must be available at corresponding URI</option>
                 </param>
                 <when value="history">
                        <param label="@LABEL@" format="@FORMAT@" name="annotation" multiple="True" optional="true" type="data" />
@@ -539,6 +539,39 @@
                 </when>
             </conditional>
      </xml>
+    <xml name="pafref_conditional" token_label="Track Data" token_format="data">
+        <conditional name="pafuseuri">
+                <param name="insource" type="select" label="PAF reference data from a history file or an internet URI?"
+                    help="A public URI implies that all the associated tabix files are also in place. They are created for history files">
+                    <option value="history" selected="true">PAF genome reference data from a history file</option>
+                    <option value="uri">PAF genome reference data from tabix data URI - index files must be available at corresponding URI</option>
+                </param>
+                <when value="history">
+                    <repeat name="refgenomes" title="Add one or more comparison genomes used to make the PAF">
+                       <param label="@LABEL@" format="@FORMAT@" name="annotation" multiple="True" optional="true" type="data" />
+                       <param label="Short name for track display" name="annoname" type="text" >
+                             <sanitizer invalid_char="_">
+                                <valid initial="string.printable" >
+                                    <remove value="'" />
+                                </valid>
+                              </sanitizer>
+                        </param>
+                    </repeat>
+                </when>
+                <when value="uri">
+                    <repeat name="refgenomes" title="Provide URI for a comparison genomesused to make the PAF">
+                       <param label="@LABEL@" name="annotation"  type="text" />
+                       <param label="Short name for track display" name="annoname" type="text" >
+                             <sanitizer invalid_char="_">
+                                <valid initial="string.printable" >
+                                    <remove value="'" />
+                                </valid>
+                              </sanitizer>
+                        </param>
+                    </repeat>
+                </when>
+            </conditional>
+     </xml>
     <xml name="citations">
         <citations>
         <citation type="doi">10.1186/s13059-016-0924-1</citation>