changeset 8:ad4b9d7eae6a draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse commit 9a243c616a4a3156347e38fdb5f35863ae5133f9
author iuc
date Tue, 29 Nov 2016 10:55:30 -0500
parents 1e74f16adaa1
children f422ba2e9aa5
files all_fasta.loc.sample blastxml_to_gapped_gff3.py gff3_rebase.py jbrowse-fromdir.xml jbrowse.py jbrowse.xml macros.xml readme.rst test-data/frameshift/1.gff test-data/frameshift/test.xml test-data/gencode/test-1.xml test-data/gencode/test.xml test-data/gff3/test.xml test-data/menus/test.xml tool_data_table_conf.xml.sample tool_dependencies.xml
diffstat 16 files changed, 792 insertions(+), 416 deletions(-) [+]
line wrap: on
line diff
--- a/all_fasta.loc.sample	Sun Jun 26 10:50:15 2016 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-#This file lists the locations and dbkeys of all the fasta files
-#under the "genome" directory (a directory that contains a directory
-#for each build). The script extract_fasta.py will generate the file
-#all_fasta.loc. This file has the format (white space characters are
-#TAB characters):
-#
-#<unique_build_id>	<dbkey>		<display_name>	<file_path>
-#
-#So, all_fasta.loc could look something like this:
-#
-#apiMel3	apiMel3	Honeybee (Apis mellifera): apiMel3		/path/to/genome/apiMel3/apiMel3.fa
-#hg19canon	hg19		Human (Homo sapiens): hg19 Canonical		/path/to/genome/hg19/hg19canon.fa
-#hg19full	hg19		Human (Homo sapiens): hg19 Full			/path/to/genome/hg19/hg19full.fa
-#
-#Your all_fasta.loc file should contain an entry for each individual
-#fasta file. So there will be multiple fasta files for each build,
-#such as with hg19 above.
-#
--- a/blastxml_to_gapped_gff3.py	Sun Jun 26 10:50:15 2016 -0400
+++ b/blastxml_to_gapped_gff3.py	Tue Nov 29 10:55:30 2016 -0500
@@ -1,10 +1,12 @@
 #!/usr/bin/perl
+import argparse
+import copy
+import logging
 import re
 import sys
-import copy
-import argparse
+
 from BCBio import GFF
-import logging
+
 logging.basicConfig(level=logging.INFO)
 log = logging.getLogger(name='blastxml2gff3')
 
@@ -218,7 +220,6 @@
         else:
             log.warn("Bad data: \n\t%s\n\t%s\n\t%s\n" % (query, match, subject))
 
-
         if strict_m:
             if ret == '=' or ret == 'X':
                 ret = 'M'
--- a/gff3_rebase.py	Sun Jun 26 10:50:15 2016 -0400
+++ b/gff3_rebase.py	Tue Nov 29 10:55:30 2016 -0500
@@ -1,11 +1,13 @@
 #!/usr/bin/env python
-import sys
-import logging
-logging.basicConfig(level=logging.INFO)
 import argparse
 import copy
+import logging
+import sys
+
 from BCBio import GFF
 from Bio.SeqFeature import FeatureLocation
+
+logging.basicConfig(level=logging.INFO)
 log = logging.getLogger(__name__)
 
 __author__ = "Eric Rasche"
--- a/jbrowse-fromdir.xml	Sun Jun 26 10:50:15 2016 -0400
+++ b/jbrowse-fromdir.xml	Tue Nov 29 10:55:30 2016 -0500
@@ -1,11 +1,10 @@
-<tool id="jbrowse_to_standalone" name="JBrowse - Data Directory to Standalone" version="0.4">
+<tool id="jbrowse_to_standalone" name="JBrowse - Data Directory to Standalone" version="@WRAPPER_VERSION@">
   <description>upgrades the bare data directory to a full JBrowse instance</description>
   <macros>
     <import>macros.xml</import>
   </macros>
   <expand macro="requirements"/>
   <expand macro="stdio"/>
-  <version_command>python jbrowse.py --version</version_command>
   <command><![CDATA[
 ## Create output directory
 mkdir -p $output.files_path &&
@@ -26,15 +25,12 @@
   <outputs>
       <data format="html" name="output" label="#set $name = $input.name.replace('Data Directory', 'Standalone')# $name"/>
   </outputs>
+  <tests>
+  </tests>
   <help><![CDATA[
 Upgrades an existing bare JBrowse "data" directory into a full-fledged JBrowse instance.
 
 @ATTRIBUTION@
 ]]></help>
-  <tests>
-  </tests>
-  <citations>
-    <citation type="doi">10.1101/gr.094607.109</citation>
-  </citations>
+  <expand macro="citations"/>
 </tool>
-
--- a/jbrowse.py	Sun Jun 26 10:50:15 2016 -0400
+++ b/jbrowse.py	Tue Nov 29 10:55:30 2016 -0500
@@ -1,17 +1,19 @@
 #!/usr/bin/env python
-import os
+import argparse
 import copy
-import argparse
-import subprocess
 import hashlib
+import json
+import logging
+import os
+import shutil
 import struct
+import subprocess
 import tempfile
-import shutil
-import json
+import xml.etree.ElementTree as ET
+from collections import defaultdict
+
 from Bio.Data import CodonTable
-import xml.etree.ElementTree as ET
-import logging
-from collections import defaultdict
+
 logging.basicConfig(level=logging.INFO)
 log = logging.getLogger('jbrowse')
 
@@ -79,11 +81,11 @@
         """,
         'blast': """
             var opacity = 0;
-            if(score == 0.0) {{
+            if(score == 0.0) {
                 opacity = 1;
-            }} else {{
+            } else{
                 opacity = (20 - Math.log10(score)) / 180;
-            }}
+            }
         """
     }
 
@@ -125,7 +127,7 @@
 
     def rgb_from_hex(self, hexstr):
         # http://stackoverflow.com/questions/4296249/how-do-i-convert-a-hex-triplet-to-an-rgb-tuple-and-back
-        return struct.unpack('BBB',hexstr.decode('hex'))
+        return struct.unpack('BBB', hexstr.decode('hex'))
 
     def min_max_gff(self, gff_file):
         min_val = None
@@ -154,6 +156,31 @@
         self.brewer_colour_idx += 1
         return r, g, b
 
+    def parse_menus(self, track):
+        trackConfig = {'menuTemplate': [{}, {}, {}]}
+
+        if 'menu' in track['menus']:
+            menu_list = [track['menus']['menu']]
+            if isinstance(track['menus']['menu'], list):
+                menu_list = track['menus']['menu']
+
+            for m in menu_list:
+                tpl = {
+                    'action': m['action'],
+                    'label': m.get('label', '{name}'),
+                    'iconClass': m.get('iconClass', 'dijitIconBookmark'),
+                }
+                if 'url' in m:
+                    tpl['url'] = m['url']
+                if 'content' in m:
+                    tpl['content'] = m['content']
+                if 'title' in m:
+                    tpl['title'] = m['title']
+
+                trackConfig['menuTemplate'].append(tpl)
+
+        return trackConfig
+
     def parse_colours(self, track, trackFormat, gff3=None):
         # Wiggle tracks have a bicolor pallete
         trackConfig = {'style': {}}
@@ -166,7 +193,6 @@
                 trackConfig['style']['neg_color'] = self.hex_from_rgb(*self._get_colours())
                 trackConfig['style']['pos_color'] = self.hex_from_rgb(*self._get_colours())
 
-
             # Wiggle tracks can change colour at a specified place
             bc_pivot = track['wiggle']['bicolor_pivot']
             if bc_pivot not in ('mean', 'zero'):
@@ -223,7 +249,7 @@
                         auto_color = "'%s'" % self.hex_from_rgb(*self._get_colours())
 
                     color_function = self.COLOR_FUNCTION_TEMPLATE_QUAL.format(**{
-                        'opacity': self.OPACITY_MATH[algo].format(**{'max': max_val,'min': min_val}),
+                        'opacity': self.OPACITY_MATH[algo].format(**{'max': max_val, 'min': min_val}),
                         'user_spec_color': user_color,
                         'auto_gen_color': auto_color,
                     })
@@ -240,14 +266,14 @@
         for dc in map(etree_to_dict, children):
             for k, v in dc.iteritems():
                 dd[k].append(v)
-        d = {t.tag: {k:v[0] if len(v) == 1 else v for k, v in dd.iteritems()}}
+        d = {t.tag: {k: v[0] if len(v) == 1 else v for k, v in dd.iteritems()}}
     if t.attrib:
         d[t.tag].update(('@' + k, v) for k, v in t.attrib.iteritems())
     if t.text:
         text = t.text.strip()
         if children or t.attrib:
             if text:
-              d[t.tag]['#text'] = text
+                d[t.tag]['#text'] = text
         else:
             d[t.tag] = text
     return d
@@ -274,6 +300,7 @@
         self.genome_paths = genomes
         self.standalone = standalone
         self.gencode = gencode
+        self.tracksToIndex = []
 
         if standalone:
             self.clone_jbrowse(self.jbrowse, self.outdir)
@@ -302,7 +329,6 @@
         with open(trackList, 'w') as handle:
             json.dump(trackListData, handle, indent=2)
 
-
     def subprocess_check_call(self, command):
         log.debug('cd %s && %s', self.outdir, ' '.join(command))
         subprocess.check_call(command, cwd=self.outdir)
@@ -316,11 +342,23 @@
                 'perl', self._jbrowse_bin('prepare-refseqs.pl'),
                 '--fasta', genome_path])
 
-        # Generate name
-        # self.subprocess_check_call([
-            # 'perl', self._jbrowse_bin('generate-names.pl'),
-            # '--hashBits', '16'
-        # ])
+    def generate_names(self):
+        # Generate names
+
+        args = [
+            'perl', self._jbrowse_bin('generate-names.pl'),
+            '--hashBits', '16'
+        ]
+
+        tracks = ','.join(self.tracksToIndex)
+
+        if tracks:
+            args += ['--tracks', tracks]
+        else:
+            # No tracks to index, index only the refseq
+            args += ['--tracks', 'DNA']
+
+        self.subprocess_check_call(args)
 
     def _add_json(self, json_data):
 
@@ -343,7 +381,6 @@
         self.subprocess_check_call(cmd)
         os.unlink(tmp.name)
 
-
     def _blastxml_to_gff3(self, xml, min_gap=10):
         gff3_unrebased = tempfile.NamedTemporaryFile(delete=False)
         cmd = ['python', os.path.join(INSTALLED_TO, 'blastxml_to_gapped_gff3.py'),
@@ -389,6 +426,9 @@
         self.subprocess_check_call(cmd)
         os.unlink(gff3)
 
+        if blastOpts.get('index', 'false') == 'true':
+            self.tracksToIndex.append("%s" % trackData['label'])
+
     def add_bigwig(self, data, trackData, wiggleOpts, **kwargs):
         dest = os.path.join('data', 'raw', trackData['label'] + '.bw')
         cmd = ['ln', data, dest]
@@ -425,7 +465,6 @@
             "storeClass": "JBrowse/Store/SeqFeature/BAM",
         })
 
-
         self._add_track_json(trackData)
 
         if bamOpts.get('auto_snp', 'false') == 'true':
@@ -433,7 +472,7 @@
             trackData2.update({
                 "type": "JBrowse/View/Track/SNPCoverage",
                 "key": trackData['key'] + " - SNPs/Coverage",
-                "label": trackData['label']  + "_autosnp",
+                "label": trackData['label'] + "_autosnp",
             })
             self._add_track_json(trackData2)
 
@@ -468,7 +507,7 @@
         clientConfig = trackData['style']
         del config['style']
 
-        if  'match' in gffOpts:
+        if 'match' in gffOpts:
             config['glyph'] = 'JBrowse/View/FeatureGlyph/Segments'
             cmd += ['--type', gffOpts['match']]
 
@@ -488,12 +527,14 @@
 
         self.subprocess_check_call(cmd)
 
+        if gffOpts.get('index', 'false') == 'true':
+            self.tracksToIndex.append("%s" % trackData['label'])
 
     def process_annotations(self, track):
         outputTrackConfig = {
             'style': {
-                'label':       track['style'].get('label', 'description'),
-                'className':   track['style'].get('className', 'feature'),
+                'label': track['style'].get('label', 'description'),
+                'className': track['style'].get('className', 'feature'),
                 'description': track['style'].get('description', ''),
             },
             'category': track['category'],
@@ -516,11 +557,14 @@
                 else:
                     outputTrackConfig[key] = colourOptions[key]
 
+            menus = self.cs.parse_menus(track['conf']['options'])
+            outputTrackConfig.update(menus)
+
             # import pprint; pprint.pprint(track)
             # import sys; sys.exit()
             if dataset_ext in ('gff', 'gff3', 'bed'):
                 self.add_features(dataset_path, dataset_ext, outputTrackConfig,
-                                track['conf']['options']['gff'])
+                                  track['conf']['options']['gff'])
             elif dataset_ext == 'bigwig':
                 self.add_bigwig(dataset_path, outputTrackConfig,
                                 track['conf']['options']['wiggle'])
@@ -645,14 +689,14 @@
         try:
             # Only pertains to gff3 + blastxml. TODO?
             track_conf['style'] = {t.tag: t.text for t in track.find('options/style')}
-        except TypeError, te:
+        except TypeError:
             track_conf['style'] = {}
             pass
         track_conf['conf'] = etree_to_dict(track.find('options'))
         keys = jc.process_annotations(track_conf)
 
-
         for key in keys:
             extra_data['visibility'][track.attrib.get('visibility', 'default_off')].append(key)
 
     jc.add_final_data(extra_data)
+    jc.generate_names()
--- a/jbrowse.xml	Sun Jun 26 10:50:15 2016 -0400
+++ b/jbrowse.xml	Tue Nov 29 10:55:30 2016 -0500
@@ -1,17 +1,16 @@
-<tool id="jbrowse" name="JBrowse" version="0.5.2">
+<tool id="jbrowse" name="JBrowse" version="@WRAPPER_VERSION@">
   <description>genome browser</description>
   <macros>
     <import>macros.xml</import>
   </macros>
   <expand macro="requirements"/>
   <expand macro="stdio"/>
-  <version_command>python jbrowse.py --version</version_command>
   <command><![CDATA[
 
 #if $action.action_select == "create":
-    mkdir -p $output.files_path;
+    mkdir -p $output.files_path &&
 #else:
-    cp -R $action.update_jbrowse.extra_files_path $output.files_path;
+    cp -R $action.update_jbrowse.extra_files_path $output.files_path &&
 #end if
 
 ## Copy the XML file into the directory, mostly for debugging
@@ -27,7 +26,7 @@
 #end if
 
 --outdir $output.files_path
-$trackxml;
+$trackxml &&
 
 #if str($standalone) == "Complete":
     mv $output.files_path/index.html $output;
@@ -72,13 +71,13 @@
     <metadata>
         <gencode>$gencode</gencode>
         <genomes>
-              #if str($action.reference_genome.genome_type_select) == "indexed":
-                <genome>${action.reference_genome.genomes.fields.path}</genome>
-              #else
-                #for $genome in $action.reference_genome.genomes:
-                    <genome>$genome</genome>
-                #end for
-              #end if
+            #if str($reference_genome.genome_type_select) == "indexed":
+              <genome>${reference_genome.genomes.fields.path}</genome>
+            #else
+              #for $genome in $reference_genome.genomes:
+                  <genome>$genome</genome>
+              #end for
+            #end if
         </genomes>
         <general>
             <defaultLocation>${jbgen.defaultLocation}</defaultLocation>
@@ -145,6 +144,25 @@
                         </scheme>
                   #end if
                 </scaling>
+                <menus>
+                  #for $menu_item in $track.data_format.jbmenu.track_menu:
+                  <menu>
+                    <action>${menu_item.menu_action}</action>
+                    #if str($menu_item.menu_label) != "":
+                      <label>${menu_item.menu_label}</label>
+                    #end if
+                    #if str($menu_item.menu_title) != "":
+                      <title>${menu_item.menu_title}</title>
+                    #end if
+                    #if str($menu_item.menu_url) != "":
+                      <url>${menu_item.menu_url.replace("&", "&amp;").replace("\"", "&quot;")}</url>
+                    #end if
+                    #if str($menu_item.menu_icon) != "":
+                      <iconClass>${menu_item.menu_icon}</iconClass>
+                    #end if
+                  </menu>
+                  #end for
+                </menus>
             #end if
 
             #if str($track.data_format.data_format_select) == "wiggle":
@@ -194,6 +212,7 @@
                   #end if
                     <protein>${track.data_format.is_protein}</protein>
                     <min_gap>${track.data_format.min_gap}</min_gap>
+                    <index>${track.data_format.index}</index>
                 </blast>
             #else if str($track.data_format.data_format_select) == "gene_calls":
                 <gff>
@@ -201,6 +220,7 @@
                   #if $track.data_format.match_part.match_part_select:
                     <match>${track.data_format.match_part.name}</match>
                   #end if
+                    <index>${track.data_format.index}</index>
                 </gff>
 ##            #else if str($track.data_format.data_format_select) == "sparql":
 ##                <sparql>
@@ -216,32 +236,40 @@
         #end for
     </tracks>
 </root>
-]]>
-      </configfile>
+]]></configfile>
   </configfiles>
   <inputs>
-    <conditional name="action" label="Action">
-        <param type="select" label="JBrowse-in-Galaxy Action" name="action_select">
-            <option value="create">New JBrowse Instance</option>
-            <option value="update">Update exising JBrowse Instance</option>
+    <conditional name="reference_genome">
+        <param help="Built-in references" 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>
         </param>
-        <when value="create">
-            <expand macro="genome_selector" />
-       </when>
-        <when value="update">
-            <expand macro="genome_selector"
-              label="Additional Fasta Sequence(s)"
-              help="If sequences are selected, they will be added to the existing JBrowse instance. You should not select any sequences if you are simply updating an existing JBrowse instance which already has the required reference sequences."
-              optional="True"/>
-            <param label="Previous JBrowse Instance"
-                   name="update_jbrowse"
-                   type="data"
-                   format="html" />
+        <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="genomes"
+              type="data"
+              multiple="True" />
         </when>
     </conditional>
 
     <param name="standalone" label="Produce Standalone Instance" type="boolean" truevalue="Complete" falsevalue="Data Directory" help="Produce a full, working JBrowse instance or just the data directory. Data dir mode is experimental and intended to be used with Apollo" checked="True"/>
 
+
     <param label="Genetic Code" name="gencode" type="select">
       <option value="1">1. The Standard Code</option>
       <option value="2">2. The Vertebrate Mitochondrial Code</option>
@@ -263,6 +291,20 @@
       <option value="25">25. Candidate Division SR1 and Gracilibacteria Code</option>
    </param>
 
+    <conditional name="action">
+        <param type="select" label="JBrowse-in-Galaxy 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 label="Previous JBrowse Instance"
+                   name="update_jbrowse"
+                   type="data"
+                   format="html" />
+        </when>
+    </conditional>
+
     <repeat name="track_groups" title="Track Group">
         <param label="Track Category"
                name="category"
@@ -270,7 +312,7 @@
                value="Default"
                help="Organise your tracks into Categories for a nicer end-user experience" optional="False"/>
     <repeat name="data_tracks" title="Annotation Track">
-        <conditional name="data_format" label="Track Options">
+        <conditional name="data_format">
             <param type="select" label="Track Type" name="data_format_select">
                 <option value="gene_calls">GFF/GFF3/BED/GBK Features</option>
                 <option value="pileup">BAM Pileups</option>
@@ -301,6 +343,8 @@
                        truevalue="true"
                        falsevalue="false" />
 
+                <param label="Index this track" name="index" type="boolean" checked="false" truevalue="true" falsevalue="false" />
+
                 <expand macro="track_styling"
                         classname="feature"
                         label="description"
@@ -309,6 +353,7 @@
                 <expand macro="color_selection"
                         token_scaling_lin_select="false"
                         token_scaling_log_select="true" />
+                <expand macro="track_menu" />
                 <expand macro="track_display" />
             </when>
             <when value="vcf">
@@ -317,7 +362,7 @@
             </when>
             <when value="gene_calls">
                 <expand macro="input_conditional" label="GFF/GFF3/BED Track Data" format="gff,gff3,bed" />
-                <conditional name="match_part" label="match/match_part data">
+                <conditional name="match_part">
                     <param label="This is match/match_part data"
                            type="boolean"
                            name="match_part_select"
@@ -333,12 +378,16 @@
                     </when>
                     <when value="false" />
                 </conditional>
+
+                <param label="Index this track" name="index" type="boolean" checked="false" truevalue="true" falsevalue="false" />
+
                 <param type="select" label="JBrowse Track Type [Advanced]" name="track_class">
                   <option value="JBrowse/View/Track/HTMLFeatures">HTML Features</option>
                   <option value="JBrowse/View/Track/CanvasFeatures" selected="true">Canvas Features</option>
                 </param>
                 <expand macro="track_styling" />
                 <expand macro="color_selection" />
+                <expand macro="track_menu" />
                 <expand macro="track_display" />
             </when>
             <when value="pileup">
@@ -367,7 +416,7 @@
                        truevalue="true"
                        falsevalue="false" />
 
-                <conditional name="scaling" label="Scaling">
+                <conditional name="scaling">
                     <param type="select" label="Track Scaling" name="scale_select">
                         <option value="auto_local">Autoscale (local)</option>
                         <option value="auto_global" selected="true">Autoscale (global)</option>
@@ -406,97 +455,280 @@
   <tests>
     <test>
       <!-- gencode -->
-      <param name="genomes" value="merlin.fa"/>
+      <param name="reference_genome|genome_type_select" value="history"/>
+      <param name="reference_genome|genomes" value="merlin.fa"/>
       <param name="gencode" value="1" />
       <param name="standalone" value="Data Directory" />
       <param name="uglyTestingHack" value="enabled" />
       <output name="output" file="gencode/test-1.xml" lines_diff="4" />
     </test>
     <test>
-      <param name="genomes" value="merlin.fa"/>
+      <param name="reference_genome|genome_type_select" value="history"/>
+      <param name="reference_genome|genomes" value="merlin.fa"/>
       <param name="gencode" value="11" />
       <param name="standalone" value="Data Directory" />
       <param name="uglyTestingHack" value="enabled" />
       <output name="output" file="gencode/test.xml" lines_diff="4"/>
     </test>
-    <!--
     <test>
-      <param name="genomes" value="merlin.fa"/>
+      <param name="reference_genome|genome_type_select" value="history"/>
+      <param name="reference_genome|genomes" value="merlin.fa"/>
       <param name="gencode" value="11" />
       <param name="standalone" value="Data Directory" />
-      <param name="track_groups_0|category" value="Auto Coloured" />
-      <param name="track_groups_0|data_tracks_0|data_format" value="gene_calls"/>
-      <param name="track_groups_0|data_tracks_0|annotation" value="gff3/A.gff,gff3/B.gff,gff3/C.gff,gff3/D.gff"/>
-      <param name="track_groups_0|data_tracks_0|match_part|match_part_select" value="false"/>
-      <param name="track_groups_0|data_tracks_0|jbcolor_scale|color_score|color_score_select" value="none"/>
-      <param name="track_groups_0|data_tracks_0|jbcolor_scale|color|color_select" value="automatic"/>
-
+      <repeat name="track_groups">
+        <param name="category" value="Auto Coloured" />
+        <repeat name="data_tracks">
+            <conditional name="data_format">
+                <param name="data_format_select" value="gene_calls"/>
+                <param name="annotation" value="gff3/A.gff,gff3/B.gff,gff3/C.gff,gff3/D.gff"/>
+                <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>
 
-      <param name="track_groups_1|category" value="Ignore Scale" />
-      <param name="track_groups_1|data_tracks_0|data_format" value="gene_calls"/>
-      <param name="track_groups_1|data_tracks_0|annotation" value="gff3/1.gff"/>
-      <param name="track_groups_1|data_tracks_0|match_part|match_part_select" value="false"/>
-      <param name="track_groups_1|data_tracks_0|jbcolor_scale|color_score|color_score_select" value="none"/>
-      <param name="track_groups_1|data_tracks_0|jbcolor_scale|color_score|color|color_select" value="manual"/>
-      <param name="track_groups_1|data_tracks_0|jbcolor_scale|color_score|color|style_color" value="#ff00ff"/>
+      <repeat name="track_groups">
+        <param name="category" value="Ignore Scale" />
+        <repeat name="data_tracks">
+            <conditional name="data_format">
+                <param name="data_format_select" value="gene_calls"/>
+                <param name="annotation" value="gff3/1.gff"/>
+                <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>
 
-      <param name="track_groups_2|category" value="Scaled Colour" />
-      <param name="track_groups_2|data_tracks_0|data_format" value="gene_calls"/>
-      <param name="track_groups_2|data_tracks_0|annotation" value="gff3/1.gff"/>
-      <param name="track_groups_2|data_tracks_0|match_part|match_part_select" value="false"/>
-      <param name="track_groups_2|data_tracks_0|jbcolor_scale|color_score|color_score_select" value="score"/>
-      <param name="track_groups_2|data_tracks_0|jbcolor_scale|color_score|score_scaling" value="linear"/>
-      <param name="track_groups_2|data_tracks_0|jbcolor_scale|color_score|score_scales|scale_select" value="automatic"/>
-      <param name="track_groups_2|data_tracks_0|jbcolor_scale|color_score|color_scheme|score_scheme" value="opacity"/>
-      <param name="track_groups_2|data_tracks_0|jbcolor_scale|color_score|color_scheme|color_select" value="automatic"/>
-      <param name="track_groups_2|data_tracks_1|data_format" value="gene_calls"/>
-      <param name="track_groups_2|data_tracks_1|annotation" value="gff3/1.gff"/>
-      <param name="track_groups_2|data_tracks_1|match_part|match_part_select" value="false"/>
-      <param name="track_groups_2|data_tracks_1|jbcolor_scale|color_score|color_score_select" value="score"/>
-      <param name="track_groups_2|data_tracks_1|jbcolor_scale|color_score|score_scaling" value="linear"/>
-      <param name="track_groups_2|data_tracks_1|jbcolor_scale|color_score|score_scales|scale_select" value="automatic"/>
-      <param name="track_groups_2|data_tracks_1|jbcolor_scale|color_score|color_scheme|score_scheme" value="opacity"/>
-      <param name="track_groups_2|data_tracks_1|jbcolor_scale|color_score|color_scheme|color_select" value="manual"/>
-      <param name="track_groups_2|data_tracks_1|jbcolor_scale|color_score|color_scheme|style_color" value="#0000ff"/>
-      <param name="track_groups_2|data_tracks_2|data_format" value="gene_calls"/>
-      <param name="track_groups_2|data_tracks_2|annotation" value="gff3/1.gff"/>
-      <param name="track_groups_2|data_tracks_2|match_part|match_part_select" value="false"/>
-      <param name="track_groups_2|data_tracks_2|jbcolor_scale|color_score|color_score_select" value="score"/>
-      <param name="track_groups_2|data_tracks_2|jbcolor_scale|color_score|score_scaling" value="linear"/>
-      <param name="track_groups_2|data_tracks_2|jbcolor_scale|color_score|score_scales|scale_select" value="automatic"/>
-      <param name="track_groups_2|data_tracks_2|jbcolor_scale|color_score|score_scales|minimum" value="0"/>
-      <param name="track_groups_2|data_tracks_2|jbcolor_scale|color_score|score_scales|maximum" value="1000"/>
-      <param name="track_groups_2|data_tracks_2|jbcolor_scale|color_score|color_scheme|score_scheme" value="opacity"/>
-      <param name="track_groups_2|data_tracks_2|jbcolor_scale|color_score|color_scheme|color_select" value="automatic"/>
-      <param name="track_groups_2|data_tracks_3|data_format" value="gene_calls"/>
-      <param name="track_groups_2|data_tracks_3|annotation" value="gff3/1.gff"/>
-      <param name="track_groups_2|data_tracks_3|match_part|match_part_select" value="false"/>
-      <param name="track_groups_2|data_tracks_3|jbcolor_scale|color_score|color_score_select" value="score"/>
-      <param name="track_groups_2|data_tracks_3|jbcolor_scale|color_score|score_scaling" value="linear"/>
-      <param name="track_groups_2|data_tracks_3|jbcolor_scale|color_score|score_scales|scale_select" value="automatic"/>
-      <param name="track_groups_2|data_tracks_3|jbcolor_scale|color_score|score_scales|minimum" value="0"/>
-      <param name="track_groups_2|data_tracks_3|jbcolor_scale|color_score|score_scales|maximum" value="1000"/>
-      <param name="track_groups_2|data_tracks_3|jbcolor_scale|color_score|color_scheme|score_scheme" value="opacity"/>
-      <param name="track_groups_2|data_tracks_3|jbcolor_scale|color_score|color_scheme|color_select" value="manual"/>
-      <param name="track_groups_2|data_tracks_3|jbcolor_scale|color_score|color_scheme|style_color" value="#ff0000"/>
+      <repeat name="track_groups">
+        <param name="category" value="Scaled Colour" />
+        <repeat name="data_tracks">
+            <conditional name="data_format">
+                <param name="data_format_select" value="gene_calls"/>
+                <param name="annotation" value="gff3/1.gff"/>
+                <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="gene_calls"/>
+                <param name="annotation" value="gff3/1.gff"/>
+                <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="gene_calls"/>
+                <param name="annotation" value="gff3/1.gff"/>
+                <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="gene_calls"/>
+                <param name="annotation" value="gff3/1.gff"/>
+                <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>
 
-      <param name="track_groups_3|category" value="Realistic" />
-      <param name="track_groups_3|data_tracks_0|data_format" value="gene_calls"/>
-      <param name="track_groups_3|data_tracks_0|annotation" value="gff3/interpro.gff"/>
-      <param name="track_groups_3|data_tracks_0|match_part|match_part_select" value="false"/>
-      <param name="track_groups_3|data_tracks_0|jbcolor_scale|color_score|color_score_select" value="none"/>
-      <param name="track_groups_3|data_tracks_0|jbcolor_scale|color|color_select" value="automatic"/>
-      <param name="track_groups_3|data_tracks_1|data_format" value="gene_calls"/>
-      <param name="track_groups_3|data_tracks_1|annotation" value="gff3/2.gff"/>
-      <param name="track_groups_3|data_tracks_1|match_part|match_part_select" value="true"/>
-      <param name="track_groups_3|data_tracks_1|match_part|name" value="cDNA_match"/>
-      <param name="track_groups_3|data_tracks_1|jbcolor_scale|color_score|color_score_select" value="none"/>
-      <param name="track_groups_3|data_tracks_1|jbcolor_scale|color|color_select" value="automatic"/>
+      <repeat name="track_groups">
+        <param name="category" value="Realistic" />
+        <repeat name="data_tracks">
+            <conditional name="data_format">
+                <param name="data_format_select" value="gene_calls"/>
+                <param name="annotation" value="gff3/interpro.gff"/>
+                <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="gene_calls"/>
+                <param name="annotation" value="gff3/2.gff"/>
+                <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>
 
       <param name="uglyTestingHack" value="enabled" />
-      <output name="output" file="gff3/test.xml" />
+      <output name="output" file="gff3/test.xml" lines_diff="24" />
     </test>
-    -->
+    <test>
+        <param name="reference_genome|genome_type_select" value="history"/>
+        <param name="reference_genome|genomes" value="merlin.fa"/>
+        <param name="gencode" value="11" />
+        <param name="standalone" value="Data Directory" />
+
+        <repeat name="track_groups">
+            <param name="category" value="With menu or index" />
+            <repeat name="data_tracks">
+                <conditional name="data_format">
+                    <param name="data_format_select" value="gene_calls"/>
+                    <param name="annotation" value="gff3/1.gff"/>
+                    <conditional name="match_part">
+                        <param name="match_part_select" value="false"/>
+                    </conditional>
+                    <section name="jbcolor_scale">
+                        <conditional name="color_score">
+                            <param name="color_score_select" value="none"/>
+                        </conditional>
+                        <conditional name="color">
+                            <param name="color_select" value="automatic"/>
+                        </conditional>
+                    </section>
+                    <section name="jbmenu">
+                        <repeat name="track_menu">
+                            <param name="menu_action" value="iframeDialog"/>
+                            <param name="menu_label" value="Some menu item"/>
+                            <param name="menu_title" value="Frame title"/>
+                            <param name="menu_url" value="https://example.com/#!/?id={name}&amp;q={type}&amp;z=&quot;{end}&quot;"/>
+                            <param name="menu_icon" value="dijitIconNewTask"/>
+                        </repeat>
+                        <repeat name="track_menu">
+                            <param name="menu_action" value="newWindow"/>
+                            <param name="menu_label" value="Another menu item"/>
+                            <param name="menu_title" value="Frame title 2"/>
+                            <param name="menu_url" value="https://example.com/#!/?id={name}&amp;q={type}&amp;z=&quot;{end}&quot;"/>
+                        </repeat>
+                    </section>
+                </conditional>
+            </repeat>
+            <repeat name="data_tracks">
+                <conditional name="data_format">
+                    <param name="data_format_select" value="gene_calls"/>
+                    <param name="annotation" value="gff3/1.gff"/>
+                    <param name="index" value="true"/>
+                    <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>
+
+        <param name="uglyTestingHack" value="enabled" />
+        <output name="output" file="menus/test.xml" lines_diff="6"/>
+    </test>
   </tests>
   <help><![CDATA[
 JBrowse-in-Galaxy
@@ -505,12 +737,6 @@
 JBrowse-in-Galaxy offers a highly configurable, workflow-compatible
 alternative to Trackster.
 
-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, taking advantage of the
 latest Galaxy features such as dataset collections, sections, and colour
@@ -587,7 +813,7 @@
 consists of top level ``match`` features, with a child ``match_part``
 feature, and is often used in displaying alignments. (See "Alignments"
 section on the `GFF3
-specification <http://www.sequenceontology.org/gff3.shtml>`__ for more
+specification <https://github.com/The-Sequence-Ontology/Specifications/blob/master/gff3.md>`__ for more
 information). If the data is match/match part, you will need to specify
 the top level match feature name, as it can be one of a few different SO
 terms, and JiG does not yet have the ability to understand SO terms.
@@ -755,8 +981,5 @@
 
 @ATTRIBUTION@
 ]]></help>
-  <citations>
-    <citation type="doi">10.1101/gr.094607.109</citation>
-  </citations>
+  <expand macro="citations"/>
 </tool>
-
--- a/macros.xml	Sun Jun 26 10:50:15 2016 -0400
+++ b/macros.xml	Tue Nov 29 10:55:30 2016 -0500
@@ -2,10 +2,8 @@
 <macros>
   <xml name="requirements">
     <requirements>
-      <requirement type="package" version="1.12.0">jbrowse</requirement>
-      <requirement type="package" version="1.12.0">bundle_jbrowse</requirement>
+      <requirement type="package" version="1.12.1">jbrowse</requirement>
       <requirement type="package" version="2.7">python</requirement>
-      <requirement type="package" version="5.18.1">perl</requirement>
       <requirement type="package" version="1.66">biopython</requirement>
       <requirement type="package" version="0.6.2">bcbiogff</requirement>
       <requirement type="package" version="1.2">samtools</requirement>
@@ -13,7 +11,8 @@
       <yield/>
     </requirements>
   </xml>
-  <token name="@WRAPPER_VERSION@">1.0</token>
+  <token name="@DATA_DIR@">\$GALAXY_JBROWSE_SHARED_DIR</token>
+  <token name="@WRAPPER_VERSION@">0.5.1</token>
   <xml name="stdio">
     <stdio>
       <exit_code range="1:"/>
@@ -28,43 +27,6 @@
 This Galaxy tool relies on the JBrowse, maintained by the GMOD Community. The Galaxy wrapper is developed by Eric Rasche
 ]]>
   </token>
-  
-  <xml name="genome_selector"
-    token_help=""
-    token_label="Fasta sequences"
-    token_optional="False" >
-    <conditional name="reference_genome">
-        <param help="Built-in references" 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>
-        </param>
-        <when value="indexed">
-            <param 
-              help="@HELP@"
-              label="@LABEL@"
-              name="genomes"
-              type="select"
-              optional="@OPTIONAL@"
-              >
-                <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="@LABEL@"
-              help="@HELP@"
-              name="genomes"
-              type="data"
-              optional="@OPTIONAL@"
-              multiple="True" />
-        </when>
-    </conditional>
-  </xml>
-  
   <xml name="auto_manual_tk"
       token_cond_label="Color"
       token_cond_name="color"
@@ -218,7 +180,7 @@
             <param type="select" label="JBrowse style.color function's score scaling" name="score_scaling"
                    help="How should the colors be distributed across the values? For blast results which distributes scores on the scale of approximately [1e-500, 10], it makes sense to request a logarithmic scaling of the color values. Logarithmic is indeed the default for blast. However other analysis methods may produce scores on ranges such as [0, 100] where a linear scale would be more appropriate for color distribution.">
               <option value="linear"      selected="@SCALING_LIN_SELECT@" >Linear scaling</option>
-              <option value="logarithmic" selected=""                     >Logarithmic scaling</option>
+              <option value="logarithmic">Logarithmic scaling</option>
               <option value="blast"       selected="@SCALING_LOG_SELECT@" >Blast scaling</option>
             </param>
 
@@ -257,8 +219,8 @@
   </xml>
   <xml name="track_styling"
        token_classname="feature"
-       token_label="prodcut,name,id"
-       token_description="note"
+       token_label="name,id"
+       token_description="note,description"
        token_height="100px">
     <section name="jbstyle" title="JBrowse Styling Options [Advanced]" expanded="false">
         <param label="JBrowse style.className" type="text"
@@ -283,7 +245,99 @@
     </section>
   </xml>
 
+  <xml name="track_menu">
+    <section name="jbmenu" title="JBrowse Contextual Menu options [Advanced]" expanded="false">
+      <repeat name="track_menu" title="Track Menu">
+          <param label="Menu action"
+                 type="select"
+                 name="menu_action"
+                 help="Action performed when user clicks on the menu">
+            <option value="iframeDialog" selected="true">iframeDialog: causes the given url to be opened in a popup dialog box within JBrowse, in an iframe element.</option>
+            <option value="newWindow">newWindow: causes the given url to be opened in a new browser window.</option>
+            <option value="navigateTo">navigateTo: opens the given url in the same browser window, navigating the user away from JBrowse.</option>
+          </param>
+          <param label="Menu label"
+                 type="text"
+                 name="menu_label"
+                 help="Will be displayed in the contextual menu on each feature ({name}, {id}, {type}, {start}, {end}, {strand} variables will be interpreted)">
+           <expand macro="menu_sanitize" />
+          </param>
+          <param label="Menu title"
+                 type="text"
+                 name="menu_title"
+                 help="Will be displayed in the popup title bar if displayed ({name}, {id}, {type}, {start}, {end}, {strand} variables will be interpreted)">
+           <expand macro="menu_sanitize" />
+          </param>
+          <param label="Menu url"
+                 type="text"
+                 name="menu_url"
+                 help="Destination URL ({name}, {id}, {type}, {start}, {end}, {strand} variables will be interpreted)">
+           <expand macro="menu_sanitize" />
+          </param>
+          <param label="Menu icon"
+                 type="select"
+                 name="menu_icon"
+                 help="Icon to display next to menu label">
+            <option value="dijitIconBookmark" selected="true">Bookmark</option>
+            <option value="dijitIconSave">Save</option>
+            <option value="dijitIconPrint">Print</option>
+            <option value="dijitIconCut">Cut</option>
+            <option value="dijitIconCopy">Copy</option>
+            <option value="dijitIconClear">Clear</option>
+            <option value="dijitIconDelete">Delete</option>
+            <option value="dijitIconUndo">Undo</option>
+            <option value="dijitIconEdit">Edit</option>
+            <option value="dijitIconNewTask">New Task</option>
+            <option value="dijitIconEditTask">Edit Task</option>
+            <option value="dijitIconEditProperty">Edit Property</option>
+            <option value="dijitIconTask">Task</option>
+            <option value="dijitIconFilter">Filter</option>
+            <option value="dijitIconConfigure">Configure</option>
+            <option value="dijitIconSearch">Search</option>
+            <option value="dijitIconApplication">Application</option>
+            <option value="dijitIconChart">Chart</option>
+            <option value="dijitIconConnector">Connector</option>
+            <option value="dijitIconDatabase">Database</option>
+            <option value="dijitIconDocuments">Documents</option>
+            <option value="dijitIconMail">Mail</option>
+            <option value="dijitLeaf">Leaf</option>
+            <option value="dijitIconFile">File</option>
+            <option value="dijitIconFunction">Function</option>
+            <option value="dijitIconKey">Key</option>
+            <option value="dijitIconPackage">Package</option>
+            <option value="dijitIconSample">Sample</option>
+            <option value="dijitIconTable">Table</option>
+            <option value="dijitIconUsers">Users</option>
+            <option value="dijitIconFolderClosed">Folder Closed</option>
+            <option value="dijitIconFolderOpen">Folder Open</option>
+            <option value="dijitIconError">Error</option>
+          </param>
+      </repeat>
+    </section>
+  </xml>
+
+  <xml name="menu_sanitize">
+    <sanitizer>
+        <valid>
+            <add value="{"/>
+            <add value="}"/>
+            <add value="!"/>
+            <add value="?"/>
+            <add value="&amp;"/>
+            <add value="+"/>
+            <add value="="/>
+            <add value="'"/>
+            <add value='"'/>
+        </valid>
+    </sanitizer>
+  </xml>
+
   <xml name="input_conditional" token_label="Track Data" token_format="data">
       <param label="@LABEL@" format="@FORMAT@" name="annotation" type="data" multiple="True"/>
   </xml>
+  <xml name="citations">
+    <citations>
+      <citation type="doi">10.1101/gr.094607.109</citation>
+    </citations>
+  </xml>
 </macros>
--- a/readme.rst	Sun Jun 26 10:50:15 2016 -0400
+++ b/readme.rst	Tue Nov 29 10:55:30 2016 -0500
@@ -25,6 +25,9 @@
 History
 =======
 
+-  0.5.1 Support for contextual menus. Conda tests.
+-  0.5 Update existing instances on disk. Index names. Support HTML tracks
+   instead of Canvas. Support default tracks. General JBrowse optinos
 -  0.4 Support for dataset collections and customisation of tracks including
    labelling, colours, styling. Added support for genetic code selection.
    Fixed package installation recipe issues.
--- a/test-data/frameshift/1.gff	Sun Jun 26 10:50:15 2016 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-##gff-version 3
-##sequence-region Merlin 1 172788
-Merlin	GeneMark.hmm	gene	10	20	.	+	.	ID=Merlin_1;seqid=Merlin
-Merlin	GeneMark.hmm	mRNA	10	20	.	+	.	ID=Merlin_1_mRNA;Parent=Merlin_1
-Merlin	GeneMark.hmm	exon	10	20	.	+	.	Parent=Merlin_1_mRNA
-Merlin	GeneMark.hmm	CDS	10	20	1000	+	0	ID=Merlin_1_CDS ;Parent=Merlin_1_mRNA
-Merlin	GeneMark.hmm	CDS	19	30	500	+	0	ID=Merlin_1_CDS ;Parent=Merlin_1_mRNA
--- a/test-data/frameshift/test.xml	Sun Jun 26 10:50:15 2016 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-<?xml version="1.0"?>
-<root>
-    <metadata>
-        <gencode>11</gencode>
-        <genomes>
-            <genome>test-data/merlin.fa</genome>
-        </genomes>
-        <general>
-            <defaultLocation>Merlin:1-50</defaultLocation>
-            <trackPadding>40</trackPadding>
-            <shareLink>true</shareLink>
-            <aboutDescription></aboutDescription>
-            <show_tracklist>true</show_tracklist>
-            <show_nav>true</show_nav>
-            <show_overview>false</show_overview>
-            <show_menu>true</show_menu>
-            <hideGenomeOptions>false</hideGenomeOptions>
-        </general>
-    </metadata>
-    <tracks>
-        <track cat="Auto Coloured" format="gene_calls" visibility="default_on">
-            <files>
-                <trackFile path="test-data/frameshift/1.gff" ext="gff3" label="Test Track"/>
-            </files>
-            <options>
-                <style>
-                    <className>feature</className>
-                    <description>feature</description>
-                    <label>name,id</label>
-                    <height>100px</height>
-                </style>
-                <gff>
-                </gff>
-                <scaling>
-                    <method>ignore</method>
-                    <scheme>
-                        <color>__auto__</color>
-                    </scheme>
-                </scaling>
-            </options>
-        </track>
-    </tracks>
-</root>
--- a/test-data/gencode/test-1.xml	Sun Jun 26 10:50:15 2016 -0400
+++ b/test-data/gencode/test-1.xml	Tue Nov 29 10:55:30 2016 -0500
@@ -3,8 +3,20 @@
     <metadata>
         <gencode>1</gencode>
         <genomes>
-            <genome>test-data/merlin.fa</genome>
+                  <genome>/tmp/tmpPJZIQf/files/000/dataset_1.dat</genome>
         </genomes>
+        <general>
+            <defaultLocation></defaultLocation>
+            <trackPadding>20</trackPadding>
+
+            <shareLink>true</shareLink>
+            <aboutDescription></aboutDescription>
+            <show_tracklist>true</show_tracklist>
+            <show_nav>true</show_nav>
+            <show_overview>true</show_overview>
+            <show_menu>true</show_menu>
+            <hideGenomeOptions>false</hideGenomeOptions>
+        </general>
     </metadata>
     <tracks>
     </tracks>
--- a/test-data/gencode/test.xml	Sun Jun 26 10:50:15 2016 -0400
+++ b/test-data/gencode/test.xml	Tue Nov 29 10:55:30 2016 -0500
@@ -3,8 +3,20 @@
     <metadata>
         <gencode>11</gencode>
         <genomes>
-            <genome>test-data/merlin.fa</genome>
+                  <genome>/tmp/tmps5cL_a/files/000/dataset_3.dat</genome>
         </genomes>
+        <general>
+            <defaultLocation></defaultLocation>
+            <trackPadding>20</trackPadding>
+
+            <shareLink>true</shareLink>
+            <aboutDescription></aboutDescription>
+            <show_tracklist>true</show_tracklist>
+            <show_nav>true</show_nav>
+            <show_overview>true</show_overview>
+            <show_menu>true</show_menu>
+            <hideGenomeOptions>false</hideGenomeOptions>
+        </general>
     </metadata>
     <tracks>
     </tracks>
--- a/test-data/gff3/test.xml	Sun Jun 26 10:50:15 2016 -0400
+++ b/test-data/gff3/test.xml	Tue Nov 29 10:55:30 2016 -0500
@@ -3,226 +3,268 @@
     <metadata>
         <gencode>11</gencode>
         <genomes>
-            <genome>test-data/merlin.fa</genome>
+                  <genome>test-data/merlin.fa</genome>
         </genomes>
         <general>
             <defaultLocation></defaultLocation>
-            <trackPadding>40</trackPadding>
+            <trackPadding>20</trackPadding>
+
             <shareLink>true</shareLink>
             <aboutDescription></aboutDescription>
             <show_tracklist>true</show_tracklist>
             <show_nav>true</show_nav>
-            <show_overview>false</show_overview>
+            <show_overview>true</show_overview>
             <show_menu>true</show_menu>
             <hideGenomeOptions>false</hideGenomeOptions>
         </general>
     </metadata>
     <tracks>
-        <track cat="Auto Coloured" format="gene_calls" visibility="default_on">
+        <track cat="Auto Coloured" format="gene_calls" visibility="default_off">
             <files>
-                <trackFile path="test-data/gff3/1.gff" ext="gff3" label="A"/>
-                <trackFile path="test-data/gff3/1.gff" ext="gff3" label="B"/>
-                <trackFile path="test-data/gff3/1.gff" ext="gff3" label="C"/>
-                <trackFile path="test-data/gff3/1.gff" ext="gff3" label="D"/>
+              <trackFile path="test-data/gff3/1.gff" ext="gff3" label="A"/>
+              <trackFile path="test-data/gff3/1.gff" ext="gff3" label="B"/>
+              <trackFile path="test-data/gff3/1.gff" ext="gff3" label="C"/>
+              <trackFile path="test-data/gff3/1.gff" ext="gff3" label="D"/>
             </files>
 
             <options>
                 <style>
                     <className>feature</className>
-                    <description>feature</description>
+                    <description>note,description</description>
                     <label>name,id</label>
                     <height>100px</height>
                 </style>
+                <scaling>
+                        <method>ignore</method>
+                        <scheme>
+                            <color>__auto__</color>
+                        </scheme>
+                </scaling>
+                <menus>
+                </menus>
+
                 <gff>
+                    <trackType>JBrowse/View/Track/CanvasFeatures</trackType>
+                    <index>false</index>
                 </gff>
-                <scaling>
-                    <method>ignore</method>
-                    <scheme>
-                        <color>__auto__</color>
-                    </scheme>
-                </scaling>
             </options>
         </track>
-        <track cat="Ignore Scale" format="gene_calls">
+        <track cat="Ignore Scale" format="gene_calls" visibility="default_off">
             <files>
-                <trackFile path="test-data/gff3/1.gff" ext="gff3" label="Fixed Colour"/>
+              <trackFile path="test-data/gff3/1.gff" ext="gff3" label="Fixed Colour"/>
             </files>
 
             <options>
                 <style>
                     <className>feature</className>
-                    <description>feature</description>
+                    <description>note,description</description>
                     <label>name,id</label>
                     <height>100px</height>
                 </style>
+                <scaling>
+                        <method>ignore</method>
+                        <scheme>
+                            <color>#ff00ff</color>
+                        </scheme>
+                </scaling>
+                <menus>
+                </menus>
+
                 <gff>
+                    <trackType>JBrowse/View/Track/CanvasFeatures</trackType>
+                    <index>false</index>
                 </gff>
-                <scaling>
-                    <method>ignore</method>
-                    <scheme>
-                        <color>#ff00ff</color>
-                    </scheme>
-                </scaling>
             </options>
         </track>
-        <track cat="Scaled Colour" format="gene_calls">
+        <track cat="Scaled Colour" format="gene_calls" visibility="default_off">
             <files>
-                <trackFile path="test-data/gff3/1.gff" ext="gff3" label="Linear, Auto-bounds"/>
+              <trackFile path="test-data/gff3/1.gff" ext="gff3" label="Linear, Auto-bounds"/>
             </files>
 
             <options>
                 <style>
                     <className>feature</className>
-                    <description>feature</description>
+                    <description>note,description</description>
                     <label>name,id</label>
                     <height>100px</height>
                 </style>
+                <scaling>
+                        <method>score</method>
+                        <algo>linear</algo>
+                        <scales>
+                            <type>automatic</type>
+
+                        </scales>
+                        <scheme>
+                            <type>opacity</type>
+                            <color>__auto__</color>
+                        </scheme>
+                </scaling>
+                <menus>
+                </menus>
+
                 <gff>
+                    <trackType>JBrowse/View/Track/CanvasFeatures</trackType>
+                    <index>false</index>
                 </gff>
-                <scaling>
-                    <method>score</method>
-                    <algo>linear</algo>
-                    <scales>
-                        <type>__auto__</type>
-                    </scales>
-                    <scheme>
-                        <type>opacity</type>
-                        <color>__auto__</color>
-                    </scheme>
-                </scaling>
             </options>
         </track>
-        <track cat="Scaled Colour" format="gene_calls">
+        <track cat="Scaled Colour" format="gene_calls" visibility="default_off">
             <files>
-                <trackFile path="test-data/gff3/1.gff" ext="gff3" label="Linear, Auto-bounds, Fixed Color"/>
+              <trackFile path="test-data/gff3/1.gff" ext="gff3" label="Linear, Auto-bounds, Fixed Color"/>
             </files>
 
             <options>
                 <style>
                     <className>feature</className>
-                    <description>feature</description>
+                    <description>note,description</description>
                     <label>name,id</label>
                     <height>100px</height>
                 </style>
+                <scaling>
+                        <method>score</method>
+                        <algo>linear</algo>
+                        <scales>
+                            <type>automatic</type>
+
+                        </scales>
+                        <scheme>
+                            <type>opacity</type>
+                            <color>#0000ff</color>
+                        </scheme>
+                </scaling>
+                <menus>
+                </menus>
+
                 <gff>
+                    <trackType>JBrowse/View/Track/CanvasFeatures</trackType>
+                    <index>false</index>
                 </gff>
-                <scaling>
-                    <method>score</method>
-                    <algo>linear</algo>
-                    <scales>
-                        <type>__auto__</type>
-                    </scales>
-                    <scheme>
-                        <type>opacity</type>
-                        <color>#0000ff</color>
-                    </scheme>
-                </scaling>
             </options>
         </track>
-        <track cat="Scaled Colour" format="gene_calls">
+        <track cat="Scaled Colour" format="gene_calls" visibility="default_off">
             <files>
-                <trackFile path="test-data/gff3/1.gff" ext="gff3" label="Linear, Manual Bounds"/>
+              <trackFile path="test-data/gff3/1.gff" ext="gff3" label="Linear, Manual Bounds"/>
             </files>
 
             <options>
                 <style>
                     <className>feature</className>
-                    <description>feature</description>
+                    <description>note,description</description>
                     <label>name,id</label>
                     <height>100px</height>
                 </style>
+                <scaling>
+                        <method>score</method>
+                        <algo>linear</algo>
+                        <scales>
+                            <type>manual</type>
+
+                            <min>0</min>
+                            <max>1000</max>
+                        </scales>
+                        <scheme>
+                            <type>opacity</type>
+                            <color>__auto__</color>
+                        </scheme>
+                </scaling>
+                <menus>
+                </menus>
+
                 <gff>
+                    <trackType>JBrowse/View/Track/CanvasFeatures</trackType>
+                    <index>false</index>
                 </gff>
-                <scaling>
-                    <method>score</method>
-                    <algo>linear</algo>
-                    <scales>
-                        <type>manual</type>
-                        <min>0</min>
-                        <max>1000</max>
-                    </scales>
-                    <scheme>
-                        <type>opacity</type>
-                        <color>__auto__</color>
-                    </scheme>
-                </scaling>
             </options>
         </track>
-        <track cat="Scaled Colour" format="gene_calls">
+        <track cat="Scaled Colour" format="gene_calls" visibility="default_off">
             <files>
-                <trackFile path="test-data/gff3/1.gff" ext="gff3" label="Linear, Manual Bounds, Fixed Color"/>
+              <trackFile path="test-data/gff3/1.gff" ext="gff3" label="Linear, Manual Bounds, Fixed Color"/>
             </files>
 
             <options>
                 <style>
                     <className>feature</className>
-                    <description>feature</description>
+                    <description>note,description</description>
                     <label>name,id</label>
                     <height>100px</height>
                 </style>
+                <scaling>
+                        <method>score</method>
+                        <algo>linear</algo>
+                        <scales>
+                            <type>manual</type>
+
+                            <min>0</min>
+                            <max>1000</max>
+                        </scales>
+                        <scheme>
+                            <type>opacity</type>
+                            <color>#ff0000</color>
+                        </scheme>
+                </scaling>
+                <menus>
+                </menus>
+
                 <gff>
+                    <trackType>JBrowse/View/Track/CanvasFeatures</trackType>
+                    <index>false</index>
                 </gff>
-                <scaling>
-                    <method>score</method>
-                    <algo>linear</algo>
-                    <scales>
-                        <type>manual</type>
-                        <min>0</min>
-                        <max>1000</max>
-                    </scales>
-                    <scheme>
-                        <type>opacity</type>
-                        <color>#ff0000</color>
-                    </scheme>
-                </scaling>
             </options>
         </track>
-
-
-        <track cat="Realistic" format="gene_calls">
+        <track cat="Realistic" format="gene_calls" visibility="default_off">
             <files>
-                <trackFile path="test-data/gff3/interpro.gff" ext="gff3" label="Interpro data"/>
+              <trackFile path="test-data/gff3/interpro.gff" ext="gff3" label="Interpro data"/>
             </files>
 
             <options>
                 <style>
                     <className>feature</className>
-                    <description>feature</description>
+                    <description>note,description</description>
                     <label>name,id</label>
                     <height>100px</height>
                 </style>
+                <scaling>
+                        <method>ignore</method>
+                        <scheme>
+                            <color>__auto__</color>
+                        </scheme>
+                </scaling>
+                <menus>
+                </menus>
+
                 <gff>
+                    <trackType>JBrowse/View/Track/CanvasFeatures</trackType>
+                    <index>false</index>
                 </gff>
-                <scaling>
-                    <method>ignore</method>
-                    <scheme>
-                        <color>__auto__</color>
-                    </scheme>
-                </scaling>
             </options>
         </track>
-        <track cat="Realistic" format="gene_calls">
+        <track cat="Realistic" format="gene_calls" visibility="default_off">
             <files>
-                <trackFile path="test-data/gff3/2.gff" ext="gff3" label="Match/Match Part"/>
+              <trackFile path="test-data/gff3/2.gff" ext="gff3" label="Match/Match Part"/>
             </files>
 
             <options>
                 <style>
                     <className>feature</className>
-                    <description>feature</description>
+                    <description>note,description</description>
                     <label>name,id</label>
                     <height>100px</height>
                 </style>
+                <scaling>
+                        <method>ignore</method>
+                        <scheme>
+                            <color>__auto__</color>
+                        </scheme>
+                </scaling>
+                <menus>
+                </menus>
+
                 <gff>
+                    <trackType>JBrowse/View/Track/CanvasFeatures</trackType>
                     <match>cDNA_match</match>
+                    <index>false</index>
                 </gff>
-                <scaling>
-                    <method>ignore</method>
-                    <scheme>
-                        <type>opacity</type>
-                        <color>__auto__</color>
-                    </scheme>
-                </scaling>
             </options>
         </track>
     </tracks>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/menus/test.xml	Tue Nov 29 10:55:30 2016 -0500
@@ -0,0 +1,91 @@
+<?xml version="1.0"?>
+<root>
+    <metadata>
+        <gencode>11</gencode>
+        <genomes>
+                  <genome>/tmp/tmplFZ5li/files/000/dataset_14.dat</genome>
+        </genomes>
+        <general>
+            <defaultLocation></defaultLocation>
+            <trackPadding>20</trackPadding>
+
+            <shareLink>true</shareLink>
+            <aboutDescription></aboutDescription>
+            <show_tracklist>true</show_tracklist>
+            <show_nav>true</show_nav>
+            <show_overview>true</show_overview>
+            <show_menu>true</show_menu>
+            <hideGenomeOptions>false</hideGenomeOptions>
+        </general>
+    </metadata>
+    <tracks>
+        <track cat="With menu or index" format="gene_calls" visibility="default_off">
+            <files>
+              <trackFile path="/tmp/tmplFZ5li/files/000/dataset_15.dat" ext="gff3" label="1.gff" />
+            </files>
+
+            <options>
+                <style>
+                    <className>feature</className>
+                    <description>note,description</description>
+                    <label>name,id</label>
+                    <height>100px</height>
+                </style>
+                <scaling>
+                        <method>ignore</method>
+                        <scheme>
+                            <color>__auto__</color>
+                        </scheme>
+                </scaling>
+                <menus>
+                  <menu>
+                    <action>iframeDialog</action>
+                      <label>Some menu item</label>
+                      <title>Frame title</title>
+                      <url>https://example.com/#!/?id={name}&amp;q={type}&amp;z=&quot;{end}&quot;</url>
+                      <iconClass>dijitIconNewTask</iconClass>
+                  </menu>
+                  <menu>
+                    <action>newWindow</action>
+                      <label>Another menu item</label>
+                      <title>Frame title 2</title>
+                      <url>https://example.com/#!/?id={name}&amp;q={type}&amp;z=&quot;{end}&quot;</url>
+                      <iconClass>dijitIconBookmark</iconClass>
+                  </menu>
+                </menus>
+
+                <gff>
+                    <trackType>JBrowse/View/Track/CanvasFeatures</trackType>
+                    <index>false</index>
+                </gff>
+            </options>
+        </track>
+        <track cat="With menu or index" format="gene_calls" visibility="default_off">
+            <files>
+              <trackFile path="/tmp/tmplFZ5li/files/000/dataset_15.dat" ext="gff3" label="1.gff" />
+            </files>
+
+            <options>
+                <style>
+                    <className>feature</className>
+                    <description>note,description</description>
+                    <label>name,id</label>
+                    <height>100px</height>
+                </style>
+                <scaling>
+                        <method>ignore</method>
+                        <scheme>
+                            <color>__auto__</color>
+                        </scheme>
+                </scaling>
+                <menus>
+                </menus>
+
+                <gff>
+                    <trackType>JBrowse/View/Track/CanvasFeatures</trackType>
+                    <index>true</index>
+                </gff>
+            </options>
+        </track>
+    </tracks>
+</root>
--- a/tool_data_table_conf.xml.sample	Sun Jun 26 10:50:15 2016 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-<!-- Use the file tool_data_table_conf.xml.oldlocstyle if you don't want to update your loc files as changed in revision 4550:535d276c92bc-->
-<tables>
-    <!-- Locations of all fasta files under genome directory -->
-    <table name="all_fasta" comment_char="#">
-        <columns>value, dbkey, name, path</columns>
-        <file path="tool-data/all_fasta.loc" />
-    </table>
-</tables>
-
--- a/tool_dependencies.xml	Sun Jun 26 10:50:15 2016 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-<?xml version="1.0"?>
-<tool_dependency>
-  <package name="jbrowse" version="1.12.0">
-    <repository changeset_revision="d65f12198038" name="package_jbrowse_1_12_0" owner="iuc" toolshed="https://toolshed.g2.bx.psu.edu" />
-  </package>
-  <package name="bundle_jbrowse" version="1.12.0">
-    <repository changeset_revision="52153ec17769" name="package_perl_bundle_jbrowse_1_12_0" owner="iuc" toolshed="https://toolshed.g2.bx.psu.edu" />
-  </package>
-  <package name="python" version="2.7">
-    <repository changeset_revision="8b09fe018cac" name="package_python_2_7" owner="iuc" toolshed="https://toolshed.g2.bx.psu.edu" />
-  </package>
-  <package name="biopython" version="1.66">
-    <repository changeset_revision="8433ee4531ff" name="package_biopython_1_66" owner="biopython" toolshed="https://toolshed.g2.bx.psu.edu" />
-  </package>
-  <package name="bcbiogff" version="0.6.2">
-    <repository changeset_revision="8ee2210f6074" name="package_python_2_7_bcbiogff_0_6_2" owner="iuc" toolshed="https://toolshed.g2.bx.psu.edu" />
-  </package>
-  <package name="perl" version="5.18.1">
-    <repository changeset_revision="35f117d7396b" name="package_perl_5_18" owner="iuc" toolshed="https://toolshed.g2.bx.psu.edu" />
-  </package>
-  <package name="samtools" version="1.2">
-    <repository changeset_revision="f6ae3ba3f3c1" name="package_samtools_1_2" owner="iuc" toolshed="https://toolshed.g2.bx.psu.edu" />
-  </package>
-  <package name="pyyaml" version="3.11">
-    <repository changeset_revision="99267d131c05" name="package_python_2_7_pyyaml_3_11" owner="iuc" toolshed="https://toolshed.g2.bx.psu.edu" />
-  </package>
-</tool_dependency>