[hg] galaxy 2449: Merging Ian's trackster update with current head
details: http://www.bx.psu.edu/hg/galaxy/rev/6125f71c838a changeset: 2449:6125f71c838a user: James Taylor <james@jamestaylor.org> date: Thu Jun 11 12:20:03 2009 -0400 description: Merging Ian's trackster update with current head 11 file(s) affected in this change: datatypes_conf.xml.sample lib/galaxy/datatypes/data.py lib/galaxy/datatypes/interval.py lib/galaxy/datatypes/registry.py lib/galaxy/tools/actions/__init__.py lib/galaxy/tools/actions/upload.py lib/galaxy/tools/parameters/basic.py lib/galaxy/web/controllers/root.py lib/galaxy/web/framework/__init__.py templates/dataset/edit_attributes.mako tools/data_source/upload.xml diffs (671 lines): diff -r c69e55c91036 -r 6125f71c838a datatypes_conf.xml.sample --- a/datatypes_conf.xml.sample Thu Jun 11 12:06:29 2009 -0400 +++ b/datatypes_conf.xml.sample Thu Jun 11 12:20:03 2009 -0400 @@ -8,6 +8,9 @@ <converter file="interval_to_coverage.xml" target_datatype="coverage"/> </datatype> <datatype extension="binseq.zip" type="galaxy.datatypes.images:Binseq" mimetype="application/zip" display_in_upload="true"/> + <datatype extension="len" type="galaxy.datatypes.chrominfo:ChromInfo" display_in_upload="true"> + <!-- no converters yet --> + </datatype> <datatype extension="coverage" type="galaxy.datatypes.coverage:LastzCoverage" display_in_upload="true"> <indexer file="coverage.xml" /> </datatype> @@ -31,7 +34,7 @@ <datatype extension="html" type="galaxy.datatypes.images:Html" mimetype="text/html"/> <datatype extension="interval" type="galaxy.datatypes.interval:Interval" display_in_upload="true"> <converter file="interval_to_bed_converter.xml" target_datatype="bed"/> - <indexer file="interval.xml" /> + <indexer file="interval_awk.xml" /> </datatype> <datatype extension="jpg" type="galaxy.datatypes.images:Image" mimetype="image/jpeg"/> <datatype extension="laj" type="galaxy.datatypes.images:Laj"/> diff -r c69e55c91036 -r 6125f71c838a lib/galaxy/datatypes/chrominfo.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/galaxy/datatypes/chrominfo.py Thu Jun 11 12:20:03 2009 -0400 @@ -0,0 +1,14 @@ +import data +from galaxy import util +from galaxy.datatypes.sniff import * +from galaxy.web import url_for +from tabular import Tabular +from galaxy.datatypes import metadata +from galaxy.datatypes.metadata import MetadataElement + + +class ChromInfo( Tabular ): + file_ext = "len" + MetadataElement( name="chrom", default=1, desc="Chrom column", param=metadata.ColumnParameter ) + MetadataElement( name="length", default=2, desc="Length column", param=metadata.ColumnParameter ) + diff -r c69e55c91036 -r 6125f71c838a lib/galaxy/datatypes/data.py --- a/lib/galaxy/datatypes/data.py Thu Jun 11 12:06:29 2009 -0400 +++ b/lib/galaxy/datatypes/data.py Thu Jun 11 12:20:03 2009 -0400 @@ -42,7 +42,7 @@ __metaclass__ = DataMeta """Add metadata elements""" - MetadataElement( name="dbkey", desc="Database/Build", default="?", param=metadata.SelectParameter, multiple=False, values=util.dbnames, no_value="?" ) + MetadataElement( name="dbkey", desc="Database/Build", default="?", param=metadata.DBKeyParameter, multiple=False, no_value="?" ) """Stores the set of display applications, and viewing methods, supported by this datatype """ supported_display_apps = {} diff -r c69e55c91036 -r 6125f71c838a lib/galaxy/datatypes/indexers/coverage.py --- a/lib/galaxy/datatypes/indexers/coverage.py Thu Jun 11 12:06:29 2009 -0400 +++ b/lib/galaxy/datatypes/indexers/coverage.py Thu Jun 11 12:20:03 2009 -0400 @@ -37,7 +37,7 @@ os.rename( fname+".npy", fname ) # Write average - for window in 10, 100, 1000, 10000: + for window in 10, 100, 1000, 10000, 100000: input = scores.copy() size = len( input ) input.resize( ( ( size / window ), window ) ) diff -r c69e55c91036 -r 6125f71c838a lib/galaxy/datatypes/indexers/interval.awk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/galaxy/datatypes/indexers/interval.awk Thu Jun 11 12:20:03 2009 -0400 @@ -0,0 +1,43 @@ +BEGIN { + # from galaxy.utils + mapped_chars[">"] = "__gt__" + mapped_chars["<"] = "__lt__" + mapped_chars["'"] = "__sq__" + mapped_chars["\""] = "__dq__" + mapped_chars["\\["] = "__ob__" + mapped_chars["\\]"] = "__cb__" + mapped_chars["\\{"] = "__oc__" + mapped_chars["\\}"] = "__cc__" + mapped_chars["@"] = "__at__" + # additional, not in galaxy.utils + mapped_chars["/"] = "__fs__" + mapped_chars["^manifest\.tab$"] = "__manifest.tab__" +} +function escape_filename( name ) +{ + for( char in mapped_chars ) { + gsub( char, mapped_chars[char], name ) + } + return name +} +!_[$chrom]++ { + # close files only when we switch to a new one. + fn && close(fn) + fn = storepath "/" escape_filename($1) } +{ + print $0 >> fn; + # the || part is needed to catch 0 length chromosomes, which + # should never happen but... + if ($end > chroms[$chrom] || !chroms[$chrom]) + chroms[$chrom] = $end } +END { + fn = storepath "/manifest.tab" + for( x in chroms ) { + # add line to manifest + print x "\t" chroms[x] >> fn + chromfile = storepath "/" escape_filename(x) + # sort in-place + system( "sort -f -n -k " chrom " -k " start " -k " end " -o " chromfile " " chromfile ) + close(chromfile) + } +} \ No newline at end of file diff -r c69e55c91036 -r 6125f71c838a lib/galaxy/datatypes/indexers/interval.py --- a/lib/galaxy/datatypes/indexers/interval.py Thu Jun 11 12:06:29 2009 -0400 +++ b/lib/galaxy/datatypes/indexers/interval.py Thu Jun 11 12:20:03 2009 -0400 @@ -29,13 +29,11 @@ manifest[chrom] = max(manifest.get(chrom,0),line.end) if not lastchrom == chrom: if current_file: - current_file.flush() current_file.close() current_file = open( os.path.join( out_path, "%s" % chrom), "a" ) print >> current_file, "\t".join(line) lastchrom = chrom if current_file: - current_file.flush() current_file.close() return manifest diff -r c69e55c91036 -r 6125f71c838a lib/galaxy/datatypes/indexers/interval_awk.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/galaxy/datatypes/indexers/interval_awk.xml Thu Jun 11 12:20:03 2009 -0400 @@ -0,0 +1,16 @@ +<tool id="INDEXER_Interval_0" name="Index Interval for Track Viewer"> + <!-- Used internally to generate track indexes --> + <command interpreter="awk -f">interval.awk + chrom=${input_dataset.metadata.chromCol} start=${input_dataset.metadata.startCol} + end=${input_dataset.metadata.endCol} strand=${input_dataset.metadata.strandCol} + storepath=${store_path} + $input_dataset 2>&1 + </command> + <inputs> + <page> + <param format="interval" name="input_dataset" type="data" label="Choose intervals"/> + </page> + </inputs> + <help> + </help> +</tool> diff -r c69e55c91036 -r 6125f71c838a lib/galaxy/datatypes/indexers/wiggle.py --- a/lib/galaxy/datatypes/indexers/wiggle.py Thu Jun 11 12:06:29 2009 -0400 +++ b/lib/galaxy/datatypes/indexers/wiggle.py Thu Jun 11 12:20:03 2009 -0400 @@ -18,6 +18,8 @@ from numpy import * import tempfile import os +from galaxy.tracks.store import sanitize_name + def write_chrom(max, out_base, instream): @@ -35,7 +37,7 @@ os.rename( fname+".npy", fname ) # Write average - for window in 10, 100, 1000, 10000: + for window in 10, 100, 1000, 10000, 100000: input = scores.copy() size = len( input ) input.resize( ( ( size / window ), window ) ) @@ -60,7 +62,7 @@ LEN[chrom] = max2( LEN.get(chrom,0), pos+1 ) for chrom, stream in chroms.items(): stream.seek(0) - prefix = os.path.join(sys.argv[2], chrom) + prefix = os.path.join(sys.argv[2], sanitize_name(chrom)) write_chrom( LEN[chrom], prefix, stream ) manifest_file = open( os.path.join( sys.argv[2], "manifest.tab" ),"w" ) diff -r c69e55c91036 -r 6125f71c838a lib/galaxy/datatypes/interval.py --- a/lib/galaxy/datatypes/interval.py Thu Jun 11 12:06:29 2009 -0400 +++ b/lib/galaxy/datatypes/interval.py Thu Jun 11 12:20:03 2009 -0400 @@ -798,7 +798,7 @@ # Determine appropriate resolution to plot ~1000 points resolution = ( 10 ** math.ceil( math.log10( range / 1000 ) ) ) # Restrict to valid range - resolution = min( resolution, 10000 ) + resolution = min( resolution, 100000 ) resolution = max( resolution, 1 ) # Memory map the array (don't load all the data) data = numpy.load( data ) @@ -815,7 +815,7 @@ # Determine appropriate resolution to plot ~1000 points resolution = math.ceil( 10 ** math.ceil( math.log10( range / 1000 ) ) ) # Restrict to valid range - resolution = min( resolution, 10000 ) + resolution = min( resolution, 100000 ) resolution = max( resolution, 1 ) return resolution diff -r c69e55c91036 -r 6125f71c838a lib/galaxy/datatypes/metadata.py --- a/lib/galaxy/datatypes/metadata.py Thu Jun 11 12:06:29 2009 -0400 +++ b/lib/galaxy/datatypes/metadata.py Thu Jun 11 12:20:03 2009 -0400 @@ -289,7 +289,22 @@ if value is None: return [] if not isinstance( value, list ): return [value] return value - + + +class DBKeyParameter( SelectParameter ): + def get_html_field( self, value=None, context={}, other_values={}, values=None, **kwd): + try: + values = kwd['trans'].db_builds + except AttributeError: pass + return super(DBKeyParameter, self).get_html_field( value, context, other_values, values, **kwd) + + def get_html( self, value=None, context={}, other_values={}, values=None, **kwd): + try: + values = kwd['trans'].db_builds + except AttributeError: pass + return super(DBKeyParameter, self).get_html( value, context, other_values, values, **kwd) + + class RangeParameter( SelectParameter ): def __init__( self, spec ): SelectParameter.__init__( self, spec ) diff -r c69e55c91036 -r 6125f71c838a lib/galaxy/datatypes/registry.py --- a/lib/galaxy/datatypes/registry.py Thu Jun 11 12:06:29 2009 -0400 +++ b/lib/galaxy/datatypes/registry.py Thu Jun 11 12:20:03 2009 -0400 @@ -3,7 +3,7 @@ """ import os import logging -import data, tabular, interval, images, sequence, qualityscore, genetics, xml, coverage, tracks +import data, tabular, interval, images, sequence, qualityscore, genetics, xml, coverage, tracks, chrominfo import galaxy.util from galaxy.util.odict import odict diff -r c69e55c91036 -r 6125f71c838a lib/galaxy/tools/actions/__init__.py --- a/lib/galaxy/tools/actions/__init__.py Thu Jun 11 12:06:29 2009 -0400 +++ b/lib/galaxy/tools/actions/__init__.py Thu Jun 11 12:20:03 2009 -0400 @@ -107,6 +107,7 @@ out_data = {} # Collect any input datasets from the incoming parameters inp_data = self.collect_input_datasets( tool, incoming, trans ) + # Deal with input dataset names, 'dbkey' and types input_names = [] input_ext = 'data' @@ -119,6 +120,16 @@ data = NoneDataset( datatypes_registry = trans.app.datatypes_registry ) if data.dbkey not in [None, '?']: input_dbkey = data.dbkey + + # Collect chromInfo dataset and add as parameters to incoming + db_datasets = {} + db_dataset = trans.db_dataset_for( input_dbkey ) + if db_dataset: + db_datasets[ "chromInfo" ] = db_dataset + incoming[ "chromInfo" ] = db_dataset.file_name + else: + incoming[ "chromInfo" ] = os.path.join( trans.app.config.tool_data_path, 'shared','ucsc','chrom', "%s.len" % input_dbkey ) + inp_data.update( db_datasets ) # Determine output dataset permission/roles list existing_datasets = [ inp for inp in inp_data.values() if inp ] diff -r c69e55c91036 -r 6125f71c838a lib/galaxy/tools/parameters/basic.py --- a/lib/galaxy/tools/parameters/basic.py Thu Jun 11 12:06:29 2009 -0400 +++ b/lib/galaxy/tools/parameters/basic.py Thu Jun 11 12:20:03 2009 -0400 @@ -668,7 +668,7 @@ >>> # Create a mock transcation with 'hg17' as the current build >>> from galaxy.util.bunch import Bunch - >>> trans = Bunch( history=Bunch( genome_build='hg17' ) ) + >>> trans = Bunch( history=Bunch( genome_build='hg17' ), db_builds=util.dbnames ) >>> p = GenomeBuildParameter( None, XML( ... ''' @@ -703,10 +703,10 @@ """ def get_options( self, trans, other_values ): last_used_build = trans.history.genome_build - for dbkey, build_name in util.dbnames: + for dbkey, build_name in trans.db_builds: yield build_name, dbkey, ( dbkey == last_used_build ) def get_legal_values( self, trans, other_values ): - return set( dbkey for dbkey, _ in util.dbnames ) + return set( dbkey for dbkey, _ in trans.db_builds ) class ColumnListParameter( SelectToolParameter ): """ diff -r c69e55c91036 -r 6125f71c838a lib/galaxy/tracks/store.py --- a/lib/galaxy/tracks/store.py Thu Jun 11 12:06:29 2009 -0400 +++ b/lib/galaxy/tracks/store.py Thu Jun 11 12:20:03 2009 -0400 @@ -1,5 +1,17 @@ import os +import re from string import Template +from galaxy.util import sanitize_text + +# extra mappings/escape to keep users from traversing around the +# filesystem and wreaking havoc +extra_mappings = { r"/": "__fs__", r"^manifest.tab$": "__manifest.tab__" } + +def sanitize_name( name ): + name = sanitize_text( name ) + for key, value in extra_mappings.items(): + name = re.sub( key, value, name ) + return name class TemplateSubber( object ): def __init__(self, obj): @@ -56,7 +68,7 @@ fd.close() def _get_object_path( self, chrom, resolution ): - object_name = chrom + object_name = sanitize_name(chrom) if resolution: object_name += "_%d" % resolution return os.path.join( self.path, object_name ) diff -r c69e55c91036 -r 6125f71c838a lib/galaxy/web/controllers/root.py --- a/lib/galaxy/web/controllers/root.py Thu Jun 11 12:06:29 2009 -0400 +++ b/lib/galaxy/web/controllers/root.py Thu Jun 11 12:20:03 2009 -0400 @@ -236,11 +236,15 @@ if spec.get("readonly"): continue optional = params.get("is_"+name, None) + other = params.get("or_"+name, None) if optional and optional == 'true': # optional element... == 'true' actually means it is NOT checked (and therefore omitted) setattr(data.metadata, name, None) else: - setattr( data.metadata, name, spec.unwrap( params.get (name, None) ) ) + if other: + setattr( data.metadata, name, other ) + else: + setattr( data.metadata, name, spec.unwrap( params.get (name, None) ) ) data.datatype.after_edit( data ) trans.app.model.flush() diff -r c69e55c91036 -r 6125f71c838a lib/galaxy/web/controllers/tracks.py --- a/lib/galaxy/web/controllers/tracks.py Thu Jun 11 12:06:29 2009 -0400 +++ b/lib/galaxy/web/controllers/tracks.py Thu Jun 11 12:20:03 2009 -0400 @@ -1,13 +1,11 @@ -from mako import exceptions -from mako.template import Template -from mako.lookup import TemplateLookup +import math + +import mimeparse +from galaxy.tracks import messages +from galaxy.util.json import to_json_string from galaxy.web.base.controller import * from galaxy.web.framework import simplejson -from galaxy import web -from galaxy.tracks import messages -import mimeparse -from galaxy.util.json import to_json_string -import math + class MultiResponse(object): """ @@ -82,18 +80,19 @@ def build( self, trans, **kwargs ): trans.session["track_sets"] = list(kwargs.keys()) trans.session.save() - waiting = False - for id, value in kwargs.items(): - status = self.data_handler( trans, id ) - if status == messages.PENDING: - waiting = True - if not waiting: - return trans.response.send_redirect( web.url_for( controller='tracks', action='chroms', dbkey=trans.session["track_dbkey"]) ) - return trans.fill_template( 'tracks/build.mako' ) + #waiting = False + #for id, value in kwargs.items(): + # status = self.data_handler( trans, id ) + # if status == messages.PENDING: + # waiting = True + #if not waiting: + return trans.response.send_redirect( web.url_for( controller='tracks/', action='index', chrom="" ) ) + #return trans.fill_template( 'tracks/build.mako' ) @web.expose def index(self, trans, **kwargs): tracks = [] + dbkey = "" for track in trans.session["track_sets"]: dataset = trans.app.model.HistoryDatasetAssociation.get( track ) tracks.append({ @@ -101,17 +100,23 @@ "name": dataset.name, "id": dataset.id }) + dbkey = dataset.dbkey chrom = kwargs.get("chrom","") LEN = self.chroms_handler(trans, trans.session["track_dbkey"]).get(chrom,0) return trans.fill_template( 'tracks/index.mako', - tracks=tracks, chrom=chrom, + tracks=tracks, chrom=chrom, dbkey=dbkey, LEN=LEN ) def chroms_handler(self, trans, dbkey ): - db_manifest = os.path.join( trans.app.config.tool_data_path, 'shared','ucsc','chrom', "%s.len" % dbkey ) + db_manifest = trans.db_dataset_for( dbkey ) + if not db_manifest: + db_manifest = os.path.join( trans.app.config.tool_data_path, 'shared','ucsc','chrom', "%s.len" % dbkey ) + else: + db_manifest = db_manifest.file_name manifest = {} if os.path.exists( db_manifest ): for line in open( db_manifest ): + if line.startswith("#"): continue line = line.rstrip("\r\n") fields = line.split("\t") manifest[fields[0]] = int(fields[1]) diff -r c69e55c91036 -r 6125f71c838a lib/galaxy/web/framework/__init__.py --- a/lib/galaxy/web/framework/__init__.py Thu Jun 11 12:06:29 2009 -0400 +++ b/lib/galaxy/web/framework/__init__.py Thu Jun 11 12:20:03 2009 -0400 @@ -549,6 +549,31 @@ template = Template( source=template_string, searchList=[context or kwargs, dict(caller=self)] ) return str(template) + + @property + def db_builds( self ): + """ + Returns the builds defined by galaxy and the builds defined by + the user (chromInfo in history). + """ + dbnames = list() + datasets = self.app.model.HistoryDatasetAssociation.filter_by(deleted=False, history_id=self.history.id, extension="len").all() + if len(datasets) > 0: + dbnames.append( (util.dbnames.default_value, '--------- User Defined Builds ----------') ) + for dataset in datasets: + dbnames.append( (dataset.dbkey, dataset.name) ) + dbnames.extend( util.dbnames ) + return dbnames + + def db_dataset_for( self, dbkey ): + """ + Returns the db_file dataset associated/needed by `dataset`, or `None`. + """ + datasets = self.app.model.HistoryDatasetAssociation.filter_by(deleted=False, history_id=self.history.id, extension="len").all() + for ds in datasets: + if dbkey == ds.dbkey: + return ds + return None class FormBuilder( object ): """ diff -r c69e55c91036 -r 6125f71c838a static/scripts/trackster.js --- a/static/scripts/trackster.js Thu Jun 11 12:06:29 2009 -0400 +++ b/static/scripts/trackster.js Thu Jun 11 12:20:03 2009 -0400 @@ -85,7 +85,7 @@ var resolution = Math.pow( 10, Math.ceil( Math.log( range / DENSITY ) / Math.log( 10 ) ) ); resolution = Math.max( resolution, 1 ); - resolution = Math.min( resolution, 10000 ); + resolution = Math.min( resolution, 100000 ); var parent_element = $("<div style='position: relative;'></div>"); this.content_div.children( ":first" ).remove(); @@ -152,10 +152,20 @@ var low = position * DENSITY * resolution; var high = ( position + 1 ) * DENSITY * resolution; cache[resolution][position] = { state: "loading" }; - $.getJSON( "data" + this.type, { chr: this.view.chr, low: low, high: high, dataset_id: this.track.dataset_id }, function ( data ) { - cache[resolution][position] = { state: "loaded", values: data }; - $(document).trigger( "redraw" ); - }); + // use closure to preserve this and parameters for getJSON + var fetcher = function (ref) { + return function () { + $.getJSON( "data" + ref.type, { chr: ref.view.chr, low: low, high: high, dataset_id: ref.track.dataset_id }, function ( data ) { + if( data == "pending" ) { + setTimeout( fetcher, 5000 ); + } else { + cache[resolution][position] = { state: "loaded", values: data }; + } + $(document).trigger( "redraw" ); + }); + }; + }(this); + fetcher(); } return cache[resolution][position]; } @@ -288,8 +298,11 @@ var chunk = this.cache.get( resolution, tile_index ); if ( chunk.state == "loading" ) { - return null; - } + parent_element.addClass("loading"); + return null; + } else { + parent_element.removeClass("loading"); + } var values = chunk.values; for ( var index in values ) { diff -r c69e55c91036 -r 6125f71c838a static/trackster.css --- a/static/trackster.css Thu Jun 11 12:06:29 2009 -0400 +++ b/static/trackster.css Thu Jun 11 12:20:03 2009 -0400 @@ -85,7 +85,10 @@ } .loading { - background: #DDDDDD; + background-image: url("/static/images/loading_large_white_bg.gif"); + background-position: center center; + background-repeat: no-repeat; + min-height: 100px; } .label-track .label { diff -r c69e55c91036 -r 6125f71c838a templates/dataset/edit_attributes.mako --- a/templates/dataset/edit_attributes.mako Thu Jun 11 12:06:29 2009 -0400 +++ b/templates/dataset/edit_attributes.mako Thu Jun 11 12:20:03 2009 -0400 @@ -46,7 +46,7 @@ ${spec.desc}: </label> <div style="float: left; width: 250px; margin-right: 10px;"> - ${data.metadata.get_html_by_name( name )} + ${data.metadata.get_html_by_name( name, trans=trans )} </div> <div style="clear: both"></div> </div> diff -r c69e55c91036 -r 6125f71c838a templates/tracks/index.mako --- a/templates/tracks/index.mako Thu Jun 11 12:06:29 2009 -0400 +++ b/templates/tracks/index.mako Thu Jun 11 12:20:03 2009 -0400 @@ -17,18 +17,19 @@ ${parent.late_javascripts()} <script type="text/javascript" src="/static/scripts/jquery.event.drag.js"></script> <script type="text/javascript" src="/static/scripts/trackster.js"></script> -<script> +<script type="text/javascript"> - var view = new View( "${chrom}", ${LEN}, 0, ${LEN} ); + var view = new View( "${chrom}", ${LEN}, 0, ${max(LEN,1)} ); var tracks = new TrackLayout( view ); - + var dbkey = "${dbkey}"; + $(function() { tracks.add( new LabelTrack( view, $("#viewport" ) ) ); %for track in tracks: tracks.add( new ${track["type"]}( "${track["name"]}", view, $("#viewport" ), ${track["id"]} ) ); %endfor - + $(document).bind( "redraw", function( e ) { tracks.redraw(); }); @@ -56,9 +57,43 @@ view.high = new_high; tracks.redraw(); }); + tracks.redraw(); + load_chroms(); + }); - tracks.redraw(); - }); + var load_chroms = function () { + var fetcher = function (ref) { + return function () { + $.getJSON( "chroms", { dbkey: dbkey }, function ( data ) { + // Hacky - check length of "object" + var chrom_length = 0; + for (key in data) chrom_length++; + if( chrom_length == 0 ) { + setTimeout( fetcher, 5000 ); + } else { + var chrom_options = ''; + for (key in data) { + if( key == view.chr ) { + chrom_options += '<option value="' + key + '" selected="true">' + key + '</option>'; + } else { + chrom_options += '<option value="' + key + '">' + key + '</option>'; + } + } + $("#chrom").html(chrom_options); + $("#chrom").bind( "change", function ( e ) { + $("#chr").submit(); + }); + if( view.chr == "" ) { + $("#chrom option:first").attr("selected", true); + $("#chrom").trigger( "change" ); + } + } + }); + }; + }(this); + fetcher(); + }; + </script> </%def> @@ -79,11 +114,14 @@ <div id="nav"> <div id="nav-controls"> + <form name="chr" id="chr" method="GET"> <a href="#" onclick="javascript:view.left(5);tracks.redraw();"><<</a> <a href="#" onclick="javascript:view.left(2);tracks.redraw();"><</a> - - <span style="display: inline-block; width: 30em; text-align: center;">Viewing ${chrom}:<span id="low">0</span>-<span id="high">180857866</span></span> - + <span style="display: inline-block; width: 30em; text-align: center;">Viewing + <select id="chrom" name="chrom"> + <option value="">loading</option> + </select> + <span id="low">0</span>-<span id="high">180857866</span></span> <span style="display: inline-block; width: 10em;"> <a href="#" onclick="javascript:view.zoom_in(2);tracks.redraw();">+</a> <a href="#" onclick="javascript:view.zoom_out(2);tracks.redraw();">-</a> @@ -91,6 +129,7 @@ <a href="#" onclick="javascript:view.right(2);tracks.redraw();">></a> <a href="#" onclick="javascript:view.right(5);tracks.redraw();">>></a> + </form> </div> </div> diff -r c69e55c91036 -r 6125f71c838a tools/annotation_profiler/annotation_profiler.xml --- a/tools/annotation_profiler/annotation_profiler.xml Thu Jun 11 12:06:29 2009 -0400 +++ b/tools/annotation_profiler/annotation_profiler.xml Thu Jun 11 12:20:03 2009 -0400 @@ -1,6 +1,6 @@ <tool id="Annotation_Profiler_0" name="Profile Annotations" Version="1.0.0"> <description>for a set of genomic intervals</description> - <command interpreter="python">annotation_profiler_for_interval.py -i $input1 -c ${input1.metadata.chromCol} -s ${input1.metadata.startCol} -e ${input1.metadata.endCol} -o $out_file1 $keep_empty -p /depot/data2/galaxy/annotation_profiler/$dbkey $summary -l ${GALAXY_DATA_INDEX_DIR}/shared/ucsc/chrom/${dbkey}.len -b 3 -t $table_names</command> + <command interpreter="python">annotation_profiler_for_interval.py -i $input1 -c ${input1.metadata.chromCol} -s ${input1.metadata.startCol} -e ${input1.metadata.endCol} -o $out_file1 $keep_empty -p /depot/data2/galaxy/annotation_profiler/$dbkey $summary -l ${chromInfo} -b 3 -t $table_names</command> <inputs> <param format="interval" name="input1" type="data" label="Choose Intervals"> <validator type="dataset_metadata_in_file" filename="annotation_profiler_valid_builds.txt" metadata_name="dbkey" metadata_column="0" message="Profiling is not currently available for this species."/> diff -r c69e55c91036 -r 6125f71c838a tools/data_source/upload.xml --- a/tools/data_source/upload.xml Thu Jun 11 12:06:29 2009 -0400 +++ b/tools/data_source/upload.xml Thu Jun 11 12:20:03 2009 -0400 @@ -25,6 +25,7 @@ </param> </upload_dataset> <param name="dbkey" type="genomebuild" label="Genome" /> + <param name="other_dbkey" type="text" label="Or user-defined Genome" /> </inputs> <help> diff -r c69e55c91036 -r 6125f71c838a tools/new_operations/complement.xml --- a/tools/new_operations/complement.xml Thu Jun 11 12:06:29 2009 -0400 +++ b/tools/new_operations/complement.xml Thu Jun 11 12:20:03 2009 -0400 @@ -1,6 +1,6 @@ <tool id="gops_complement_1" name="Complement"> <description>intervals of a query</description> - <command interpreter="python">gops_complement.py $input1 $output -1 ${input1.metadata.chromCol},${input1.metadata.startCol},${input1.metadata.endCol},${input1.metadata.strandCol} -l ${GALAXY_DATA_INDEX_DIR}/shared/ucsc/chrom/${dbkey}.len $allchroms</command> + <command interpreter="python">gops_complement.py $input1 $output -1 ${input1.metadata.chromCol},${input1.metadata.startCol},${input1.metadata.endCol},${input1.metadata.strandCol} -l ${chromInfo} $allchroms</command> <inputs> <param format="interval" name="input1" type="data"> <label>Complement regions of</label> @@ -58,4 +58,4 @@ .. image:: ../static/operation_icons/gops_complement.gif </help> -</tool> \ No newline at end of file +</tool>
participants (1)
-
Greg Von Kuster