view jbrowse2.xml @ 125:49f3d3878413 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 5ea1f9c1eef1de76232e69aa6d34cda77d90d566
author fubar
date Sat, 05 Oct 2024 23:58:05 +0000
parents 137e08517410
children fbabf7498471
line wrap: on
line source

<tool id="jbrowse2" name="JBrowse2" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="22.05">
    <description>genome browser</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="edamInc"/>
    <xrefs>
        <xref type="bio.tools">jbrowse_2</xref>
    </xrefs>
    <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_webserver.py"/>
        <include path="jbrowse2.py"/>
        <include path="maf2bed.py"/>
        <include path="bedscoreplugin.js"/>
    </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=\$(realpath \$(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]'
                #for $ref in $refs:
                    --pafreferencemeta '$ref'
                #end for
            #end if
        #else if $autoCollection[$key].ext == 'fasta':
            --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'
        #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'
        #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'
    #else
      cp '$output.files_path/index.html' '$output'
    #end if
#else:
    python '$__tool_directory__/jbrowse2.py'
    --jbrowse2path \${JBROWSE2_PATH}
    --outdir '$output.files_path'
    --xml '$trackxml' &&
    #if $jbgen.zipOut == "true":
        cd '$output.files_path' &&
        zip -r - . > '$output'
    #else
        cp '$output.files_path/index.html' '$output'
    #end if
#end if
  ]]></command>
    <configfiles>
        <configfile name="trackxml"><![CDATA[<?xml version="1.0"?>
<root>
    <metadata>
        <general>
            <defaultLocation>${jbgen.defaultLocation}</defaultLocation>
            <zipOut>${jbgen.zipOut}</zipOut>
            <bpPerPx>${jbgen.bpPerPx}</bpPerPx>
            <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>
            <session_name>${jbgen.session_name}</session_name>
        </general>
        <galaxyUrl>${__app__.config.galaxy_infrastructure_url}</galaxyUrl>
    </metadata>
#if $jbgen.ucol.formcoll=="form":
    #for $assembly in $assemblies:
    <assembly>
        <metadata>
            <genomes>
                #if str($assembly.reference_genome.genome_type_select) == "uri":
                  <genome path="${assembly.reference_genome.uri}" label="${assembly.reference_genome.refname}" useuri="yes">
                      <metadata>
                         <dataset
                          dname = "${assembly.reference_genome.refname}" />
                  </metadata>
                  </genome>
                #else if str($assembly.reference_genome.genome_type_select) == "indexed":
                  <genome path="${assembly.reference_genome.genome.fields.path}" label="${assembly.reference_genome.genome.fields.dbkey}" useuri="no">
                      <metadata>
                         <dataset
                          dname = "${assembly.reference_genome.genome.fields.name}" />
                      </metadata>
                  </genome>
                #else
                  <genome path="$assembly.reference_genome.genome" label="${assembly.reference_genome.genome.element_identifier}" useuri="no">
                    <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.name}"
                          />
                      <history
                          #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
                          id="${__app__.security.encode_id($assembly.reference_genome.genome.history_id)}"
                          />
                      <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>
                  </genome>
                #end if
            </genomes>
    </metadata>
    <tracks>
        #for $tg in $assembly.track_groups:
            #for $track in $tg.data_tracks:
                #set input_exists = "False"
                #if $track.data_format.useuri.insource == "uri":
                    #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>
                                 <trackFile path="${track.data_format.useuri.annouri}" ext="${track.data_format.data_format_select}"
                                    label="${track.data_format.useuri.annoname}" useuri="yes">
                                    <metadata>
                                    <dataset id = "${track.data_format.useuri.annouri}" />
                                    </metadata>
                                 </trackFile>
                            </files>
                    #end if
                #else if $track.data_format.useuri.insource == "history":
                    #if $track.data_format.useuri.annotation:
                        #set input_exists = "True"
                    <track cat="${tg.category}" format="${track.data_format.data_format_select}" visibility="${track.data_format.track_visibility}">
                    <files>
                        #for $dataset in $track.data_format.useuri.annotation:
                              <trackFile path="${dataset}" ext="${dataset.ext}" label="${dataset.element_identifier}" 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}"
                                      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):
                                        #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="${dataset.creating_job.tool_id}"
                                      tool_version="${dataset.creating_job.tool_version}"
                                      />
                                </metadata>
                              </trackFile>
                       #end for
                    </files>
                    #end if
                #end if
                #if $input_exists == "True":
                      <options>
                        <style>
                            #if str($track.data_format.data_format_select) in ["gff", "bed", "maf", "blastxml"]:
                                <type>${track.data_format.jbstyle.display}</type>
                                #if str($track.data_format.jbstyle.display) in ["LinearBasicDisplay", "LinearVariantDisplay"]:
                                    <trackShowLabels>${track.data_format.jbstyle.show_labels}</trackShowLabels>
                                    <trackShowDescriptions>${track.data_format.jbstyle.show_descriptions}</trackShowDescriptions>
                                #end if
                            #else if str($track.data_format.data_format_select) == "vcf":
                                <type>${track.data_format.jbstyle.track_style.display}</type>
                                #if str($track.data_format.jbstyle.track_style.display) in ["LinearBasicDisplay", "LinearVariantDisplay"]:
                                    <trackShowLabels>${track.data_format.jbstyle.track_style.show_labels}</trackShowLabels>
                                    <trackShowDescriptions>${track.data_format.jbstyle.track_style.show_descriptions}</trackShowDescriptions>
                                #end if
                            #else if str($track.data_format.data_format_select) == "bigwig":
                                <type>${track.data_format.jbstyle.track_style.display}</type>
                                <color>${track.data_format.jbstyle.track_style.color}</color>
                                <autoscale>${track.data_format.jbstyle.track_style.autoscale}</autoscale>
                                <resolution>${track.data_format.jbstyle.track_style.resolution}</resolution>
                                <summaryScoreMode>${track.data_format.jbstyle.track_style.summaryScoreMode}</summaryScoreMode>
                                <filled>${track.data_format.jbstyle.track_style.filled}</filled>
                                <scaleType>${track.data_format.jbstyle.track_style.scaleType}</scaleType>
                                <displayCrossHatches>${track.data_format.jbstyle.track_style.displayCrossHatches}</displayCrossHatches>
                                <minScore>${track.data_format.jbstyle.track_style.minScore}</minScore>
                                <maxScore>${track.data_format.jbstyle.track_style.maxScore}</maxScore>
                            #end if
                            #if str($track.data_format.data_format_select) in ["bam", "cram"]:
                                <type>LinearAlignmentsDisplay</type>
                            #end if
                            #if str($track.data_format.data_format_select) in ["hic", "cool", "mcool", "scool"]:
                                <type>LinearHicDisplay</type>
                            #end if
                        </style>
                        #if str($track.data_format.data_format_select) == "bam":
                            <bam>
                            <bam_index>
                                #for $dataset in $track.data_format.useuri.annotation:
                                    ${dataset} ~ ${dataset.metadata.bam_index},
                                #end for
                            </bam_index>
                            </bam>
                        #else if str($track.data_format.data_format_select) == "cram":
                            <cram>
                            <cram_index>
                                #for $dataset in $track.data_format.useuri.annotation:
                                    ${dataset} ~ ${dataset.metadata.cram_index},
                                #end for
                            </cram_index>
                            </cram>
                        #else if str($track.data_format.data_format_select) == "blastxml":
                            <blast>
                              #if str($track.data_format.blast_parent) != "":
                                <parent>${track.data_format.blast_parent}</parent>
                              #end if
                                <protein>${track.data_format.is_protein}</protein>
                                <min_gap>${track.data_format.min_gap}</min_gap>
                            </blast>
                        #else if str($track.data_format.data_format_select) == "gff":
                            <gff>
                              #if $track.data_format.match_part.match_part_select == "true":
                                <match>${track.data_format.match_part.name}</match>
                              #end if
                            </gff>
                        #else if str($track.data_format.data_format_select) == "paf":
                            <paf>
                                #if str($track.data_format.pafuseuri.insource) == "history":
                                <genome>
                                    #for $anno in $track.data_format.pafuseuri.annotation:
                                        ${anno} ~ ${anno.name},
                                    #end for
                                </genome>
                                <useuri>
                                    false
                                </useuri>
                                #else:
                                <genome>
                                    #for $refgenome in $track.data_format.pafuseuri.refuri:
                                        ${refgenome.annotation} ~ ${refgenome.annoname},
                                    #end for
                                </genome>
                                <useuri>
                                    true
                                </useuri>
                                #end if
                            </paf>
                        #else if str($track.data_format.data_format_select) == "hic":
                            <hic>
                            </hic>
                        #else if str($track.data_format.data_format_select) == "cool":
                            <cool>
                            </cool>
                        #else if str($track.data_format.data_format_select) == "bed":
                            <bed>
                                <usebedscore>${track.data_format.jbstyle.usebedscore}</usebedscore>
                            </bed>
                        #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>
                        #end if
                        </options>
                  </track>
                  #end if
            #end for
        #end for
    </tracks>
    </assembly>
    #end for
#end if
</root>
]]></configfile>
    </configfiles>
    <inputs>
        <repeat name="assemblies" min="1" title="Genome for a set of tracks" help="Tracks will display on this genome coordinates so must all match. Multiple genomes with their own sets of tracks can be added">
            <conditional name="reference_genome">
                <param name="genome_type_select" type="select" label="Reference genome source" help="Select a built in, history or remote tabix URI for the reference track">
                    <option selected="True" value="indexed">Use a Galaxy server built-in genome</option>
                    <option value="history">Use a genome fasta file from the current history</option>
                    <option value="uri">Provide a URI (e.g. "https://..." for a genome reference as
                        tabix bgzip with predictable index file URI</option>
                </param>
                <when value="indexed">
                    <param name="genome" type="select" optional="false" 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"/>
                        </options>
                    </param>
                </when>
                <when value="history">
                    <param name="genome" type="data" format="fasta" optional="false" label="Select the reference genome"/>
                </when>
                <when value="uri">
                    <param name="uri" type="text" label="URI pointing to tabix compressed fasta - must always be on-line" 
                        help="Warning: Requires an internet connection to view. If this URI is not available for any reason, the track will show an error. Saves disk storage">
                    </param>
                    <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."/>
                <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 converting to BED/bigWig 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. Recommend converting to BED/bigWig unless mapping annotation needed</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 - Pairwise 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="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"/>
                            <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="track_visibility"/>
                        </when>
                        <when value="gff">
                            <expand macro="input_conditional" label="GFF/GFF3 Track Data" format="gff,gff3"/>
                            <conditional name="match_part" label="match/match_part data">
                                <param name="match_part_select" type="select" label="This is match/match_part data" help="Match part data selection ">
                                    <option selected="True" value="false">Not match/match part data</option>
                                    <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)."/>
                                </when>
                                <when value="false"/>
                            </conditional>
                            <expand macro="track_styling_vgp"/>
                            <expand macro="track_visibility"/>
                        </when>
                        <when value="bam">
                            <expand macro="input_conditional" label="BAM Track Data" format="bam"/>
                            <expand macro="track_visibility"/>
                        </when>
                        <when value="bed">
                            <expand macro="input_conditional" label="BED Track Data" format="bed"/>
                            <expand macro="track_styling_vgp"/>
                            <expand macro="track_visibility"/>
                        </when>
                        <when value="cram">
                            <expand macro="input_conditional" label="CRAM Track Data" format="cram"/>
                            <expand macro="track_visibility"/>
                        </when>
                        <when value="maf">
                            <expand macro="input_conditional" label="MAF Track Data" format="maf"/>
                            <expand macro="track_styling_vgp"/>
                            <expand macro="track_visibility"/>
                        </when>
                        <when value="bigwig">
                            <expand macro="input_conditional" label="BigWig Track Data" format="bigwig"/>
                            <expand macro="track_visibility"/>
                            <expand macro="track_styling_bigwig"/>                            
                        </when>
                        <when value="paf">
                            <expand macro="input_conditional" label="PAF format synteny mapping data" format="paf" help="PAF made with mashmap or minimap2 mapping the real reference as a query on the comparison genomes as references"/>
                            <expand macro="pafref_conditional" label="Comparison genome sequence(s)" format="fasta" help="Paf from these as the reference(s), using the common reference as the reads to map"/>
                            <expand macro="track_visibility"/>
                        </when>
                        <when value="hic">
                            <expand macro="input_conditional" label="Binary Juicebox HiC data" format="hic,juicebox_hic"/>
                            <expand macro="track_visibility"/>
                        </when>
                        <when value="cool">
                            <expand macro="input_conditional" label="HiC data in cool/mcool/scool format" format="cool,mcool,scool"/>
                            <expand macro="track_visibility"/>
                        </when>
                    </conditional>
                </repeat>
            </repeat>
        </repeat>
        <expand macro="general_options"/>
    </inputs>
    <outputs>
        <data format="html" name="output" label="JBrowse2: ${jbgen.session_name}">
            <change_format>
                <when input="zipOut" value="true" format="zip"/>
            </change_format>
        </data>
    </outputs>
    <tests>
        <test>
            <repeat name="assemblies">
                <conditional name="reference_genome">
                    <param name="genome_type_select" value="history"/>
                    <param name="genome" location="https://usegalaxy.eu/static/share/ebp/jbrowse2/test-data/Merlin"/>
                    <param name="genome.ext" value="fasta"/>
                </conditional>
                <repeat name="track_groups">
                    <param name="category" value="Assembly properties"/>
                    <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" location="https://usegalaxy.eu/static/share/ebp/jbrowse2/test-data/merlin.gff3"/>
                            </conditional>
                        </conditional>
                    </repeat>
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="bigwig"/>
                            <conditional name="useuri">
                                <param name="insource" value="history"/>
                                <param name="annotation" location="https://usegalaxy.eu/static/share/ebp/jbrowse2/test-data/merlin.bw"/>
                            </conditional>
                        </conditional>
                    </repeat>
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="bed"/>
                            <conditional name="useuri">
                                <param name="insource" value="history"/>
                                <param name="annotation" location="https://usegalaxy.eu/static/share/ebp/jbrowse2/test-data/test-6.bed"/>
                            </conditional>
                        </conditional>
                    </repeat>
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="vcf"/>
                            <conditional name="useuri">
                                <param name="insource" value="history"/>
                                <param name="annotation" location="https://usegalaxy.eu/static/share/ebp/jbrowse2/test-data/merlin.vcf"/>
                            </conditional>
                        </conditional>
                    </repeat>
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="cram"/>
                            <conditional name="useuri">
                                <param name="insource" value="history"/>
                                <param name="annotation" location="https://usegalaxy.eu/static/share/ebp/jbrowse2/test-data/merlin.cram"/>
                            </conditional>
                        </conditional>
                    </repeat>
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="bam"/>
                            <conditional name="useuri">
                                <param name="insource" value="history"/>
                                <param name="annotation" location="https://usegalaxy.eu/static/share/ebp/jbrowse2/test-data/merlin-sample.bam"/>
                            </conditional>
                        </conditional>
                    </repeat>
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="maf"/>
                            <conditional name="useuri">
                                <param name="insource" value="history"/>
                                <param name="annotation" location="https://usegalaxy.eu/static/share/ebp/jbrowse2/test-data/merlinlastz.maf"/>
                            </conditional>
                        </conditional>
                    </repeat>
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="blastxml"/>
                            <conditional name="useuri">
                                <param name="insource" value="history"/>
                                <param name="annotation" location="https://usegalaxy.eu/static/share/ebp/jbrowse2/test-data/merlin.blastxml"/>
                            </conditional>
                        </conditional>
                    </repeat>
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="bam"/>
                            <conditional name="useuri">
                                <param name="insource" value="history"/>
                                <param name="annotation" value=""/>
                            </conditional>
                        </conditional>
                    </repeat>
                </repeat>
            </repeat>
            <repeat name="assemblies">
                <conditional name="reference_genome">
                    <param name="genome_type_select" value="history"/>
                    <param name="genome" location="https://usegalaxy.eu/static/share/ebp/jbrowse2/test-data/dm3.fa"/>
                    <param name="genome.ext" value="fasta"/>
                </conditional>
                <repeat name="track_groups">
                    <param name="category" value="Assembly properties"/>
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="cool"/>
                            <conditional name="useuri">
                                <param name="insource" value="history"/>
                                <param name="annotation" location="https://usegalaxy.eu/static/share/ebp/jbrowse2/test-data/dm3test.cool"/>
                            </conditional>
                        </conditional>
                    </repeat>
                </repeat>
            </repeat>
            <repeat name="assemblies">
                <conditional name="reference_genome">
                    <param name="genome_type_select" value="history"/>
                    <param name="genome" location="https://usegalaxy.eu/static/share/ebp/jbrowse2/test-data/Ppersica1.fa"/>
                    <param name="genome.ext" value="fasta"/>
                </conditional>
                <repeat name="track_groups">
                    <param name="category" value="Assembly properties"/>
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="paf"/>
                            <conditional name="useuri">
                                <param name="insource" value="history"/>
                                <param name="annotation" location="https://usegalaxy.eu/static/share/ebp/jbrowse2/test-data/peach-grape-map.paf"/>
                            </conditional>
                            <conditional name="pafuseuri">
                                <param name="insource" value="history"/>
                                <param name="annotation" location="https://usegalaxy.eu/static/share/ebp/jbrowse2/test-data/Vvinifera1.fa"/>
                            </conditional>
                        </conditional>
                    </repeat>
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="paf"/>
                            <conditional name="useuri">
                                <param name="insource" value="history"/>
                                <param name="annotation" location="https://usegalaxy.eu/static/share/ebp/jbrowse2/test-data/arabgrapepeach.paf"/>
                            </conditional>
                            <conditional name="pafuseuri">
                                <param name="insource" value="uri"/>
                                <repeat name="refuri">
                                    <param name="annotation" value="https://usegalaxy.eu/static/share/ebp/jbrowse2/test-data/arabidopsis.fa.gz"/>
                                    <param name="annoname" value="arabidopsis.URI"/>
                                </repeat>
                                <repeat name="refuri">
                                    <param name="annotation" value="https://usegalaxy.eu/static/share/ebp/jbrowse2/test-data/Vvinifera1.fa.gz"/>
                                    <param name="annoname" value="Vvinifera1.URI"/>
                                </repeat>
                            </conditional>
                        </conditional>
                    </repeat>
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="paf"/>
                            <conditional name="useuri">
                                <param name="insource" value="history"/>
                                <param name="annotation" location="https://usegalaxy.eu/static/share/ebp/jbrowse2/test-data/arabgrapepeach.paf"/>
                            </conditional>
                            <conditional name="pafuseuri">
                                <param name="insource" value="history"/>
                                <param name="annotation" location="https://usegalaxy.eu/static/share/ebp/jbrowse2/test-data/arabidopsis.fa"/>
                                <param name="annotation" location="https://usegalaxy.eu/static/share/ebp/jbrowse2/test-data/Vvinifera1.fa"/>
                            </conditional>
                        </conditional>
                    </repeat>
                </repeat>
            </repeat>
            <repeat name="assemblies">
                <conditional name="reference_genome">
                    <param name="genome_type_select" value="uri"/>
                    <param name="uri" value="https://s3.amazonaws.com/jbrowse.org/genomes/GRCh38/fasta/GRCh38.fa.gz"/>
                    <param name="refname" value="hg38"/>
                </conditional>
                <repeat name="track_groups">
                    <param name="category" value="Assembly properties"/>
                    <repeat name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="hic"/>
                            <conditional name="useuri">
                                <param name="insource" value="uri"/>
                                <param name="annouri" value="https://s3.amazonaws.com/igv.broadinstitute.org/data/hic/intra_nofrag_30.hic"/>
                                <param name="annoname" value="humanhic"/>
                            </conditional>
                        </conditional>
                    </repeat>
                </repeat>
            </repeat>
            <section name="jbgen">
                <param name="zipOut" value="true"/>
                <param name="session_name" value="New test session"/>
            </section>
            <output name="output" ftype="zip">
                <assert_contents>
                    <has_archive_member path=".*" n="678" delta="10"/>
                    <has_archive_member path="index.html"/>
                    <has_archive_member path="manifest.json">
                        <has_text text="favicon.ico"/>
                        <has_text text="background_color"/>
                    </has_archive_member>
                    <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 test session"/>
                    </has_archive_member>
                    <has_archive_member path="merlin.gff3_0.gz"/>
                    <has_archive_member path="merlin.gff3_0.gz.tbi"/>
                    <has_archive_member path="merlin.bw_1"/>
                    <has_archive_member path="test-6.bed_2.gz"/>
                    <has_archive_member path="merlin.vcf_3"/>
                    <has_archive_member path="merlin.vcf_3.tbi"/>
                    <has_archive_member path="merlin.cram_4"/>
                    <has_archive_member path="merlin.cram_4.crai"/>
                    <has_archive_member path="merlin-sample.bam_5"/>
                    <has_archive_member path="merlin-sample.bam_5.bai"/>
                    <has_archive_member path="merlinlastz.maf_6.sorted.bed.gz.tbi"/>
                    <has_archive_member path="merlin.blastxml_7.gz"/>
                    <has_archive_member path="dm3test.cool_9.hic"/>
                    <has_archive_member path="peach-grape-map.paf_10"/>
                    <has_archive_member path="arabgrapepeach.paf_11"/>
                    <has_archive_member path="Merlin.fa.gz.fai"/>
                    <has_archive_member path="dm3.fa.fa.gz.fai"/>
                    <has_archive_member path="Ppersica1.fa.fa.gz"/>
                    <has_archive_member path="Ppersica1.fa.fa.gz.fai"/>
                    <has_archive_member path="Ppersica1.fa.fa.gz.gzi"/>
                    <has_archive_member path="Vvinifera1.fa.fa.gz.fai"/>
                    <has_archive_member path="Vvinifera1.fa.fa.gz"/>
                    <has_archive_member path="Vvinifera1.fa.fa.gz.gzi"/>
                    <has_archive_member path="config.json">
                        <has_json_property_with_text property="name" text="Merlin"/>
                    </has_archive_member>
                </assert_contents>
            </output>
        </test>
        <test>
            <param name="autoCollection">
                <collection type="list" name="merlintest">
                    <element name="merlin.fa" value="merlin.fa"/>
                    <element name="merlin.bw" value="bw/merlin.bw"/>
                    <element name="test-6.bed" value="bed/test-6.bed"/>
                </collection>
            </param>
            <section name="jbgen">
                <param name="zipOut" value="true"/>
                <param name="session_name" value="Collection test"/>
                <param name="ucol|formcoll" value="collect"/>
            </section>
            <output name="output" ftype="zip">
                <assert_contents>
                    <has_archive_member path=".*" n="652" delta="10"/>
                    <has_archive_member path="index.html"/>
                    <has_archive_member path="manifest.json">
                        <has_text text="favicon.ico"/>
                        <has_text text="background_color"/>
                    </has_archive_member>
                    <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="Collection test"/>
                    </has_archive_member>
                    <has_archive_member path="jb2_webserver.py"/>
                    <has_archive_member path="merlin.fa.fa.gz.gzi"/>
                    <has_archive_member path="merlin.fa.fa.gz"/>
                    <has_archive_member path="merlin.fa.fa.gz.fai"/>
                    <has_archive_member path="merlin.bw"/>
                    <has_archive_member path="index.html"/>
                    <has_archive_member path="test-6.bed.gz"/>
                    <has_archive_member path="test-6.bed.gz.tbi"/>
                </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="bigwig"/>
                            <conditional name="useuri">
                                <param name="annotation" value="bw/merlin.bw"/>
                                <param name="insource" value="history"/>
                            </conditional>
                        </conditional>
                    </repeat>
                </repeat>
            </repeat>
            <section name="jbgen">
                <param name="zipOut" value="true"/>
            </section>
            <output name="output">
                <assert_contents>
                    <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>
        <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="vcf"/>
                            <conditional name="useuri">
                                <param name="insource" value="history"/>
                                <param name="annotation" value="vcf/merlin.vcf"/>
                            </conditional>
                        </conditional>
                    </repeat>
                </repeat>
            </repeat>
            <section name="jbgen">
                <param name="zipOut" value="true"/>
            </section>
            <output name="output">
                <assert_contents>
                    <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>
        <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>
            <section name="jbgen">
                <param name="zipOut" value="true"/>
            </section>
            <output name="output">
                <assert_contents>
                    <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>
        <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="vcf"/>
                            <conditional name="useuri">
                                <param name="insource" value="history"/>
                                <param name="annotation" value="vcf/merlin.vcf"/>
                            </conditional>
                        </conditional>
                    </repeat>
                </repeat>
            </repeat>
            <section name="jbgen">
                <param name="zipOut" value="true"/>
            </section>
            <output name="output">
                <assert_contents>
                    <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>
        <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="insource" value="history"/>
                                <param name="annotation" value="gff3/A.gff"/>
                            </conditional>
                        </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>
                    </repeat>
                </repeat>
                <repeat name="track_groups">
                    <param name="category" value="Ignore Scale"/>
                    <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/1.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="none"/>
                                    <conditional name="color">
                                        <param name="color_select" value="manual"/>
                                        <param name="style_color" value="#ff00ff"/>
                                    </conditional>
                                </conditional>
                            </section>
                        </conditional>
                    </repeat>
                </repeat>
                <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"/>
                                        </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"/>
                            </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>
                            </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"/>
                            </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>
                            </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="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>
                            </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"/>
                            </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 name="data_tracks">
                        <conditional name="data_format">
                            <param name="data_format_select" value="gff"/>
                            <conditional name="useuri">
                                <param name="annotation" value="gff3/2.gff"/>
                                <param name="insource" value="history"/>
                            </conditional>
                            <conditional name="match_part">
                                <param name="match_part_select" value="true"/>
                                <param name="name" value="cDNA_match"/>
                            </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>
            <section name="jbgen">
                <param name="zipOut" value="true"/>
            </section>
            <output name="output">
                <assert_contents>
                    <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>
        <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>
                    <has_archive_member path=".*" n="649" delta="30"/>
                    <has_archive_member path="index.html"/>
                    <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> 
        <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="bigwig"/>
                            <conditional name="useuri">
                                <param name="annotation" value="bw/m:e.r.l .i-n.bw"/>
                                <param name="insource" value="history"/>
                            </conditional>
                        </conditional>
                    </repeat>
                </repeat>
            </repeat>
            <section name="jbgen">
                <param name="zipOut" value="true"/>
            </section>
            <output name="output">
                <assert_contents>
                    <has_archive_member path="config.json">
                        <has_text text="QuantitativeTrack"/>
                        <has_text text="trackId"/>
                        <has_text text="me.r.l.i-n.bw_0"/>
                        <has_text text="name"/>
                        <has_text text="Default"/>
                        <has_text text="name"/>
                        <has_text text="assemblyName"/>
                        <has_text text="merlin.fa"/>
                    </has_archive_member>
                </assert_contents>
            </output>
        </test>
    </tests>
    <help><![CDATA[

JBrowse2-in-Galaxy
==================

JBrowse2-in-Galaxy offers a highly configurable, workflow-compatible Genome viewer.


Use and local viewing
=====================

Browser tracks need a coordinate system, based on the reference genome, so that must be chosen before adding groups of tracks.

Many Galaxy datatypes can be turned into a track for display - in all cases, the selected reference genome must have been 
used to generate the data:

::

    bam
    bed
    bigwig
    blastxml
    cram
    gff3
    hic
    maf
    paf
    vcf

Note that cram and bam will be large, so very slow amd are only recommended if you need the cigar annotation. Otherwise conversion to bed is recommended to slim them down. 
Unfortunately if you have millions of rows in a bed, it will also be very slow - in which case a bigwig is recommended. 

A JBrowse2 history item can be opened by viewing it (the "eye" icon).

Overview
--------

JBrowse is a fast, embeddable genome browser built completely with
JavaScript and HTML5.

The JBrowse-in-Galaxy (JiG) tool was written to help build complex
JBrowse installations straight from Galaxy. 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.

Options
-------

**Reference or Assembly**

Choose either a built-in or select one from your history.

Track coordinates and contig names *must* match this reference precisely
or they will not display.

**Track Groups** represent a set of tracks in a single category.


Annotation Tracks
-----------------


BED
~~~

Bed feature annotation usually requires clicking on the feature. 

Bed files created by the *Bigwig extremes to bed features* tool have the score in column 5
set to *1* for regions above the quantile and *-1* for regions below. It is possible to set an advanced option for each bed track, to use the bed score in column 5 
for the feature colour, giving red and blue using a JBrowse2 plugin, so they are easy to distinguish in a combined track.


MAF
~~~

For history references, the name of the reference genome dataset in your history is very important for MAF tracks,
because it becomes the "dbkey" for that reference. So, it must be exactly the same as the genome name (dbkey) used
when making the MAF, typically in the Lastz tool.

If you used "hg38" as the reference in Lastz, that is exactly what the reference fasta should be named for any MAF track.
Change it using the "pencil" icon on the reference data in your history. Any other name, such as "hg38.fasta"
will cause the MAF track to show no data since there are no matches with that reference dbkey.


GFF3/BED
~~~~~~~~

Standard feature tracks. They usually highlight genes, mRNAs and other features of interest along a genomic region.

When these contain tens of millions of features, such as repeat regions from a VGP assembly, displaying one at a time leads
to extremely slow loading times when a large region is in view, unless the "LinearPileupDisplay" display option is
selected for that track in the styling options section. The default is LinearBasicDisplay, which shows all details and works
well for relatively sparse bed files. A better option is to make a bigwig track using a set of windows based on the
lengths of each assembly or reference contig.

BAM Pileups
~~~~~~~~~~~

We support BAM files and can automatically generate SNP tracks based on
that bam data.


BlastXML
~~~~~~~~

JiG now supports both blastn and blastp datasets. JiG internally uses a
blastXML to gapped GFF3 tool to convert your blastxml datasets into a
format amenable to visualization in JBrowse. This tool is also
available separately from the IUC on the toolshed.

**Minimum Gap Size** reflects how long a gap must be before it becomes a
real gap in the processed gff3 file. In the picture above, various sizes
of gaps can be seen. If the minimum gap size was set much higher, say
100nt, many of the smaller gaps would disappear, and the features on
both sides would be merged into one, longer feature. This setting is
inversely proportional to runtime and output file size. *Do not set this
to a low value for large datasets*. By setting this number lower, you
will have extremely large outputs and extremely long runtimes. The
default was configured based off of the author's experience, but the
author only works on small viruses. It is *strongly* recommended that
you filter your blast results before display, e.g. picking out the top
10 hits or so.

**Protein blast search** option merely informs underlying tools that
they should adjust feature locations by 3x.

Local viewing
=============

The same browser data and setup can also be downloaded as a compressed zip archive by clicking the download ("floppy disk") icon in the history.
This can be shared and viewed without Galaxy.

A replacement application to serve the browser is required without Galaxy. A local python web server can be started using a script included in each archive,
assuming that Python3 is already working on your desktop - if not you will have to install it first. Unzip the archive (*unzip [filename].zip*) and change
directory to the first level in that zip archive. It contains a file named *jb2_webserver.py*

With python3 installed,

*python3 jb2_webserver.py*

will serve the unarchived JBrowse2 configuration from the same directory as the python script automatically. If a new browser window does not open,
but the script appears to be running, try pointing your web browser to the default of *localhost:8080*

]]></help>
    <expand macro="citations"/>
    <expand macro="creators"/>
</tool>