Repository 'jbrowse'
hg clone https://toolshed.g2.bx.psu.edu/repos/iuc/jbrowse

Changeset 8:ad4b9d7eae6a (2016-11-29)
Previous changeset 7:1e74f16adaa1 (2016-06-26) Next changeset 9:f422ba2e9aa5 (2016-11-29)
Commit message:
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse commit 9a243c616a4a3156347e38fdb5f35863ae5133f9
modified:
blastxml_to_gapped_gff3.py
gff3_rebase.py
jbrowse-fromdir.xml
jbrowse.py
jbrowse.xml
macros.xml
readme.rst
test-data/gencode/test-1.xml
test-data/gencode/test.xml
test-data/gff3/test.xml
added:
test-data/menus/test.xml
removed:
all_fasta.loc.sample
test-data/frameshift/1.gff
test-data/frameshift/test.xml
tool_data_table_conf.xml.sample
tool_dependencies.xml
b
diff -r 1e74f16adaa1 -r ad4b9d7eae6a all_fasta.loc.sample
--- a/all_fasta.loc.sample Sun Jun 26 10:50:15 2016 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
b
@@ -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.
-#
b
diff -r 1e74f16adaa1 -r ad4b9d7eae6a blastxml_to_gapped_gff3.py
--- 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
b
@@ -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'
b
diff -r 1e74f16adaa1 -r ad4b9d7eae6a gff3_rebase.py
--- a/gff3_rebase.py Sun Jun 26 10:50:15 2016 -0400
+++ b/gff3_rebase.py Tue Nov 29 10:55:30 2016 -0500
b
@@ -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"
b
diff -r 1e74f16adaa1 -r ad4b9d7eae6a jbrowse-fromdir.xml
--- 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>
-
b
diff -r 1e74f16adaa1 -r ad4b9d7eae6a jbrowse.py
--- a/jbrowse.py Sun Jun 26 10:50:15 2016 -0400
+++ b/jbrowse.py Tue Nov 29 10:55:30 2016 -0500
[
b'@@ -1,17 +1,19 @@\n #!/usr/bin/env python\n-import os\n+import argparse\n import copy\n-import argparse\n-import subprocess\n import hashlib\n+import json\n+import logging\n+import os\n+import shutil\n import struct\n+import subprocess\n import tempfile\n-import shutil\n-import json\n+import xml.etree.ElementTree as ET\n+from collections import defaultdict\n+\n from Bio.Data import CodonTable\n-import xml.etree.ElementTree as ET\n-import logging\n-from collections import defaultdict\n+\n logging.basicConfig(level=logging.INFO)\n log = logging.getLogger(\'jbrowse\')\n \n@@ -79,11 +81,11 @@\n         """,\n         \'blast\': """\n             var opacity = 0;\n-            if(score == 0.0) {{\n+            if(score == 0.0) {\n                 opacity = 1;\n-            }} else {{\n+            } else{\n                 opacity = (20 - Math.log10(score)) / 180;\n-            }}\n+            }\n         """\n     }\n \n@@ -125,7 +127,7 @@\n \n     def rgb_from_hex(self, hexstr):\n         # http://stackoverflow.com/questions/4296249/how-do-i-convert-a-hex-triplet-to-an-rgb-tuple-and-back\n-        return struct.unpack(\'BBB\',hexstr.decode(\'hex\'))\n+        return struct.unpack(\'BBB\', hexstr.decode(\'hex\'))\n \n     def min_max_gff(self, gff_file):\n         min_val = None\n@@ -154,6 +156,31 @@\n         self.brewer_colour_idx += 1\n         return r, g, b\n \n+    def parse_menus(self, track):\n+        trackConfig = {\'menuTemplate\': [{}, {}, {}]}\n+\n+        if \'menu\' in track[\'menus\']:\n+            menu_list = [track[\'menus\'][\'menu\']]\n+            if isinstance(track[\'menus\'][\'menu\'], list):\n+                menu_list = track[\'menus\'][\'menu\']\n+\n+            for m in menu_list:\n+                tpl = {\n+                    \'action\': m[\'action\'],\n+                    \'label\': m.get(\'label\', \'{name}\'),\n+                    \'iconClass\': m.get(\'iconClass\', \'dijitIconBookmark\'),\n+                }\n+                if \'url\' in m:\n+                    tpl[\'url\'] = m[\'url\']\n+                if \'content\' in m:\n+                    tpl[\'content\'] = m[\'content\']\n+                if \'title\' in m:\n+                    tpl[\'title\'] = m[\'title\']\n+\n+                trackConfig[\'menuTemplate\'].append(tpl)\n+\n+        return trackConfig\n+\n     def parse_colours(self, track, trackFormat, gff3=None):\n         # Wiggle tracks have a bicolor pallete\n         trackConfig = {\'style\': {}}\n@@ -166,7 +193,6 @@\n                 trackConfig[\'style\'][\'neg_color\'] = self.hex_from_rgb(*self._get_colours())\n                 trackConfig[\'style\'][\'pos_color\'] = self.hex_from_rgb(*self._get_colours())\n \n-\n             # Wiggle tracks can change colour at a specified place\n             bc_pivot = track[\'wiggle\'][\'bicolor_pivot\']\n             if bc_pivot not in (\'mean\', \'zero\'):\n@@ -223,7 +249,7 @@\n                         auto_color = "\'%s\'" % self.hex_from_rgb(*self._get_colours())\n \n                     color_function = self.COLOR_FUNCTION_TEMPLATE_QUAL.format(**{\n-                        \'opacity\': self.OPACITY_MATH[algo].format(**{\'max\': max_val,\'min\': min_val}),\n+                        \'opacity\': self.OPACITY_MATH[algo].format(**{\'max\': max_val, \'min\': min_val}),\n                         \'user_spec_color\': user_color,\n                         \'auto_gen_color\': auto_color,\n                     })\n@@ -240,14 +266,14 @@\n         for dc in map(etree_to_dict, children):\n             for k, v in dc.iteritems():\n                 dd[k].append(v)\n-        d = {t.tag: {k:v[0] if len(v) == 1 else v for k, v in dd.iteritems()}}\n+        d = {t.tag: {k: v[0] if len(v) == 1 else v for k, v in dd.iteritems()}}\n     if t.attrib:\n         d[t.tag].update((\'@\' + k, v) for k, v in t.attrib.iteritems())\n     if t.text:\n         text = t.text.strip()\n         if children or t.attrib:\n             if text:\n-              d[t.tag][\'#text\'] = text\n+                d[t.tag][\'#text\'] = text\n         else:\n             d[t.tag] = text\n     return d\n@@ -274,6 +300,7 @@\n         self.genome_paths = genomes\n         self.standalone = standalone\n     '..b'           \'perl\', self._jbrowse_bin(\'generate-names.pl\'),\n+            \'--hashBits\', \'16\'\n+        ]\n+\n+        tracks = \',\'.join(self.tracksToIndex)\n+\n+        if tracks:\n+            args += [\'--tracks\', tracks]\n+        else:\n+            # No tracks to index, index only the refseq\n+            args += [\'--tracks\', \'DNA\']\n+\n+        self.subprocess_check_call(args)\n \n     def _add_json(self, json_data):\n \n@@ -343,7 +381,6 @@\n         self.subprocess_check_call(cmd)\n         os.unlink(tmp.name)\n \n-\n     def _blastxml_to_gff3(self, xml, min_gap=10):\n         gff3_unrebased = tempfile.NamedTemporaryFile(delete=False)\n         cmd = [\'python\', os.path.join(INSTALLED_TO, \'blastxml_to_gapped_gff3.py\'),\n@@ -389,6 +426,9 @@\n         self.subprocess_check_call(cmd)\n         os.unlink(gff3)\n \n+        if blastOpts.get(\'index\', \'false\') == \'true\':\n+            self.tracksToIndex.append("%s" % trackData[\'label\'])\n+\n     def add_bigwig(self, data, trackData, wiggleOpts, **kwargs):\n         dest = os.path.join(\'data\', \'raw\', trackData[\'label\'] + \'.bw\')\n         cmd = [\'ln\', data, dest]\n@@ -425,7 +465,6 @@\n             "storeClass": "JBrowse/Store/SeqFeature/BAM",\n         })\n \n-\n         self._add_track_json(trackData)\n \n         if bamOpts.get(\'auto_snp\', \'false\') == \'true\':\n@@ -433,7 +472,7 @@\n             trackData2.update({\n                 "type": "JBrowse/View/Track/SNPCoverage",\n                 "key": trackData[\'key\'] + " - SNPs/Coverage",\n-                "label": trackData[\'label\']  + "_autosnp",\n+                "label": trackData[\'label\'] + "_autosnp",\n             })\n             self._add_track_json(trackData2)\n \n@@ -468,7 +507,7 @@\n         clientConfig = trackData[\'style\']\n         del config[\'style\']\n \n-        if  \'match\' in gffOpts:\n+        if \'match\' in gffOpts:\n             config[\'glyph\'] = \'JBrowse/View/FeatureGlyph/Segments\'\n             cmd += [\'--type\', gffOpts[\'match\']]\n \n@@ -488,12 +527,14 @@\n \n         self.subprocess_check_call(cmd)\n \n+        if gffOpts.get(\'index\', \'false\') == \'true\':\n+            self.tracksToIndex.append("%s" % trackData[\'label\'])\n \n     def process_annotations(self, track):\n         outputTrackConfig = {\n             \'style\': {\n-                \'label\':       track[\'style\'].get(\'label\', \'description\'),\n-                \'className\':   track[\'style\'].get(\'className\', \'feature\'),\n+                \'label\': track[\'style\'].get(\'label\', \'description\'),\n+                \'className\': track[\'style\'].get(\'className\', \'feature\'),\n                 \'description\': track[\'style\'].get(\'description\', \'\'),\n             },\n             \'category\': track[\'category\'],\n@@ -516,11 +557,14 @@\n                 else:\n                     outputTrackConfig[key] = colourOptions[key]\n \n+            menus = self.cs.parse_menus(track[\'conf\'][\'options\'])\n+            outputTrackConfig.update(menus)\n+\n             # import pprint; pprint.pprint(track)\n             # import sys; sys.exit()\n             if dataset_ext in (\'gff\', \'gff3\', \'bed\'):\n                 self.add_features(dataset_path, dataset_ext, outputTrackConfig,\n-                                track[\'conf\'][\'options\'][\'gff\'])\n+                                  track[\'conf\'][\'options\'][\'gff\'])\n             elif dataset_ext == \'bigwig\':\n                 self.add_bigwig(dataset_path, outputTrackConfig,\n                                 track[\'conf\'][\'options\'][\'wiggle\'])\n@@ -645,14 +689,14 @@\n         try:\n             # Only pertains to gff3 + blastxml. TODO?\n             track_conf[\'style\'] = {t.tag: t.text for t in track.find(\'options/style\')}\n-        except TypeError, te:\n+        except TypeError:\n             track_conf[\'style\'] = {}\n             pass\n         track_conf[\'conf\'] = etree_to_dict(track.find(\'options\'))\n         keys = jc.process_annotations(track_conf)\n \n-\n         for key in keys:\n             extra_data[\'visibility\'][track.attrib.get(\'visibility\', \'default_off\')].append(key)\n \n     jc.add_final_data(extra_data)\n+    jc.generate_names()\n'
b
diff -r 1e74f16adaa1 -r ad4b9d7eae6a jbrowse.xml
--- a/jbrowse.xml Sun Jun 26 10:50:15 2016 -0400
+++ b/jbrowse.xml Tue Nov 29 10:55:30 2016 -0500
[
b'@@ -1,17 +1,16 @@\n-<tool id="jbrowse" name="JBrowse" version="0.5.2">\n+<tool id="jbrowse" name="JBrowse" version="@WRAPPER_VERSION@">\n   <description>genome browser</description>\n   <macros>\n     <import>macros.xml</import>\n   </macros>\n   <expand macro="requirements"/>\n   <expand macro="stdio"/>\n-  <version_command>python jbrowse.py --version</version_command>\n   <command><![CDATA[\n \n #if $action.action_select == "create":\n-    mkdir -p $output.files_path;\n+    mkdir -p $output.files_path &&\n #else:\n-    cp -R $action.update_jbrowse.extra_files_path $output.files_path;\n+    cp -R $action.update_jbrowse.extra_files_path $output.files_path &&\n #end if\n \n ## Copy the XML file into the directory, mostly for debugging\n@@ -27,7 +26,7 @@\n #end if\n \n --outdir $output.files_path\n-$trackxml;\n+$trackxml &&\n \n #if str($standalone) == "Complete":\n     mv $output.files_path/index.html $output;\n@@ -72,13 +71,13 @@\n     <metadata>\n         <gencode>$gencode</gencode>\n         <genomes>\n-              #if str($action.reference_genome.genome_type_select) == "indexed":\n-                <genome>${action.reference_genome.genomes.fields.path}</genome>\n-              #else\n-                #for $genome in $action.reference_genome.genomes:\n-                    <genome>$genome</genome>\n-                #end for\n-              #end if\n+            #if str($reference_genome.genome_type_select) == "indexed":\n+              <genome>${reference_genome.genomes.fields.path}</genome>\n+            #else\n+              #for $genome in $reference_genome.genomes:\n+                  <genome>$genome</genome>\n+              #end for\n+            #end if\n         </genomes>\n         <general>\n             <defaultLocation>${jbgen.defaultLocation}</defaultLocation>\n@@ -145,6 +144,25 @@\n                         </scheme>\n                   #end if\n                 </scaling>\n+                <menus>\n+                  #for $menu_item in $track.data_format.jbmenu.track_menu:\n+                  <menu>\n+                    <action>${menu_item.menu_action}</action>\n+                    #if str($menu_item.menu_label) != "":\n+                      <label>${menu_item.menu_label}</label>\n+                    #end if\n+                    #if str($menu_item.menu_title) != "":\n+                      <title>${menu_item.menu_title}</title>\n+                    #end if\n+                    #if str($menu_item.menu_url) != "":\n+                      <url>${menu_item.menu_url.replace("&", "&amp;").replace("\\"", "&quot;")}</url>\n+                    #end if\n+                    #if str($menu_item.menu_icon) != "":\n+                      <iconClass>${menu_item.menu_icon}</iconClass>\n+                    #end if\n+                  </menu>\n+                  #end for\n+                </menus>\n             #end if\n \n             #if str($track.data_format.data_format_select) == "wiggle":\n@@ -194,6 +212,7 @@\n                   #end if\n                     <protein>${track.data_format.is_protein}</protein>\n                     <min_gap>${track.data_format.min_gap}</min_gap>\n+                    <index>${track.data_format.index}</index>\n                 </blast>\n             #else if str($track.data_format.data_format_select) == "gene_calls":\n                 <gff>\n@@ -201,6 +220,7 @@\n                   #if $track.data_format.match_part.match_part_select:\n                     <match>${track.data_format.match_part.name}</match>\n                   #end if\n+                    <index>${track.data_format.index}</index>\n                 </gff>\n ##            #else if str($track.data_format.data_format_select) == "sparql":\n ##                <sparql>\n@@ -216,32 +236,40 @@\n         #end for\n     </tracks>\n </root>\n-]]>\n-      </configfile>\n+]]></configfile>\n   </configfiles>\n   <inputs>\n-    <conditional name="action" label="Action">\n-        <param type="select" label="JBrowse-in-Galaxy Action" name="action_select">\n-            <option value="create">New JBrowse Instance</option>\n-            <op'..b'                  <param name="match_part_select" value="false"/>\n+                    </conditional>\n+                    <section name="jbcolor_scale">\n+                        <conditional name="color_score">\n+                            <param name="color_score_select" value="none"/>\n+                        </conditional>\n+                        <conditional name="color">\n+                            <param name="color_select" value="automatic"/>\n+                        </conditional>\n+                    </section>\n+                    <section name="jbmenu">\n+                        <repeat name="track_menu">\n+                            <param name="menu_action" value="iframeDialog"/>\n+                            <param name="menu_label" value="Some menu item"/>\n+                            <param name="menu_title" value="Frame title"/>\n+                            <param name="menu_url" value="https://example.com/#!/?id={name}&amp;q={type}&amp;z=&quot;{end}&quot;"/>\n+                            <param name="menu_icon" value="dijitIconNewTask"/>\n+                        </repeat>\n+                        <repeat name="track_menu">\n+                            <param name="menu_action" value="newWindow"/>\n+                            <param name="menu_label" value="Another menu item"/>\n+                            <param name="menu_title" value="Frame title 2"/>\n+                            <param name="menu_url" value="https://example.com/#!/?id={name}&amp;q={type}&amp;z=&quot;{end}&quot;"/>\n+                        </repeat>\n+                    </section>\n+                </conditional>\n+            </repeat>\n+            <repeat name="data_tracks">\n+                <conditional name="data_format">\n+                    <param name="data_format_select" value="gene_calls"/>\n+                    <param name="annotation" value="gff3/1.gff"/>\n+                    <param name="index" value="true"/>\n+                    <conditional name="match_part">\n+                        <param name="match_part_select" value="false"/>\n+                    </conditional>\n+                    <section name="jbcolor_scale">\n+                        <conditional name="color_score">\n+                            <param name="color_score_select" value="none"/>\n+                        </conditional>\n+                        <conditional name="color">\n+                            <param name="color_select" value="automatic"/>\n+                        </conditional>\n+                    </section>\n+                </conditional>\n+            </repeat>\n+        </repeat>\n+\n+        <param name="uglyTestingHack" value="enabled" />\n+        <output name="output" file="menus/test.xml" lines_diff="6"/>\n+    </test>\n   </tests>\n   <help><![CDATA[\n JBrowse-in-Galaxy\n@@ -505,12 +737,6 @@\n JBrowse-in-Galaxy offers a highly configurable, workflow-compatible\n alternative to Trackster.\n \n-Overview\n---------\n-\n-JBrowse is a fast, embeddable genome browser built completely with\n-JavaScript and HTML5.\n-\n The JBrowse-in-Galaxy (JiG) tool was written to help build complex\n JBrowse installations straight from Galaxy, taking advantage of the\n latest Galaxy features such as dataset collections, sections, and colour\n@@ -587,7 +813,7 @@\n consists of top level ``match`` features, with a child ``match_part``\n feature, and is often used in displaying alignments. (See "Alignments"\n section on the `GFF3\n-specification <http://www.sequenceontology.org/gff3.shtml>`__ for more\n+specification <https://github.com/The-Sequence-Ontology/Specifications/blob/master/gff3.md>`__ for more\n information). If the data is match/match part, you will need to specify\n the top level match feature name, as it can be one of a few different SO\n terms, and JiG does not yet have the ability to understand SO terms.\n@@ -755,8 +981,5 @@\n \n @ATTRIBUTION@\n ]]></help>\n-  <citations>\n-    <citation type="doi">10.1101/gr.094607.109</citation>\n-  </citations>\n+  <expand macro="citations"/>\n </tool>\n-\n'
b
diff -r 1e74f16adaa1 -r ad4b9d7eae6a macros.xml
--- a/macros.xml Sun Jun 26 10:50:15 2016 -0400
+++ b/macros.xml Tue Nov 29 10:55:30 2016 -0500
[
b'@@ -2,10 +2,8 @@\n <macros>\n   <xml name="requirements">\n     <requirements>\n-      <requirement type="package" version="1.12.0">jbrowse</requirement>\n-      <requirement type="package" version="1.12.0">bundle_jbrowse</requirement>\n+      <requirement type="package" version="1.12.1">jbrowse</requirement>\n       <requirement type="package" version="2.7">python</requirement>\n-      <requirement type="package" version="5.18.1">perl</requirement>\n       <requirement type="package" version="1.66">biopython</requirement>\n       <requirement type="package" version="0.6.2">bcbiogff</requirement>\n       <requirement type="package" version="1.2">samtools</requirement>\n@@ -13,7 +11,8 @@\n       <yield/>\n     </requirements>\n   </xml>\n-  <token name="@WRAPPER_VERSION@">1.0</token>\n+  <token name="@DATA_DIR@">\\$GALAXY_JBROWSE_SHARED_DIR</token>\n+  <token name="@WRAPPER_VERSION@">0.5.1</token>\n   <xml name="stdio">\n     <stdio>\n       <exit_code range="1:"/>\n@@ -28,43 +27,6 @@\n This Galaxy tool relies on the JBrowse, maintained by the GMOD Community. The Galaxy wrapper is developed by Eric Rasche\n ]]>\n   </token>\n-  \n-  <xml name="genome_selector"\n-    token_help=""\n-    token_label="Fasta sequences"\n-    token_optional="False" >\n-    <conditional name="reference_genome">\n-        <param help="Built-in references" label="Reference genome to display" name="genome_type_select" type="select">\n-            <option selected="True" value="indexed">Use a built-in genome</option>\n-            <option value="history">Use a genome from history</option>\n-        </param>\n-        <when value="indexed">\n-            <param \n-              help="@HELP@"\n-              label="@LABEL@"\n-              name="genomes"\n-              type="select"\n-              optional="@OPTIONAL@"\n-              >\n-                <options from_data_table="all_fasta">\n-                    <filter column="2" type="sort_by" />\n-                    <validator message="No genomes are available for the selected input dataset" type="no_options" />\n-                </options>\n-            </param>\n-        </when>\n-        <when value="history">\n-            <param \n-              format="fasta"\n-              label="@LABEL@"\n-              help="@HELP@"\n-              name="genomes"\n-              type="data"\n-              optional="@OPTIONAL@"\n-              multiple="True" />\n-        </when>\n-    </conditional>\n-  </xml>\n-  \n   <xml name="auto_manual_tk"\n       token_cond_label="Color"\n       token_cond_name="color"\n@@ -218,7 +180,7 @@\n             <param type="select" label="JBrowse style.color function\'s score scaling" name="score_scaling"\n                    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.">\n               <option value="linear"      selected="@SCALING_LIN_SELECT@" >Linear scaling</option>\n-              <option value="logarithmic" selected=""                     >Logarithmic scaling</option>\n+              <option value="logarithmic">Logarithmic scaling</option>\n               <option value="blast"       selected="@SCALING_LOG_SELECT@" >Blast scaling</option>\n             </param>\n \n@@ -257,8 +219,8 @@\n   </xml>\n   <xml name="track_styling"\n        token_classname="feature"\n-       token_label="prodcut,name,id"\n-       token_description="note"\n+       token_label="name,id"\n+       token_description="note,description"\n        token_height="100px">\n     <section name="jbstyle" title="JBrowse Styling Options [Advanced]" expanded="false">\n         <param label="JBrowse style.className" type="text"\n@@ -283,7 +245,99 @@\n     </section>\n   </xml>\n \n+  <xml name="track_menu">\n+    <section name="jbmenu" titl'..b'ng the user away from JBrowse.</option>\n+          </param>\n+          <param label="Menu label"\n+                 type="text"\n+                 name="menu_label"\n+                 help="Will be displayed in the contextual menu on each feature ({name}, {id}, {type}, {start}, {end}, {strand} variables will be interpreted)">\n+           <expand macro="menu_sanitize" />\n+          </param>\n+          <param label="Menu title"\n+                 type="text"\n+                 name="menu_title"\n+                 help="Will be displayed in the popup title bar if displayed ({name}, {id}, {type}, {start}, {end}, {strand} variables will be interpreted)">\n+           <expand macro="menu_sanitize" />\n+          </param>\n+          <param label="Menu url"\n+                 type="text"\n+                 name="menu_url"\n+                 help="Destination URL ({name}, {id}, {type}, {start}, {end}, {strand} variables will be interpreted)">\n+           <expand macro="menu_sanitize" />\n+          </param>\n+          <param label="Menu icon"\n+                 type="select"\n+                 name="menu_icon"\n+                 help="Icon to display next to menu label">\n+            <option value="dijitIconBookmark" selected="true">Bookmark</option>\n+            <option value="dijitIconSave">Save</option>\n+            <option value="dijitIconPrint">Print</option>\n+            <option value="dijitIconCut">Cut</option>\n+            <option value="dijitIconCopy">Copy</option>\n+            <option value="dijitIconClear">Clear</option>\n+            <option value="dijitIconDelete">Delete</option>\n+            <option value="dijitIconUndo">Undo</option>\n+            <option value="dijitIconEdit">Edit</option>\n+            <option value="dijitIconNewTask">New Task</option>\n+            <option value="dijitIconEditTask">Edit Task</option>\n+            <option value="dijitIconEditProperty">Edit Property</option>\n+            <option value="dijitIconTask">Task</option>\n+            <option value="dijitIconFilter">Filter</option>\n+            <option value="dijitIconConfigure">Configure</option>\n+            <option value="dijitIconSearch">Search</option>\n+            <option value="dijitIconApplication">Application</option>\n+            <option value="dijitIconChart">Chart</option>\n+            <option value="dijitIconConnector">Connector</option>\n+            <option value="dijitIconDatabase">Database</option>\n+            <option value="dijitIconDocuments">Documents</option>\n+            <option value="dijitIconMail">Mail</option>\n+            <option value="dijitLeaf">Leaf</option>\n+            <option value="dijitIconFile">File</option>\n+            <option value="dijitIconFunction">Function</option>\n+            <option value="dijitIconKey">Key</option>\n+            <option value="dijitIconPackage">Package</option>\n+            <option value="dijitIconSample">Sample</option>\n+            <option value="dijitIconTable">Table</option>\n+            <option value="dijitIconUsers">Users</option>\n+            <option value="dijitIconFolderClosed">Folder Closed</option>\n+            <option value="dijitIconFolderOpen">Folder Open</option>\n+            <option value="dijitIconError">Error</option>\n+          </param>\n+      </repeat>\n+    </section>\n+  </xml>\n+\n+  <xml name="menu_sanitize">\n+    <sanitizer>\n+        <valid>\n+            <add value="{"/>\n+            <add value="}"/>\n+            <add value="!"/>\n+            <add value="?"/>\n+            <add value="&amp;"/>\n+            <add value="+"/>\n+            <add value="="/>\n+            <add value="\'"/>\n+            <add value=\'"\'/>\n+        </valid>\n+    </sanitizer>\n+  </xml>\n+\n   <xml name="input_conditional" token_label="Track Data" token_format="data">\n       <param label="@LABEL@" format="@FORMAT@" name="annotation" type="data" multiple="True"/>\n   </xml>\n+  <xml name="citations">\n+    <citations>\n+      <citation type="doi">10.1101/gr.094607.109</citation>\n+    </citations>\n+  </xml>\n </macros>\n'
b
diff -r 1e74f16adaa1 -r ad4b9d7eae6a readme.rst
--- a/readme.rst Sun Jun 26 10:50:15 2016 -0400
+++ b/readme.rst Tue Nov 29 10:55:30 2016 -0500
b
@@ -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.
b
diff -r 1e74f16adaa1 -r ad4b9d7eae6a test-data/frameshift/1.gff
--- a/test-data/frameshift/1.gff Sun Jun 26 10:50:15 2016 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
b
@@ -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
b
diff -r 1e74f16adaa1 -r ad4b9d7eae6a test-data/frameshift/test.xml
--- a/test-data/frameshift/test.xml Sun Jun 26 10:50:15 2016 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
b
@@ -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>
b
diff -r 1e74f16adaa1 -r ad4b9d7eae6a test-data/gencode/test-1.xml
--- 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
b
@@ -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>
b
diff -r 1e74f16adaa1 -r ad4b9d7eae6a test-data/gencode/test.xml
--- 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
b
@@ -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>
b
diff -r 1e74f16adaa1 -r ad4b9d7eae6a test-data/gff3/test.xml
--- 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
b
b'@@ -3,226 +3,268 @@\n     <metadata>\n         <gencode>11</gencode>\n         <genomes>\n-            <genome>test-data/merlin.fa</genome>\n+                  <genome>test-data/merlin.fa</genome>\n         </genomes>\n         <general>\n             <defaultLocation></defaultLocation>\n-            <trackPadding>40</trackPadding>\n+            <trackPadding>20</trackPadding>\n+\n             <shareLink>true</shareLink>\n             <aboutDescription></aboutDescription>\n             <show_tracklist>true</show_tracklist>\n             <show_nav>true</show_nav>\n-            <show_overview>false</show_overview>\n+            <show_overview>true</show_overview>\n             <show_menu>true</show_menu>\n             <hideGenomeOptions>false</hideGenomeOptions>\n         </general>\n     </metadata>\n     <tracks>\n-        <track cat="Auto Coloured" format="gene_calls" visibility="default_on">\n+        <track cat="Auto Coloured" format="gene_calls" visibility="default_off">\n             <files>\n-                <trackFile path="test-data/gff3/1.gff" ext="gff3" label="A"/>\n-                <trackFile path="test-data/gff3/1.gff" ext="gff3" label="B"/>\n-                <trackFile path="test-data/gff3/1.gff" ext="gff3" label="C"/>\n-                <trackFile path="test-data/gff3/1.gff" ext="gff3" label="D"/>\n+              <trackFile path="test-data/gff3/1.gff" ext="gff3" label="A"/>\n+              <trackFile path="test-data/gff3/1.gff" ext="gff3" label="B"/>\n+              <trackFile path="test-data/gff3/1.gff" ext="gff3" label="C"/>\n+              <trackFile path="test-data/gff3/1.gff" ext="gff3" label="D"/>\n             </files>\n \n             <options>\n                 <style>\n                     <className>feature</className>\n-                    <description>feature</description>\n+                    <description>note,description</description>\n                     <label>name,id</label>\n                     <height>100px</height>\n                 </style>\n+                <scaling>\n+                        <method>ignore</method>\n+                        <scheme>\n+                            <color>__auto__</color>\n+                        </scheme>\n+                </scaling>\n+                <menus>\n+                </menus>\n+\n                 <gff>\n+                    <trackType>JBrowse/View/Track/CanvasFeatures</trackType>\n+                    <index>false</index>\n                 </gff>\n-                <scaling>\n-                    <method>ignore</method>\n-                    <scheme>\n-                        <color>__auto__</color>\n-                    </scheme>\n-                </scaling>\n             </options>\n         </track>\n-        <track cat="Ignore Scale" format="gene_calls">\n+        <track cat="Ignore Scale" format="gene_calls" visibility="default_off">\n             <files>\n-                <trackFile path="test-data/gff3/1.gff" ext="gff3" label="Fixed Colour"/>\n+              <trackFile path="test-data/gff3/1.gff" ext="gff3" label="Fixed Colour"/>\n             </files>\n \n             <options>\n                 <style>\n                     <className>feature</className>\n-                    <description>feature</description>\n+                    <description>note,description</description>\n                     <label>name,id</label>\n                     <height>100px</height>\n                 </style>\n+                <scaling>\n+                        <method>ignore</method>\n+                        <scheme>\n+                            <color>#ff00ff</color>\n+                        </scheme>\n+                </scaling>\n+                <menus>\n+                </menus>\n+\n                 <gff>\n+                    <trackType>JBrowse/View/Track/CanvasFeatures</trackType>\n+                    <index>false</index>\n                 </gff>\n-                <scaling>\n-                    <method>ignore</method>\n-                    <scheme>\n-                        <color>#ff00ff</color>\n-                    </scheme>\n-         '..b'    <type>manual</type>\n+\n+                            <min>0</min>\n+                            <max>1000</max>\n+                        </scales>\n+                        <scheme>\n+                            <type>opacity</type>\n+                            <color>#ff0000</color>\n+                        </scheme>\n+                </scaling>\n+                <menus>\n+                </menus>\n+\n                 <gff>\n+                    <trackType>JBrowse/View/Track/CanvasFeatures</trackType>\n+                    <index>false</index>\n                 </gff>\n-                <scaling>\n-                    <method>score</method>\n-                    <algo>linear</algo>\n-                    <scales>\n-                        <type>manual</type>\n-                        <min>0</min>\n-                        <max>1000</max>\n-                    </scales>\n-                    <scheme>\n-                        <type>opacity</type>\n-                        <color>#ff0000</color>\n-                    </scheme>\n-                </scaling>\n             </options>\n         </track>\n-\n-\n-        <track cat="Realistic" format="gene_calls">\n+        <track cat="Realistic" format="gene_calls" visibility="default_off">\n             <files>\n-                <trackFile path="test-data/gff3/interpro.gff" ext="gff3" label="Interpro data"/>\n+              <trackFile path="test-data/gff3/interpro.gff" ext="gff3" label="Interpro data"/>\n             </files>\n \n             <options>\n                 <style>\n                     <className>feature</className>\n-                    <description>feature</description>\n+                    <description>note,description</description>\n                     <label>name,id</label>\n                     <height>100px</height>\n                 </style>\n+                <scaling>\n+                        <method>ignore</method>\n+                        <scheme>\n+                            <color>__auto__</color>\n+                        </scheme>\n+                </scaling>\n+                <menus>\n+                </menus>\n+\n                 <gff>\n+                    <trackType>JBrowse/View/Track/CanvasFeatures</trackType>\n+                    <index>false</index>\n                 </gff>\n-                <scaling>\n-                    <method>ignore</method>\n-                    <scheme>\n-                        <color>__auto__</color>\n-                    </scheme>\n-                </scaling>\n             </options>\n         </track>\n-        <track cat="Realistic" format="gene_calls">\n+        <track cat="Realistic" format="gene_calls" visibility="default_off">\n             <files>\n-                <trackFile path="test-data/gff3/2.gff" ext="gff3" label="Match/Match Part"/>\n+              <trackFile path="test-data/gff3/2.gff" ext="gff3" label="Match/Match Part"/>\n             </files>\n \n             <options>\n                 <style>\n                     <className>feature</className>\n-                    <description>feature</description>\n+                    <description>note,description</description>\n                     <label>name,id</label>\n                     <height>100px</height>\n                 </style>\n+                <scaling>\n+                        <method>ignore</method>\n+                        <scheme>\n+                            <color>__auto__</color>\n+                        </scheme>\n+                </scaling>\n+                <menus>\n+                </menus>\n+\n                 <gff>\n+                    <trackType>JBrowse/View/Track/CanvasFeatures</trackType>\n                     <match>cDNA_match</match>\n+                    <index>false</index>\n                 </gff>\n-                <scaling>\n-                    <method>ignore</method>\n-                    <scheme>\n-                        <type>opacity</type>\n-                        <color>__auto__</color>\n-                    </scheme>\n-                </scaling>\n             </options>\n         </track>\n     </tracks>\n'
b
diff -r 1e74f16adaa1 -r ad4b9d7eae6a test-data/menus/test.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/menus/test.xml Tue Nov 29 10:55:30 2016 -0500
b
@@ -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>
b
diff -r 1e74f16adaa1 -r ad4b9d7eae6a tool_data_table_conf.xml.sample
--- 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
b
@@ -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>
-
b
diff -r 1e74f16adaa1 -r ad4b9d7eae6a tool_dependencies.xml
--- a/tool_dependencies.xml Sun Jun 26 10:50:15 2016 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
b
@@ -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>