view jbrowse2.xml @ 0:61add3f58f26 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 4fa86613193c985e0cb9a8fc795c56b8bc7b8532
author iuc
date Thu, 02 Oct 2025 10:19:44 +0000
parents
children
line wrap: on
line source

<tool id="jbrowse2" name="JBrowse2" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="25.0">
    <description>genome browser</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <edam_topics>
        <edam_topic>topic_3307</edam_topic>
        <edam_topic>topic_0092</edam_topic>
    </edam_topics>
    <edam_operations>
        <edam_operation>operation_0573</edam_operation>
        <edam_operation>operation_0564</edam_operation>
    </edam_operations>
    <xrefs>
        <xref type="bio.tools">jbrowse_2</xref>
    </xrefs>
    <expand macro="requirements"/>
    <command><![CDATA[
mkdir -p '$output.files_path/data';

#if $action.action_select == "update":
    cp -R '$action.update_jbrowse.extra_files_path/data' '$output.files_path/';
#end if

## Copy the XML file into the directory, mostly for debugging
## but nice if users want to reproduce locally
cp '$trackxml' '$output.files_path/galaxy.xml';

export JBROWSE2_SOURCE_DIR=\$(dirname \$(which jbrowse))/../opt/jbrowse2;

## Once that's done, we run the python script to handle the real work
python '$__tool_directory__/jbrowse2.py'
--jbrowse \${JBROWSE2_SOURCE_DIR}

#if $action.action_select == "update":
--update
#end if

--outdir '$output.files_path'
'$trackxml';

cp '$output.files_path/index.html' '$output';
  ]]></command>
  <configfiles>
      <configfile name="trackxml"><![CDATA[<?xml version="1.0"?>
#import json
<root>
    <metadata>
        <general>
            <analytics>${jbgen.enableAnalytics}</analytics>
            <primary_color>${jbgen.primary_color}</primary_color>
            <secondary_color>${jbgen.secondary_color}</secondary_color>
            <tertiary_color>${jbgen.tertiary_color}</tertiary_color>
            <quaternary_color>${jbgen.quaternary_color}</quaternary_color>
            <font_size>${jbgen.font_size}</font_size>
        </general>
        <galaxyUrl>${__app__.config.galaxy_infrastructure_url}</galaxyUrl>
    </metadata>
    #for $assembly in $assemblies:
    <assembly>
        #if str($assembly.reference_genome.genome_type_select) == "indexed":
            <genome path="${assembly.reference_genome.genomes.fields.path}" label="${assembly.reference_genome.genomes.fields.name}">
                <metadata />
            </genome>
        #else if str($assembly.reference_genome.genome_type_select) == "remote":
            <genome path="${assembly.reference_genome.uri}" label="${assembly.reference_genome.label}" remote="true">
                <metadata />
            </genome>
        #else
            <genome path="$assembly.reference_genome.genome" label="${assembly.reference_genome.genome.element_identifier}">
            <metadata>
                <dataset id="${__app__.security.encode_id($assembly.reference_genome.genome.id)}" hid="${assembly.reference_genome.genome.hid}"
                    size="${assembly.reference_genome.genome.get_size(nice_size=True)}"
                    edam_format="${assembly.reference_genome.genome.datatype.edam_format}"
                    file_ext="${assembly.reference_genome.genome.ext}"
                    dname = "${assembly.reference_genome.genome.element_identifier}" />
                <history id="${__app__.security.encode_id($assembly.reference_genome.genome.history_id)}"
                    #if $assembly.reference_genome.genome.history.user:
                    user_email="${assembly.reference_genome.genome.history.user.email}"
                    user_id="${assembly.reference_genome.genome.history.user_id}"
                    display_name="${assembly.reference_genome.genome.history.get_display_name()}"/>
                    #else
                    user_email="anonymous"
                    user_id="-1"
                    display_name="Unnamed History"/>
                    #end if
                <metadata
                    #for (key, value) in $assembly.reference_genome.genome.get_metadata().items():
                    #if "_types" not in $key:
                    #if isinstance($value, list):
                        #set value_str = "[%s]" % ','.join([str(val) for val in value])
                        ${key}="$value_str"
                    #else
                        ${key}="${value}"
                    #end if
                    #end if
                    #end for
                    />
                <tool
                    tool_id="${assembly.reference_genome.genome.creating_job.tool_id}"
                    tool_version="${assembly.reference_genome.genome.creating_job.tool_version}"
                    />
            </metadata>
            #if $assembly.ref_name_aliases:
                <ref_name_aliases path="${assembly.ref_name_aliases}" />
            #end if
            #if $assembly.cytobands:
                <cytobands path="${assembly.cytobands}" />
            #end if
            </genome>
        #end if
        <defaultLocation>${assembly.defaultLocation}</defaultLocation>
    <tracks>
        #for $tg in $assembly.track_groups:
        #for $track in $tg.data_tracks:
        <track cat="${tg.category}" format="${track.data_format.data_format_select}" visibility="${track.data_format.track_visibility}">
            #if $track.data_format.data_format_select not in ("sparql", "gc"):

                #if $track.data_format.annotation_cond.annotation_source == "history":

                    #if not isinstance($track.data_format.annotation_cond.annotation, list):
                        ## Synteny tracks allow only one file
                        #set $annotations = [$track.data_format.annotation_cond.annotation]
                    #else
                        #set $annotations = $track.data_format.annotation_cond.annotation
                    #end if
                    <files>
                    #for $dataset in $annotations:
                    <trackFile path="${dataset}" ext="${dataset.ext}" label="${dataset.element_identifier}">
                        <metadata>
                        #if $track.data_format.metadata.galaxy_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}"
                            file_ext="${dataset.ext}" />
                        <history id="${__app__.security.encode_id($dataset.history_id)}"
                            #if $dataset.history.user:
                            user_email="${dataset.history.user.email}"
                            user_id="${dataset.history.user_id}"
                            display_name="${dataset.history.get_display_name()}"/>
                            #else
                            user_email="anonymous"
                            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:
                            #if isinstance($value, list) or isinstance($value, dict):
                                #set value_str = json.dumps(value).replace('"', "&quot;")
                                ${key}="${value_str}"
                            #else
                                ${key}="${value}"
                            #end if
                            #end if
                            #end for
                            />
                        <tool
                            tool_id="${dataset.creating_job.tool_id}"
                            tool_version="${dataset.creating_job.tool_version}"
                            />
                        #end if
                        #if $track.data_format.metadata.metadata_bonus:
                            <bonus src="${track.data_format.metadata.metadata_bonus}" />
                        #end if
                        </metadata>
                    </trackFile>
                    #end for
                    </files>
                #else

                    #set $annotations = $track.data_format.annotation_cond.uri
                    <files>
                    <trackFile path="${track.data_format.annotation_cond.uri}" ext="${track.data_format.annotation_cond.format}" label="${track.data_format.annotation_cond.label}" remote="true">
                        <metadata>
                        #if $track.data_format.metadata.metadata_bonus:
                            <bonus src="${track.data_format.metadata.metadata_bonus}" />
                        #end if
                        </metadata>
                    </trackFile>
                    </files>
                #end if
            #end if

            <options>
                <style>
                    #if str($track.data_format.data_format_select) in ("gene_calls", "pileup", "cram", "wiggle", "vcf", "synteny"):
                        <display>${track.data_format.jbstyle.track_style.display}</display>
                    #else if str($track.data_format.data_format_select) in ("hic", "gc", "maf"):
                        <display>${track.data_format.track_display}</display>
                    #end if

                    #if str($track.data_format.data_format_select) in ("gene_calls"):
                        #if str($track.data_format.jbstyle.track_style.display) == "LinearBasicDisplay":
                            <show_labels type="boolean">${track.data_format.jbstyle.track_style.show_labels}</show_labels>
                            <show_descriptions type="boolean">${track.data_format.jbstyle.track_style.show_descriptions}</show_descriptions>
                            <labels_name>${track.data_format.jbstyle.track_style.labels_name}</labels_name>
                            <descriptions_name>${track.data_format.jbstyle.track_style.descriptions_name}</descriptions_name>
                            <display_mode>${track.data_format.jbstyle.track_style.display_mode}</display_mode>
                            <max_height type="integer">${track.data_format.jbstyle.track_style.max_height}</max_height>
                        #else if str($track.data_format.jbstyle.track_style.display) == "LinearArcDisplay":
                            <labels_name>${track.data_format.jbstyle.track_style.labels_name}</labels_name>
                            <display_mode>${track.data_format.jbstyle.track_style.display_mode}</display_mode>
                        #end if
                    #end if

                    #if str($track.data_format.data_format_select) in ("pileup", "cram"):
                        #if str($track.data_format.jbstyle.track_style.display) == "LinearSNPCoverageDisplay":
                            <scale_type>${track.data_format.jbstyle.track_style.scale_type}</scale_type>
                            #if str($track.data_format.jbstyle.track_style.min_score) != "":
                                <min_score type="integer">${track.data_format.jbstyle.track_style.min_score}</min_score>
                            #end if
                            #if str($track.data_format.jbstyle.track_style.max_score) != "":
                                <max_score type="integer">${track.data_format.jbstyle.track_style.max_score}</max_score>
                            #end if
                        #end if
                    #end if

                    #if str($track.data_format.data_format_select) in ("wiggle"):
                        <renderer>${track.data_format.jbstyle.track_style.wig_renderer}</renderer>
                    #end if
                </style>

                #if str($track.data_format.data_format_select) in ("gene_calls"):
                    <formatdetails>
                        #if str($track.data_format.formatdetails.formatdetails_feature) != "":
                        <feature>${track.data_format.formatdetails.formatdetails_feature}</feature>
                        #end if
                        #if str($track.data_format.formatdetails.formatdetails_subfeature) != "":
                        <subfeature>${track.data_format.formatdetails.formatdetails_subfeature}</subfeature>
                        #end if
                        #if str($track.data_format.formatdetails.formatdetails_depth) != "":
                        <depth>${track.data_format.formatdetails.formatdetails_depth}</depth>
                        #end if
                    </formatdetails>
                #end if

                #if str($track.data_format.data_format_select) in ("wiggle"):
                    #if str($track.data_format.jbstyle.track_style.display) == "MultiLinearWiggleDisplay":
                        <multitrack type="boolean">True</multitrack>
                    #end if
                #end if

                #if str($track.data_format.data_format_select) == "pileup":
                    <pileup>
                        #if $track.data_format.annotation_cond.annotation_source == "history":
                            <bam_indices>
                                #for $dataset in $track.data_format.annotation_cond.annotation:
                                    <bam_index>${dataset.metadata.bam_index}</bam_index>
                                #end for
                            </bam_indices>
                        #end if
                    </pileup>
                #else if str($track.data_format.data_format_select) == "cram":
                    <cram>
                        #if $track.data_format.annotation_cond.annotation_source == "history":
                            <cram_indices>
                                #for $dataset in $track.data_format.annotation_cond.annotation:
                                <cram_index>${dataset.metadata.cram_index}</cram_index>
                                #end for
                            </cram_indices>
                        #end if
                    </cram>
                #else if str($track.data_format.data_format_select) == "gene_calls":
                    <gff>
                    <index>${track.data_format.index}</index>
                    </gff>
                #else if str($track.data_format.data_format_select) == "synteny":
                    <synteny>
                    </synteny>
                #else if str($track.data_format.data_format_select) == "hic":
                    <hic>
                    </hic>
                #else if str($track.data_format.data_format_select) == "maf":
                    <maf>
                    <assembly_name>${track.data_format.assembly_name}</assembly_name>
                    </maf>
                #else if str($track.data_format.data_format_select) == "sparql":
                    <label>${track.data_format.label}</label>
                    <sparql>
                        <url>${track.data_format.url}</url>
                        <query>${track.data_format.query}</query>
                        <query_refnames>${track.data_format.query_refnames}</query_refnames>
                    </sparql>
                #else if str($track.data_format.data_format_select) == "wiggle":
                    <wiggle>
                    </wiggle>
                #else if str($track.data_format.data_format_select) == "gc":
                    <label>GC Content</label>
                #end if
            </options>
        </track>
        #end for
        #end for
    </tracks>
    </assembly>
    #end for
</root>
]]></configfile>
    </configfiles>
    <inputs>
        <conditional name="action">
            <param type="select" label="Action" name="action_select">
                <option value="create">New JBrowse Instance</option>
                <option value="update">Update exising JBrowse Instance</option>
            </param>
            <when value="create" />
            <when value="update">
                <param name="update_jbrowse" type="data" format="html" label="Previous JBrowse Instance" />
            </when>
        </conditional>

        <repeat name="assemblies" min="1" title="Genome Assemblies">
        <conditional name="reference_genome">
            <param label="Reference genome to display" name="genome_type_select" type="select">
                <option selected="True" value="indexed">Use a built-in genome</option>
                <option value="history">Use a genome from history</option>
                <option value="remote">Use a genome from a remote source (not recommended)</option>
            </param>
            <when value="indexed">
                <param
                    help="If your genome of interest is not listed, contact the Galaxy team"
                    label="Select a reference genome"
                    name="genomes"
                    type="select"
                >
                    <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" />
                    </options>
                </param>
            </when>
            <when value="history">
                <param
                    format="fasta"
                    label="Select the reference genome"
                    name="genome"
                    type="data" />
            </when>
            <when value="remote">
                <param name="label" type="text" label="Display name of the genome"/>
                <param name="uri" type="text" label="URI pointing to a bgzip compressed fasta (.fai and .gzi files expected to be present)"
                    help="⚠️ WARNING: If this URI is not available for any reason, your JBrowse dataset will be unusable." />
            </when>
        </conditional>

        <!-- TODO genetic code not yet supported in jbrowse2
             https://github.com/GMOD/jbrowse-components/issues/1765
        -->

        <param label="Default region to display" type="text" name="defaultLocation" value="" help="e.g. 'ctgA:1234..5678'"/>

        <param name="ref_name_aliases" type="data" format="tsv,tabular" label="Reference sequence name aliases" help="Use when chromosomes have alternate names (TSV file: first column is the names from your genome sequence, the rest of the columns are aliases." optional="true" />

        <param name="cytobands" type="data" format="bed" label="cytobands data" help="BED file containing cytobands locations" optional="true" />

        <repeat name="track_groups" title="Track Group">
            <param label="Track Category"
                name="category"
                type="text"
                value="Default"
                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." optional="False"/>
            <repeat name="data_tracks" title="Annotation Track">
                <conditional name="data_format" label="Track Options">
                    <param type="select" label="Track Type" name="data_format_select">
                        <option value="gene_calls">GFF/GFF3/BED Features</option>
                        <option value="pileup">BAM Pileups</option>
                        <option value="cram">CRAM</option>
                        <option value="wiggle">BigWig</option>
                        <option value="vcf">VCF SNPs</option>
                        <option value="hic">HiC</option>
                        <option value="maf">MAF</option>
                        <option value="synteny">Synteny</option>
                        <option value="sparql">SPARQL</option>
                        <option value="gc">GC content</option>
                    </param>
                    <when value="gene_calls">
                        <expand macro="input_conditional" label="GFF/GFF3/BED Track Data" format="gff,gff3,bed" />

                        <param label="Index this track" name="index" type="boolean" checked="false" truevalue="true" falsevalue="false" />

                        <expand macro="track_styling_feature"/>
                        <expand macro="details_panel" />
                        <expand macro="track_metadata" />
                        <expand macro="track_visibility" />
                    </when>
                    <when value="pileup">
                        <expand macro="input_conditional" label="BAM Track Data" format="bam" />
                        <expand macro="track_styling_xam"/>
                        <expand macro="track_metadata" />
                        <expand macro="track_visibility" />
                    </when>
                    <when value="cram">
                        <expand macro="input_conditional" label="CRAM Track Data" format="cram" />
                        <expand macro="track_styling_xam"/>
                        <expand macro="track_metadata" />
                        <expand macro="track_visibility" />
                    </when>
                    <when value="wiggle">
                        <expand macro="input_conditional" label="BigWig Track Data" format="bigwig" />
                        <expand macro="track_styling_bigwig"/>
                        <expand macro="track_metadata" />
                        <expand macro="track_visibility" />
                    </when>
                    <when value="vcf">
                        <expand macro="input_conditional" label="SNP Track Data" format="vcf,vcf_bgzip" />
                        <expand macro="track_styling_vcf"/>
                        <expand macro="details_panel" />
                        <expand macro="track_metadata" />
                        <expand macro="track_visibility" />
                    </when>
                    <when value="hic">
                        <expand macro="input_conditional" label="HiC data" format="hic" help="Cool files can be converted to hic format with hictk tool" />
                        <expand macro="track_styling_hic"/>
                        <expand macro="track_metadata" />
                        <expand macro="track_visibility" />
                    </when>
                    <when value="maf">
                        <expand macro="input_conditional_no_remote" label="MAF Track Data" format="maf" />
                        <param name="assembly_name" type="text" label="Assembly name" optional="True" help="As used when creating the MAF file (default: guessed from selected genome assembly)" />
                        <expand macro="track_styling_maf"/>
                        <expand macro="track_metadata" />
                        <expand macro="track_visibility" />
                    </when>
                    <when value="synteny">
                        <expand macro="input_conditional" label="PAF Alignment Data" format="paf" multiple="False" help="Query is current assembly, and target is the next assembly. You should not fill this field on the last assembly." />
                        <expand macro="track_styling_synteny"/>
                        <expand macro="track_metadata" />
                        <expand macro="track_visibility" />
                    </when>
                    <when value="sparql">
                        <!-- Not totally sure it works in real life, probably very rare use case -->
                        <param type="text" label="SPARQL Server URL" name="url" />
                        <param type="text" label="Track Label" name="label" value="SPARQL Genes" />
                        <param type="text" label="SPARQL Query" name="query" area="true">
                            <sanitizer>
                                <mapping initial="galaxy.util.mapped_chars">
                                <add source="&#10;" target=" " />
                                <add source="&gt;" target="__gt__" />
                                <add source="&lt;" target="__lt__" />
                                </mapping>
                                <valid initial="default">
                                <add value="|" />
                                <add value="#" />
                                <add value="{"/>
                                <add value="}"/>
                                <add value="!"/>
                                <add value="?"/>
                                <add value="&amp;"/>
                                <add value="+"/>
                                <add value="="/>
                                <add value="'"/>
                                <add value='"'/>
                                </valid>
                            </sanitizer>
                        </param>
                        <param type="text" label="SPARQL reference names query" help="This query should return a line for each reference name in a `refName` column" name="query_refnames" area="true">
                            <sanitizer>
                                <mapping initial="galaxy.util.mapped_chars">
                                <add source="&#10;" target=" " />
                                <add source="&gt;" target="__gt__" />
                                <add source="&lt;" target="__lt__" />
                                </mapping>
                                <valid initial="default">
                                <add value="|" />
                                <add value="#" />
                                <add value="{"/>
                                <add value="}"/>
                                <add value="!"/>
                                <add value="?"/>
                                <add value="&amp;"/>
                                <add value="+"/>
                                <add value="="/>
                                <add value="'"/>
                                <add value='"'/>
                                </valid>
                            </sanitizer>
                        </param>
                        <expand macro="track_visibility" />
                    </when>

                    <when value="gc">
                        <expand macro="track_styling_gc"/>
                        <expand macro="track_metadata" />
                        <expand macro="track_visibility" />
                    </when>
                </conditional>
            </repeat>
        </repeat>
        </repeat>
        <expand macro="general_options" />
    </inputs>
    <outputs>
        <data format="html" name="output" label="JBrowse2 on $on_string"/>
    </outputs>
    <tests>
        <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">
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="gene_calls" />
                            <conditional name="annotation_cond">
                                <param name="annotation_source" value="history" />
                                <param name="annotation" value="gff3/merlin.gff" />
                            </conditional>
                        </conditional>
                    </repeat>
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="gene_calls"/>
                            <conditional name="annotation_cond">
                                <param name="annotation_source" value="history" />
                                <param name="annotation" value="bed/test-3.bed,bed/test-6.bed"/>
                            </conditional>
                        </conditional>
                    </repeat>
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="pileup" />
                            <conditional name="annotation_cond">
                                <param name="annotation_source" value="history" />
                                <param name="annotation" value="bam/merlin-sample.bam" />
                            </conditional>
                        </conditional>
                    </repeat>
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="wiggle"/>
                            <conditional name="annotation_cond">
                                <param name="annotation_source" value="history" />
                                <param name="annotation" value="bw/data.bw"/>
                            </conditional>
                        </conditional>
                    </repeat>
                </repeat>
                <repeat name="track_groups">
                    <param name="category" value="Second category" />
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="cram" />
                            <conditional name="annotation_cond">
                                <param name="annotation_source" value="history" />
                                <param name="annotation" value="cram/merlin-sample.cram" />
                            </conditional>
                        </conditional>
                    </repeat>
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="wiggle"/>
                            <conditional name="annotation_cond">
                                <param name="annotation_source" value="history" />
                                <param name="annotation" value="bw/data.bw,bw/smaller2.bw"/>
                            </conditional>
                        </conditional>
                    </repeat>
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="vcf" />
                            <conditional name="annotation_cond">
                                <param name="annotation_source" value="history" />
                                <param name="annotation" value="vcf/test.vcf" />
                            </conditional>
                        </conditional>
                    </repeat>
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="hic" />
                            <conditional name="annotation_cond">
                                <param name="annotation_source" value="history" />
                                <param name="annotation" value="hic/merlin.hic" />
                            </conditional>
                        </conditional>
                    </repeat>
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="maf" />
                            <conditional name="annotation_cond">
                                <param name="annotation_source" value="history" />
                                <param name="annotation" value="maf/merlinlastz.maf" />
                            </conditional>
                        </conditional>
                    </repeat>
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="gc" />
                        </conditional>
                    </repeat>
                </repeat>
            </repeat>
            <output name="output">
                <extra_files name="galaxy.xml" type="file" value="out/01_all_tracks/galaxy.xml" compare="sim_size" />
                <extra_files name="config.json" type="file" value="out/01_all_tracks/config.json" compare="sim_size" />
            </output>
        </test>
        <test> <!-- Remote data -->
            <repeat name="assemblies">
                <conditional name="reference_genome">
                    <param name="genome_type_select" value="remote"/>
                    <param name="uri" value="https://jbrowse.org/genomes/hg19/fasta/hg19.fa.gz"/>
                    <param name="label" value="hg19"/>
                </conditional>
                <repeat name="track_groups">
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="wiggle" />
                            <conditional name="annotation_cond">
                                <param name="annotation_source" value="remote" />
                                <param name="uri" value="https://s3.amazonaws.com/jbrowse.org/genomes/hg19/reads_lr_skbr3.fa_ngmlr-0.2.3_mapped.bam.regions.bw" />
                                <param name="label" value="SKBR3 pacbio coverage (NGMLR)" />
                            </conditional>
                        </conditional>
                    </repeat>
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="wiggle" />
                            <conditional name="annotation_cond">
                                <param name="annotation_source" value="remote" />
                                <param name="uri" value="https://s3.amazonaws.com/jbrowse.org/genomes/hg19/reads_lr_skbr3.fa_ngmlr-0.2.3_mapped.bam.regions.bw" />
                                <param name="label" value="SKBR3 pacbio coverage (NGMLR)" />
                            </conditional>
                            <section name="jbstyle">
                                <conditional name="track_style">
                                    <param name="display" value="MultiLinearWiggleDisplay" />
                                </conditional>
                            </section>
                        </conditional>
                    </repeat>
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="pileup" />
                            <conditional name="annotation_cond">
                                <param name="annotation_source" value="remote" />
                                <param name="uri" value="https://s3.amazonaws.com/1000genomes/phase3/data/NA12878/exome_alignment/NA12878.mapped.ILLUMINA.bwa.CEU.exome.20121211.bam" />
                                <param name="label" value="NA12878 Exome" />
                            </conditional>
                        </conditional>
                    </repeat>
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="cram" />
                            <conditional name="annotation_cond">
                                <param name="annotation_source" value="remote" />
                                <param name="uri" value="https://s3.amazonaws.com/jbrowse.org/genomes/hg19/alzheimers_isoseq/hq_isoforms.fasta.cram" />
                                <param name="label" value="hg_isoforms.fasta_cram" />
                            </conditional>
                        </conditional>
                    </repeat>
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="hic" />
                            <conditional name="annotation_cond">
                                <param name="annotation_source" value="remote" />
                                <param name="uri" value="https://jbrowse.org/genomes/hg19/intra_nofrag_30.hic" />
                                <param name="label" value="hg_isoforms.fasta_cram" />
                            </conditional>
                        </conditional>
                    </repeat>
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="vcf" />
                            <conditional name="annotation_cond">
                                <param name="annotation_source" value="remote" />
                                <param name="uri" value="https://ftp.ncbi.nlm.nih.gov/pub/dbVar/data/Homo_sapiens/by_study/vcf/nstd175.GRCh37.variant_call.vcf.gz" />
                                <param name="label" value="HG002 dbVar variant calls" />
                            </conditional>
                        </conditional>
                    </repeat>
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="vcf" />
                            <conditional name="annotation_cond">
                                <param name="annotation_source" value="remote" />
                                <param name="uri" value="https://s3.amazonaws.com/jbrowse.org/genomes/hg19/COLO829/truthset_somaticSVs_COLO829.vcf" />
                                <param name="label" value="truthset_somaticSVs_COLO829" />
                            </conditional>
                        </conditional>
                    </repeat>
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="gene_calls" />
                            <conditional name="annotation_cond">
                                <param name="annotation_source" value="remote" />
                                <param name="uri" value="https://s3.amazonaws.com/jbrowse.org/genomes/hg19/gencode/gencode.v36lift37.annotation.sort.gff3.gz" />
                                <param name="label" value="Gencode v36 (GRCh37 liftover)" />
                            </conditional>
                        </conditional>
                    </repeat>
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="gene_calls" />
                            <conditional name="annotation_cond">
                                <param name="annotation_source" value="remote" />
                                <param name="uri" value="https://s3.amazonaws.com/jbrowse.org/genomes/hg19/mappability/wgEncodeDukeMapabilityRegionsExcludable.bed.gz" />
                                <param name="label" value="wgEncodeDukeMapabilityRegionsExcludable" />
                            </conditional>
                        </conditional>
                    </repeat>
                </repeat>
            </repeat>
            <output name="output">
                <extra_files name="galaxy.xml" type="file" value="out/02_remote/galaxy.xml" compare="sim_size" />
                <extra_files name="config.json" type="file" value="out/02_remote/config.json" compare="sim_size" />
            </output>
        </test>
        <test> <!-- Synteny merlin -->
            <repeat name="assemblies">
                <conditional name="reference_genome">
                    <param name="genome_type_select" value="history"/>
                    <param name="genome" value="merlun.fa"/>
                </conditional>
                <repeat name="track_groups">
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="synteny"/>
                            <conditional name="annotation_cond">
                                <param name="annotation_source" value="history" />
                                <param name="annotation" value="paf/merlun_on_merlon.paf"/>
                            </conditional>
                        </conditional>
                    </repeat>
                </repeat>
            </repeat>
            <repeat name="assemblies">
                <conditional name="reference_genome">
                    <param name="genome_type_select" value="history"/>
                    <param name="genome" value="merlon.fa"/>
                </conditional>
                <repeat name="track_groups">
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="synteny"/>
                            <conditional name="annotation_cond">
                                <param name="annotation_source" value="history" />
                                <param name="annotation" value="paf/merlon_on_merlin.paf"/>
                            </conditional>
                        </conditional>
                    </repeat>
                </repeat>
            </repeat>
            <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">
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="wiggle"/>
                            <conditional name="annotation_cond">
                                <param name="annotation_source" value="history" />
                                <param name="annotation" value="bw/data.bw"/>
                            </conditional>
                        </conditional>
                    </repeat>
                </repeat>
            </repeat>
            <output name="output">
                <extra_files name="galaxy.xml" type="file" value="out/03_synteny/galaxy.xml" compare="sim_size" />
                <extra_files name="config.json" type="file" value="out/03_synteny/config.json" compare="sim_size" />
            </output>
        </test>
        <test> <!-- Synteny with remote genomes -->
            <repeat name="assemblies">
                <conditional name="reference_genome">
                    <param name="genome_type_select" value="remote"/>
                    <param name="uri" value="https://s3.amazonaws.com/jbrowse.org/genomes/peach/Ppersica_298_v2.0.fa.gz"/>
                    <param name="label" value="Peach"/>
                </conditional>
                <repeat name="track_groups">
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="synteny"/>
                            <conditional name="annotation_cond">
                                <param name="annotation_source" value="history" />
                                <param name="annotation" value="paf/peach-grape-map.paf"/>
                            </conditional>
                        </conditional>
                    </repeat>
                </repeat>
            </repeat>
            <repeat name="assemblies">
                <conditional name="reference_genome">
                    <param name="genome_type_select" value="remote"/>
                    <param name="uri" value="https://s3.amazonaws.com/jbrowse.org/genomes/grape/Vvinifera_145_Genoscope.12X.fa.gz"/>
                    <param name="label" value="Grape"/>
                </conditional>
            </repeat>
            <output name="output">
                <extra_files name="galaxy.xml" type="file" value="out/04_synteny_remote/galaxy.xml" compare="sim_size" />
                <extra_files name="config.json" type="file" value="out/04_synteny_remote/config.json" compare="sim_size" />
            </output>
        </test>
        <test> <!-- Synteny with remote genomes *and* paf -->
            <repeat name="assemblies">
                <conditional name="reference_genome">
                    <param name="genome_type_select" value="remote"/>
                    <param name="uri" value="https://s3.amazonaws.com/jbrowse.org/genomes/peach/Ppersica_298_v2.0.fa.gz"/>
                    <param name="label" value="Peach"/>
                </conditional>
                <repeat name="track_groups">
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="synteny"/>
                            <conditional name="annotation_cond">
                                <param name="annotation_source" value="remote" />
                                <param name="uri" value="https://s3.amazonaws.com/jbrowse.org/genomes/synteny/peach_grape.paf.gz" />
                                <param name="label" value="Peach vs grape" />
                            </conditional>
                        </conditional>
                    </repeat>
                </repeat>
            </repeat>
            <repeat name="assemblies">
                <conditional name="reference_genome">
                    <param name="genome_type_select" value="remote"/>
                    <param name="uri" value="https://s3.amazonaws.com/jbrowse.org/genomes/grape/Vvinifera_145_Genoscope.12X.fa.gz"/>
                    <param name="label" value="Grape"/>
                </conditional>
            </repeat>
            <output name="output">
                <extra_files name="galaxy.xml" type="file" value="out/05_synteny_full_remote/galaxy.xml" compare="sim_size" />
                <extra_files name="config.json" type="file" value="out/05_synteny_full_remote/config.json" compare="sim_size" />
            </output>
        </test>
        <test> <!-- various options,  cytobands, ref name aliases -->
            <repeat name="assemblies">
                <conditional name="reference_genome">
                    <param name="genome_type_select" value="history"/>
                    <param name="genome" value="merlin.fa"/>
                </conditional>
                <param name="ref_name_aliases" value="aliases.tsv"/>
                <param name="cytobands" value="cytobands.bed"/>
                <param name="defaultLocation" value="Merlin:1000..2000"/>
                <repeat name="track_groups">
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="gene_calls" />
                            <conditional name="annotation_cond">
                                <param name="annotation_source" value="history" />
                                <param name="annotation" value="gff3/merlin.gff" />
                            </conditional>
                            <param name="index" value="true" />
                            <section name="jbstyle">
                                <conditional name="track_style">
                                    <param name="display" value="LinearBasicDisplay" />
                                    <param name="display_mode" value="reducedRepresentation" />
                                    <param name="labels_name" value="jexl:get(feature,'id')" />
                                </conditional>
                            </section>
                            <section name="metadata">
                                <param name="galaxy_metadata" value="false" />
                                <param name="metadata_bonus" value="metadata.tsv" />
                            </section>
                            <section name="formatdetails">
                                <param name="formatdetails_feature" value="jexl:{newfield:'Top custom contents here: '+feature.name}"/>
                                <param name="formatdetails_subfeature" value="jexl:{newfield:'Sub custom contents here: '+feature.name}"/>
                                <param name="formatdetails_depth" value="2"/>
                            </section>
                        </conditional>
                    </repeat>
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="gene_calls" />
                            <conditional name="annotation_cond">
                                <param name="annotation_source" value="history" />
                                <param name="annotation" value="gff3/1.gff" />
                            </conditional>
                            <param name="index" value="true" />
                            <section name="jbstyle">
                                <conditional name="track_style">
                                    <param name="display" value="LinearArcDisplay" />
                                    <param name="display_mode" value="semicircles" />
                                </conditional>
                            </section>
                            <param name="track_visibility" value="default_off" />
                        </conditional>
                    </repeat>
                </repeat>
            </repeat>
            <section name="jbgen">
                <param name="enableAnalytics" value="true" />
                <param name="primary_color" value="#9d233f"/>
                <param name="secondary_color" value="#421e63"/>
                <param name="tertiary_color" value="#935560"/>
                <param name="quaternary_color" value="#9fb11d"/>
                <param name="font_size" value="15" />
            </section>
            <output name="output">
                <extra_files name="galaxy.xml" type="file" value="out/06_various_options/galaxy.xml" compare="sim_size" />
                <extra_files name="config.json" type="file" value="out/06_various_options/config.json" compare="sim_size" />
            </output>
        </test>
        <test> <!-- Synteny, mixed basic / viewer -->
            <repeat name="assemblies">
                <conditional name="reference_genome">
                    <param name="genome_type_select" value="history"/>
                    <param name="genome" value="merlun.fa"/>
                </conditional>
                <repeat name="track_groups">
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="synteny"/>
                            <conditional name="annotation_cond">
                                <param name="annotation_source" value="history" />
                                <param name="annotation" value="paf/merlun_on_merlon.paf"/>
                            </conditional>
                        </conditional>
                    </repeat>
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="synteny"/>
                            <conditional name="annotation_cond">
                                <param name="annotation_source" value="history" />
                                <param name="annotation" value="paf/merlun_on_merlon.paf"/>
                            </conditional>
                            <section name="jbstyle">
                                <conditional name="track_style">
                                    <param name="display" value="LinearBasicDisplay" />
                                </conditional>
                            </section>
                        </conditional>
                    </repeat>
                </repeat>
            </repeat>
            <repeat name="assemblies">
                <conditional name="reference_genome">
                    <param name="genome_type_select" value="history"/>
                    <param name="genome" value="merlon.fa"/>
                </conditional>
                <repeat name="track_groups">
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="synteny"/>
                            <conditional name="annotation_cond">
                                <param name="annotation_source" value="history" />
                                <param name="annotation" value="paf/merlon_on_merlin.paf"/>
                            </conditional>
                        </conditional>
                    </repeat>
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="synteny"/>
                            <conditional name="annotation_cond">
                                <param name="annotation_source" value="history" />
                                <param name="annotation" value="paf/merlon_on_merlin.paf"/>
                            </conditional>
                            <section name="jbstyle">
                                <conditional name="track_style">
                                    <param name="display" value="LinearBasicDisplay" />
                                </conditional>
                            </section>
                        </conditional>
                    </repeat>
                </repeat>
            </repeat>
            <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">
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="wiggle"/>
                            <conditional name="annotation_cond">
                                <param name="annotation_source" value="history" />
                                <param name="annotation" value="bw/data.bw"/>
                            </conditional>
                        </conditional>
                    </repeat>
                </repeat>
            </repeat>
            <output name="output">
                <extra_files name="galaxy.xml" type="file" value="out/07_synteny_mixed/galaxy.xml" compare="sim_size" />
                <extra_files name="config.json" type="file" value="out/07_synteny_mixed/config.json" compare="sim_size" />
            </output>
        </test>
    </tests>
    <help format="markdown"><![CDATA[
# JBrowse2

JBrowse2 (or simply JBrowse) is a fast, embeddable genome browser built completely with
JavaScript and HTML5.

The JBrowse2 Galaxy tool was written to help build complex
JBrowse installations straight from Galaxy, taking advantage of the
latest Galaxy features such as dataset collections and sections.
It allows you to build up a JBrowse instance without worrying
about how to run the command line tools to format your data, and which
options need to be supplied and where.

With this tool, you can easily generate a standalone JBrowse browser,
that you can download, share with collaborators or even publish publicly.
You can even deposit it as an archive on data repositories for long term
archival and reuse.

## Options

### Action

The default action of this tool is to create a new JBrowse dataset from scratch.
However, you have the possibility to add new data (genomes and tracks) to a JBrowse2
dataset previously generated with the same tool. Note however that mixing synteny and
non-synteny dataset can give unwanted results.

### Genome assemblies

In JBrowse2 you can as many genome assemblies as needed, each one having its specific
set of tracks.

To add an assembly, you will need to input its sequence, either from a FASTA file in your history
or from a genome pre-installed by your server administrators.

### Track Groups

Track groups represent a set of tracks in a single category. These
can be used to let your users understand relationships between large
groups of tracks.

### Annotation Tracks

Within Track Groups, you have one or more **Annotation Tracks**. Each
Annotation Track is a dataset, or a group of datasets which have similar styling.
This allows you to rapidly build up JBrowse instances without having to
configure tracks individually. For example, if you have five different GFF3 files from
various gene callers that you wish to display, you can take advantage of
this feature to style all of them similarly.

For each track, or group of tracks, you will need to select the corresponding data type
(GFF, BED, VCF, BAM, CRAM, ...) and the corresponding input files. Depending on the selected
track type, you will get access to advanced configuration sections where you will be able to
change the styling of the track. Please consult the [JBrowse2 documentation](https://jbrowse.org/jb2/docs/)
for more details on all the possibilities. These options will only change the default styling
of your JBrowse dataset: when visualising it, you will be able to use the JBrowse menus to switch to different
styling.

When clicking on features in JBrowse (like genes from a GFF), JBrowse opens a panel with detailed
information about this feature. This panel can also be customized directly from this Galaxy tool, by
adding new fields, or modifying/removing existing ones.

On different type of tracks, you also have the possiblity to customize metadata associated to tracks.
Metadata is used by JBrowse to easily sort track in its Faceted Track Selector.

## Special data

### Synteny

JBrowse2 allows to display synteny relationships between different genomes. To use it with this tool,
generate alignement data between your different genomes (with minimap2 for example), then add the different genomes
one by one, and a synteny track to the each genome corresponding to alignements to the
next one.

For example, say you have 3 genomes : A, B and C
- align genome B on genome A, and genome C on genome B
- add genome C, B, and A in the Galaxy tool
- add a synteny track on genome C where you input the alignement against genome B
- add a synteny track on genome B where you input the alignement against genome A

Multiway synteny representation is not yet possible.

### Remote data sources

We have made the choice to allow selecting data from remote sources (HTTP) instead of datasets from your history.
Please be **very careful** when using this feature: by using it, your dataset will no longer be standalone, it will
depend on the existence of the remote data. If for any reason the remote server administrator decides to remove or change
the access rights to the corresponding file, your JBrowse dataset will become unusable.

Using remote data sources can be useful when using this tool for specific projects with associated reliable data
repositories, but for most other use cases, selecting datasets from history is much more recommended.
]]></help>
    <expand macro="citations"/>
</tool>