# HG changeset patch # User iuc # Date 1555338686 14400 # Node ID 2bb2e07a7a210e435de91b56ca7782c045252ac9 # Parent ca2def38369cbf97bec05fca4850d5024ba984da planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse commit 12dff0abf006f6c81f6462cdf4ea9c0c740d1e9c diff -r ca2def38369c -r 2bb2e07a7a21 jbrowse.py --- a/jbrowse.py Thu Apr 11 09:35:00 2019 -0400 +++ b/jbrowse.py Mon Apr 15 10:31:26 2019 -0400 @@ -80,8 +80,7 @@ var opacity = (score - ({min})) / (({max}) - ({min})); """, 'logarithmic': """ - var opacity = (score - ({min})) / (({max}) - ({min})); - opacity = Math.log10(opacity) + Math.log10({max}); + var opacity = Math.log10(score - ({min})) / Math.log10(({max}) - ({min})); """, 'blast': """ var opacity = 0; @@ -682,6 +681,36 @@ } self._add_track_json(data) + def traverse_to_option_parent(self, splitKey, outputTrackConfig): + trackConfigSubDict = outputTrackConfig + for part in splitKey[:-1]: + if trackConfigSubDict.get(part) is None: + trackConfigSubDict[part] = dict() + trackConfigSubDict = trackConfigSubDict[part] + assert isinstance(trackConfigSubDict, dict), 'Config element {} is not a dict'.format(trackConfigSubDict) + return trackConfigSubDict + + def get_formatted_option(self, valType2ValDict, mapped_chars): + assert isinstance(valType2ValDict, dict) and len(valType2ValDict.items()) == 1 + for valType, value in valType2ValDict.items(): + if valType == "text": + for char, mapped_char in mapped_chars.items(): + value = value.replace(mapped_char, char) + elif valType == "integer": + value = int(value) + elif valType == "float": + value = float(value) + else: # boolean + value = {'true': True, 'false': False}[value] + return value + + def set_custom_track_options(self, customTrackConfig, outputTrackConfig, mapped_chars): + for optKey, optType2ValDict in customTrackConfig.items(): + splitKey = optKey.split('.') + trackConfigOptionParent = self.traverse_to_option_parent(splitKey, outputTrackConfig) + optVal = self.get_formatted_option(optType2ValDict, mapped_chars) + trackConfigOptionParent[splitKey[-1]] = optVal + def process_annotations(self, track): category = track['category'].replace('__pd__date__pd__', TODAY) outputTrackConfig = { @@ -747,6 +776,10 @@ menus = self.cs.parse_menus(track['conf']['options']) outputTrackConfig.update(menus) + customTrackConfig = track['conf']['options'].get('custom_config', {}) + if customTrackConfig: + self.set_custom_track_options(customTrackConfig, outputTrackConfig, mapped_chars) + # import pprint; pprint.pprint(track) # import sys; sys.exit() if dataset_ext in ('gff', 'gff3', 'bed'): diff -r ca2def38369c -r 2bb2e07a7a21 jbrowse.xml --- a/jbrowse.xml Thu Apr 11 09:35:00 2019 -0400 +++ b/jbrowse.xml Mon Apr 15 10:31:26 2019 -0400 @@ -210,6 +210,15 @@ #end for #end if + #if str($track.data_format.data_format_select) in ["gene_calls", "pileup", "blast", "wiggle", "vcf"]: + + #for $custom_option in $track.data_format.jb_custom_config.option: + <${custom_option.opt_key}> + <${custom_option.opt_value.val_type}>${$custom_option.opt_value.val} + + #end for + + #end if #if str($track.data_format.data_format_select) == "wiggle": @@ -318,7 +327,8 @@ BlastView="${plugins.BlastView}" theme="" /> -]]> + +]]> @@ -431,11 +441,13 @@ + + @@ -487,6 +499,7 @@ description="note,description" height="10px"/> + @@ -503,6 +516,7 @@ type="integer" help="Maximum size in bytes of BAM chunks that the browser will try to deal with. When this is exceeded, most tracks will display 'Too much data' message." value="5000000" /> + @@ -545,6 +559,7 @@ help="MultiBigWig is a plugin to group multiple big-wig tracks in a more aesthetically pleasing format and to show data in a higher density display." /> + @@ -642,7 +657,7 @@ - + @@ -650,7 +665,7 @@ - + @@ -846,7 +861,7 @@ - + @@ -909,7 +924,7 @@ - + @@ -927,6 +942,7 @@ +
@@ -946,7 +962,59 @@ - + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + +
@@ -965,7 +1033,7 @@ - + @@ -975,7 +1043,7 @@ - + @@ -1022,7 +1090,7 @@ - + \$GALAXY_JBROWSE_SHARED_DIR - galaxy2 + galaxy3 + +
+ + + ^[\w]+(\.\w+)*$ + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
diff -r ca2def38369c -r 2bb2e07a7a21 test-data/bam/test.xml --- a/test-data/bam/test.xml Thu Apr 11 09:35:00 2019 -0400 +++ b/test-data/bam/test.xml Mon Apr 15 10:31:26 2019 -0400 @@ -54,15 +54,14 @@ display_name="test_history"/> + + false /tmp/tmpWtvfKr/files/_metadata_files/000/metadata_1.dat + 5000000 @@ -87,6 +89,7 @@ ComboTrackSelector="" Bookmarks="" GCContent="" + BlastView="True" theme="" /> - \ No newline at end of file + diff -r ca2def38369c -r 2bb2e07a7a21 test-data/custom_config/test.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/custom_config/test.xml Mon Apr 15 10:31:26 2019 -0400 @@ -0,0 +1,119 @@ + + + + 11 + + + + + + + + + + + + + 20 + + true + + true + true + true + true + false + + http://localhost + + + + + + + + + + + + + + + + + + ignore + + __auto__ + + + + + + + collapsed + + + 150 + + + 0.1 + + + false + + + + + NeatHTMLFeatures/View/Track/NeatFeatures + mRNA + false + + + + + + diff -r ca2def38369c -r 2bb2e07a7a21 test-data/gencode/test.xml --- a/test-data/gencode/test.xml Thu Apr 11 09:35:00 2019 -0400 +++ b/test-data/gencode/test.xml Mon Apr 15 10:31:26 2019 -0400 @@ -45,6 +45,7 @@ ComboTrackSelector="" Bookmarks="" GCContent="" + BlastView="True" theme="" /> diff -r ca2def38369c -r 2bb2e07a7a21 test-data/gff3/test.xml --- a/test-data/gff3/test.xml Thu Apr 11 09:35:00 2019 -0400 +++ b/test-data/gff3/test.xml Mon Apr 15 10:31:26 2019 -0400 @@ -158,6 +158,8 @@ + + NeatHTMLFeatures/View/Track/NeatFeatures @@ -212,6 +214,8 @@ + + NeatHTMLFeatures/View/Track/NeatFeatures @@ -272,6 +276,8 @@ + + NeatHTMLFeatures/View/Track/NeatFeatures @@ -332,6 +338,8 @@ + + NeatHTMLFeatures/View/Track/NeatFeatures @@ -394,6 +402,8 @@ + + NeatHTMLFeatures/View/Track/NeatFeatures @@ -456,6 +466,8 @@ + + NeatHTMLFeatures/View/Track/NeatFeatures @@ -510,6 +522,8 @@ + + NeatHTMLFeatures/View/Track/NeatFeatures @@ -564,6 +578,8 @@ + + NeatHTMLFeatures/View/Track/NeatFeatures diff -r ca2def38369c -r 2bb2e07a7a21 test-data/menus/test.xml --- a/test-data/menus/test.xml Thu Apr 11 09:35:00 2019 -0400 +++ b/test-data/menus/test.xml Mon Apr 15 10:31:26 2019 -0400 @@ -57,7 +57,6 @@ data_lines="27" comment_lines="19" columns="9" - column_names="" delimiter="__tc__" attributes="6" /> @@ -73,7 +72,7 @@