changeset 63:ac00dcfb5d1d draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit f450a9a7bec7ae695a85a061bf59956b73196976
author fubar
date Thu, 28 Mar 2024 07:46:04 +0000
parents ab0d6782a95f
children 497fd2d27aa2
files jbrowse2.py jbrowse2.xml
diffstat 2 files changed, 140 insertions(+), 219 deletions(-) [+]
line wrap: on
line diff
--- a/jbrowse2.py	Thu Mar 28 04:51:06 2024 +0000
+++ b/jbrowse2.py	Thu Mar 28 07:46:04 2024 +0000
@@ -15,7 +15,7 @@
 import xml.etree.ElementTree as ET
 from collections import defaultdict
 
-logging.basicConfig(level=logging.DEBUG)
+logging.basicConfig(level=logging.INFO)
 log = logging.getLogger("jbrowse")
 
 JB2VER = "v2.10.3"
@@ -493,7 +493,7 @@
                     else:
                         try:
                             fl = urllib.request.urlopen(fapath + ".fai").readline()
-                        except:
+                        except Exception:
                             fl = None
                         if fl:  # is first row of the text fai so the first contig name
                             this_genome["genome_firstcontig"] = (
@@ -622,7 +622,6 @@
         # can be served - if public.
         # dsId = trackData["metadata"]["dataset_id"]
         # url = "%s/api/datasets/%s/display?to_ext=hic " % (self.giURL, dsId)
-        hic_path = trackData.get("hic_path", None)
         useuri = trackData["useuri"].lower() == "yes"
         if useuri:
             uri = data
@@ -682,7 +681,7 @@
         sampu = list(dict.fromkeys(samp))
         samples = [x.split(".")[0] for x in sampu]
         samples.sort()
-        logging.warn(
+        logging.debug(
             "$$$$ cmd=%s, mafss=%s samp=%s samples=%s"
             % (" ".join(cmd), mafss, samp, samples)
         )
@@ -737,7 +736,7 @@
         ]
         subprocess.check_call(cmd, cwd=self.outdir, stdout=gff3_unrebased)
         gff3_unrebased.close()
-        logging.warn("### blastxml to gff3 cmd = %s" % " ".join(cmd))
+        logging.debug("### blastxml to gff3 cmd = %s" % " ".join(cmd))
         return gff3_unrebased.name
 
     def add_blastxml(self, data, trackData, blastOpts, **kwargs):
@@ -749,7 +748,7 @@
                 cmd.append("--protein2dna")
             cmd.extend([os.path.realpath(blastOpts["parent"]), gff3])
             subprocess.check_call(cmd, cwd=self.outdir, stdout=gff3_rebased)
-            logging.warn("### gff3rebase cmd = %s" % " ".join(cmd))
+            logging.debug("### gff3rebase cmd = %s" % " ".join(cmd))
             gff3_rebased.close()
             # Replace original gff3 file
             shutil.copy(gff3_rebased.name, gff3)
@@ -1307,7 +1306,7 @@
                 track_types[tId] = track_conf["type"]
                 style_data = default_data["style"].get(tId, None)
                 if not style_data:
-                    logging.warn(
+                    logging.debug(
                         "### No style data in default data %s for %s"
                         % (default_data, tId)
                     )
@@ -1488,7 +1487,6 @@
             }
             for x in ass.findall("metadata/genomes/genome")
         ]
-        logging.warn("#!!! genomes=%s" % genomes)
         assref_name = jc.process_genomes(genomes)
 
         for track in ass.find("tracks"):
--- a/jbrowse2.xml	Thu Mar 28 04:51:06 2024 +0000
+++ b/jbrowse2.xml	Thu Mar 28 07:46:04 2024 +0000
@@ -541,7 +541,7 @@
                 <assert_contents>
                     <has_text text="genome path="></has_text>
                    <has_text text="label="></has_text>
-                    <has_text text="format="></has_text>
+                    <has_text text="useuri="></has_text>
                     <has_text text="metadata"></has_text>
                 </assert_contents>
             </output>
@@ -576,7 +576,7 @@
                     <has_text text="metadata"></has_text>
                     <has_text text="useuri="></has_text>
                     <has_text text="trackFile path="></has_text>
-                    <has_text text="ext=&quot;bed&quot; label=&quot;test-3.bed&quot;"></has_text>
+                    <has_text text="ext=&quot;vcf&quot; label=&quot;merlin.vcf&quot;"></has_text>
                 </assert_contents>
             </output>
         </test>
@@ -588,7 +588,7 @@
                     <param name="genome.ext" value="fasta"/>
                     <param name="genome.name" value="Merlin"/>
                  </conditional>
-                <repeat name="track_groups">
+                 <repeat name="track_groups">
                     <param name="category" value="Default" />
                     <repeat name="data_tracks">
                         <conditional name="data_format">
@@ -611,11 +611,9 @@
                         </section>
                     </repeat>
                 </repeat>
-            </repeat>
-
-            <repeat name="track_groups">
+                <repeat name="track_groups">
                 <param name="category" value="Ignore Scale" />
-                <repeat name="data_tracks">
+                    <repeat name="data_tracks">
                     <conditional name="data_format">
                         <param name="data_format_select" value="gff"/>
                        <conditional name="useuri">
@@ -635,150 +633,148 @@
                             </conditional>
                         </section>
                     </conditional>
+                    </repeat>
                 </repeat>
-            </repeat>
-
-            <repeat name="track_groups">
+                <repeat name="track_groups">
                 <param name="category" value="Scaled Colour" />
-                <repeat name="data_tracks">
-                    <conditional name="data_format">
-                        <param name="data_format_select" value="gff"/>
-                       <conditional name="useuri">
-                            <param name="insource" value= "history"/>
-                            <param name="annotation" value="gff3/C.gff"/>
-                        </conditional>
-                        <conditional name="match_part">
-                            <param name="match_part_select" value="false"/>
-                        </conditional>
-                        <section name="jbcolor_scale">
-                            <conditional name="color_score">
-                                <param name="color_score_select" value="score"/>
-                                <param name="score_scaling" value="linear"/>
-                                <conditional name="score_scales">
-                                    <param name="scale_select" value="automatic"/>
-                                </conditional>
-                                <conditional name="color_scheme">
-                                    <param name="score_scheme" value="opacity"/>
-                                    <conditional name="color">
-                                        <param name="color_select" value="automatic"/>
+                    <repeat name="data_tracks">
+                        <conditional name="data_format">
+                            <param name="data_format_select" value="gff"/>
+                           <conditional name="useuri">
+                                <param name="insource" value= "history"/>
+                                <param name="annotation" value="gff3/C.gff"/>
+                            </conditional>
+                            <conditional name="match_part">
+                                <param name="match_part_select" value="false"/>
+                            </conditional>
+                            <section name="jbcolor_scale">
+                                <conditional name="color_score">
+                                    <param name="color_score_select" value="score"/>
+                                    <param name="score_scaling" value="linear"/>
+                                    <conditional name="score_scales">
+                                        <param name="scale_select" value="automatic"/>
+                                    </conditional>
+                                    <conditional name="color_scheme">
+                                        <param name="score_scheme" value="opacity"/>
+                                        <conditional name="color">
+                                            <param name="color_select" value="automatic"/>
+                                        </conditional>
                                     </conditional>
                                 </conditional>
-                            </conditional>
-                        </section>
-                    </conditional>
-                </repeat>
-                <repeat name="data_tracks">
-                    <conditional name="data_format">
-                        <param name="data_format_select" value="gff"/>
-                       <conditional name="useuri">
-                            <param name="annotation" value="gff3/B.gff"/>
-                            <param name="insource" value= "history"/>
+                            </section>
                         </conditional>
-                       <conditional name="match_part">
-                            <param name="match_part_select" value="false"/>
-                        </conditional>
-                        <section name="jbcolor_scale">
-                            <conditional name="color_score">
-                                <param name="color_score_select" value="score"/>
-                                <param name="score_scaling" value="linear"/>
-                                <conditional name="score_scales">
-                                    <param name="scale_select" value="automatic"/>
-                                </conditional>
-                                <conditional name="color_scheme">
-                                    <param name="score_scheme" value="opacity"/>
-                                    <conditional name="color">
-                                        <param name="color_select" value="manual"/>
-                                        <param name="style_color" value="#0000ff"/>
+                    </repeat>
+                    <repeat name="data_tracks">
+                        <conditional name="data_format">
+                            <param name="data_format_select" value="gff"/>
+                           <conditional name="useuri">
+                                <param name="annotation" value="gff3/B.gff"/>
+                                <param name="insource" value= "history"/>
+                            </conditional>
+                           <conditional name="match_part">
+                                <param name="match_part_select" value="false"/>
+                            </conditional>
+                            <section name="jbcolor_scale">
+                                <conditional name="color_score">
+                                    <param name="color_score_select" value="score"/>
+                                    <param name="score_scaling" value="linear"/>
+                                    <conditional name="score_scales">
+                                        <param name="scale_select" value="automatic"/>
+                                    </conditional>
+                                    <conditional name="color_scheme">
+                                        <param name="score_scheme" value="opacity"/>
+                                        <conditional name="color">
+                                            <param name="color_select" value="manual"/>
+                                            <param name="style_color" value="#0000ff"/>
+                                        </conditional>
                                     </conditional>
                                 </conditional>
-                            </conditional>
-                        </section>
-                    </conditional>
-                </repeat>
-                <repeat name="data_tracks">
-                    <conditional name="data_format">
-                        <param name="data_format_select" value="gff"/>
-                       <conditional name="useuri">
-                            <param name="annotation" value="gff3/A.gff"/>
-                            <param name="insource" value= "history"/>
-                        </conditional>
-                        <conditional name="match_part">
-                            <param name="match_part_select" value="false"/>
+                            </section>
                         </conditional>
-                        <section name="jbcolor_scale">
-                            <conditional name="color_score">
-                                <param name="color_score_select" value="score"/>
-                                <param name="score_scaling" value="linear"/>
-                                <conditional name="score_scales">
-                                    <param name="scale_select" value="manual"/>
-                                    <param name="minimum" value="0"/>
-                                    <param name="maximum" value="1000"/>
-                                </conditional>
-                                <conditional name="color_scheme">
-                                    <param name="score_scheme" value="opacity"/>
-                                    <conditional name="color">
-                                        <param name="color_select" value="automatic"/>
+                    </repeat>
+                    <repeat name="data_tracks">
+                        <conditional name="data_format">
+                            <param name="data_format_select" value="gff"/>
+                           <conditional name="useuri">
+                                <param name="annotation" value="gff3/A.gff"/>
+                                <param name="insource" value= "history"/>
+                            </conditional>
+                            <conditional name="match_part">
+                                <param name="match_part_select" value="false"/>
+                            </conditional>
+                            <section name="jbcolor_scale">
+                                <conditional name="color_score">
+                                    <param name="color_score_select" value="score"/>
+                                    <param name="score_scaling" value="linear"/>
+                                    <conditional name="score_scales">
+                                        <param name="scale_select" value="manual"/>
+                                        <param name="minimum" value="0"/>
+                                        <param name="maximum" value="1000"/>
+                                    </conditional>
+                                    <conditional name="color_scheme">
+                                        <param name="score_scheme" value="opacity"/>
+                                        <conditional name="color">
+                                            <param name="color_select" value="automatic"/>
+                                        </conditional>
                                     </conditional>
                                 </conditional>
-                            </conditional>
-                        </section>
-                    </conditional>
-                </repeat>
-                <repeat name="data_tracks">
-                    <conditional name="data_format">
-                        <param name="data_format_select" value="gff"/>
-                        <conditional name="useuri">
-                            <param name="annotation" value="gff3/1.gff"/>
-                            <param name="insource" value= "history"/>
-                        </conditional>
-                        <conditional name="match_part">
-                            <param name="match_part_select" value="false"/>
+                            </section>
                         </conditional>
-                        <section name="jbcolor_scale">
-                            <conditional name="color_score">
-                                <param name="color_score_select" value="score"/>
-                                <param name="score_scaling" value="linear"/>
-                                <conditional name="score_scales">
-                                    <param name="scale_select" value="manual"/>
-                                    <param name="minimum" value="0"/>
-                                    <param name="maximum" value="1000"/>
-                                </conditional>
-                                <conditional name="color_scheme">
-                                    <param name="score_scheme" value="opacity"/>
-                                    <conditional name="color">
-                                        <param name="color_select" value="manual"/>
-                                        <param name="style_color" value="#ff0000"/>
+                    </repeat>
+                    <repeat name="data_tracks">
+                        <conditional name="data_format">
+                            <param name="data_format_select" value="gff"/>
+                            <conditional name="useuri">
+                                <param name="annotation" value="gff3/1.gff"/>
+                                <param name="insource" value= "history"/>
+                            </conditional>
+                            <conditional name="match_part">
+                                <param name="match_part_select" value="false"/>
+                            </conditional>
+                            <section name="jbcolor_scale">
+                                <conditional name="color_score">
+                                    <param name="color_score_select" value="score"/>
+                                    <param name="score_scaling" value="linear"/>
+                                    <conditional name="score_scales">
+                                        <param name="scale_select" value="manual"/>
+                                        <param name="minimum" value="0"/>
+                                        <param name="maximum" value="1000"/>
+                                    </conditional>
+                                    <conditional name="color_scheme">
+                                        <param name="score_scheme" value="opacity"/>
+                                        <conditional name="color">
+                                            <param name="color_select" value="manual"/>
+                                            <param name="style_color" value="#ff0000"/>
+                                        </conditional>
                                     </conditional>
                                 </conditional>
-                            </conditional>
-                        </section>
-                    </conditional>
-                </repeat>
-            </repeat>
-
-            <repeat name="track_groups">
-                <param name="category" value="Realistic" />
-                <repeat name="data_tracks">
-                    <conditional name="data_format">
-                        <param name="data_format_select" value="gff"/>
-                        <conditional name="useuri">
-                            <param name="annotation" value="gff3/interpro.gff"/>
-                            <param name="insource" value= "history"/>
+                            </section>
                         </conditional>
-                        <conditional name="match_part">
-                            <param name="match_part_select" value="false"/>
-                        </conditional>
-                        <section name="jbcolor_scale">
-                            <conditional name="color_score">
-                                <param name="color_score_select" value="none"/>
+                    </repeat>
+                </repeat>
+                <repeat name="track_groups">
+                <param name="category" value="Realistic" />
+                    <repeat name="data_tracks">
+                        <conditional name="data_format">
+                            <param name="data_format_select" value="gff"/>
+                            <conditional name="useuri">
+                                <param name="annotation" value="gff3/interpro.gff"/>
+                                <param name="insource" value= "history"/>
                             </conditional>
-                            <conditional name="color">
-                                <param name="color_select" value="automatic"/>
+                            <conditional name="match_part">
+                                <param name="match_part_select" value="false"/>
                             </conditional>
-                        </section>
-                    </conditional>
-                </repeat>
-                <repeat name="data_tracks">
+                            <section name="jbcolor_scale">
+                                <conditional name="color_score">
+                                    <param name="color_score_select" value="none"/>
+                                </conditional>
+                                <conditional name="color">
+                                    <param name="color_select" value="automatic"/>
+                                </conditional>
+                            </section>
+                        </conditional>
+                    </repeat>
+                    <repeat name="data_tracks">
                     <conditional name="data_format">
                         <param name="data_format_select" value="gff"/>
                          <conditional name="useuri">
@@ -798,13 +794,14 @@
                             </conditional>
                         </section>
                     </conditional>
+                    </repeat>
                 </repeat>
             </repeat>
 
             <param name="uglyTestingHack" value="enabled" />
             <output name="output">
                 <assert_contents>
-                        <has_text text="Auto Coloured"/>
+                        <has_text text="Ignore Scale"/>
                         <has_text text="A.gff"/>
                         <has_text text="B.gff"/>
                         <has_text text="C.gff"/>
@@ -815,81 +812,7 @@
                 </assert_contents>
             </output>
         </test>
-        <test>
-            <repeat name="assemblies">
-                 <conditional name="reference_genome">
-                    <param name="genome_type_select" value="history"/>
-                    <param name="genome" value="merlin.fa"/>
-                    <param name="genome.ext" value="fasta"/>
-                    <param name="genome.name" value="Merlin"/>
-                 </conditional>
-                <repeat name="track_groups">
-                    <param name="category" value="Default" />
-                    <repeat name="data_tracks">
-                        <conditional name="data_format">
-                            <param name="data_format_select" value="gff"/>
-                            <conditional name="useuri">
-                                <param name="annotation" value="gff3/1.gff"/>
-                                <param name="insource" value= "history"/>
-                            </conditional>
-                            <conditional name="match_part">
-                                <param name="match_part_select" value="false"/>
-                            </conditional>
-                            <section name="jbcolor_scale">
-                                <conditional name="color_score">
-                                    <param name="color_score_select" value="none"/>
-                                </conditional>
-                                <conditional name="color">
-                                    <param name="color_select" value="automatic"/>
-                                </conditional>
-                            </section>
-                            <section name="jbmenu">
-                                <repeat name="track_menu">
-                                    <param name="menu_action" value="iframeDialog"/>
-                                    <param name="menu_label" value="Some menu item"/>
-                                    <param name="menu_title" value="Frame title"/>
-                                    <param name="menu_url" value="https://example.com/#!/?id={name}&amp;q={type}&amp;z=&quot;{end}&quot;"/>
-                                    <param name="menu_icon" value="dijitIconNewTask"/>
-                                </repeat>
-                                <repeat name="track_menu">
-                                    <param name="menu_action" value="newWindow"/>
-                                    <param name="menu_label" value="Another menu item"/>
-                                    <param name="menu_title" value="Frame title 2"/>
-                                    <param name="menu_url" value="https://example.com/#!/?id={name}&amp;q={type}&amp;z=&quot;{end}&quot;"/>
-                                </repeat>
-                            </section>
-                        </conditional>
-                     </repeat>
-                    <repeat name="data_tracks">
-                        <conditional name="data_format">
-                        <param name="data_format_select" value="gff"/>
-                            <conditional name="useuri">
-                             <param name="annotation" value="gff3/1.gff"/>
-                             <param name="insource" value= "history"/>
-                            </conditional>
-                            <conditional name="match_part">
-                                <param name="match_part_select" value="false"/>
-                            </conditional>
-                            <section name="jbcolor_scale">
-                                <conditional name="color_score">
-                                    <param name="color_score_select" value="none"/>
-                                </conditional>
-                                <conditional name="color">
-                                    <param name="color_select" value="automatic"/>
-                                </conditional>
-                            </section>
-                        </conditional>
-                    </repeat>
-            </repeat>
-            </repeat>
-            <param name="uglyTestingHack" value="enabled" />
-            <output name="output">
-                <assert_contents>
-                    <has_text text="With menu or index"/>
-                    <has_text text="gff"/>
-                </assert_contents>
-            </output>
-        </test>
+
 
         <!-- TODO add a synteny test -->
         <!-- TODO add a bam and a cram test -->