diff jbrowse2.xml @ 98:b1260bca5fdc draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
author bgruening
date Wed, 05 Jun 2024 10:00:07 +0000
parents 74074746ccd8
children 990291e918c7
line wrap: on
line diff
--- a/jbrowse2.xml	Sat Jun 01 05:37:13 2024 +0000
+++ b/jbrowse2.xml	Wed Jun 05 10:00:07 2024 +0000
@@ -1,4 +1,4 @@
-<tool id="jbrowse2" name="JBrowse2" version="@TOOL_VERSION@+@WRAPPER_VERSION@_17" profile="22.05">
+<tool id="jbrowse2" name="JBrowse2" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="22.05">
     <description>genome browser</description>
     <macros>
         <import>macros.xml</import>
@@ -7,51 +7,50 @@
     <xrefs>
         <xref type="bio.tools">jbrowse2</xref>
     </xrefs>
-    <expand macro="requirements" />
-    <expand macro="creators"/>
-    <version_command>python '${__tool_directory__}/jbrowse2.py' --version</version_command>
+    <expand macro="requirements"/>
     <required_files>
-        <include path="autogenJB2.py" />
-        <include path="blastxml_to_gapped_gff3.py" />
-        <include path="convertMAF.sh" />
-        <include path="gff3_rebase.py" />
-        <include path="jb2_urlconf.py" />
-        <include path="jb2_webserver.py" />
-        <include path="jbrowse2.py" />
-        <include path="maf2bed.py" />
+        <include path="autogenJB2.py"/>
+        <include path="blastxml_to_gapped_gff3.py"/>
+        <include path="convertMAF.sh"/>
+        <include path="gff3_rebase.py"/>
+        <include path="jb2_webserver.py"/>
+        <include path="jbrowse2.py"/>
+        <include path="maf2bed.py"/>
     </required_files>
+    <version_command>python '${__tool_directory__}/jbrowse2.py' --version</version_command>
     <command detect_errors="aggressive"><![CDATA[
 mkdir -p '$output.files_path' &&
 cp '$trackxml' '$output.files_path/galaxy.xml' &&
-export JBROWSE2_PATH=\$(dirname \$(which jbrowse))/../opt/jbrowse2  &&
+export JBROWSE2_PATH=\$(dirname \$(which jbrowse))/../opt/jbrowse2 &&
 #if $jbgen.ucol.formcoll=="collect":
     python '$__tool_directory__/autogenJB2.py'
     #for $key in $autoCollection.keys():
         #if $autoCollection[$key].is_collection:
             #set subCol=$autoCollection[$key]
             #set pafs=[($subCol[x],$subcol[x].ext,x) for x in $subCol.keys() if $subCol[x].ext == 'paf']
-            #set refs=[($subCol[x],$subcol[x].ext,x) for x in $subCol.keys() if $subCol[x].ext in ['fasta.gz','fasta']]
             #if len($pafs) > 0:
-                 --pafmeta '$pafs[0]'
+                --pafmeta '$pafs[0]'
+                #set refs = [($pafs[0][2],$subCol[x],x) for x in $subCol.keys() if $subCol[x].ext == 'fasta']
                 #for $ref in $refs:
-                 --pafreferencemeta '$ref'
+                    --pafreferencemeta '$ref'
                 #end for
             #end if
         #else if $autoCollection[$key].ext == 'fasta':
-          --referencemeta '$autoCollection[$key],$autoCollection[$key].ext,$key'
+            --referencemeta '$autoCollection[$key],$autoCollection[$key].ext,$key'
         #else if $autoCollection[$key].ext in ['bed', 'bigwig', 'cool', 'gff', 'gff3', 'hic', 'maf', 'mcool', 'scool', 'vcf']
-          --trackmeta '$autoCollection[$key],$autoCollection[$key].ext,$key'
+            --trackmeta '$autoCollection[$key],$autoCollection[$key].ext,$key'
         #else if $autoCollection[$key].ext in ['bam',]
-          --trackmeta '$autoCollection[$key],$autoCollection[$key].ext,$key,$autoCollection[$key].metadata.bam_index'
-         #else if $autoCollection[$key].ext in ['cram',]
-          --trackmeta '$autoCollection[$key],$autoCollection[$key].ext,$key,$autoCollection[$key].metadata.cram_index'
+            --trackmeta '$autoCollection[$key],$autoCollection[$key].ext,$key,$autoCollection[$key].metadata.bam_index'
+        #else if $autoCollection[$key].ext in ['cram',]
+            --trackmeta '$autoCollection[$key],$autoCollection[$key].ext,$key,$autoCollection[$key].metadata.cram_index'
         #end if
     #end for
     --outdir '$output.files_path'
     --jbrowse2path \${JBROWSE2_PATH}
     --sessName "Autogen JBrowse" &&
     #if $jbgen.zipOut == "true":
-        (cd '$output.files_path' && zip -r - . ) > '$output'
+        cd '$output.files_path' &&
+        zip -r - . > '$output'
     #else
       cp '$output.files_path/index.html' '$output'
     #end if
@@ -61,13 +60,10 @@
     --outdir '$output.files_path'
     --xml '$trackxml' &&
     #if $jbgen.zipOut == "true":
-        (cd '$output.files_path' && zip -r - . ) > '$output'
+        cd '$output.files_path' &&
+        zip -r - . > '$output'
     #else
-      cp '$output.files_path/index.html' '$output'
-    #end if
-    ## Ugly testing hack since I cannot get <extra_files> to test the files I want to test. Hmph.
-    #if str($uglyTestingHack) == "enabled":
-       &&   cp '$trackxml' '$output'
+        cp '$output.files_path/index.html' '$output'
     #end if
 #end if
   ]]></command>
@@ -146,7 +142,6 @@
                           tool_id="${assembly.reference_genome.genome.creating_job.tool_id}"
                           tool_version="${assembly.reference_genome.genome.creating_job.tool_version}"
                           />
-
                     </metadata>
                   </genome>
                 #end if
@@ -157,7 +152,7 @@
             #for $track in $tg.data_tracks:
                 #set input_exists = "False"
                 #if $track.data_format.useuri.insource == "uri":
-                        #if $track.data_format.useuri.annouri:
+                    #if $track.data_format.useuri.annouri:
                         #set input_exists = "True"
                         <track cat="${tg.category}" format="${track.data_format.data_format_select}" visibility="${track.data_format.track_visibility}">
                             <files>
@@ -168,7 +163,7 @@
                                     </metadata>
                                  </trackFile>
                             </files>
-                        #end if
+                    #end if
                 #else if $track.data_format.useuri.insource == "history":
                     #if $track.data_format.useuri.annotation:
                         #set input_exists = "True"
@@ -177,7 +172,6 @@
                         #for $dataset in $track.data_format.useuri.annotation:
                               <trackFile path="${dataset}" ext="${dataset.ext}" label="${dataset.name}" useuri="no">
                                 <metadata>
-
                                   <dataset id="${__app__.security.encode_id($dataset.id)}" hid="${dataset.hid}"
                                       size="${dataset.get_size(nice_size=True)}"
                                       edam_format="${dataset.datatype.edam_format}"
@@ -192,7 +186,6 @@
                                       user_id="-1"
                                       display_name="Unnamed History"/>
                                       #end if
-
                                   <metadata
                                     #for (key, value) in $dataset.get_metadata().items():
                                     #if "_types" not in $key and $value is not None and len(str($value)) < 5000:
@@ -211,7 +204,7 @@
                                       />
                                 </metadata>
                               </trackFile>
-                        #end for
+                       #end for
                     </files>
                     #end if
                 #end if
@@ -333,47 +326,38 @@
                     <param name="genome" type="select" optional="true" label="Select a built in reference genome or custom genome" help="If not listed, add a custom genome, use a history genome or a remote URI tabix genome">
                         <options from_data_table="all_fasta">
                             <filter column="2" type="sort_by"/>
-                            <validator message="No genomes are available for the selected input dataset" type="no_options">
-                            </validator>
+                            <validator message="No genomes are available for the selected input dataset" type="no_options"/>
                         </options>
                     </param>
                 </when>
                 <when value="history">
-                    <param name="genome" type="data" format="fasta" optional="true" label="Select the reference genome">
-                    </param>
+                    <param name="genome" type="data" format="fasta" optional="true" label="Select the reference genome"/>
                 </when>
                 <when value="uri">
-                    <param name="uri" type="text" label="URI pointing to tabix compressed fasta">
-                    </param>
-                    <param name="refname" type="text" label="Reference dbkey for tracks with this genome, such as hg38 or SacCer4">
-                    </param>
+                    <param name="uri" type="text" label="URI pointing to tabix compressed fasta"/>
+                    <param name="refname" type="text" label="Reference dbkey for tracks with this genome, such as hg38 or SacCer4"/>
                 </when>
             </conditional>
             <repeat name="track_groups" title="Track Group">
-                <param name="category" type="text" value="Default" optional="False" label="Track Category" help="Organise your tracks into Categories for a nicer end-user experience. You can use #date# and it will be replaced with the current date in 'yyyy-mm-dd' format,                 which is very useful for repeatedly updating a JBrowse instance when member databases / underlying tool versions are updated."/>
+                <param name="category" type="text" value="Default" optional="False" label="Track Category" help="Organise your tracks into Categories for a nicer end-user experience. You can use #date# and it will be replaced with the current date in 'yyyy-mm-dd' format, which is very useful for repeatedly updating a JBrowse instance when member databases / underlying tool versions are updated."/>
                 <repeat name="data_tracks" title="Annotation Track">
                     <conditional name="data_format" label="Track Data Selection Options">
                         <param name="data_format_select" type="select" label="Track Type">
-                            <option value="bam">BAM track. Recommend convert to faster BED unless
-                                mapping annotation needed</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 (as GFF3)</option>
-                            <option value="cram">CRAM track. Currently not advantageous over BAM in
-                                Galaxy. Convert to BED like BAM.</option>
+                            <option value="cram">CRAM track, we recomment to convert to BED like for BAM</option>
                             <option value="gff">GFF/GFF3 track</option>
                             <option value="cool">HiC as cool/mcool/scool format files</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="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 track</option>
                         </param>
                         <when value="blastxml">
                             <expand macro="input_conditional" label="BlastXML Track Data" format="blastxml"/>
-                            <param name="blast_parent" type="data" format="gff3" optional="true" label="Features used in Blast Search" help="in GFF3. This is used  so we know where to map features. E.g. where results of which CDS Protein32 match up to. The query IDs in your blast results should MATCH some feature                             IDs in your GFF3 file. This is an optional field and is most useful if using JBrowse to display protein blast results on a DNA genome. blastn results don't need this,                             blastp results on a protein sequence don't need this."/>
+                            <param name="blast_parent" type="data" format="gff3" optional="true" label="Features used in Blast Search" help="in GFF3. This is used  so we know where to map features. E.g. where results of which CDS Protein32 match up to. The query IDs in your blast results should MATCH some feature IDs in your GFF3 file. This is an optional field and is most useful if using JBrowse to display protein blast results on a DNA genome. blastn results don't need this, blastp results on a protein sequence don't need this."/>
                             <param name="min_gap" type="integer" min="2" value="10" label="Minimum Gap Size" help="before a new match_part feature is created"/>
                             <param name="is_protein" type="boolean" truevalue="true" falsevalue="false" label="Is this a protein blast search?"/>
                             <expand macro="track_styling_vgp"/>
@@ -392,7 +376,7 @@
                                     <option value="true">Match/match part data</option>
                                 </param>
                                 <when value="true">
-                                    <param name="name" type="text" value="match" optional="True" label="Match Part Feature Type" help="Match_parts have options for the parent feature type, such as cDNA_match, match, translated_nucleotide_match, etc.                                     Please select the appropriate one here. You can leave empty to try autodetection (only works with CanvasFeatures track type)."/>
+                                    <param name="name" type="text" value="match" optional="True" label="Match Part Feature Type" help="Match_parts have options for the parent feature type, such as cDNA_match, match, translated_nucleotide_match, etc. Please select the appropriate one here. You can leave empty to try autodetection (only works with CanvasFeatures track type)."/>
                                 </when>
                                 <when value="false"/>
                             </conditional>
@@ -439,7 +423,6 @@
             </repeat>
         </repeat>
         <expand macro="general_options"/>
-        <param name="uglyTestingHack" type="hidden" value=""/>
     </inputs>
     <outputs>
         <data format="html" name="output" label="JBrowse2: ${jbgen.session_name}">
@@ -747,17 +730,21 @@
                     </repeat>
                 </repeat>
             </repeat>
-            <param name="uglyTestingHack" value="enabled"/>
+            <section name="jbgen">
+                <param name="zipOut" value="true"/>
+            </section>
             <output name="output">
                 <assert_contents>
-                    <has_text text="genome path="/>
-                    <has_text text="label="/>
-                    <has_text text="format="/>
-                    <has_text text="metadata"/>
-                    <has_text text="useuri="/>
-                    <has_text text="trackFile path="/>
-                    <has_text text="ext=&quot;bigwig&quot;"/>
-                    <has_text text="format=&quot;bigwig&quot;"/>
+                    <has_archive_member path="galaxy.xml">
+                        <has_text text="genome path="/>
+                        <has_text text="label="/>
+                        <has_text text="format="/>
+                        <has_text text="metadata"/>
+                        <has_text text="useuri="/>
+                        <has_text text="trackFile path="/>
+                        <has_text text="ext=&quot;bigwig&quot;"/>
+                        <has_text text="format=&quot;bigwig&quot;"/>
+                    </has_archive_member>
                 </assert_contents>
             </output>
         </test>
@@ -782,16 +769,20 @@
                     </repeat>
                 </repeat>
             </repeat>
-            <param name="uglyTestingHack" value="enabled"/>
+            <section name="jbgen">
+                <param name="zipOut" value="true"/>
+            </section>
             <output name="output">
                 <assert_contents>
-                    <has_text text="genome path="/>
-                    <has_text text="label="/>
-                    <has_text text="format="/>
-                    <has_text text="metadata"/>
-                    <has_text text="useuri="/>
-                    <has_text text="trackFile path="/>
-                    <has_text text="ext=&quot;vcf&quot; label=&quot;merlin.vcf&quot;"/>
+                    <has_archive_member path="galaxy.xml">
+                        <has_text text="genome path="/>
+                        <has_text text="label="/>
+                        <has_text text="format="/>
+                        <has_text text="metadata"/>
+                        <has_text text="useuri="/>
+                        <has_text text="trackFile path="/>
+                        <has_text text="ext=&quot;vcf&quot; label=&quot;merlin.vcf&quot;"/>
+                    </has_archive_member>
                 </assert_contents>
             </output>
         </test>
@@ -804,13 +795,17 @@
                     <param name="genome.name" value="Merlin"/>
                 </conditional>
             </repeat>
-            <param name="uglyTestingHack" value="enabled"/>
+            <section name="jbgen">
+                <param name="zipOut" value="true"/>
+            </section>
             <output name="output">
                 <assert_contents>
-                    <has_text text="genome path="/>
-                    <has_text text="label="/>
-                    <has_text text="useuri="/>
-                    <has_text text="metadata"/>
+                    <has_archive_member path="galaxy.xml">
+                        <has_text text="genome path="/>
+                        <has_text text="label="/>
+                        <has_text text="useuri="/>
+                        <has_text text="metadata"/>
+                    </has_archive_member>
                 </assert_contents>
             </output>
         </test>
@@ -835,16 +830,20 @@
                     </repeat>
                 </repeat>
             </repeat>
-            <param name="uglyTestingHack" value="enabled"/>
+            <section name="jbgen">
+                <param name="zipOut" value="true"/>
+            </section>
             <output name="output">
                 <assert_contents>
-                    <has_text text="genome path="/>
-                    <has_text text="label="/>
-                    <has_text text="format="/>
-                    <has_text text="metadata"/>
-                    <has_text text="useuri="/>
-                    <has_text text="trackFile path="/>
-                    <has_text text="ext=&quot;vcf&quot; label=&quot;merlin.vcf&quot;"/>
+                    <has_archive_member path="galaxy.xml">
+                        <has_text text="genome path="/>
+                        <has_text text="label="/>
+                        <has_text text="format="/>
+                        <has_text text="metadata"/>
+                        <has_text text="useuri="/>
+                        <has_text text="trackFile path="/>
+                        <has_text text="ext=&quot;vcf&quot; label=&quot;merlin.vcf&quot;"/>
+                    </has_archive_member>
                 </assert_contents>
             </output>
         </test>
@@ -1065,36 +1064,73 @@
                     </repeat>
                 </repeat>
             </repeat>
-            <param name="uglyTestingHack" value="enabled"/>
+            <section name="jbgen">
+                <param name="zipOut" value="true"/>
+            </section>
             <output name="output">
                 <assert_contents>
-                    <has_text text="Ignore Scale"/>
-                    <has_text text="A.gff"/>
-                    <has_text text="B.gff"/>
-                    <has_text text="C.gff"/>
-                    <has_text text="interpro.gff"/>
-                    <has_text text="Scaled Colour"/>
-                    <has_text text="1.gff"/>
-                    <has_text text="2.gff"/>
+                    <has_archive_member path="A.gff"/>
+                    <has_archive_member path="B.gff"/>
+                    <has_archive_member path="C.gff"/>
+                    <has_archive_member path="interpro.gff"/>
+                    <has_archive_member path="1.gff"/>
+                    <has_archive_member path="2.gff"/>
+                    <has_archive_member path="galaxy.xml">
+                        <is_valid_xml/>
+                        <has_n_elements_with_path path="./metadata/general/session_name" n="1"/>
+                        <element_text_is path="./metadata/general/session_name" text="New JBrowse2 session"/>
+                    </has_archive_member>
                 </assert_contents>
             </output>
         </test>
-        <!-- TODO add a synteny test -->
-        <!-- TODO add a bam and a cram test -->
-        <!-- TODO add an hic test -->
-        <!-- TODO add a vcf_bgzip test -->
+        <test>
+            <repeat name="assemblies">
+                <conditional name="reference_genome">
+                    <param name="genome_type_select" value="history"/>
+                    <param name="genome" value="merlin.fa"/>
+                </conditional>
+                <repeat name="track_groups">
+                    <param name="category" value="Auto Coloured"/>
+                    <repeat name="data_tracks">
+                        <conditional name="data_format">
+                            <param name="data_format_select" value="cram"/>
+                            <param name="annotation" value="cram/merlin-sample.cram"/>
+                        </conditional>
+                    </repeat>
+                </repeat>
+            </repeat>
+            <section name="jbgen">
+                <param name="zipOut" value="true"/>
+            </section>
+            <output name="output" ftype="zip">
+                <assert_contents>
+                    <!-- roughly 590 files in an archive -->
+                    <has_archive_member path=".*" n="608" delta="30"/>
+                    <has_archive_member path="index.html"/>
+                    <has_archive_member path="static/media/roboto-latin-400-normal.3f2b9a42f643e62a49b7.woff"/>
+                    <has_archive_member path="manifest.json">
+                        <has_text text="favicon.ico"/>
+                        <has_text text="background_color"/>
+                    </has_archive_member>
+                    <has_archive_member path="merlin.fa.fa.gz.fai"/>
+                    <has_archive_member path="galaxy.xml">
+                        <is_valid_xml/>
+                        <has_n_elements_with_path path="./metadata/general/session_name" n="1"/>
+                        <element_text_is path="./metadata/general/session_name" text="New JBrowse2 session"/>
+                    </has_archive_member>
+                </assert_contents>
+            </output>
+        </test>
     </tests>
     <help><![CDATA[
 
 JBrowse2-in-Galaxy
 ==================
 
-JBrowse2-in-Galaxy offers a highly configurable, workflow-compatible
-alternative to JBrowse1-in-Galaxy and Trackster.
+JBrowse2-in-Galaxy offers a highly configurable, workflow-compatible Genome viewer.
 
 Compared to JBrowse1-in-Galaxy, there is no support for alternative codons for unusual genomes,
-and detailed track styling is not yet implemented. Send code.
-JBrowse1 development has now ceased in favour of JBrowse2.
+and detailed track styling is not yet implemented. Please contact us if you are missing features.
 
 Use and local viewing
 =====================