galaxy-commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
November 2010
- 1 participants
- 286 discussions
galaxy-dist commit 51873f4ee7a6: Fixed typo in FloatToolParameter doctest
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User peterjc <p.j.a.cock(a)googlemail.com>
# Date 1286450288 -3600
# Node ID 51873f4ee7a6a3535dc028c66259a5381cc46c9c
# Parent e082f7f28e628263faacb652ef9d0ee9b37d8532
Fixed typo in FloatToolParameter doctest
--- a/lib/galaxy/tools/parameters/basic.py
+++ b/lib/galaxy/tools/parameters/basic.py
@@ -215,7 +215,7 @@ class FloatToolParameter( TextToolParame
"""
Parameter that takes a real number value.
- >>> p = FloatToolParameter( None, XML( '<param name="blah" type="integer" size="4" value="3.141592" />' ) )
+ >>> p = FloatToolParameter( None, XML( '<param name="blah" type="float" size="4" value="3.141592" />' ) )
>>> print p.name
blah
>>> print p.get_html()
1
0
galaxy-dist commit b67978eeba2c: Add framework for specifying dynamic filters for tracks; framework uses datatype and dataset metadata to specify filters. VCF data provider uses framework to define filter for quality scores. Trackster client does not yet support filters.
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User jeremy goecks <jeremy.goecks(a)emory.edu>
# Date 1286804627 14400
# Node ID b67978eeba2c67c86453515d90f81a13acb88586
# Parent ddcfb334eb3ad53425a62f4b094374b219daa455
Add framework for specifying dynamic filters for tracks; framework uses datatype and dataset metadata to specify filters. VCF data provider uses framework to define filter for quality scores. Trackster client does not yet support filters.
--- a/lib/galaxy/datatypes/tabular.py
+++ b/lib/galaxy/datatypes/tabular.py
@@ -462,7 +462,14 @@ class ElandMulti( Tabular ):
return False
class Vcf( Tabular ):
+ """ Variant Call Format for describing SNPs and other simple genome variations. """
+
file_ext = 'vcf'
+ column_names = [ 'Chrom', 'Pos', 'ID', 'Ref', 'Alt', 'Qual', 'Filter', 'Info', 'Format', 'data' ]
+
+ MetadataElement( name="columns", default=10, desc="Number of columns", readonly=True, visible=False )
+ MetadataElement( name="column_types", default=['str','int','str','str','str','int','str','list','str','str'], param=metadata.ColumnTypesParameter, desc="Column types", readonly=True, visible=False )
+ MetadataElement( name="viz_filter_columns", default=[5] )
def sniff( self, filename ):
try:
@@ -472,6 +479,21 @@ class Vcf( Tabular ):
return True
except:
return False
+
+ def make_html_table( self, dataset, skipchars=[] ):
+ """Create HTML table, used for displaying peek"""
+ out = ['<table cellspacing="0" cellpadding="3">']
+ try:
+ # Generate column header
+ out.append( '<tr>' )
+ for i, name in enumerate( self.column_names ):
+ out.append( '<th>%s.%s</th>' % ( str( i+1 ), name ) )
+ out.append( self.make_html_peek_rows( dataset, skipchars=skipchars ) )
+ out.append( '</table>' )
+ out = "".join( out )
+ except Exception, exc:
+ out = "Can't create peek %s" % exc
+ return out
def get_track_type( self ):
return "FeatureTrack", {"data": "interval_index", "index": "summary_tree"}
--- a/lib/galaxy/web/controllers/tracks.py
+++ b/lib/galaxy/web/controllers/tracks.py
@@ -24,7 +24,8 @@ from galaxy.visualization.tracks.data.ar
from galaxy.visualization.tracks.data.interval_index import IntervalIndexDataProvider
from galaxy.visualization.tracks.data.bam import BamDataProvider
from galaxy.visualization.tracks.data.summary_tree import SummaryTreeDataProvider
-from galaxy.visualization.tracks.data.vcf import VCFDataProvider
+from galaxy.visualization.tracks.data.vcf import VcfDataProvider
+from galaxy.visualization.tracks.data.base import dataset_to_data_provider
# Message strings returned to browser
messages = Bunch(
@@ -39,9 +40,10 @@ messages = Bunch(
# Mapping from dataset type to a class that can fetch data from a file of that
# type. First key is converted dataset type; if result is another dict, second key
# is original dataset type. TODO: This needs to be more flexible.
+# TODO: move this mapping into TracksDataProvider
dataset_type_to_data_provider = {
"array_tree": ArrayTreeDataProvider,
- "interval_index": { "vcf": VCFDataProvider, "default" : IntervalIndexDataProvider },
+ "interval_index": { "vcf": VcfDataProvider, "default" : IntervalIndexDataProvider },
"bai": BamDataProvider,
"summary_tree": SummaryTreeDataProvider
}
@@ -150,12 +152,15 @@ class TracksController( BaseController,
hda_query = trans.sa_session.query( model.HistoryDatasetAssociation )
dataset = hda_query.get( dataset_id )
track_type, _ = dataset.datatype.get_track_type()
+ track_data_provider_class = dataset_to_data_provider( dataset )
+ track_data_provider = track_data_provider_class( original_dataset=dataset )
track = {
"track_type": track_type,
"name": dataset.name,
"dataset_id": dataset.id,
"prefs": {},
+ "filters": track_data_provider.get_filters()
}
return track
--- a/lib/galaxy/visualization/tracks/data/base.py
+++ b/lib/galaxy/visualization/tracks/data/base.py
@@ -1,7 +1,17 @@
+from galaxy.datatypes.tabular import Vcf
+from galaxy.visualization.tracks import data
+
class TracksDataProvider( object ):
""" Base class for tracks data providers. """
- def __init__( self, converted_dataset, original_dataset ):
+ """
+ Mapping from column name to index in data. This mapping is used to create
+ filters.
+ """
+ col_name_data_index_mapping = {}
+
+ def __init__( self, converted_dataset=None, original_dataset=None ):
+ """ Create basic data provider. """
self.converted_dataset = converted_dataset
self.original_dataset = original_dataset
@@ -9,3 +19,59 @@ class TracksDataProvider( object ):
""" Returns data in region defined by chrom, start, and end. """
# Override.
pass
+
+ def get_filters( self ):
+ """
+ Returns filters for provider's data. Return value is a list of
+ filters; each filter is a dictionary with the keys 'name', 'index', 'value'.
+ NOTE: This method uses the original dataset's datatype and metadata to
+ create the filters.
+ """
+ # Get column names.
+ try:
+ column_names = self.original_dataset.datatype.column_names
+ except AttributeError:
+ column_names = range( self.original_dataset.metadata.columns )
+
+ # Dataset must have column types; if not, cannot create filters.
+ try:
+ column_types = self.original_dataset.metadata.column_types
+ except AttributeError:
+ return []
+
+ # Create and return filters.
+ filters = []
+ if self.original_dataset.metadata.viz_filter_columns:
+ for viz_col_index in self.original_dataset.metadata.viz_filter_columns:
+ col_name = column_names[ viz_col_index ]
+ # Make sure that column has a mapped index. If not, do not add filter.
+ try:
+ index = self.col_name_data_index_mapping[ col_name ]
+ except KeyError:
+ continue
+ filters.append(
+ { 'name' : col_name, 'value' : column_types[viz_col_index], \
+ 'index' : index } )
+ return filters
+
+
+#
+# Helper methods.
+#
+
+def dataset_to_data_provider( dataset=None ):
+ """
+ Returns data provider for a dataset.
+ """
+ # TODO: merge this method with the dict in tracks controller to provide a
+ # unified way to get data providers based on dataset/converted dataset type.
+ if isinstance( dataset.datatype, Vcf ):
+ return data.vcf.VcfDataProvider
+ else:
+ try:
+ # If get_track_type is available, then generic data provider
+ # should work.
+ dataset.datatype.get_track_type()
+ return TracksDataProvider
+ except e:
+ return None
--- a/lib/galaxy/visualization/tracks/data/vcf.py
+++ b/lib/galaxy/visualization/tracks/data/vcf.py
@@ -1,10 +1,3 @@
-"""
-VCF data provider for the Galaxy track browser.
-
-Payload format:
-[ uid (offset), start, end, ID, reference base(s), alternate base(s), quality score]
-"""
-
import pkg_resources; pkg_resources.require( "bx-python" )
from bx.interval_index_file import Indexes
from galaxy.datatypes.tabular import Vcf
@@ -12,8 +5,15 @@ from base import TracksDataProvider
MAX_VALS = 5000 # only display first MAX_VALS features
-class VCFDataProvider( TracksDataProvider ):
- """ Provides data for VCF tracks. """
+class VcfDataProvider( TracksDataProvider ):
+ """
+ VCF data provider for the Galaxy track browser.
+
+ Payload format:
+ [ uid (offset), start, end, ID, reference base(s), alternate base(s), quality score]
+ """
+
+ col_name_data_index_mapping = { 'Qual' : 6 }
def get_data( self, chrom, start, end, **kwargs ):
""" Returns data in region defined by chrom, start, and end. """
--- a/lib/galaxy/web/base/controller.py
+++ b/lib/galaxy/web/base/controller.py
@@ -9,6 +9,7 @@ from galaxy.model.orm import *
from galaxy.workflow.modules import *
from galaxy.web.framework import simplejson
from galaxy.web.form_builder import AddressField, CheckboxField, SelectField, TextArea, TextField, WorkflowField
+from galaxy.visualization.tracks.data.base import dataset_to_data_provider
from Cheetah.Template import Template
@@ -169,11 +170,15 @@ class UsesVisualization( SharableItemSec
prefs = {}
dataset = hda_query.get( dataset_id )
track_type, _ = dataset.datatype.get_track_type()
+ track_data_provider_class = dataset_to_data_provider( dataset )
+ track_data_provider = track_data_provider_class( original_dataset=dataset )
+
tracks.append( {
"track_type": track_type,
"name": dataset.name,
"dataset_id": dataset.id,
"prefs": simplejson.dumps(prefs),
+ "filters": track_data_provider.get_filters()
} )
config = { "title": visualization.title, "vis_id": trans.security.encode_id( visualization.id ),
1
0
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Kanwei Li <kanwei(a)gmail.com>
# Date 1286571405 14400
# Node ID ddcfb334eb3ad53425a62f4b094374b219daa455
# Parent b36700318a817db7d9817213aef9e7d1602b9aec
trackster:
- Fix LineTrack axis labels not aligning consistently
- New image for draggable elements
- New slider that is rounded, easier to see and will go off-screen if smaller than the minimum width
- Added "Close overview" link when overview is showing
- Fix array_tree from recent refactoring
Binary file static/images/draggable_horizontal.png has changed
--- a/static/scripts/packed/trackster.js
+++ b/static/scripts/packed/trackster.js
@@ -1,1 +1,1 @@
-var DENSITY=200,FEATURE_LEVELS=10,MAX_FEATURE_DEPTH=100,DATA_ERROR="There was an error in indexing this dataset. ",DATA_NOCONVERTER="A converter for this dataset is not installed. Please check your datatypes_conf.xml file.",DATA_NONE="No data for this chrom/contig.",DATA_PENDING="Currently indexing... please wait",DATA_LOADING="Loading data...",CACHED_TILES_FEATURE=10,CACHED_TILES_LINE=30,CACHED_DATA=5,CONTEXT=$("<canvas></canvas>").get(0).getContext("2d"),PX_PER_CHAR=CONTEXT.measureText("A").width,RIGHT_STRAND,LEFT_STRAND;var right_img=new Image();right_img.src=image_path+"/visualization/strand_right.png";right_img.onload=function(){RIGHT_STRAND=CONTEXT.createPattern(right_img,"repeat")};var left_img=new Image();left_img.src=image_path+"/visualization/strand_left.png";left_img.onload=function(){LEFT_STRAND=CONTEXT.createPattern(left_img,"repeat")};var right_img_inv=new Image();right_img_inv.src=image_path+"/visualization/strand_right_inv.png";right_img_inv.onload=function()
{RIGHT_STRAND_INV=CONTEXT.createPattern(right_img_inv,"repeat")};var left_img_inv=new Image();left_img_inv.src=image_path+"/visualization/strand_left_inv.png";left_img_inv.onload=function(){LEFT_STRAND_INV=CONTEXT.createPattern(left_img_inv,"repeat")};function round_1000(a){return Math.round(a*1000)/1000}var Cache=function(a){this.num_elements=a;this.clear()};$.extend(Cache.prototype,{get:function(b){var a=this.key_ary.indexOf(b);if(a!=-1){this.key_ary.splice(a,1);this.key_ary.push(b)}return this.obj_cache[b]},set:function(b,c){if(!this.obj_cache[b]){if(this.key_ary.length>=this.num_elements){var a=this.key_ary.shift();delete this.obj_cache[a]}this.key_ary.push(b)}this.obj_cache[b]=c;return c},clear:function(){this.obj_cache={};this.key_ary=[]}});var View=function(a,c,e,d,b){this.container=a;this.vis_id=d;this.dbkey=b;this.title=e;this.chrom=c;this.tracks=[];this.label_tracks=[];this.max_low=0;this.max_high=0;this.num_tracks=0;this.track_id_counter=0;this.zoom_factor=3;this.
min_separation=30;this.has_changes=false;this.init();this.reset()};$.extend(View.prototype,{init:function(){var c=this.container,a=this;this.top_labeltrack=$("<div/>").addClass("top-labeltrack").appendTo(c);this.content_div=$("<div/>").addClass("content").css("position","relative").hide().appendTo(c);this.intro_div=$("<div/>").addClass("intro").text("Select a chrom from the dropdown below").hide().appendTo(c);this.viewport_container=$("<div/>").addClass("viewport-container").addClass("viewport-container").appendTo(this.content_div);this.nav_container=$("<div/>").addClass("nav-container").appendTo(c);this.nav_labeltrack=$("<div/>").addClass("nav-labeltrack").appendTo(this.nav_container);this.nav=$("<div/>").addClass("nav").appendTo(this.nav_container);this.overview=$("<div/>").addClass("overview").appendTo(this.nav);this.overview_viewport=$("<div/>").addClass("overview-viewport").appendTo(this.overview);this.overview_box_background=$("<div/>").addClass("overview-boxback").app
endTo(this.overview_viewport);this.overview_box=$("<div/>").addClass("overview-box").appendTo(this.overview_viewport);this.default_overview_height=this.overview_box.height();this.nav_controls=$("<div/>").addClass("nav-controls").appendTo(this.nav);this.chrom_form=$("<form/>").attr("action",function(){void (0)}).appendTo(this.nav_controls);this.chrom_select=$("<select/>").attr({name:"chrom"}).css("width","15em").addClass("no-autocomplete").append("<option value=''>Loading</option>").appendTo(this.chrom_form);var b=function(d){if(d.type==="focusout"||(d.keyCode||d.which)===13||(d.keyCode||d.which)===27){if((d.keyCode||d.which)!==27){a.go_to($(this).val())}$(this).hide();a.location_span.show();a.chrom_select.show();return false}};this.nav_input=$("<input/>").addClass("nav-input").hide().bind("keypress focusout",b).appendTo(this.chrom_form);this.location_span=$("<span/>").addClass("location").appendTo(this.chrom_form);this.location_span.bind("click",function(){a.location_span.hi
de();a.chrom_select.hide();a.nav_input.css("display","inline-block");a.nav_input.select();a.nav_input.focus()});if(this.vis_id!==undefined){this.hidden_input=$("<input/>").attr("type","hidden").val(this.vis_id).appendTo(this.chrom_form)}this.zo_link=$("<a/>").click(function(){a.zoom_out();a.redraw()}).html('<img src="'+image_path+'/fugue/magnifier-zoom-out.png" />').appendTo(this.chrom_form);this.zi_link=$("<a/>").click(function(){a.zoom_in();a.redraw()}).html('<img src="'+image_path+'/fugue/magnifier-zoom.png" />').appendTo(this.chrom_form);$.ajax({url:chrom_url,data:(this.vis_id!==undefined?{vis_id:this.vis_id}:{dbkey:this.dbkey}),dataType:"json",success:function(d){if(d.reference){a.add_label_track(new ReferenceTrack(a))}a.chrom_data=d.chrom_info;var f='<option value="">Select Chrom/Contig</option>';for(i in a.chrom_data){var e=a.chrom_data[i]["chrom"];f+='<option value="'+e+'">'+e+"</option>"}a.chrom_select.html(f);a.intro_div.show();a.content_div.hide();a.chrom_select.b
ind("change",function(){a.change_chrom(a.chrom_select.val())})},error:function(){alert("Could not load chroms for this dbkey:",a.dbkey)}});this.content_div.bind("dblclick",function(d){a.zoom_in(d.pageX,this.viewport_container)});this.overview_box.bind("dragstart",function(d){this.current_x=d.offsetX}).bind("drag",function(d){var g=d.offsetX-this.current_x;this.current_x=d.offsetX;var f=Math.round(g/a.viewport_container.width()*(a.max_high-a.max_low));a.move_delta(-f)});this.viewport_container.bind("dragstart",function(d){this.original_low=a.low;this.current_height=d.clientY;this.current_x=d.offsetX;this.enable_pan=(d.clientX<a.viewport_container.width()-16)?true:false}).bind("drag",function(g){if(!this.enable_pan||this.in_reordering){return}var d=$(this);var j=g.offsetX-this.current_x;var f=d.scrollTop()-(g.clientY-this.current_height);d.scrollTop(f);this.current_height=g.clientY;this.current_x=g.offsetX;var h=Math.round(j/a.viewport_container.width()*(a.high-a.low));a.move_
delta(h)});this.top_labeltrack.bind("dragstart",function(d){this.drag_origin_x=d.clientX;this.drag_origin_pos=d.clientX/a.viewport_container.width()*(a.high-a.low)+a.low;this.drag_div=$("<div />").css({height:a.content_div.height()+30,top:"0px",position:"absolute","background-color":"#cfc",border:"1px solid #6a6",opacity:0.5,"z-index":1000}).appendTo($(this))}).bind("drag",function(j){var f=Math.min(j.clientX,this.drag_origin_x)-a.container.offset().left,d=Math.max(j.clientX,this.drag_origin_x)-a.container.offset().left,h=(a.high-a.low),g=a.viewport_container.width();a.update_location(Math.round(f/g*h)+a.low,Math.round(d/g*h)+a.low);this.drag_div.css({left:f+"px",width:(d-f)+"px"})}).bind("dragend",function(k){var f=Math.min(k.clientX,this.drag_origin_x),d=Math.max(k.clientX,this.drag_origin_x),h=(a.high-a.low),g=a.viewport_container.width(),j=a.low;a.low=Math.round(f/g*h)+j;a.high=Math.round(d/g*h)+j;this.drag_div.remove();a.redraw()});this.add_label_track(new LabelTrack(th
is,this.top_labeltrack));this.add_label_track(new LabelTrack(this,this.nav_labeltrack))},update_location:function(a,b){this.location_span.text(commatize(a)+" - "+commatize(b));this.nav_input.val(this.chrom+":"+commatize(a)+"-"+commatize(b))},change_chrom:function(d,a,f){var c=this;var e=$.grep(c.chrom_data,function(h,j){return h.chrom===d})[0];if(e===undefined){return}if(d!==c.chrom){c.chrom=d;if(c.chrom===""){c.intro_div.show();c.content_div.hide()}else{c.intro_div.hide();c.content_div.show()}c.chrom_select.val(c.chrom);c.max_high=e.len;c.reset();c.redraw(true);for(var g in c.tracks){var b=c.tracks[g];if(b.init){b.init()}}}if(a!==undefined&&f!==undefined){c.low=Math.max(a,0);c.high=Math.min(f,c.max_high)}c.overview_viewport.find("canvas").remove();c.redraw()},go_to:function(f){var k=this,b=f.split(":"),h=b[0],j=b[1];if(j!==undefined){try{var g=j.split("-"),a=parseInt(g[0].replace(/,/g,"")),d=parseInt(g[1].replace(/,/g,""))}catch(c){return false}}k.change_chrom(h,a,d)},move_
delta:function(c){var a=this;var b=a.high-a.low;if(a.low-c<a.max_low){a.low=a.max_low;a.high=a.max_low+b}else{if(a.high-c>a.max_high){a.high=a.max_high;a.low=a.max_high-b}else{a.high-=c;a.low-=c}}a.redraw()},add_track:function(a){a.view=this;a.track_id=this.track_id_counter;this.tracks.push(a);if(a.init){a.init()}a.container_div.attr("id","track_"+a.track_id);this.track_id_counter+=1;this.num_tracks+=1},add_label_track:function(a){a.view=this;this.label_tracks.push(a)},remove_track:function(a){this.has_changes=true;a.container_div.fadeOut("slow",function(){$(this).remove()});delete this.tracks[this.tracks.indexOf(a)];this.num_tracks-=1},reset:function(){this.low=this.max_low;this.high=this.max_high;this.viewport_container.find(".yaxislabel").remove()},redraw:function(h){var d=this.high-this.low,b=this.low,f=this.high;if(b<this.max_low){b=this.max_low}if(f>this.max_high){f=this.max_high}if(this.high!==0&&d<this.min_separation){f=b+this.min_separation}this.low=Math.floor(b);th
is.high=Math.ceil(f);this.resolution=Math.pow(10,Math.ceil(Math.log((this.high-this.low)/200)/Math.LN10));this.zoom_res=Math.pow(FEATURE_LEVELS,Math.max(0,Math.ceil(Math.log(this.resolution,FEATURE_LEVELS)/Math.log(FEATURE_LEVELS))));var e=(this.low/(this.max_high-this.max_low))*this.overview_viewport.width();var g=(this.high-this.low)/(this.max_high-this.max_low)*this.overview_viewport.width();this.overview_box.css({left:e,width:Math.max(12,g)}).show();if(this.overview_highlight){this.overview_highlight.css({left:e,width:g})}this.update_location(this.low,this.high);if(!h){for(var c=0,a=this.tracks.length;c<a;c++){if(this.tracks[c]&&this.tracks[c].enabled){this.tracks[c].draw()}}for(var c=0,a=this.label_tracks.length;c<a;c++){this.label_tracks[c].draw()}}},zoom_in:function(b,c){if(this.max_high===0||this.high-this.low<this.min_separation){return}var d=this.high-this.low,e=d/2+this.low,a=(d/this.zoom_factor)/2;if(b){e=b/this.viewport_container.width()*(this.high-this.low)+thi
s.low}this.low=Math.round(e-a);this.high=Math.round(e+a);this.redraw()},zoom_out:function(){if(this.max_high===0){return}var b=this.high-this.low,c=b/2+this.low,a=(b*this.zoom_factor)/2;this.low=Math.round(c-a);this.high=Math.round(c+a);this.redraw()}});var Track=function(b,a,c){this.name=b;this.parent_element=c;this.view=a;this.init_global()};$.extend(Track.prototype,{init_global:function(){this.container_div=$("<div />").addClass("track");if(!this.hidden){this.header_div=$("<div class='track-header' />").appendTo(this.container_div);this.drag_div=$("<div class='draghandle' />").appendTo(this.header_div);this.name_div=$("<div class='menubutton popup' />").appendTo(this.header_div);this.name_div.text(this.name)}this.content_div=$("<div class='track-content'>").appendTo(this.container_div);this.parent_element.append(this.container_div)},init_each:function(c,b){var a=this;a.enabled=false;a.data_queue={};a.tile_cache.clear();a.data_cache.clear();a.initial_canvas=undefined;a.con
tent_div.css("height","auto");if(!a.content_div.text()){a.content_div.text(DATA_LOADING)}a.container_div.removeClass("nodata error pending");if(a.view.chrom){$.getJSON(data_url,c,function(d){if(!d||d==="error"||d.kind==="error"){a.container_div.addClass("error");a.content_div.text(DATA_ERROR);if(d.message){var f=a.view.tracks.indexOf(a);var e=$("<a href='javascript:void(0);'></a>").attr("id",f+"_error");e.text("Click to view error");$("#"+f+"_error").live("click",function(){show_modal("Trackster Error","<pre>"+d.message+"</pre>",{Close:hide_modal})});a.content_div.append(e)}}else{if(d==="no converter"){a.container_div.addClass("error");a.content_div.text(DATA_NOCONVERTER)}else{if(d.data!==undefined&&(d.data===null||d.data.length===0)){a.container_div.addClass("nodata");a.content_div.text(DATA_NONE)}else{if(d==="pending"){a.container_div.addClass("pending");a.content_div.text(DATA_PENDING);setTimeout(function(){a.init()},5000)}else{a.content_div.text("");a.content_div.css("he
ight",a.height_px+"px");a.enabled=true;b(d);a.draw()}}}}})}else{a.container_div.addClass("nodata");a.content_div.text(DATA_NONE)}}});var TiledTrack=function(){var d=this,c=d.view;if(d.hidden){return}if(d.display_modes!==undefined){if(d.mode_div===undefined){d.mode_div=$("<div class='right-float menubutton popup' />").appendTo(d.header_div);var h=d.display_modes[0];d.mode=h;d.mode_div.text(h);var a=function(j){d.mode_div.text(j);d.mode=j;d.tile_cache.clear();d.draw()};var f={};for(var e in d.display_modes){var g=d.display_modes[e];f[g]=function(j){return function(){a(j)}}(g)}make_popupmenu(d.mode_div,f)}else{d.mode_div.hide()}}var b={};b["Set track as overview"]=function(){c.overview_viewport.find("canvas").remove();d.is_overview=true;d.set_overview();for(var j in c.tracks){if(c.tracks[j]!==d){c.tracks[j].is_overview=false}}};b["Edit configuration"]=function(){var k=function(){hide_modal()};var j=function(){d.update_options(d.track_id);hide_modal()};show_modal("Configure Trac
k",d.gen_options(d.track_id),{Cancel:k,OK:j})};b.Remove=function(){c.remove_track(d);if(c.num_tracks===0){$("#no-tracks").show()}};make_popupmenu(d.name_div,b)};$.extend(TiledTrack.prototype,Track.prototype,{draw:function(){var j=this.view.low,e=this.view.high,f=e-j,d=this.view.resolution;var l=$("<div style='position: relative;'></div>"),m=this.content_div.width()/f,h;this.content_div.children(":first").remove();this.content_div.append(l),this.max_height=0;var a=Math.floor(j/d/DENSITY);while((a*DENSITY*d)<e){var k=this.content_div.width()+"_"+m+"_"+a;var c=this.tile_cache.get(k);if(c){var g=a*DENSITY*d;var b=(g-j)*m;if(this.left_offset){b-=this.left_offset}c.css({left:b});l.append(c);this.max_height=Math.max(this.max_height,c.height());this.content_div.css("height",this.max_height+"px")}else{this.delayed_draw(this,k,j,e,a,d,l,m)}a+=1}},delayed_draw:function(c,e,a,f,b,d,g,h){setTimeout(function(){if(!(a>c.view.high||f<c.view.low)){tile_element=c.draw_tile(d,b,g,h);if(tile_el
ement){if(!c.initial_canvas){c.initial_canvas=$(tile_element).clone();var l=tile_element.get(0).getContext("2d");var j=c.initial_canvas.get(0).getContext("2d");var k=l.getImageData(0,0,l.canvas.width,l.canvas.height);j.putImageData(k,0,0);c.set_overview()}c.tile_cache.set(e,tile_element);c.max_height=Math.max(c.max_height,tile_element.height());c.content_div.css("height",c.max_height+"px")}}},50)},set_overview:function(){var a=this.view;a.overview_viewport.height(a.default_overview_height);a.overview_box.height(a.default_overview_height);if(this.initial_canvas&&this.is_overview){if(!a.overview_highlight){a.overview_highlight=$("<div />").addClass("overview-highlight").appendTo(a.overview_viewport)}a.overview_viewport.append(this.initial_canvas);a.overview_highlight.height(this.initial_canvas.height());a.overview_viewport.height(this.initial_canvas.height()+a.overview_box.height())}$(window).trigger("resize")}});var LabelTrack=function(a,b){this.track_type="LabelTrack";this.h
idden=true;Track.call(this,null,a,b);this.container_div.addClass("label-track")};$.extend(LabelTrack.prototype,Track.prototype,{draw:function(){var c=this.view,d=c.high-c.low,g=Math.floor(Math.pow(10,Math.floor(Math.log(d)/Math.log(10)))),a=Math.floor(c.low/g)*g,e=this.content_div.width(),b=$("<div style='position: relative; height: 1.3em;'></div>");while(a<c.high){var f=(a-c.low)/d*e;b.append($("<div class='label'>"+commatize(a)+"</div>").css({position:"absolute",left:f-1}));a+=g}this.content_div.children(":first").remove();this.content_div.append(b)}});var ReferenceTrack=function(a){this.track_type="ReferenceTrack";this.hidden=true;Track.call(this,null,a,a.top_labeltrack);TiledTrack.call(this);this.height_px=12;this.container_div.addClass("reference-track");this.dummy_canvas=$("<canvas></canvas>").get(0).getContext("2d");this.data_queue={};this.data_cache=new Cache(CACHED_DATA);this.tile_cache=new Cache(CACHED_TILES_LINE)};$.extend(ReferenceTrack.prototype,TiledTrack.proto
type,{get_data:function(d,b){var c=this,a=b*DENSITY*d,f=(b+1)*DENSITY*d,e=d+"_"+b;if(!c.data_queue[e]){c.data_queue[e]=true;$.ajax({url:reference_url,dataType:"json",data:{chrom:this.view.chrom,low:a,high:f,dbkey:this.view.dbkey},success:function(g){c.data_cache.set(e,g);delete c.data_queue[e];c.draw()},error:function(h,g,j){console.log(h,g,j)}})}},draw_tile:function(f,b,k,o){var g=b*DENSITY*f,d=DENSITY*f,e=$("<canvas class='tile'></canvas>"),n=e.get(0).getContext("2d"),j=f+"_"+b;if(o>PX_PER_CHAR){if(this.data_cache.get(j)===undefined){this.get_data(f,b);return}var m=this.data_cache.get(j);if(m===null){this.content_div.css("height","0px");return}e.get(0).width=Math.ceil(d*o+this.left_offset);e.get(0).height=this.height_px;e.css({position:"absolute",top:0,left:(g-this.view.low)*o-this.left_offset});for(var h=0,l=m.length;h<l;h++){var a=Math.round(h*o);n.fillText(m[h],a+this.left_offset,10)}k.append(e);return e}this.content_div.css("height","0px")}});var LineTrack=function(d,b
,a,c){this.track_type="LineTrack";this.display_modes=["Line","Filled","Intensity"];this.mode="Line";Track.call(this,d,b,b.viewport_container);TiledTrack.call(this);this.height_px=80;this.dataset_id=a;this.data_cache=new Cache(CACHED_DATA);this.tile_cache=new Cache(CACHED_TILES_LINE);this.prefs={min_value:undefined,max_value:undefined,mode:"Line"};if(c.min_value!==undefined){this.prefs.min_value=c.min_value}if(c.max_value!==undefined){this.prefs.max_value=c.max_value}};$.extend(LineTrack.prototype,TiledTrack.prototype,{init:function(){var a=this,b=a.view.tracks.indexOf(a);a.vertical_range=undefined;this.init_each({stats:true,chrom:a.view.chrom,low:null,high:null,dataset_id:a.dataset_id},function(c){a.container_div.addClass("line-track");data=c.data;if(isNaN(parseFloat(a.prefs.min_value))||isNaN(parseFloat(a.prefs.max_value))){a.prefs.min_value=data.min;a.prefs.max_value=data.max;$("#track_"+b+"_minval").val(a.prefs.min_value);$("#track_"+b+"_maxval").val(a.prefs.max_value)}a.
vertical_range=a.prefs.max_value-a.prefs.min_value;a.total_frequency=data.total_frequency;$("#linetrack_"+b+"_minval").remove();$("#linetrack_"+b+"_maxval").remove();var e=$("<div />").addClass("yaxislabel").attr("id","linetrack_"+b+"_minval").text(round_1000(a.prefs.min_value));var d=$("<div />").addClass("yaxislabel").attr("id","linetrack_"+b+"_maxval").text(round_1000(a.prefs.max_value));d.css({position:"relative",top:"32px",left:"10px"});d.prependTo(a.container_div);e.css({position:"relative",top:a.height_px+32+"px",left:"10px"});e.prependTo(a.container_div)})},get_data:function(d,b){var c=this,a=b*DENSITY*d,f=(b+1)*DENSITY*d,e=d+"_"+b;if(!c.data_queue[e]){c.data_queue[e]=true;$.ajax({url:data_url,dataType:"json",data:{chrom:this.view.chrom,low:a,high:f,dataset_id:this.dataset_id,resolution:this.view.resolution},success:function(g){data=g.data;c.data_cache.set(e,data);delete c.data_queue[e];c.draw()},error:function(h,g,j){console.log(h,g,j)}})}},draw_tile:function(p,r,c,
e){if(this.vertical_range===undefined){return}var s=r*DENSITY*p,a=DENSITY*p,b=$("<canvas class='tile'></canvas>"),v=p+"_"+r;if(this.data_cache.get(v)===undefined){this.get_data(p,r);return}var j=this.data_cache.get(v);if(j===null){return}b.css({position:"absolute",top:0,left:(s-this.view.low)*e});b.get(0).width=Math.ceil(a*e);b.get(0).height=this.height_px;var o=b.get(0).getContext("2d"),k=false,l=this.prefs.min_value,g=this.prefs.max_value,n=this.vertical_range,t=this.total_frequency,d=this.height_px,m=this.mode;o.beginPath();if(data.length>1){var f=Math.ceil((data[1][0]-data[0][0])*e)}else{var f=10}var u,h;for(var q=0;q<data.length;q++){u=(data[q][0]-s)*e;h=data[q][1];if(m=="Intensity"){if(h===null){continue}if(h<=l){h=l}else{if(h>=g){h=g}}h=255-Math.floor((h-l)/n*255);o.fillStyle="rgb("+h+","+h+","+h+")";o.fillRect(u,0,f,this.height_px)}else{if(h===null){if(k&&m==="Filled"){o.lineTo(u,d)}k=false;continue}else{if(h<=l){h=l}else{if(h>=g){h=g}}h=Math.round(d-(h-l)/n*d);if(k)
{o.lineTo(u,h)}else{k=true;if(m==="Filled"){o.moveTo(u,d);o.lineTo(u,h)}else{o.moveTo(u,h)}}}}}if(m==="Filled"){if(k){o.lineTo(u,d)}o.fill()}else{o.stroke()}c.append(b);return b},gen_options:function(k){var a=$("<div />").addClass("form-row");var e="track_"+k+"_minval",h=$("<label></label>").attr("for",e).text("Min value:"),b=(this.prefs.min_value===undefined?"":this.prefs.min_value),j=$("<input></input>").attr("id",e).val(b),g="track_"+k+"_maxval",d=$("<label></label>").attr("for",g).text("Max value:"),f=(this.prefs.max_value===undefined?"":this.prefs.max_value),c=$("<input></input>").attr("id",g).val(f);return a.append(h).append(j).append(d).append(c)},update_options:function(c){var a=$("#track_"+c+"_minval").val(),b=$("#track_"+c+"_maxval").val();if(a!==this.prefs.min_value||b!==this.prefs.max_value){this.prefs.min_value=parseFloat(a);this.prefs.max_value=parseFloat(b);this.vertical_range=this.prefs.max_value-this.prefs.min_value;$("#linetrack_"+c+"_minval").text(this.pre
fs.min_value);$("#linetrack_"+c+"_maxval").text(this.prefs.max_value);this.tile_cache.clear();this.draw()}}});var FeatureTrack=function(d,b,a,c){this.track_type="FeatureTrack";this.display_modes=["Auto","Dense","Squish","Pack"];Track.call(this,d,b,b.viewport_container);TiledTrack.call(this);this.height_px=0;this.container_div.addClass("feature-track");this.dataset_id=a;this.zo_slots={};this.show_labels_scale=0.001;this.showing_details=false;this.vertical_detail_px=10;this.vertical_nodetail_px=2;this.summary_draw_height=20;this.default_font="9px Monaco, Lucida Console, monospace";this.inc_slots={};this.data_queue={};this.s_e_by_tile={};this.tile_cache=new Cache(CACHED_TILES_FEATURE);this.data_cache=new Cache(20);this.left_offset=200;this.prefs={block_color:"black",label_color:"black",show_counts:true};if(c.block_color!==undefined){this.prefs.block_color=c.block_color}if(c.label_color!==undefined){this.prefs.label_color=c.label_color}if(c.show_counts!==undefined){this.prefs.sh
ow_counts=c.show_counts}};$.extend(FeatureTrack.prototype,TiledTrack.prototype,{init:function(){var a=this,b="initial";this.init_each({low:a.view.max_low,high:a.view.max_high,dataset_id:a.dataset_id,chrom:a.view.chrom,resolution:this.view.resolution,mode:a.mode},function(c){a.mode_div.show();a.data_cache.set(b,c);a.draw()})},get_data:function(a,d){var b=this,c=a+"_"+d;if(!b.data_queue[c]){b.data_queue[c]=true;$.getJSON(data_url,{chrom:b.view.chrom,low:a,high:d,dataset_id:b.dataset_id,resolution:this.view.resolution,mode:this.mode},function(e){b.data_cache.set(c,e);delete b.data_queue[c];b.draw()})}},incremental_slots:function(a,h,c,r){if(!this.inc_slots[a]){this.inc_slots[a]={};this.inc_slots[a].w_scale=a;this.inc_slots[a].mode=r;this.s_e_by_tile[a]={}}var n=this.inc_slots[a].w_scale,z=[],l=0,b=$("<canvas></canvas>").get(0).getContext("2d"),o=this.view.max_low;var B=[];if(this.inc_slots[a].mode!==r){delete this.inc_slots[a];this.inc_slots[a]={mode:r,w_scale:n};delete this.s_
e_by_tile[a];this.s_e_by_tile[a]={}}for(var w=0,x=h.length;w<x;w++){var g=h[w],m=g[0];if(this.inc_slots[a][m]!==undefined){l=Math.max(l,this.inc_slots[a][m]);B.push(this.inc_slots[a][m])}else{z.push(w)}}for(var w=0,x=z.length;w<x;w++){var g=h[z[w]],m=g[0],s=g[1],d=g[2],q=g[3],e=Math.floor((s-o)*n),f=Math.ceil((d-o)*n);if(q!==undefined&&!c){var t=b.measureText(q).width;if(e-t<0){f+=t}else{e-=t}}var v=0;while(true){var p=true;if(this.s_e_by_tile[a][v]!==undefined){for(var u=0,A=this.s_e_by_tile[a][v].length;u<A;u++){var y=this.s_e_by_tile[a][v][u];if(f>y[0]&&e<y[1]){p=false;break}}}if(p){if(this.s_e_by_tile[a][v]===undefined){this.s_e_by_tile[a][v]=[]}this.s_e_by_tile[a][v].push([e,f]);this.inc_slots[a][m]=v;l=Math.max(l,v);break}v++}}return l},rect_or_text:function(n,o,f,m,b,d,k,e,h){n.textAlign="center";var j=Math.round(o/2);if((this.mode==="Pack"||this.mode==="Auto")&&d!==undefined&&o>PX_PER_CHAR){n.fillStyle=this.prefs.block_color;n.fillRect(k,h+1,e,9);n.fillStyle="#eee";f
or(var g=0,l=d.length;g<l;g++){if(b+g>=f&&b+g<=m){var a=Math.floor(Math.max(0,(b+g-f)*o));n.fillText(d[g],a+this.left_offset+j,h+9)}}}else{n.fillStyle=this.prefs.block_color;n.fillRect(k,h+4,e,3)}},draw_tile:function(ae,o,r,ar){var L=o*DENSITY*ae,ak=(o+1)*DENSITY*ae,K=ak-L;var al=(!this.initial_canvas?"initial":L+"_"+ak);var G=this.data_cache.get(al);var e;if(G===undefined||(this.mode!=="Auto"&&G.dataset_type==="summary_tree")){this.data_queue[[L,ak]]=true;this.get_data(L,ak);return}var a=Math.ceil(K*ar),S=$("<canvas class='tile'></canvas>"),ag=this.prefs.label_color,h=this.prefs.block_color,q=this.mode,v=25,ac=(q==="Squish")||(q==="Dense")&&(q!=="Pack")||(q==="Auto"&&(G.extra_info==="no_detail")),W=this.left_offset,aq,B,at;if(G.dataset_type==="summary_tree"){B=this.summary_draw_height}else{if(q==="Dense"){B=v;at=10}else{at=(ac?this.vertical_nodetail_px:this.vertical_detail_px);var w=(ar<0.0001?1/view.zoom_res:ar);B=this.incremental_slots(w,G.data,ac,q)*at+v;aq=this.inc_slot
s[w]}}S.css({position:"absolute",top:0,left:(L-this.view.low)*ar-W});S.get(0).width=a+W;S.get(0).height=B;r.parent().css("height",Math.max(this.height_px,B)+"px");var H=S.get(0).getContext("2d");H.fillStyle=h;H.font=this.default_font;H.textAlign="right";if(G.dataset_type=="summary_tree"){var R,O=55,aj=255-O,n=aj*2/3,Y=G.data,J=G.max,p=G.avg,b=Math.ceil(G.delta*ar);for(var an=0,F=Y.length;an<F;an++){var aa=Math.floor((Y[an][0]-L)*ar);var Z=Y[an][1];if(!Z){continue}R=Math.floor(aj-(Z/J)*aj);H.fillStyle="rgb("+R+","+R+","+R+")";H.fillRect(aa+W,0,b,this.summary_draw_height);if(this.prefs.show_counts&&H.measureText(Z).width<b){if(R>n){H.fillStyle="black"}else{H.fillStyle="#ddd"}H.textAlign="center";H.fillText(Z,aa+W+(b/2),12)}}e="Summary";r.append(S);return S}if(G.message){S.css({border:"solid red","border-width":"2px 2px 2px 0px"});H.fillStyle="red";H.textAlign="left";H.fillText(G.message,100+W,at)}var ap=G.data;var am=0;for(var an=0,F=ap.length;an<F;an++){var T=ap[an],Q=T[0],ao
=T[1],ab=T[2],M=T[3];if(ao<=ak&&ab>=L){var ad=Math.floor(Math.max(0,(ao-L)*ar)),I=Math.ceil(Math.min(a,Math.max(0,(ab-L)*ar))),X=(q==="Dense"?1:(1+aq[Q]))*at;if(G.dataset_type==="bai"){H.fillStyle=h;if(T[4] instanceof Array){var C=Math.floor(Math.max(0,(T[4][0]-L)*ar)),P=Math.ceil(Math.min(a,Math.max(0,(T[4][1]-L)*ar))),A=Math.floor(Math.max(0,(T[5][0]-L)*ar)),u=Math.ceil(Math.min(a,Math.max(0,(T[5][1]-L)*ar)));if(T[4][1]>=L&&T[4][0]<=ak){this.rect_or_text(H,ar,L,ak,T[4][0],T[4][2],C+W,P-C,X)}if(T[5][1]>=L&&T[5][0]<=ak){this.rect_or_text(H,ar,L,ak,T[5][0],T[5][2],A+W,u-A,X)}if(A>P){H.fillStyle="#999";H.fillRect(P+W,X+5,A-P,1)}}else{H.fillStyle=h;this.rect_or_text(H,ar,L,ak,ao,M,ad+W,I-ad,X)}if(q!=="Dense"&&!ac&&ao>L){H.fillStyle=this.prefs.label_color;if(o===0&&ad-H.measureText(M).width<0){H.textAlign="left";H.fillText(Q,I+2+W,X+8)}else{H.textAlign="right";H.fillText(Q,ad-2+W,X+8)}H.fillStyle=h}}else{if(G.dataset_type==="interval_index"){if(ac){H.fillStyle=h;H.fillRect(ad+W,
X+5,I-ad,1)}else{var E=T[4],V=T[5],af=T[6],g=T[7];var D,ah,N=null,au=null;if(V&&af){N=Math.floor(Math.max(0,(V-L)*ar));au=Math.ceil(Math.min(a,Math.max(0,(af-L)*ar)))}if(q!=="Dense"&&M!==undefined&&ao>L){H.fillStyle=ag;if(o===0&&ad-H.measureText(M).width<0){H.textAlign="left";H.fillText(M,I+2+W,X+8)}else{H.textAlign="right";H.fillText(M,ad-2+W,X+8)}H.fillStyle=h}if(g){if(E){if(E=="+"){H.fillStyle=RIGHT_STRAND}else{if(E=="-"){H.fillStyle=LEFT_STRAND}}H.fillRect(ad+W,X,I-ad,10);H.fillStyle=h}for(var al=0,f=g.length;al<f;al++){var t=g[al],d=Math.floor(Math.max(0,(t[0]-L)*ar)),U=Math.ceil(Math.min(a,Math.max((t[1]-L)*ar)));if(d>U){continue}D=5;ah=3;H.fillRect(d+W,X+ah,U-d,D);if(N!==undefined&&!(d>au||U<N)){D=9;ah=1;var ai=Math.max(d,N),z=Math.min(U,au);H.fillRect(ai+W,X+ah,z-ai,D)}}}else{D=9;ah=1;H.fillRect(ad+W,X+ah,I-ad,D);if(T.strand){if(T.strand=="+"){H.fillStyle=RIGHT_STRAND_INV}else{if(T.strand=="-"){H.fillStyle=LEFT_STRAND_INV}}H.fillRect(ad+W,X,I-ad,10);H.fillStyle=h}}}}
else{if(G.dataset_type==="vcf"){if(ac){H.fillStyle=h;H.fillRect(ad+W,X+5,I-ad,1)}else{var s=T[4],m=T[5],c=T[6];D=9;ah=1;H.fillRect(ad+W,X,I-ad,D);if(q!=="Dense"&&M!==undefined&&ao>L){H.fillStyle=ag;if(o===0&&ad-H.measureText(M).width<0){H.textAlign="left";H.fillText(M,I+2+W,X+8)}else{H.textAlign="right";H.fillText(M,ad-2+W,X+8)}H.fillStyle=h}var l=s+" / "+m;if(ao>L&&H.measureText(l).width<(I-ad)){H.fillStyle="white";H.textAlign="center";H.fillText(l,W+ad+(I-ad)/2,X+8);H.fillStyle=h}}}}}am++}}r.append(S);return S},gen_options:function(j){var a=$("<div />").addClass("form-row");var e="track_"+j+"_block_color",l=$("<label />").attr("for",e).text("Block color:"),m=$("<input />").attr("id",e).attr("name",e).val(this.prefs.block_color),k="track_"+j+"_label_color",g=$("<label />").attr("for",k).text("Text color:"),h=$("<input />").attr("id",k).attr("name",k).val(this.prefs.label_color),f="track_"+j+"_show_count",c=$("<label />").attr("for",f).text("Show summary counts"),b=$('<input
type="checkbox" style="float:left;"></input>').attr("id",f).attr("name",f).attr("checked",this.prefs.show_counts),d=$("<div />").append(b).append(c);return a.append(l).append(m).append(g).append(h).append(d)},update_options:function(e){var b=$("#track_"+e+"_block_color").val(),d=$("#track_"+e+"_label_color").val(),c=$("#track_"+e+"_mode option:selected").val(),a=$("#track_"+e+"_show_count").attr("checked");if(b!==this.prefs.block_color||d!==this.prefs.label_color||a!==this.prefs.show_counts){this.prefs.block_color=b;this.prefs.label_color=d;this.prefs.show_counts=a;this.tile_cache.clear();this.draw()}}});var ReadTrack=function(d,b,a,c){FeatureTrack.call(this,d,b,a,c);this.track_type="ReadTrack";this.vertical_detail_px=10;this.vertical_nodetail_px=5};$.extend(ReadTrack.prototype,TiledTrack.prototype,FeatureTrack.prototype,{});
+var DENSITY=200,FEATURE_LEVELS=10,MAX_FEATURE_DEPTH=100,DATA_ERROR="There was an error in indexing this dataset. ",DATA_NOCONVERTER="A converter for this dataset is not installed. Please check your datatypes_conf.xml file.",DATA_NONE="No data for this chrom/contig.",DATA_PENDING="Currently indexing... please wait",DATA_LOADING="Loading data...",CACHED_TILES_FEATURE=10,CACHED_TILES_LINE=30,CACHED_DATA=5,CONTEXT=$("<canvas></canvas>").get(0).getContext("2d"),PX_PER_CHAR=CONTEXT.measureText("A").width,RIGHT_STRAND,LEFT_STRAND;var right_img=new Image();right_img.src=image_path+"/visualization/strand_right.png";right_img.onload=function(){RIGHT_STRAND=CONTEXT.createPattern(right_img,"repeat")};var left_img=new Image();left_img.src=image_path+"/visualization/strand_left.png";left_img.onload=function(){LEFT_STRAND=CONTEXT.createPattern(left_img,"repeat")};var right_img_inv=new Image();right_img_inv.src=image_path+"/visualization/strand_right_inv.png";right_img_inv.onload=function()
{RIGHT_STRAND_INV=CONTEXT.createPattern(right_img_inv,"repeat")};var left_img_inv=new Image();left_img_inv.src=image_path+"/visualization/strand_left_inv.png";left_img_inv.onload=function(){LEFT_STRAND_INV=CONTEXT.createPattern(left_img_inv,"repeat")};function round_1000(a){return Math.round(a*1000)/1000}var Cache=function(a){this.num_elements=a;this.clear()};$.extend(Cache.prototype,{get:function(b){var a=this.key_ary.indexOf(b);if(a!=-1){this.key_ary.splice(a,1);this.key_ary.push(b)}return this.obj_cache[b]},set:function(b,c){if(!this.obj_cache[b]){if(this.key_ary.length>=this.num_elements){var a=this.key_ary.shift();delete this.obj_cache[a]}this.key_ary.push(b)}this.obj_cache[b]=c;return c},clear:function(){this.obj_cache={};this.key_ary=[]}});var View=function(a,c,e,d,b){this.container=a;this.vis_id=d;this.dbkey=b;this.title=e;this.chrom=c;this.tracks=[];this.label_tracks=[];this.max_low=0;this.max_high=0;this.num_tracks=0;this.track_id_counter=0;this.zoom_factor=3;this.
min_separation=30;this.has_changes=false;this.init();this.reset()};$.extend(View.prototype,{init:function(){var c=this.container,a=this;this.top_labeltrack=$("<div/>").addClass("top-labeltrack").appendTo(c);this.content_div=$("<div/>").addClass("content").css("position","relative").appendTo(c);this.viewport_container=$("<div/>").addClass("viewport-container").addClass("viewport-container").appendTo(this.content_div);this.intro_div=$("<div/>").addClass("intro").text("Select a chrom from the dropdown below").hide();this.nav_container=$("<div/>").addClass("nav-container").appendTo(c);this.nav_labeltrack=$("<div/>").addClass("nav-labeltrack").appendTo(this.nav_container);this.nav=$("<div/>").addClass("nav").appendTo(this.nav_container);this.overview=$("<div/>").addClass("overview").appendTo(this.nav);this.overview_viewport=$("<div/>").addClass("overview-viewport").appendTo(this.overview);this.overview_close=$("<a href='javascript:void(0);'>Close Overview</a>").addClass("overview
-close").hide().appendTo(this.overview_viewport);this.overview_highlight=$("<div />").addClass("overview-highlight").hide().appendTo(this.overview_viewport);this.overview_box_background=$("<div/>").addClass("overview-boxback").appendTo(this.overview_viewport);this.overview_box=$("<div/>").addClass("overview-box").appendTo(this.overview_viewport);this.default_overview_height=this.overview_box.height();this.nav_controls=$("<div/>").addClass("nav-controls").appendTo(this.nav);this.chrom_form=$("<form/>").attr("action",function(){void (0)}).appendTo(this.nav_controls);this.chrom_select=$("<select/>").attr({name:"chrom"}).css("width","15em").addClass("no-autocomplete").append("<option value=''>Loading</option>").appendTo(this.chrom_form);var b=function(d){if(d.type==="focusout"||(d.keyCode||d.which)===13||(d.keyCode||d.which)===27){if((d.keyCode||d.which)!==27){a.go_to($(this).val())}$(this).hide();a.location_span.show();a.chrom_select.show();return false}};this.nav_input=$("<inp
ut/>").addClass("nav-input").hide().bind("keypress focusout",b).appendTo(this.chrom_form);this.location_span=$("<span/>").addClass("location").appendTo(this.chrom_form);this.location_span.bind("click",function(){a.location_span.hide();a.chrom_select.hide();a.nav_input.css("display","inline-block");a.nav_input.select();a.nav_input.focus()});if(this.vis_id!==undefined){this.hidden_input=$("<input/>").attr("type","hidden").val(this.vis_id).appendTo(this.chrom_form)}this.zo_link=$("<a/>").click(function(){a.zoom_out();a.redraw()}).html('<img src="'+image_path+'/fugue/magnifier-zoom-out.png" />').appendTo(this.chrom_form);this.zi_link=$("<a/>").click(function(){a.zoom_in();a.redraw()}).html('<img src="'+image_path+'/fugue/magnifier-zoom.png" />').appendTo(this.chrom_form);$.ajax({url:chrom_url,data:(this.vis_id!==undefined?{vis_id:this.vis_id}:{dbkey:this.dbkey}),dataType:"json",success:function(d){if(d.reference){a.add_label_track(new ReferenceTrack(a))}a.chrom_data=d.chrom_info
;var f='<option value="">Select Chrom/Contig</option>';for(i in a.chrom_data){var e=a.chrom_data[i]["chrom"];f+='<option value="'+e+'">'+e+"</option>"}a.chrom_select.html(f);a.intro_div.show();a.chrom_select.bind("change",function(){a.change_chrom(a.chrom_select.val())})},error:function(){alert("Could not load chroms for this dbkey:",a.dbkey)}});this.content_div.bind("dblclick",function(d){a.zoom_in(d.pageX,this.viewport_container)});this.overview_box.bind("dragstart",function(d){this.current_x=d.offsetX}).bind("drag",function(d){var g=d.offsetX-this.current_x;this.current_x=d.offsetX;var f=Math.round(g/a.viewport_container.width()*(a.max_high-a.max_low));a.move_delta(-f)});this.overview_close.bind("click",function(){for(var d in a.tracks){a.tracks[d].is_overview=false}$(this).siblings().filter("canvas").remove();$(this).parent().css("height",a.overview_box.height());a.overview_highlight.hide();$(this).hide()});this.viewport_container.bind("dragstart",function(d){this.origin
al_low=a.low;this.current_height=d.clientY;this.current_x=d.offsetX;this.enable_pan=(d.clientX<a.viewport_container.width()-16)?true:false}).bind("drag",function(g){if(!this.enable_pan||this.in_reordering){return}var d=$(this);var j=g.offsetX-this.current_x;var f=d.scrollTop()-(g.clientY-this.current_height);d.scrollTop(f);this.current_height=g.clientY;this.current_x=g.offsetX;var h=Math.round(j/a.viewport_container.width()*(a.high-a.low));a.move_delta(h)});this.top_labeltrack.bind("dragstart",function(d){this.drag_origin_x=d.clientX;this.drag_origin_pos=d.clientX/a.viewport_container.width()*(a.high-a.low)+a.low;this.drag_div=$("<div />").css({height:a.content_div.height()+30,top:"0px",position:"absolute","background-color":"#cfc",border:"1px solid #6a6",opacity:0.5,"z-index":1000}).appendTo($(this))}).bind("drag",function(j){var f=Math.min(j.clientX,this.drag_origin_x)-a.container.offset().left,d=Math.max(j.clientX,this.drag_origin_x)-a.container.offset().left,h=(a.high-a.
low),g=a.viewport_container.width();a.update_location(Math.round(f/g*h)+a.low,Math.round(d/g*h)+a.low);this.drag_div.css({left:f+"px",width:(d-f)+"px"})}).bind("dragend",function(k){var f=Math.min(k.clientX,this.drag_origin_x),d=Math.max(k.clientX,this.drag_origin_x),h=(a.high-a.low),g=a.viewport_container.width(),j=a.low;a.low=Math.round(f/g*h)+j;a.high=Math.round(d/g*h)+j;this.drag_div.remove();a.redraw()});this.add_label_track(new LabelTrack(this,this.top_labeltrack));this.add_label_track(new LabelTrack(this,this.nav_labeltrack))},update_location:function(a,b){this.location_span.text(commatize(a)+" - "+commatize(b));this.nav_input.val(this.chrom+":"+commatize(a)+"-"+commatize(b))},change_chrom:function(d,a,f){var c=this;var e=$.grep(c.chrom_data,function(h,j){return h.chrom===d})[0];if(e===undefined){return}if(d!==c.chrom){c.chrom=d;if(c.chrom===""){c.intro_div.show()}else{c.intro_div.hide()}c.chrom_select.val(c.chrom);c.max_high=e.len;c.reset();c.redraw(true);for(var g i
n c.tracks){var b=c.tracks[g];if(b.init){b.init()}}}if(a!==undefined&&f!==undefined){c.low=Math.max(a,0);c.high=Math.min(f,c.max_high)}c.overview_viewport.find("canvas").remove();c.redraw()},go_to:function(f){var k=this,b=f.split(":"),h=b[0],j=b[1];if(j!==undefined){try{var g=j.split("-"),a=parseInt(g[0].replace(/,/g,"")),d=parseInt(g[1].replace(/,/g,""))}catch(c){return false}}k.change_chrom(h,a,d)},move_delta:function(c){var a=this;var b=a.high-a.low;if(a.low-c<a.max_low){a.low=a.max_low;a.high=a.max_low+b}else{if(a.high-c>a.max_high){a.high=a.max_high;a.low=a.max_high-b}else{a.high-=c;a.low-=c}}a.redraw()},add_track:function(a){a.view=this;a.track_id=this.track_id_counter;this.tracks.push(a);if(a.init){a.init()}a.container_div.attr("id","track_"+a.track_id);this.track_id_counter+=1;this.num_tracks+=1},add_label_track:function(a){a.view=this;this.label_tracks.push(a)},remove_track:function(a){this.has_changes=true;a.container_div.fadeOut("slow",function(){$(this).remove()}
);delete this.tracks[this.tracks.indexOf(a)];this.num_tracks-=1},reset:function(){this.low=this.max_low;this.high=this.max_high;this.viewport_container.find(".yaxislabel").remove()},redraw:function(h){var g=this.high-this.low,f=this.low,b=this.high;if(f<this.max_low){f=this.max_low}if(b>this.max_high){b=this.max_high}if(this.high!==0&&g<this.min_separation){b=f+this.min_separation}this.low=Math.floor(f);this.high=Math.ceil(b);this.resolution=Math.pow(10,Math.ceil(Math.log((this.high-this.low)/200)/Math.LN10));this.zoom_res=Math.pow(FEATURE_LEVELS,Math.max(0,Math.ceil(Math.log(this.resolution,FEATURE_LEVELS)/Math.log(FEATURE_LEVELS))));var a=this.low/(this.max_high-this.max_low)*this.overview_viewport.width();var e=(this.high-this.low)/(this.max_high-this.max_low)*this.overview_viewport.width();var j=13;this.overview_box.css({left:a,width:Math.max(j,e)}).show();if(e<j){this.overview_box.css("left",a-(j-e)/2)}if(this.overview_highlight){this.overview_highlight.css({left:a,widt
h:e})}this.update_location(this.low,this.high);if(!h){for(var c=0,d=this.tracks.length;c<d;c++){if(this.tracks[c]&&this.tracks[c].enabled){this.tracks[c].draw()}}for(var c=0,d=this.label_tracks.length;c<d;c++){this.label_tracks[c].draw()}}},zoom_in:function(b,c){if(this.max_high===0||this.high-this.low<this.min_separation){return}var d=this.high-this.low,e=d/2+this.low,a=(d/this.zoom_factor)/2;if(b){e=b/this.viewport_container.width()*(this.high-this.low)+this.low}this.low=Math.round(e-a);this.high=Math.round(e+a);this.redraw()},zoom_out:function(){if(this.max_high===0){return}var b=this.high-this.low,c=b/2+this.low,a=(b*this.zoom_factor)/2;this.low=Math.round(c-a);this.high=Math.round(c+a);this.redraw()}});var Track=function(b,a,c){this.name=b;this.parent_element=c;this.view=a;this.init_global()};$.extend(Track.prototype,{init_global:function(){this.container_div=$("<div />").addClass("track");if(!this.hidden){this.header_div=$("<div class='track-header' />").appendTo(this.
container_div);this.drag_div=$("<div class='draghandle' />").appendTo(this.header_div);this.name_div=$("<div class='menubutton popup' />").appendTo(this.header_div);this.name_div.text(this.name)}this.content_div=$("<div class='track-content'>").appendTo(this.container_div);this.parent_element.append(this.container_div)},init_each:function(c,b){var a=this;a.enabled=false;a.data_queue={};a.tile_cache.clear();a.data_cache.clear();a.initial_canvas=undefined;a.content_div.css("height","auto");if(!a.content_div.text()){a.content_div.text(DATA_LOADING)}a.container_div.removeClass("nodata error pending");if(a.view.chrom){$.getJSON(data_url,c,function(d){if(!d||d==="error"||d.kind==="error"){a.container_div.addClass("error");a.content_div.text(DATA_ERROR);if(d.message){var f=a.view.tracks.indexOf(a);var e=$("<a href='javascript:void(0);'></a>").attr("id",f+"_error");e.text("Click to view error");$("#"+f+"_error").live("click",function(){show_modal("Trackster Error","<pre>"+d.message+
"</pre>",{Close:hide_modal})});a.content_div.append(e)}}else{if(d==="no converter"){a.container_div.addClass("error");a.content_div.text(DATA_NOCONVERTER)}else{if(d.data!==undefined&&(d.data===null||d.data.length===0)){a.container_div.addClass("nodata");a.content_div.text(DATA_NONE)}else{if(d==="pending"){a.container_div.addClass("pending");a.content_div.text(DATA_PENDING);setTimeout(function(){a.init()},5000)}else{a.content_div.text("");a.content_div.css("height",a.height_px+"px");a.enabled=true;b(d);a.draw()}}}}})}else{a.container_div.addClass("nodata");a.content_div.text(DATA_NONE)}}});var TiledTrack=function(){var d=this,c=d.view;if(d.hidden){return}if(d.display_modes!==undefined){if(d.mode_div===undefined){d.mode_div=$("<div class='right-float menubutton popup' />").appendTo(d.header_div);var h=d.display_modes[0];d.mode=h;d.mode_div.text(h);var a=function(j){d.mode_div.text(j);d.mode=j;d.tile_cache.clear();d.draw()};var f={};for(var e in d.display_modes){var g=d.display
_modes[e];f[g]=function(j){return function(){a(j)}}(g)}make_popupmenu(d.mode_div,f)}else{d.mode_div.hide()}}var b={};b["Set as overview"]=function(){c.overview_viewport.find("canvas").remove();d.is_overview=true;d.set_overview();for(var j in c.tracks){if(c.tracks[j]!==d){c.tracks[j].is_overview=false}}};b["Edit configuration"]=function(){var k=function(){hide_modal()};var j=function(){d.update_options(d.track_id);hide_modal()};show_modal("Configure Track",d.gen_options(d.track_id),{Cancel:k,OK:j})};b.Remove=function(){c.remove_track(d);if(c.num_tracks===0){$("#no-tracks").show()}};make_popupmenu(d.name_div,b)};$.extend(TiledTrack.prototype,Track.prototype,{draw:function(){var j=this.view.low,e=this.view.high,f=e-j,d=this.view.resolution;var l=$("<div style='position: relative;'></div>"),m=this.content_div.width()/f,h;this.content_div.children(":first").remove();this.content_div.append(l),this.max_height=0;var a=Math.floor(j/d/DENSITY);while((a*DENSITY*d)<e){var k=this.conten
t_div.width()+"_"+m+"_"+a;var c=this.tile_cache.get(k);if(c){var g=a*DENSITY*d;var b=(g-j)*m;if(this.left_offset){b-=this.left_offset}c.css({left:b});l.append(c);this.max_height=Math.max(this.max_height,c.height());this.content_div.css("height",this.max_height+"px")}else{this.delayed_draw(this,k,j,e,a,d,l,m)}a+=1}},delayed_draw:function(c,e,a,f,b,d,g,h){setTimeout(function(){if(!(a>c.view.high||f<c.view.low)){tile_element=c.draw_tile(d,b,g,h);if(tile_element){if(!c.initial_canvas){c.initial_canvas=$(tile_element).clone();var l=tile_element.get(0).getContext("2d");var j=c.initial_canvas.get(0).getContext("2d");var k=l.getImageData(0,0,l.canvas.width,l.canvas.height);j.putImageData(k,0,0);c.set_overview()}c.tile_cache.set(e,tile_element);c.max_height=Math.max(c.max_height,tile_element.height());c.content_div.css("height",c.max_height+"px")}}},50)},set_overview:function(){var a=this.view;a.overview_viewport.height(a.default_overview_height);a.overview_box.height(a.default_overv
iew_height);if(this.initial_canvas&&this.is_overview){a.overview_close.show();a.overview_viewport.append(this.initial_canvas);a.overview_highlight.show().height(this.initial_canvas.height());a.overview_viewport.height(this.initial_canvas.height()+a.overview_box.height())}$(window).trigger("resize")}});var LabelTrack=function(a,b){this.track_type="LabelTrack";this.hidden=true;Track.call(this,null,a,b);this.container_div.addClass("label-track")};$.extend(LabelTrack.prototype,Track.prototype,{draw:function(){var c=this.view,d=c.high-c.low,g=Math.floor(Math.pow(10,Math.floor(Math.log(d)/Math.log(10)))),a=Math.floor(c.low/g)*g,e=this.content_div.width(),b=$("<div style='position: relative; height: 1.3em;'></div>");while(a<c.high){var f=(a-c.low)/d*e;b.append($("<div class='label'>"+commatize(a)+"</div>").css({position:"absolute",left:f-1}));a+=g}this.content_div.children(":first").remove();this.content_div.append(b)}});var ReferenceTrack=function(a){this.track_type="ReferenceTrac
k";this.hidden=true;Track.call(this,null,a,a.top_labeltrack);TiledTrack.call(this);this.height_px=12;this.container_div.addClass("reference-track");this.dummy_canvas=$("<canvas></canvas>").get(0).getContext("2d");this.data_queue={};this.data_cache=new Cache(CACHED_DATA);this.tile_cache=new Cache(CACHED_TILES_LINE)};$.extend(ReferenceTrack.prototype,TiledTrack.prototype,{get_data:function(d,b){var c=this,a=b*DENSITY*d,f=(b+1)*DENSITY*d,e=d+"_"+b;if(!c.data_queue[e]){c.data_queue[e]=true;$.ajax({url:reference_url,dataType:"json",data:{chrom:this.view.chrom,low:a,high:f,dbkey:this.view.dbkey},success:function(g){c.data_cache.set(e,g);delete c.data_queue[e];c.draw()},error:function(h,g,j){console.log(h,g,j)}})}},draw_tile:function(f,b,k,o){var g=b*DENSITY*f,d=DENSITY*f,e=$("<canvas class='tile'></canvas>"),n=e.get(0).getContext("2d"),j=f+"_"+b;if(o>PX_PER_CHAR){if(this.data_cache.get(j)===undefined){this.get_data(f,b);return}var m=this.data_cache.get(j);if(m===null){this.content
_div.css("height","0px");return}e.get(0).width=Math.ceil(d*o+this.left_offset);e.get(0).height=this.height_px;e.css({position:"absolute",top:0,left:(g-this.view.low)*o-this.left_offset});for(var h=0,l=m.length;h<l;h++){var a=Math.round(h*o);n.fillText(m[h],a+this.left_offset,10)}k.append(e);return e}this.content_div.css("height","0px")}});var LineTrack=function(d,b,a,c){this.track_type="LineTrack";this.display_modes=["Line","Filled","Intensity"];this.mode="Line";Track.call(this,d,b,b.viewport_container);TiledTrack.call(this);this.height_px=80;this.dataset_id=a;this.data_cache=new Cache(CACHED_DATA);this.tile_cache=new Cache(CACHED_TILES_LINE);this.prefs={min_value:undefined,max_value:undefined,mode:"Line"};if(c.min_value!==undefined){this.prefs.min_value=c.min_value}if(c.max_value!==undefined){this.prefs.max_value=c.max_value}};$.extend(LineTrack.prototype,TiledTrack.prototype,{init:function(){var a=this,b=a.view.tracks.indexOf(a);a.vertical_range=undefined;this.init_each({s
tats:true,chrom:a.view.chrom,low:null,high:null,dataset_id:a.dataset_id},function(c){a.container_div.addClass("line-track");data=c.data;if(isNaN(parseFloat(a.prefs.min_value))||isNaN(parseFloat(a.prefs.max_value))){a.prefs.min_value=data.min;a.prefs.max_value=data.max;$("#track_"+b+"_minval").val(a.prefs.min_value);$("#track_"+b+"_maxval").val(a.prefs.max_value)}a.vertical_range=a.prefs.max_value-a.prefs.min_value;a.total_frequency=data.total_frequency;$("#linetrack_"+b+"_minval").remove();$("#linetrack_"+b+"_maxval").remove();a.container_div.css("position","relative");var e=$("<div />").addClass("yaxislabel").attr("id","linetrack_"+b+"_minval").text(round_1000(a.prefs.min_value));var d=$("<div />").addClass("yaxislabel").attr("id","linetrack_"+b+"_maxval").text(round_1000(a.prefs.max_value));d.css({position:"absolute",top:"22px",left:"10px"});d.prependTo(a.container_div);e.css({position:"absolute",top:a.height_px+11+"px",left:"10px"});e.prependTo(a.container_div)})},get_dat
a:function(d,b){var c=this,a=b*DENSITY*d,f=(b+1)*DENSITY*d,e=d+"_"+b;if(!c.data_queue[e]){c.data_queue[e]=true;$.ajax({url:data_url,dataType:"json",data:{chrom:this.view.chrom,low:a,high:f,dataset_id:this.dataset_id,resolution:this.view.resolution},success:function(g){data=g.data;c.data_cache.set(e,data);delete c.data_queue[e];c.draw()},error:function(h,g,j){console.log(h,g,j)}})}},draw_tile:function(p,r,c,e){if(this.vertical_range===undefined){return}var s=r*DENSITY*p,a=DENSITY*p,b=$("<canvas class='tile'></canvas>"),v=p+"_"+r;if(this.data_cache.get(v)===undefined){this.get_data(p,r);return}var j=this.data_cache.get(v);if(j===null){return}b.css({position:"absolute",top:0,left:(s-this.view.low)*e});b.get(0).width=Math.ceil(a*e);b.get(0).height=this.height_px;var o=b.get(0).getContext("2d"),k=false,l=this.prefs.min_value,g=this.prefs.max_value,n=this.vertical_range,t=this.total_frequency,d=this.height_px,m=this.mode;o.beginPath();if(data.length>1){var f=Math.ceil((data[1][0]-
data[0][0])*e)}else{var f=10}var u,h;for(var q=0;q<data.length;q++){u=(data[q][0]-s)*e;h=data[q][1];if(m=="Intensity"){if(h===null){continue}if(h<=l){h=l}else{if(h>=g){h=g}}h=255-Math.floor((h-l)/n*255);o.fillStyle="rgb("+h+","+h+","+h+")";o.fillRect(u,0,f,this.height_px)}else{if(h===null){if(k&&m==="Filled"){o.lineTo(u,d)}k=false;continue}else{if(h<=l){h=l}else{if(h>=g){h=g}}h=Math.round(d-(h-l)/n*d);if(k){o.lineTo(u,h)}else{k=true;if(m==="Filled"){o.moveTo(u,d);o.lineTo(u,h)}else{o.moveTo(u,h)}}}}}if(m==="Filled"){if(k){o.lineTo(u,d)}o.fill()}else{o.stroke()}c.append(b);return b},gen_options:function(k){var a=$("<div />").addClass("form-row");var e="track_"+k+"_minval",h=$("<label></label>").attr("for",e).text("Min value:"),b=(this.prefs.min_value===undefined?"":this.prefs.min_value),j=$("<input></input>").attr("id",e).val(b),g="track_"+k+"_maxval",d=$("<label></label>").attr("for",g).text("Max value:"),f=(this.prefs.max_value===undefined?"":this.prefs.max_value),c=$("<inp
ut></input>").attr("id",g).val(f);return a.append(h).append(j).append(d).append(c)},update_options:function(c){var a=$("#track_"+c+"_minval").val(),b=$("#track_"+c+"_maxval").val();if(a!==this.prefs.min_value||b!==this.prefs.max_value){this.prefs.min_value=parseFloat(a);this.prefs.max_value=parseFloat(b);this.vertical_range=this.prefs.max_value-this.prefs.min_value;$("#linetrack_"+c+"_minval").text(this.prefs.min_value);$("#linetrack_"+c+"_maxval").text(this.prefs.max_value);this.tile_cache.clear();this.draw()}}});var FeatureTrack=function(d,b,a,c){this.track_type="FeatureTrack";this.display_modes=["Auto","Dense","Squish","Pack"];Track.call(this,d,b,b.viewport_container);TiledTrack.call(this);this.height_px=0;this.container_div.addClass("feature-track");this.dataset_id=a;this.zo_slots={};this.show_labels_scale=0.001;this.showing_details=false;this.vertical_detail_px=10;this.vertical_nodetail_px=2;this.summary_draw_height=20;this.default_font="9px Monaco, Lucida Console, mono
space";this.inc_slots={};this.data_queue={};this.s_e_by_tile={};this.tile_cache=new Cache(CACHED_TILES_FEATURE);this.data_cache=new Cache(20);this.left_offset=200;this.prefs={block_color:"black",label_color:"black",show_counts:true};if(c.block_color!==undefined){this.prefs.block_color=c.block_color}if(c.label_color!==undefined){this.prefs.label_color=c.label_color}if(c.show_counts!==undefined){this.prefs.show_counts=c.show_counts}};$.extend(FeatureTrack.prototype,TiledTrack.prototype,{init:function(){var a=this,b="initial";this.init_each({low:a.view.max_low,high:a.view.max_high,dataset_id:a.dataset_id,chrom:a.view.chrom,resolution:this.view.resolution,mode:a.mode},function(c){a.mode_div.show();a.data_cache.set(b,c);a.draw()})},get_data:function(a,d){var b=this,c=a+"_"+d;if(!b.data_queue[c]){b.data_queue[c]=true;$.getJSON(data_url,{chrom:b.view.chrom,low:a,high:d,dataset_id:b.dataset_id,resolution:this.view.resolution,mode:this.mode},function(e){b.data_cache.set(c,e);delete b
.data_queue[c];b.draw()})}},incremental_slots:function(a,h,c,r){if(!this.inc_slots[a]){this.inc_slots[a]={};this.inc_slots[a].w_scale=a;this.inc_slots[a].mode=r;this.s_e_by_tile[a]={}}var n=this.inc_slots[a].w_scale,z=[],l=0,b=$("<canvas></canvas>").get(0).getContext("2d"),o=this.view.max_low;var B=[];if(this.inc_slots[a].mode!==r){delete this.inc_slots[a];this.inc_slots[a]={mode:r,w_scale:n};delete this.s_e_by_tile[a];this.s_e_by_tile[a]={}}for(var w=0,x=h.length;w<x;w++){var g=h[w],m=g[0];if(this.inc_slots[a][m]!==undefined){l=Math.max(l,this.inc_slots[a][m]);B.push(this.inc_slots[a][m])}else{z.push(w)}}for(var w=0,x=z.length;w<x;w++){var g=h[z[w]],m=g[0],s=g[1],d=g[2],q=g[3],e=Math.floor((s-o)*n),f=Math.ceil((d-o)*n);if(q!==undefined&&!c){var t=b.measureText(q).width;if(e-t<0){f+=t}else{e-=t}}var v=0;while(true){var p=true;if(this.s_e_by_tile[a][v]!==undefined){for(var u=0,A=this.s_e_by_tile[a][v].length;u<A;u++){var y=this.s_e_by_tile[a][v][u];if(f>y[0]&&e<y[1]){p=false;
break}}}if(p){if(this.s_e_by_tile[a][v]===undefined){this.s_e_by_tile[a][v]=[]}this.s_e_by_tile[a][v].push([e,f]);this.inc_slots[a][m]=v;l=Math.max(l,v);break}v++}}return l},rect_or_text:function(n,o,f,m,b,d,k,e,h){n.textAlign="center";var j=Math.round(o/2);if((this.mode==="Pack"||this.mode==="Auto")&&d!==undefined&&o>PX_PER_CHAR){n.fillStyle=this.prefs.block_color;n.fillRect(k,h+1,e,9);n.fillStyle="#eee";for(var g=0,l=d.length;g<l;g++){if(b+g>=f&&b+g<=m){var a=Math.floor(Math.max(0,(b+g-f)*o));n.fillText(d[g],a+this.left_offset+j,h+9)}}}else{n.fillStyle=this.prefs.block_color;n.fillRect(k,h+4,e,3)}},draw_tile:function(ae,o,r,ar){var L=o*DENSITY*ae,ak=(o+1)*DENSITY*ae,K=ak-L;var al=(!this.initial_canvas?"initial":L+"_"+ak);var G=this.data_cache.get(al);var e;if(G===undefined||(this.mode!=="Auto"&&G.dataset_type==="summary_tree")){this.data_queue[[L,ak]]=true;this.get_data(L,ak);return}var a=Math.ceil(K*ar),S=$("<canvas class='tile'></canvas>"),ag=this.prefs.label_color,h=thi
s.prefs.block_color,q=this.mode,v=25,ac=(q==="Squish")||(q==="Dense")&&(q!=="Pack")||(q==="Auto"&&(G.extra_info==="no_detail")),W=this.left_offset,aq,B,at;if(G.dataset_type==="summary_tree"){B=this.summary_draw_height}else{if(q==="Dense"){B=v;at=10}else{at=(ac?this.vertical_nodetail_px:this.vertical_detail_px);var w=(ar<0.0001?1/view.zoom_res:ar);B=this.incremental_slots(w,G.data,ac,q)*at+v;aq=this.inc_slots[w]}}S.css({position:"absolute",top:0,left:(L-this.view.low)*ar-W});S.get(0).width=a+W;S.get(0).height=B;r.parent().css("height",Math.max(this.height_px,B)+"px");var H=S.get(0).getContext("2d");H.fillStyle=h;H.font=this.default_font;H.textAlign="right";if(G.dataset_type=="summary_tree"){var R,O=55,aj=255-O,n=aj*2/3,Y=G.data,J=G.max,p=G.avg,b=Math.ceil(G.delta*ar);for(var an=0,F=Y.length;an<F;an++){var aa=Math.floor((Y[an][0]-L)*ar);var Z=Y[an][1];if(!Z){continue}R=Math.floor(aj-(Z/J)*aj);H.fillStyle="rgb("+R+","+R+","+R+")";H.fillRect(aa+W,0,b,this.summary_draw_height);if
(this.prefs.show_counts&&H.measureText(Z).width<b){if(R>n){H.fillStyle="black"}else{H.fillStyle="#ddd"}H.textAlign="center";H.fillText(Z,aa+W+(b/2),12)}}e="Summary";r.append(S);return S}if(G.message){S.css({border:"solid red","border-width":"2px 2px 2px 0px"});H.fillStyle="red";H.textAlign="left";H.fillText(G.message,100+W,at)}var ap=G.data;var am=0;for(var an=0,F=ap.length;an<F;an++){var T=ap[an],Q=T[0],ao=T[1],ab=T[2],M=T[3];if(ao<=ak&&ab>=L){var ad=Math.floor(Math.max(0,(ao-L)*ar)),I=Math.ceil(Math.min(a,Math.max(0,(ab-L)*ar))),X=(q==="Dense"?1:(1+aq[Q]))*at;if(G.dataset_type==="bai"){H.fillStyle=h;if(T[4] instanceof Array){var C=Math.floor(Math.max(0,(T[4][0]-L)*ar)),P=Math.ceil(Math.min(a,Math.max(0,(T[4][1]-L)*ar))),A=Math.floor(Math.max(0,(T[5][0]-L)*ar)),u=Math.ceil(Math.min(a,Math.max(0,(T[5][1]-L)*ar)));if(T[4][1]>=L&&T[4][0]<=ak){this.rect_or_text(H,ar,L,ak,T[4][0],T[4][2],C+W,P-C,X)}if(T[5][1]>=L&&T[5][0]<=ak){this.rect_or_text(H,ar,L,ak,T[5][0],T[5][2],A+W,u-A,X
)}if(A>P){H.fillStyle="#999";H.fillRect(P+W,X+5,A-P,1)}}else{H.fillStyle=h;this.rect_or_text(H,ar,L,ak,ao,M,ad+W,I-ad,X)}if(q!=="Dense"&&!ac&&ao>L){H.fillStyle=this.prefs.label_color;if(o===0&&ad-H.measureText(M).width<0){H.textAlign="left";H.fillText(Q,I+2+W,X+8)}else{H.textAlign="right";H.fillText(Q,ad-2+W,X+8)}H.fillStyle=h}}else{if(G.dataset_type==="interval_index"){if(ac){H.fillStyle=h;H.fillRect(ad+W,X+5,I-ad,1)}else{var E=T[4],V=T[5],af=T[6],g=T[7];var D,ah,N=null,au=null;if(V&&af){N=Math.floor(Math.max(0,(V-L)*ar));au=Math.ceil(Math.min(a,Math.max(0,(af-L)*ar)))}if(q!=="Dense"&&M!==undefined&&ao>L){H.fillStyle=ag;if(o===0&&ad-H.measureText(M).width<0){H.textAlign="left";H.fillText(M,I+2+W,X+8)}else{H.textAlign="right";H.fillText(M,ad-2+W,X+8)}H.fillStyle=h}if(g){if(E){if(E=="+"){H.fillStyle=RIGHT_STRAND}else{if(E=="-"){H.fillStyle=LEFT_STRAND}}H.fillRect(ad+W,X,I-ad,10);H.fillStyle=h}for(var al=0,f=g.length;al<f;al++){var t=g[al],d=Math.floor(Math.max(0,(t[0]-L)*ar))
,U=Math.ceil(Math.min(a,Math.max((t[1]-L)*ar)));if(d>U){continue}D=5;ah=3;H.fillRect(d+W,X+ah,U-d,D);if(N!==undefined&&!(d>au||U<N)){D=9;ah=1;var ai=Math.max(d,N),z=Math.min(U,au);H.fillRect(ai+W,X+ah,z-ai,D)}}}else{D=9;ah=1;H.fillRect(ad+W,X+ah,I-ad,D);if(T.strand){if(T.strand=="+"){H.fillStyle=RIGHT_STRAND_INV}else{if(T.strand=="-"){H.fillStyle=LEFT_STRAND_INV}}H.fillRect(ad+W,X,I-ad,10);H.fillStyle=h}}}}else{if(G.dataset_type==="vcf"){if(ac){H.fillStyle=h;H.fillRect(ad+W,X+5,I-ad,1)}else{var s=T[4],m=T[5],c=T[6];D=9;ah=1;H.fillRect(ad+W,X,I-ad,D);if(q!=="Dense"&&M!==undefined&&ao>L){H.fillStyle=ag;if(o===0&&ad-H.measureText(M).width<0){H.textAlign="left";H.fillText(M,I+2+W,X+8)}else{H.textAlign="right";H.fillText(M,ad-2+W,X+8)}H.fillStyle=h}var l=s+" / "+m;if(ao>L&&H.measureText(l).width<(I-ad)){H.fillStyle="white";H.textAlign="center";H.fillText(l,W+ad+(I-ad)/2,X+8);H.fillStyle=h}}}}}am++}}r.append(S);return S},gen_options:function(j){var a=$("<div />").addClass("form-ro
w");var e="track_"+j+"_block_color",l=$("<label />").attr("for",e).text("Block color:"),m=$("<input />").attr("id",e).attr("name",e).val(this.prefs.block_color),k="track_"+j+"_label_color",g=$("<label />").attr("for",k).text("Text color:"),h=$("<input />").attr("id",k).attr("name",k).val(this.prefs.label_color),f="track_"+j+"_show_count",c=$("<label />").attr("for",f).text("Show summary counts"),b=$('<input type="checkbox" style="float:left;"></input>').attr("id",f).attr("name",f).attr("checked",this.prefs.show_counts),d=$("<div />").append(b).append(c);return a.append(l).append(m).append(g).append(h).append(d)},update_options:function(e){var b=$("#track_"+e+"_block_color").val(),d=$("#track_"+e+"_label_color").val(),c=$("#track_"+e+"_mode option:selected").val(),a=$("#track_"+e+"_show_count").attr("checked");if(b!==this.prefs.block_color||d!==this.prefs.label_color||a!==this.prefs.show_counts){this.prefs.block_color=b;this.prefs.label_color=d;this.prefs.show_counts=a;this.t
ile_cache.clear();this.draw()}}});var ReadTrack=function(d,b,a,c){FeatureTrack.call(this,d,b,a,c);this.track_type="ReadTrack";this.vertical_detail_px=10;this.vertical_nodetail_px=5};$.extend(ReadTrack.prototype,TiledTrack.prototype,FeatureTrack.prototype,{});
--- a/static/scripts/trackster.js
+++ b/static/scripts/trackster.js
@@ -98,15 +98,17 @@ var View = function( container, chrom, t
var parent_element = this.container,
view = this;
this.top_labeltrack = $("<div/>").addClass("top-labeltrack").appendTo(parent_element);
- this.content_div = $("<div/>").addClass("content").css("position", "relative").hide().appendTo(parent_element);
- this.intro_div = $("<div/>").addClass("intro").text("Select a chrom from the dropdown below").hide().appendTo(parent_element);
+ this.content_div = $("<div/>").addClass("content").css("position", "relative").appendTo(parent_element);
this.viewport_container = $("<div/>").addClass("viewport-container").addClass("viewport-container").appendTo(this.content_div);
+ this.intro_div = $("<div/>").addClass("intro").text("Select a chrom from the dropdown below").hide(); // Future overlay
this.nav_container = $("<div/>").addClass("nav-container").appendTo(parent_element);
this.nav_labeltrack = $("<div/>").addClass("nav-labeltrack").appendTo(this.nav_container);
this.nav = $("<div/>").addClass("nav").appendTo(this.nav_container);
this.overview = $("<div/>").addClass("overview").appendTo(this.nav);
this.overview_viewport = $("<div/>").addClass("overview-viewport").appendTo(this.overview);
+ this.overview_close = $("<a href='javascript:void(0);'>Close Overview</a>").addClass("overview-close").hide().appendTo(this.overview_viewport);
+ this.overview_highlight = $("<div />").addClass("overview-highlight").hide().appendTo(this.overview_viewport);
this.overview_box_background = $("<div/>").addClass("overview-boxback").appendTo(this.overview_viewport);
this.overview_box = $("<div/>").addClass("overview-box").appendTo(this.overview_viewport);
this.default_overview_height = this.overview_box.height();
@@ -156,7 +158,6 @@ var View = function( container, chrom, t
}
view.chrom_select.html(chrom_options);
view.intro_div.show();
- view.content_div.hide();
view.chrom_select.bind("change", function() {
view.change_chrom(view.chrom_select.val());
});
@@ -195,6 +196,16 @@ var View = function( container, chrom, t
view.move_delta(-delta_chrom);
});
+ this.overview_close.bind("click", function() {
+ for (var track_id in view.tracks) {
+ view.tracks[track_id].is_overview = false;
+ }
+ $(this).siblings().filter("canvas").remove();
+ $(this).parent().css("height", view.overview_box.height());
+ view.overview_highlight.hide();
+ $(this).hide();
+ });
+
this.viewport_container.bind( "dragstart", function( e ) {
this.original_low = view.low;
this.current_height = e.clientY;
@@ -262,10 +273,8 @@ var View = function( container, chrom, t
if (view.chrom === "") {
// No chrom selected
view.intro_div.show();
- view.content_div.hide();
} else {
view.intro_div.hide();
- view.content_div.show();
}
view.chrom_select.val(view.chrom);
view.max_high = found.len;
@@ -381,10 +390,14 @@ var View = function( container, chrom, t
this.zoom_res = Math.pow( FEATURE_LEVELS, Math.max(0,Math.ceil( Math.log( this.resolution, FEATURE_LEVELS ) / Math.log(FEATURE_LEVELS) )));
// Overview
- var left_px = ( this.low / (this.max_high - this.max_low) ) * this.overview_viewport.width();
+ var left_px = this.low / (this.max_high - this.max_low) * this.overview_viewport.width();
var width_px = (this.high - this.low)/(this.max_high - this.max_low) * this.overview_viewport.width();
+ var min_width_px = 13;
- this.overview_box.css({ left: left_px, width: Math.max(12, width_px) }).show();
+ this.overview_box.css({ left: left_px, width: Math.max(min_width_px, width_px) }).show();
+ if (width_px < min_width_px) {
+ this.overview_box.css("left", left_px - (min_width_px - width_px)/2);
+ }
if (this.overview_highlight) {
this.overview_highlight.css({ left: left_px, width: width_px });
}
@@ -530,7 +543,7 @@ var TiledTrack = function() {
}
}
var track_dropdown = {};
- track_dropdown["Set track as overview"] = function() {
+ track_dropdown["Set as overview"] = function() {
view.overview_viewport.find("canvas").remove();
track.is_overview = true;
track.set_overview();
@@ -639,11 +652,9 @@ var TiledTrack = function() {
view.overview_box.height(view.default_overview_height);
if (this.initial_canvas && this.is_overview) {
- if (!view.overview_highlight) {
- view.overview_highlight = $("<div />").addClass("overview-highlight").appendTo(view.overview_viewport);
- }
+ view.overview_close.show();
view.overview_viewport.append(this.initial_canvas);
- view.overview_highlight.height(this.initial_canvas.height());
+ view.overview_highlight.show().height(this.initial_canvas.height());
view.overview_viewport.height(this.initial_canvas.height() + view.overview_box.height());
}
$(window).trigger("resize");
@@ -791,13 +802,15 @@ var LineTrack = function ( name, view, d
$('#linetrack_' + track_id + '_minval').remove();
$('#linetrack_' + track_id + '_maxval').remove();
+ track.container_div.css("position", "relative");
+
var min_label = $("<div />").addClass('yaxislabel').attr("id", 'linetrack_' + track_id + '_minval').text(round_1000(track.prefs.min_value));
var max_label = $("<div />").addClass('yaxislabel').attr("id", 'linetrack_' + track_id + '_maxval').text(round_1000(track.prefs.max_value));
- max_label.css({ position: "relative", top: "32px", left: "10px" });
+ max_label.css({ position: "absolute", top: "22px", left: "10px" });
max_label.prependTo(track.container_div);
- min_label.css({ position: "relative", top: track.height_px + 32 + "px", left: "10px" });
+ min_label.css({ position: "absolute", top: track.height_px + 11 + "px", left: "10px" });
min_label.prependTo(track.container_div);
});
},
Binary file static/images/visualization/draggable_horizontal.png has changed
--- a/lib/galaxy/web/controllers/tracks.py
+++ b/lib/galaxy/web/controllers/tracks.py
@@ -318,11 +318,11 @@ class TracksController( BaseController,
message = None
if isinstance(data, dict) and 'message' in data:
message = data['message']
- dataset_type = data.get( 'data_type', tracks_dataset_type )
+ tracks_dataset_type = data.get( 'data_type', tracks_dataset_type )
track_data = data['data']
else:
track_data = data
- return { 'dataset_type': dataset_type, 'extra_info': extra_info, 'data': track_data, 'message': message }
+ return { 'dataset_type': tracks_dataset_type, 'extra_info': extra_info, 'data': track_data, 'message': message }
@web.json
--- a/lib/galaxy/visualization/tracks/data/array_tree.py
+++ b/lib/galaxy/visualization/tracks/data/array_tree.py
@@ -12,7 +12,7 @@ from base import TracksDataProvider
class ArrayTreeDataProvider( TracksDataProvider ):
def get_stats( self, chrom ):
- f = open( self.dataset.file_name )
+ f = open( self.converted_dataset.file_name )
d = FileArrayTreeDict( f )
try:
chrom_array_tree = d[chrom]
--- a/static/june_2007_style/blue/trackster.css
+++ b/static/june_2007_style/blue/trackster.css
@@ -7,12 +7,14 @@
.nav-input{font-size:12px;width:30em;z-index:1000;}
.location{display:inline-block;width:15em;margin:0px 10px;}
.draghandle{float:left;background:transparent url(../images/visualization/draggable_horizontal.png) center center no-repeat;width:10px;height:12px;margin-right:5px;}
-.intro{margin-top:200px;margin-left:auto;margin-right:auto;color:#555;text-align:center;font-size:16px;}
+.intro{z-index:1000;margin-left:auto;margin-right:auto;color:#555;text-align:center;font-size:16px;}
.overview{width:100%;margin:0px;color:white;}
.overview-viewport{position:relative;height:14px;background:white;border-bottom:solid gray 1px;margin:0;}
-.overview-highlight{opacity:0.5;top:0px;position:absolute;z-index:100;border-style:solid;border-color:#6a6;border-width:0px 1px;}
+.overview-close{font:9px verdana;position:absolute;top:0px;right:0px;padding:5px;z-index:500;background-color:white;}
+.overview-highlight{opacity:0.5;top:0px;position:absolute;z-index:100;border-style:solid;border-color:#484848;border-width:0px 1px;}
.overview-boxback{width:100%;bottom:0px;z-index:50;position:absolute;height:14px;background:#eee;}
-.overview-box{opacity:0.5;bottom:0px;z-index:100;position:absolute;margin-top:0px;height:14px;background:#cfc url(../images/visualization/draggable_horizontal.png) center center no-repeat;border-style:solid;border-color:#6a6;border-width:0px 1px;}
+.overview-box{cursor:pointer;opacity:0.5;bottom:0px;z-index:100;position:absolute;margin-top:0px;height:14px;background:#484848 url(../images/visualization/draggable_horizontal.png) center center no-repeat;border-style:solid;border-color:#484848;border-width:0px 1px;-moz-border-radius:3px;border-radius:3px;}
+.overview-box:hover{background-color:#838383;border-color:#838383;}
.viewport-canvas{width:100%;height:100px;}
.yaxislabel{color:#777;}
.line-track .track-content{border-top:1px solid #ddd;border-bottom:1px solid #ddd;}
--- a/static/june_2007_style/trackster.css.tmpl
+++ b/static/june_2007_style/trackster.css.tmpl
@@ -42,7 +42,8 @@
margin-right: 5px;
}
.intro {
- margin-top: 200px;
+ z-index: 1000;
+/* margin-top: 200px;*/
margin-left: auto;
margin-right: auto;
color: #555;
@@ -63,13 +64,22 @@
border-bottom: solid gray 1px;
margin: 0;
}
+.overview-close {
+ font: 9px verdana;
+ position: absolute;
+ top: 0px;
+ right: 0px;
+ padding: 5px;
+ z-index: 500;
+ background-color: white;
+}
.overview-highlight {
opacity: 0.5;
top: 0px;
position: absolute;
z-index: 100;
border-style: solid;
- border-color: #6a6;
+ border-color: #484848;
border-width: 0px 1px;
}
.overview-boxback {
@@ -81,16 +91,23 @@
background: #eee;
}
.overview-box {
+ cursor: pointer;
opacity: 0.5;
bottom: 0px;
z-index: 100;
position: absolute;
margin-top: 0px;
height: 14px;
- background: #cfc url(../images/visualization/draggable_horizontal.png) center center no-repeat;
+ background: #484848 url(../images/visualization/draggable_horizontal.png) center center no-repeat;
border-style: solid;
- border-color: #6a6;
+ border-color: #484848;
border-width: 0px 1px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+}
+.overview-box:hover {
+ background-color: #838383;
+ border-color: #838383;
}
.viewport-canvas {
width: 100%;
1
0
galaxy-dist commit 83227c6bd65c: Data libraries: Use jStore to save folder expansion state
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Kanwei Li <kanwei(a)gmail.com>
# Date 1286474538 14400
# Node ID 83227c6bd65cdc2832e04b7823d4ee4f11d20ba7
# Parent 3316517f0980642b7706f26ab3a5b4ec461acfde
Data libraries: Use jStore to save folder expansion state
--- a/templates/library/common/browse_library.mako
+++ b/templates/library/common/browse_library.mako
@@ -45,65 +45,90 @@
<%def name="javascripts()">
${parent.javascripts()}
+ ${h.js("class", "jquery.jstore")}
${self.grid_javascripts()}
</%def><%def name="grid_javascripts()"><script type="text/javascript">
- $(function () {
- $("#library-grid").each( function() {
+ $(function() {
+ $.jStore.init("galaxy"); // Auto-select best storage
+ var storage_id = "library-expand-state-${trans.security.encode_id(library.id)}";
+
+ var restore_folder_state = function() {
+ var state = $.jStore.store(storage_id);
+ if (state) {
+ for (var id in state) {
+ if (state[id] === true) {
+ var row = $("#" + id),
+ index = row.parent().children().index(row);
+ row.addClass("expanded").show();
+ row.siblings().filter("tr[parent='" + index + "']").show();
+ }
+ }
+ }
+ };
+
+ var save_folder_state = function() {
+ var state = {};
+ $("tr.folderRow").each( function() {
+ var folder = $(this);
+ state[folder.attr("id")] = folder.hasClass("expanded");
+ });
+ $.jStore.store(storage_id, state);
+ };
+
+ $("#library-grid").each(function() {
// Recursively fill in children and descendents of each row
- var process_row = function( q, parents ) {
+ var process_row = function(q, parents) {
// Find my index
- var index = $(q).parent().children().index( $(q) );
+ var index = q.parent().children().index(q);
// Find my immediate children
- var children = $(q).siblings().filter( "[parent='" + index + "']" );
+ var children = q.siblings().filter("[parent='" + index + "']");
// Recursively handle them
var descendents = children;
children.each( function() {
- child_descendents = process_row( $(this), parents.add( q ) );
- descendents = descendents.add( child_descendents );
+ child_descendents = process_row( $(this), parents.add(q) );
+ descendents = descendents.add(child_descendents);
});
// Set up expand / hide link
- // HACK: assume descendents are invisible. The caller actually
- // ensures this for the root node. However, if we start
- // remembering folder states, we'll need something
- // more sophisticated here.
- var visible = false;
var expand_fn = function() {
- if ( visible ) {
+ if ( q.hasClass("expanded") ) {
descendents.hide();
- descendents.removeClass( "expanded" );
- q.removeClass( "expanded" );
- visible = false;
+ descendents.removeClass("expanded");
+ q.removeClass("expanded");
} else {
children.show();
- q.addClass( "expanded" );
- visible = true;
+ q.addClass("expanded");
}
+ save_folder_state();
};
$(q).find("span.expandLink").click(expand_fn);
$(q).find("span.expandLink a").click(expand_fn);
// Check/uncheck boxes in subfolders.
- q.children( "td" ).children( "input[type=checkbox]" ).click( function() {
+ q.children("td").children("input[type=checkbox]").click( function() {
if ( $(this).is(":checked") ) {
- descendents.find( "input[type=checkbox]").attr( 'checked', true );
+ descendents.find("input[type=checkbox]").attr("checked", true);
} else {
- descendents.find( "input[type=checkbox]").attr( 'checked', false );
+ descendents.find("input[type=checkbox]").attr("checked", false);
// If you uncheck a lower level checkbox, uncheck the boxes above it
// (since deselecting a child means the parent is not fully selected any
// more).
- parents.children( "td" ).children( "input[type=checkbox]" ).attr( "checked", false );
+ parents.children("td").children("input[type=checkbox]").attr("checked", false);
}
});
// return descendents for use by parent
return descendents;
}
- $(this).find( "tbody tr" ).not( "[parent]").each( function() {
+ $(this).find("tbody tr").not("[parent]").each( function() {
descendents = process_row( $(this), $([]) );
descendents.hide();
});
});
+
+ $.jStore.engineReady(function() {
+ restore_folder_state();
+ });
});
// For view info links, use a modal popup
@@ -313,7 +338,7 @@
info_association, inherited = folder.get_info_association( restrict=True )
%>
%if not root_folder and ( not folder.deleted or show_deleted ):
- <tr class="folderRow libraryOrFolderRow"
+ <tr id="folder-${trans.security.encode_id(folder.id)}" class="folderRow libraryOrFolderRow"
%if parent is not None:
parent="${parent}"
style="display: none;"
@@ -372,7 +397,7 @@
%endif
<td>
%if folder.description:
- ${folder.description}</i>
+ ${folder.description}
%endif
<td colspan="3"></td></tr>
1
0
galaxy-dist commit b9f3c613c026: Convert a bunch of binary requirement tags to package requirements, and change the sputnik tool to call 'sputnik' instead of 'bx-sputnik'.
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Nate Coraor <nate(a)bx.psu.edu>
# Date 1286483037 14400
# Node ID b9f3c613c0266e9285679b06e39802a452f4b151
# Parent 4ecbb9b5a360c1d1997890917799f31f5896a01e
Convert a bunch of binary requirement tags to package requirements, and change the sputnik tool to call 'sputnik' instead of 'bx-sputnik'.
--- a/tools/emboss_5/emboss_lindna.xml
+++ b/tools/emboss_5/emboss_lindna.xml
@@ -1,6 +1,7 @@
<tool id="EMBOSS: lindna48" name="lindna" version="5.0.0"><!-- tool produces memory error in ajmem.c --><description>Draws linear maps of DNA constructs</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>lindna -infile $input1 -graphout png -goutfile $out_file1 -ruler $ruler -blocktype $blocktype -maxgroups $maxgroups -maxlabels $maxlabels -intersymbol $intersymbol -intercolour $intercolour
-interticks $interticks -gapsize $gapsize -ticklines $ticklines -textheight $textheight -textlength $textlength -margin $margin -tickheight $tickheight -blockheight $blockheight -rangeheight
$rangeheight -gapgroup $gapgroup -postext $postext -auto</command>
--- a/tools/emboss_5/emboss_getorf.xml
+++ b/tools/emboss_5/emboss_getorf.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: getorf42" name="getorf" version="5.0.0"><description>Finds and extracts open reading frames (ORFs)</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>getorf -sequence $input1 -outseq $out_file1 -table $table -minsize $minsize -maxsize $maxsize -find $find -methionine $methionine -circular $circular -reverse $reverse -flanking $flanking
-osformat2 $out_format1 -auto</command><inputs>
--- a/tools/emboss_5/emboss_dan.xml
+++ b/tools/emboss_5/emboss_dan.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: dan19" name="dan" version="5.0.0"><description>Calculates DNA RNA/DNA melting temperature</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command interpreter="perl">emboss_single_outputfile_wrapper.pl dan -sequence $input1 -windowsize $window -goutfile $out_file1 -graph png -plot $plot1 -shiftincrement $shift -dnaconc $dnaconc
-saltconc $saltconc -product $product -formamide $formamide -mismatch $mismatch -prodlen $prodlen -thermo $thermo -temperature $temperature -rna $rna -outfile $out_file1 -auto</command><inputs>
--- a/tools/emboss_5/emboss_banana.xml
+++ b/tools/emboss_5/emboss_banana.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: banana3" name="banana" version="5.0.0"><description>Bending and curvature plot in B-DNA</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>banana -sequence $input1 -outfile $out_file1 -graph none -auto</command><inputs><param format="data" name="input1" type="data">
--- a/tools/emboss_5/emboss_biosed.xml
+++ b/tools/emboss_5/emboss_biosed.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: biosed4" name="biosed" version="5.0.0"><description>Replace or delete sequence sections</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>biosed -sequence $input1 -outseq $out_file1 -target $target -replace $replace -osformat2 $out_format1 -auto</command><inputs><param format="fasta" name="input1" type="data">
--- a/tools/emboss_5/emboss_isochore.xml
+++ b/tools/emboss_5/emboss_isochore.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: isochore47" name="isochore" version="5.0.0"><description>Plots isochores in large DNA sequences</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command interpreter="perl">emboss_single_outputfile_wrapper.pl isochore -sequence $input1 -outfile $ofile2 -goutfile $ofile1 -graph png -window $window -shift $shift -auto</command><!-- <command interpreter="perl">emboss_single_outputfile_wrapper.pl isochore -sequence $input1 -goutfile $ofile1 -graph png -window $window -shift $shift -auto</command>--><inputs>
--- a/tools/emboss_5/emboss_helixturnhelix.xml
+++ b/tools/emboss_5/emboss_helixturnhelix.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: helixturnhelix43" name="helixturnhelix" version="5.0.0"><description>Report nucleic acid binding motifs</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>helixturnhelix -sequence $input1 -outfile $out_file1 -mean $mean -sd $sd -minsd $minsd -eightyseven $eightyseven -rformat2 $out_format1 -auto</command><inputs><param format="data" name="input1" type="data">
--- a/tools/emboss_5/emboss_backtranseq.xml
+++ b/tools/emboss_5/emboss_backtranseq.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: backtranseq2" name="backtranseq" version="5.0.0"><description>Back translate a protein sequence</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>backtranseq -sequence $input1 -outfile $out_file1 -cfile $cfile -osformat2 $out_format1 -auto</command><inputs><param format="fasta" name="input1" type="data">
--- a/tools/emboss_5/emboss_epestfind.xml
+++ b/tools/emboss_5/emboss_epestfind.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: epestfind29" name="epestfind" version="5.0.0"><description>Finds PEST motifs as potential proteolytic cleavage sites</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command interpreter="perl">emboss_single_outputfile_wrapper.pl epestfind -sequence $input1 -goutfile $ofile2 -outfile $ofile1 -window $window -order $order -potential $potential -poor $poor
-invalid $invalid -map $map -graph png -auto</command><inputs>
--- a/tools/emboss_5/emboss_infoseq.xml
+++ b/tools/emboss_5/emboss_infoseq.xml
@@ -1,6 +1,7 @@
<tool id="EMBOSS: infoseq46" name="infoseq" version="5.0.0"><!-- info contains file information always --><description>Displays some simple information about sequences</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>infoseq -sequence $input1 -outfile $out_file1 -html $html_out1 -heading $heading -usa $usa -name $disname -accession $accession -gi $gi -version $version -type $type -length $length -pgc
$pgc -description $description -auto</command><inputs>
--- a/tools/emboss_5/emboss_dreg.xml
+++ b/tools/emboss_5/emboss_dreg.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: dreg27" name="dreg" version="5.0.0"><description>Regular expression search of a nucleotide sequence</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>dreg -sequence $input1 -outfile $out_file1 -pattern "$pattern" -raccshow3 "no" -rusashow3 "no" -rdesshow3 "no" -auto</command><inputs><param format="data" name="input1" type="data">
--- a/tools/emboss_5/emboss_fuzznuc.xml
+++ b/tools/emboss_5/emboss_fuzznuc.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: fuzznuc37" name="fuzznuc" version="5.0.1"><description>Nucleic acid pattern search</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>fuzznuc -sequence $input1 -outfile $out_file1 -pattern '$pattern' -pmismatch $mismatch -complement $complement -rformat2 $out_format1 -auto</command><inputs><param format="fasta" name="input1" type="data">
--- a/tools/emboss_5/emboss_cutseq.xml
+++ b/tools/emboss_5/emboss_cutseq.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: cutseq18" name="cutseq" version="5.0.0"><description>Removes a specified section from a sequence</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>cutseq -sequence $input1 -outseq $out_file1 -from $from -to $to -osformat2 $out_format1 -auto</command><inputs><param format="fasta" name="input1" type="data">
--- a/tools/emboss_5/emboss_digest.xml
+++ b/tools/emboss_5/emboss_digest.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: digest23" name="digest" version="5.0.0"><description>Protein proteolytic enzyme or reagent cleavage digest</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>digest -seqall $input1 -outfile $out_file1 -menu $menu -unfavoured $unfavoured -overlap $overlap -allpartials $allpartials -rformat2 $out_format1 -auto</command><inputs><param format="data" name="input1" type="data">
--- a/tools/emboss_5/emboss_fuzztran.xml
+++ b/tools/emboss_5/emboss_fuzztran.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: fuzztran39" name="fuzztran" version="5.0.0"><description>Protein pattern search after translation</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>fuzztran -sequence $input1 -outfile $out_file1 -pattern "$pattern" -pmismatch $mismatch -frame $frame -table $table -rformat2 $out_format1 -auto</command><inputs><param format="fasta" name="input1" type="data">
--- a/tools/emboss_5/emboss_hmoment.xml
+++ b/tools/emboss_5/emboss_hmoment.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: hmoment44" name="hmoment" version="5.0.0"><description>Hydrophobic moment calculation</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>hmoment -seqall $input1 -outfile $out_file1 -window $window -aangle $aangle -graph png -auto</command><inputs><param format="data" name="input1" type="data">
--- a/tools/emboss_5/emboss_antigenic.xml
+++ b/tools/emboss_5/emboss_antigenic.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: antigenic1" name="antigenic" version="5.0.0"><description>Predicts potentially antigenic regions of a protein sequence, using the method of Kolaskar and Tongaonkar.</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>antigenic -sequence $input1 -outfile $out_file1 -minlen $minlen -rformat2 $out_format1 -auto</command><inputs><param format="data" name="input1" type="data">
--- a/tools/emboss_5/emboss_cpgplot.xml
+++ b/tools/emboss_5/emboss_cpgplot.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: cpgplot15" name="cpgplot" version="5.0.0"><description>Plot CpG rich areas</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command interpreter="perl">emboss_cpgplot_wrapper.pl cpgplot -sequence $input1 -window $window -minlen $minlen -minpc $minpc -outfile $outfile -graph png -goutfile $goutfile -outfeat $outfeat -minoe $minoe -auto</command><inputs><param format="data" name="input1" type="data">
--- a/tools/emboss_5/emboss_codcmp.xml
+++ b/tools/emboss_5/emboss_codcmp.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: codcmp12" name="codcmp" version="5.0.0"><description>Codon usage table comparison</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>codcmp -first $cfile1 -second $cfile2 -outfile $out_file1 -auto</command><inputs><param name="cfile1" type="select">
--- a/tools/emboss_5/emboss_dottup.xml
+++ b/tools/emboss_5/emboss_dottup.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: dottup26" name="dottup" version="5.0.0"><description>Displays a wordmatch dotplot of two sequences</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command interpreter="perl">emboss_single_outputfile_wrapper.pl dottup -asequence $input1 -bsequence $input2 -goutfile $out_file1 -wordsize $wordsize -boxit $boxit -graph png -xygraph png -auto</command><inputs><param format="data" name="input1" type="data">
--- a/tools/emboss_5/emboss_degapseq.xml
+++ b/tools/emboss_5/emboss_degapseq.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: degapseq20" name="degapseq" version="5.0.0"><description>Removes gap characters from sequences</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>degapseq -sequence $input1 -outseq $out_file1 -osformat2 $out_format1 -auto</command><inputs><param format="data" name="input1" type="data">
--- a/tools/emboss_5/emboss_descseq.xml
+++ b/tools/emboss_5/emboss_descseq.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: descseq21" name="descseq" version="5.0.0"><description>Alter the name or description of a sequence</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>descseq -sequence $input1 -outseq $out_file1 -name "$seqname" -description "$desc" -append $append -osformat2 $out_format1 -auto</command><inputs><param format="data" name="input1" type="data">
--- a/tools/emboss_5/emboss_extractseq.xml
+++ b/tools/emboss_5/emboss_extractseq.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: extractseq35" name="extractseq" version="5.0.0"><description>Extract regions from a sequence</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>extractseq -sequence $input1 -outseq $out_file1 -regions $regions -separate $separate -osformat2 $out_format1 -auto</command><inputs><param format="data" name="input1" type="data">
--- a/tools/emboss_5/emboss_chips.xml
+++ b/tools/emboss_5/emboss_chips.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: chips10" name="chips" version="5.0.0"><description>Codon usage statistics</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>chips -seqall $input1 -outfile $out_file1 -sum $sum -auto</command><inputs><param format="data" name="input1" type="data">
--- a/tools/emboss_5/emboss_einverted.xml
+++ b/tools/emboss_5/emboss_einverted.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: einverted28" name="einverted" version="5.0.0"><description>Finds DNA inverted repeats</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>einverted -sequence $input1 -outfile $out_file1 -gap $gap -threshold $threshold -match $match -mismatch $mismatch -maxrepeat $maxrepeat -auto</command><inputs><param format="fasta" name="input1" type="data">
--- a/tools/emboss_5/emboss_fuzzpro.xml
+++ b/tools/emboss_5/emboss_fuzzpro.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: fuzzpro38" name="fuzzpro" version="5.0.0"><description>Protein pattern search</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>fuzzpro -sequence $input1 -outfile $out_file1 -pattern "$pattern" -pmismatch $mismatch -rformat2 $out_format1 -auto</command><inputs><param format="data" name="input1" type="data">
--- a/tools/emboss_5/emboss_checktrans.xml
+++ b/tools/emboss_5/emboss_checktrans.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: checktrans9" name="checktrans" version="5.0.0"><description>Reports STOP codons and ORF statistics of a protein</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>checktrans -sequence $input1 -outfile $out_file1 -outseq $out_file2 -osformat3 $out_format2 -outfeat $out_file3 -offormat4 $out_format3 -orfml $orfml -addlast $addlast -auto</command><inputs><param format="fasta" name="input1" type="data">
--- a/tools/emboss_5/emboss_cusp.xml
+++ b/tools/emboss_5/emboss_cusp.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: cusp17" name="cusp" version="5.0.0"><description>Create a codon usage table</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>cusp -sequence $input1 -outfile $out_file1 -auto</command><inputs><param format="fasta" name="input1" type="data">
--- a/tools/emboss_5/emboss_extractfeat.xml
+++ b/tools/emboss_5/emboss_extractfeat.xml
@@ -1,6 +1,7 @@
<tool id="EMBOSS: extractfeat34" name="extractfeat" version="5.0.0"><!-- tool tested with documentation, functional test not designed due to empty files resulting from test input sequences --><description>Extract features from a sequence</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>extractfeat -sequence $input1 -outseq $out_file1 -before $before -after $after -source "$source" -type "$type" -sense $sense -minscore $minscore -maxscore $maxscore -tag "$tag" -value
"$value" -join $join -featinname $featinname -describe "$describe" -osformat2 $out_format1 -auto</command><inputs>
--- a/tools/emboss_5/emboss_cirdna.xml
+++ b/tools/emboss_5/emboss_cirdna.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: cirdna11" name="cirdna" version="5.0.0"><description>Draws circular maps of DNA constructs</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command interpreter="perl">emboss_single_outputfile_wrapper.pl cirdna -infile $input1 -graphout png -goutfile $out_file1 -auto</command><inputs><param format="data" name="input1" type="data">
--- a/tools/emboss_5/emboss_btwisted.xml
+++ b/tools/emboss_5/emboss_btwisted.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: btwisted5" name="btwisted" version="5.0.0"><description>Calculates the twisting in a B-DNA sequence</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>btwisted -sequence $input1 -outfile $out_file1 -auto</command><inputs><param format="data" name="input1" type="data">
--- a/tools/emboss_5/emboss_maskfeat.xml
+++ b/tools/emboss_5/emboss_maskfeat.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: maskfeat50" name="maskfeat" version="5.0.0"><description>Mask off features of a sequence</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>maskfeat -sequence $input1 -outseq $out_file1 -type "$type" -tolower $tolower -maskchar "$maskchar" -osformat2 $out_format1 -auto</command><inputs><param format="data" name="input1" type="data">
--- a/tools/emboss_5/emboss_cpgreport.xml
+++ b/tools/emboss_5/emboss_cpgreport.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: cpgreport16" name="cpgreport" version="5.0.0"><description>Reports all CpG rich regions</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>cpgreport -sequence $input1 -outfile $out_file1 -outfeat $out_file2 -offormat3 $out_format2 -score $score -auto</command><inputs><param format="fasta" name="input1" type="data">
--- a/tools/emboss_5/emboss_freak.xml
+++ b/tools/emboss_5/emboss_freak.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: freak36" name="freak" version="5.0.0"><description>Residue/base frequency table or plot</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>freak -seqall $input1 -outfile $out_file1 -window $window -letters $letters -graph png -step $step -auto</command><inputs><param format="data" name="input1" type="data">
--- a/tools/emboss_5/emboss_dotpath.xml
+++ b/tools/emboss_5/emboss_dotpath.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: dotpath25" name="dotpath" version="5.0.0"><description>Non-overlapping wordmatch dotplot of two sequences</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command interpreter="perl">emboss_single_outputfile_wrapper.pl dotpath -asequence $input1 -bsequence $input2 -goutfile $out_file1 -wordsize $wordsize -overlaps $overlaps -boxit $boxit -graph png
-auto</command><inputs>
--- a/tools/emboss_5/emboss_iep.xml
+++ b/tools/emboss_5/emboss_iep.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: iep45" name="iep" version="5.0.0"><description>Calculates the isoelectric point of a protein</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>iep -sequence $input1 -outfile $out_file1 -step $step -amino $amino -graph png -termini $termini -auto</command><inputs><param format="data" name="input1" type="data">
--- a/tools/emboss_5/emboss_coderet.xml
+++ b/tools/emboss_5/emboss_coderet.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: coderet13" name="coderet" version="5.0.0"><description>Extract CDS, mRNA and translations from feature tables</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><!-- <command>coderet -seqall $input1 -outfile $out_file1 -osformat2 $out_format1 -cds $cds -mrna $mrna -translation $translation -auto</command>--><command>coderet -seqall $input1 -outfile $out_file1 -auto</command><inputs>
--- a/tools/emboss_5/emboss_charge.xml
+++ b/tools/emboss_5/emboss_charge.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: charge8" name="charge" version="5.0.0"><description>Protein charge plot</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>charge -seqall $input1 -outfile $out_file1 -window $window -auto</command><inputs><param format="fasta" name="input1" type="data">
--- a/tools/emboss_5/emboss_diffseq.xml
+++ b/tools/emboss_5/emboss_diffseq.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: diffseq22" name="diffseq" version="5.0.0"><description>Find differences between nearly identical sequences</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>diffseq -asequence $input1 -bsequence $input2 -outfile $out_file1 -aoutfeat $out_file2 -boutfeat $out_file3 -wordsize $wordsize -globaldifferences $globaldifferences -rformat3
$out_format1 -offormat4 $out_format2 -offormat5 $out_format3 -auto</command><inputs>
--- a/tools/emboss_5/emboss_dotmatcher.xml
+++ b/tools/emboss_5/emboss_dotmatcher.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: dotmatcher24" name="dotmatcher" version="5.0.0"><description>Displays a thresholded dotplot of two sequences</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command interpreter="perl">emboss_single_outputfile_wrapper.pl dotmatcher -asequence $input1 -bsequence $input2 -goutfile $out_file1 -windowsize $windowsize -threshold $threshold -graph png -xygraph png
-auto</command><inputs>
--- a/tools/emboss_5/emboss_garnier.xml
+++ b/tools/emboss_5/emboss_garnier.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: garnier40" name="garnier" version="5.0.0"><description>Predicts protein secondary structure</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>garnier -sequence $input1 -outfile $out_file1 -idc $idc -rformat2 $out_format1 -auto</command><inputs><param format="data" name="input1" type="data">
--- a/tools/emboss_5/emboss_geecee.xml
+++ b/tools/emboss_5/emboss_geecee.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: geecee41" name="geecee" version="5.0.0"><description>Calculates fractional GC content of nucleic acid sequences</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>geecee -sequence $input1 -outfile $out_file1 -auto</command><inputs><param format="data" name="input1" type="data">
--- a/tools/emboss_5/emboss_est2genome.xml
+++ b/tools/emboss_5/emboss_est2genome.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: est2genome32" name="est2genome" version="5.0.0"><description>Align EST and genomic DNA sequences</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>est2genome -estsequence $input1 -genomesequence $input2 -outfile $out_file1 -match $match -mismatch $mismatch -gappenalty $gappenalty -intronpenalty $intronpenalty -splicepenalty
$splicepenalty -minscore $minscore -reverse $reverse -splice $splice -mode $mode -best $best -shuffle $shuffle -seed $seed -align $align -width $width -auto</command><inputs>
--- a/tools/emboss_5/emboss_compseq.xml
+++ b/tools/emboss_5/emboss_compseq.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: compseq14" name="compseq" version="5.0.0"><description>Count composition of dimer/trimer/etc words in a sequence</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>compseq -sequence $input1 -outfile $out_file1 -word $word -frame $frame -auto</command><inputs><param format="fasta" name="input1" type="data">
--- a/tools/emboss_5/emboss_etandem.xml
+++ b/tools/emboss_5/emboss_etandem.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: etandem33" name="etandem" version="5.0.0"><description>Looks for tandem repeats in a nucleotide sequence</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>etandem -sequence $input1 -outfile $out_file1 -origfile $ofile2 -minrepeat $minrepeat -maxrepeat $maxrepeat -threshold $threshold -mismatch $mismatch -uniform $uniform -rformat2 $out_format1 -auto</command><inputs><param format="fasta" name="input1" type="data">
--- a/tools/emboss_5/emboss_marscan.xml
+++ b/tools/emboss_5/emboss_marscan.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: marscan49" name="marscan" version="5.0.0"><description>Finds MAR/SAR sites in nucleic sequences</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>marscan -sequence $input1 -outfile $out_file1 -rformat2 $out_format1 -auto</command><inputs><param format="data" name="input1" type="data">
--- a/tools/emboss_5/emboss_cai_custom.xml
+++ b/tools/emboss_5/emboss_cai_custom.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: cai_custom6" name="cai custom" version="5.0.0"><description>CAI codon adaptation index using custom codon usage file</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>cai -seqall $input1 -outfile $out_file1 -cfile $input2 -auto</command><inputs><param format="fasta" name="input1" type="data">
--- a/tools/emboss_5/emboss_equicktandem.xml
+++ b/tools/emboss_5/emboss_equicktandem.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: equicktandem31" name="equicktandem" version="5.0.0"><description>Finds tandem repeats</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>equicktandem -sequence $input1 -outfile $out_file1 -origfile $ofile2 -maxrepeat $maxrepeat -threshold $threshold -rformat2 $out_format1 -auto</command><inputs><param format="fasta" name="input1" type="data">
--- a/tools/emboss_5/emboss_cai.xml
+++ b/tools/emboss_5/emboss_cai.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: cai6" name="cai" version="5.0.0"><description>CAI codon adaptation index</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command>cai -seqall $input1 -outfile $out_file1 -cfile $cfile -auto</command><inputs><param format="fasta" name="input1" type="data">
--- a/tools/emboss_5/emboss_chaos.xml
+++ b/tools/emboss_5/emboss_chaos.xml
@@ -1,5 +1,6 @@
<tool id="EMBOSS: chaos7" name="chaos" version="5.0.0"><description>Create a chaos game representation plot for a sequence</description>
+ <requirements><requirement type="package" version="5.0.0">emboss</requirement></requirements><command interpreter="perl">emboss_single_outputfile_wrapper.pl chaos -sequence $input1 -graph png -goutfile $out_file1 -auto</command><inputs><param format="data" name="input1" type="data">
1
0
galaxy-dist commit 3316517f0980: Enable 'FASTX-Toolkit for FASTQ data' as a subsection under 'NGS: QC and manipulation' in tool_conf.xml.sample/main.
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Dan Blankenberg <dan(a)bx.psu.edu>
# Date 1286458054 14400
# Node ID 3316517f0980642b7706f26ab3a5b4ec461acfde
# Parent 9cada14f87657b951ccc9a76af5de03263ba72d9
Enable 'FASTX-Toolkit for FASTQ data' as a subsection under 'NGS: QC and manipulation' in tool_conf.xml.sample/main.
--- a/tool_conf.xml.sample
+++ b/tool_conf.xml.sample
@@ -218,15 +218,6 @@
<tool file="fastq/fastq_paired_end_splitter.xml" /><tool file="fastq/fastq_paired_end_joiner.xml" /><tool file="fastq/fastq_stats.xml" />
- <!--<label text="Deprecated: Generic FASTQ data" id="fastq" />
- <tool file="next_gen_conversion/fastq_gen_conv.xml" />
- <tool file="fastx_toolkit/fastq_quality_converter.xml" />
- <tool file="fastx_toolkit/fastx_quality_statistics.xml" />
- <tool file="fastx_toolkit/fastq_quality_boxplot.xml" />
- <tool file="fastx_toolkit/fastx_nucleotides_distribution.xml" />
- <tool file="metag_tools/split_paired_reads.xml"
- <tool file="fastx_toolkit/fastq_to_fasta.xml" />
- --><label text="Roche-454 data" id="454" /><tool file="metag_tools/short_reads_figure_score.xml" /><tool file="metag_tools/short_reads_trim_seq.xml" />
@@ -244,6 +235,21 @@
<tool file="fastq/fastq_to_fasta.xml" /><tool file="fastq/fastq_to_tabular.xml" /><tool file="fastq/tabular_to_fastq.xml" />
+ <label text="FASTX-Toolkit for FASTQ data" id="fastx_toolkit" />
+ <tool file="fastx_toolkit/fastq_quality_converter.xml" />
+ <tool file="fastx_toolkit/fastx_quality_statistics.xml" />
+ <tool file="fastx_toolkit/fastq_quality_boxplot.xml" />
+ <tool file="fastx_toolkit/fastx_nucleotides_distribution.xml" />
+ <tool file="fastx_toolkit/fastq_to_fasta.xml" />
+ <tool file="fastx_toolkit/fastq_quality_filter.xml" />
+ <tool file="fastx_toolkit/fastq_to_fasta.xml" />
+ <tool file="fastx_toolkit/fastx_artifacts_filter.xml" />
+ <tool file="fastx_toolkit/fastx_barcode_splitter.xml" />
+ <tool file="fastx_toolkit/fastx_clipper.xml" />
+ <tool file="fastx_toolkit/fastx_collapser.xml" />
+ <tool file="fastx_toolkit/fastx_renamer.xml" />
+ <tool file="fastx_toolkit/fastx_reverse_complement.xml" />
+ <tool file="fastx_toolkit/fastx_trimmer.xml" /></section><!--
Keep this section commented until it includes tools that
--- a/tool_conf.xml.main
+++ b/tool_conf.xml.main
@@ -305,15 +305,6 @@
<tool file="fastq/fastq_paired_end_splitter.xml" /><tool file="fastq/fastq_paired_end_joiner.xml" /><tool file="fastq/fastq_stats.xml" />
- <!--<label text="Deprecated: Generic FASTQ data" id="fastq" />
- <tool file="next_gen_conversion/fastq_gen_conv.xml" />
- <tool file="fastx_toolkit/fastq_quality_converter.xml" />
- <tool file="fastx_toolkit/fastx_quality_statistics.xml" />
- <tool file="fastx_toolkit/fastq_quality_boxplot.xml" />
- <tool file="fastx_toolkit/fastx_nucleotides_distribution.xml" />
- <tool file="metag_tools/split_paired_reads.xml" />
- <tool file="fastx_toolkit/fastq_to_fasta.xml" />
- --><label text="Roche-454 data" id="454" /><tool file="metag_tools/short_reads_figure_score.xml" /><tool file="metag_tools/short_reads_trim_seq.xml" />
@@ -331,6 +322,21 @@
<tool file="fastq/fastq_to_fasta.xml" /><tool file="fastq/fastq_to_tabular.xml" /><tool file="fastq/tabular_to_fastq.xml" />
+ <label text="FASTX-Toolkit for FASTQ data" id="fastx_toolkit_fastq" />
+ <tool file="fastx_toolkit/fastq_quality_converter.xml" />
+ <tool file="fastx_toolkit/fastx_quality_statistics.xml" />
+ <tool file="fastx_toolkit/fastq_quality_boxplot.xml" />
+ <tool file="fastx_toolkit/fastx_nucleotides_distribution.xml" />
+ <tool file="fastx_toolkit/fastq_to_fasta.xml" />
+ <tool file="fastx_toolkit/fastq_quality_filter.xml" />
+ <tool file="fastx_toolkit/fastq_to_fasta.xml" />
+ <tool file="fastx_toolkit/fastx_artifacts_filter.xml" />
+ <tool file="fastx_toolkit/fastx_barcode_splitter.xml" />
+ <tool file="fastx_toolkit/fastx_clipper.xml" />
+ <tool file="fastx_toolkit/fastx_collapser.xml" />
+ <tool file="fastx_toolkit/fastx_renamer.xml" />
+ <tool file="fastx_toolkit/fastx_reverse_complement.xml" />
+ <tool file="fastx_toolkit/fastx_trimmer.xml" /></section><section name="NGS: Mapping" id="ngs_mapping"><label text="Illumina" id="illumina"/>
1
0
galaxy-dist commit 5a5e35e09eab: Add default file_path to cleanup_datasets.py script. Closes #376
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Kanwei Li <kanwei(a)gmail.com>
# Date 1286475319 14400
# Node ID 5a5e35e09eab477df04549408b56dd7d0ab024b0
# Parent 83227c6bd65cdc2832e04b7823d4ee4f11d20ba7
Add default file_path to cleanup_datasets.py script. Closes #376
--- a/scripts/cleanup_datasets/cleanup_datasets.py
+++ b/scripts/cleanup_datasets/cleanup_datasets.py
@@ -56,7 +56,7 @@ def main():
database_connection = configuration['database_connection']
else:
database_connection = "sqlite:///%s?isolation_level=IMMEDIATE" % configuration["database_file"]
- file_path = configuration['file_path']
+ file_path = configuration.get('file_path', "database/files")
app = CleanupDatasetsApplication( database_connection=database_connection, file_path=file_path )
cutoff_time = datetime.utcnow() - timedelta( days=options.days )
now = strftime( "%Y-%m-%d %H:%M:%S" )
1
0
galaxy-dist commit 4ecbb9b5a360: Make published items set the "Shared Data" tab as the active tab
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Kanwei Li <kanwei(a)gmail.com>
# Date 1286480034 14400
# Node ID 4ecbb9b5a360c1d1997890917799f31f5896a01e
# Parent 5a5e35e09eab477df04549408b56dd7d0ab024b0
Make published items set the "Shared Data" tab as the active tab
--- a/templates/sharing_base.mako
+++ b/templates/sharing_base.mako
@@ -15,7 +15,7 @@
%><%inherit file="${inherit(context)}"/>
-<%namespace file="./display_common.mako" import="*" />
+<%namespace file="/display_common.mako" import="*" /><%namespace file="/message.mako" import="render_msg" />
##
@@ -157,7 +157,7 @@
if item.published:
item_status = item_status + " and published"
%>
- This ${item_class_name_lc} <strong>${item_status}</strong>.
+ This ${item_class_name_lc} is currently <strong>${item_status}</strong>.
<div><p>Anyone can view and import this ${item_class_name_lc} by visiting the following URL:
@@ -195,10 +195,10 @@
%else: ## item.published == True
## Item is importable and published. User can unpublish or disable import and unpublish.
<input class="action-button" type="submit" name="unpublish" value="Unpublish ${item_class_name}">
- <div class="toolParamHelp">Removes ${item_class_name_lc} from Galaxy's <a href='${h.url_for( action='list_published' )}' target="_top">Published ${item_class_plural_name}</a> section so that it is not publicly listed or searchable.</div>
+ <div class="toolParamHelp">Removes this ${item_class_name_lc} from Galaxy's <a href='${h.url_for( action='list_published' )}' target="_top">Published ${item_class_plural_name}</a> section so that it is not publicly listed or searchable.</div><br><input class="action-button" type="submit" name="disable_link_access_and_unpublish" value="Disable Access to ${item_class_name} via Link and Unpublish">
- <div class="toolParamHelp">Disables ${item_class_name_lc}'s link so that it is not accessible and removes ${item_class_name_lc} from Galaxy's <a href='${h.url_for( action='list_published' )}' target='_top'>Published ${item_class_plural_name}</a> section so that it is not publicly listed or searchable.</div>
+ <div class="toolParamHelp">Disables this ${item_class_name_lc}'s link so that it is not accessible and removes ${item_class_name_lc} from Galaxy's <a href='${h.url_for( action='list_published' )}' target='_top'>Published ${item_class_plural_name}</a> section so that it is not publicly listed or searchable.</div>
%endif
</form>
--- a/templates/history/list_published.mako
+++ b/templates/history/list_published.mako
@@ -4,7 +4,7 @@
<%
self.has_left_panel=False
self.has_right_panel=False
- self.active_view="page"
+ self.active_view="shared"
self.message_box_visible=False
%></%def>
--- a/templates/visualization/list_published.mako
+++ b/templates/visualization/list_published.mako
@@ -4,7 +4,7 @@
<%
self.has_left_panel=False
self.has_right_panel=False
- self.active_view="page"
+ self.active_view="shared"
self.message_box_visible=False
%></%def>
--- a/templates/workflow/list_published.mako
+++ b/templates/workflow/list_published.mako
@@ -4,7 +4,7 @@
<%
self.has_left_panel=False
self.has_right_panel=False
- self.active_view=""
+ self.active_view="shared"
self.message_box_visible=False
%></%def>
--- a/templates/webapps/galaxy/base_panels.mako
+++ b/templates/webapps/galaxy/base_panels.mako
@@ -74,7 +74,7 @@
[ 'Published Visualizations', h.url_for( controller='/visualization', action='list_published' ) ],
[ 'Published Pages', h.url_for( controller='/page', action='list_published' ) ]
]
- tab( "libraries", "Shared Data", h.url_for( controller='/library', action='index'), menu_options=menu_options )
+ tab( "shared", "Shared Data", h.url_for( controller='/library', action='index'), menu_options=menu_options )
%>
## Lab menu.
--- a/templates/page/index.mako
+++ b/templates/page/index.mako
@@ -4,7 +4,7 @@
<%
self.has_left_panel=False
self.has_right_panel=False
- self.active_view="page"
+ self.active_view="shared"
self.message_box_visible=False
%></%def>
--- a/templates/display_base.mako
+++ b/templates/display_base.mako
@@ -25,7 +25,7 @@
self.has_left_panel=False
self.has_right_panel=True
self.message_box_visible=False
- self.active_view=""
+ self.active_view="shared"
self.overlay_visible=False
%></%def>
--- a/templates/page/list_published.mako
+++ b/templates/page/list_published.mako
@@ -4,7 +4,7 @@
<%
self.has_left_panel=False
self.has_right_panel=False
- self.active_view="page"
+ self.active_view="shared"
self.message_box_visible=False
%></%def>
--- a/templates/library/index.mako
+++ b/templates/library/index.mako
@@ -4,7 +4,7 @@
<%
self.has_left_panel=False
self.has_right_panel=False
- self.active_view="libraries"
+ self.active_view="shared"
%></%def>
--- a/templates/grid_base.mako
+++ b/templates/grid_base.mako
@@ -812,7 +812,7 @@
<% num_rows_rendered = 0 %>
%if query.count() == 0:
## No results.
- <tr><td></td><td><em>No Items</em></td></tr>
+ <tr><td colspan="100"><em>No Items</em></td></tr><% num_rows_rendered = 1 %>
%endif
%for i, item in enumerate( query ):
1
0
galaxy-dist commit 5038f0863ab9: Actually change the invocation of sputnik from bx-sputnik as mentioned in my last commit. Thanks Kanwei.
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Nate Coraor <nate(a)bx.psu.edu>
# Date 1286484637 14400
# Node ID 5038f0863ab9a8286fd97c718c63945bfd442dd0
# Parent b9f3c613c0266e9285679b06e39802a452f4b151
Actually change the invocation of sputnik from bx-sputnik as mentioned in my last commit. Thanks Kanwei.
--- a/tools/regVariation/microsats_alignment_level.py
+++ b/tools/regVariation/microsats_alignment_level.py
@@ -34,7 +34,7 @@ def main():
fout = open(outfile, "w")
print >>fout, "#Block\tSeq1_Name\tSeq1_Start\tSeq1_End\tSeq1_Type\tSeq1_Length\tSeq1_RepeatNumber\tSeq1_Unit\tSeq2_Name\tSeq2_Start\tSeq2_End\tSeq2_Type\tSeq2_Length\tSeq2_RepeatNumber\tSeq2_Unit"
#sputnik_cmd = os.path.join(os.path.split(sys.argv[0])[0], "sputnik")
- sputnik_cmd = "bx-sputnik"
+ sputnik_cmd = "sputnik"
input = infile.read()
skipped = 0
block_num = 0
1
0
galaxy-dist commit d85159be56e8: Add basic support for bowtie indexes as a datatype (bowtie_base_index, bowtie_color_index), available via datatype conversion. Currently, the indexes need to be converted manually from the FASTA file before use in bowtie, but they can be reused.
by commits-noreply@bitbucket.org 20 Nov '10
by commits-noreply@bitbucket.org 20 Nov '10
20 Nov '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Dan Blankenberg <dan(a)bx.psu.edu>
# Date 1286485181 14400
# Node ID d85159be56e854731822a314a2e982e0c6987389
# Parent 5038f0863ab9a8286fd97c718c63945bfd442dd0
Add basic support for bowtie indexes as a datatype (bowtie_base_index, bowtie_color_index), available via datatype conversion. Currently, the indexes need to be converted manually from the FASTA file before use in bowtie, but they can be reused.
More work is required to allow the one-off indexes built by bowtie to become Galaxy datasets; alternatively, the custom genome selection could be limited to the index datatype for input (and not allow fasta directly), which would allow implicit datatype conversion to occur when a fasta file is selected as input, but this would prevent the index tuning that is currently available when currently selecting a fasta file.
--- a/datatypes_conf.xml.sample
+++ b/datatypes_conf.xml.sample
@@ -45,10 +45,14 @@
<datatype extension="csv" type="galaxy.datatypes.tabular:Tabular"/><!-- End MSI added Datatypes --><datatype extension="customtrack" type="galaxy.datatypes.interval:CustomTrack"/>
+ <datatype extension="bowtie_color_index" type="galaxy.datatypes.ngsindex:BowtieColorIndex" mimetype="text/html" display_in_upload="False"/>
+ <datatype extension="bowtie_base_index" type="galaxy.datatypes.ngsindex:BowtieBaseIndex" mimetype="text/html" display_in_upload="False"/><datatype extension="csfasta" type="galaxy.datatypes.sequence:csFasta" display_in_upload="true"/><datatype extension="data" type="galaxy.datatypes.data:Data" mimetype="application/octet-stream" max_optional_metadata_filesize="1048576" /><datatype extension="fasta" type="galaxy.datatypes.sequence:Fasta" display_in_upload="true"><converter file="fasta_to_tabular_converter.xml" target_datatype="tabular"/>
+ <converter file="fasta_to_bowtie_base_index_converter.xml" target_datatype="bowtie_base_index"/>
+ <converter file="fasta_to_bowtie_color_index_converter.xml" target_datatype="bowtie_color_index"/></datatype><datatype extension="fastq" type="galaxy.datatypes.sequence:Fastq" display_in_upload="true"/><datatype extension="fastqsanger" type="galaxy.datatypes.sequence:FastqSanger" display_in_upload="true"/>
--- a/tools/sr_mapping/bowtie_wrapper.xml
+++ b/tools/sr_mapping/bowtie_wrapper.xml
@@ -12,6 +12,10 @@
--snpfrac="None"
--keepends="None"
#if $refGenomeSource.genomeSource == "history":
+ #if $refGenomeSource.ownFile.extension.startswith( 'bowtie_' ):
+ --ref="${refGenomeSource.ownFile.extra_files_path}/${refGenomeSource.ownFile.metadata.base_name}"
+ --do_not_build_index
+ #else:
--ref=$refGenomeSource.ownFile
--indexSettings=$refGenomeSource.indexParams.indexSettings
#if $refGenomeSource.indexParams.indexSettings == "indexFull":
@@ -50,6 +54,7 @@
--iseed="None"
--icutoff="None"
#end if
+ #end if
#else:
--ref=$refGenomeSource.index
--indexSettings="None"
@@ -203,9 +208,9 @@
</param></when><when value="history">
- <param name="ownFile" type="data" format="fasta" metadata_name="dbkey" label="Select the reference genome" />
+ <param name="ownFile" type="data" format="bowtie_base_index,fasta" metadata_name="dbkey" label="Select the reference genome" /><conditional name="indexParams">
- <param name="indexSettings" type="select" label="Choose whether to use Default options for building indices or to Set your own">
+ <param name="indexSettings" type="select" label="Choose whether to use Default options for building indices or to Set your own" help="These settings are ignored when using a prebuilt index"><option value="indexPreSet">Default</option><option value="indexFull">Set your own</option></param>
--- /dev/null
+++ b/lib/galaxy/datatypes/converters/fasta_to_bowtie_base_index_converter.xml
@@ -0,0 +1,18 @@
+<tool id="CONVERTER_fasta_to_bowtie_base_index" name="Convert FASTA to Bowtie base space Index" version="1.0.0">
+ <!-- <description>__NOT_USED_CURRENTLY_FOR_CONVERTERS__</description> -->
+ <!-- Used on the metadata edit page. -->
+ <command>
+ mkdir ${output.files_path}
+ && bowtie-build --quiet
+ -f
+ $input ${output.files_path}/${output.metadata.base_name}
+ </command>
+ <inputs>
+ <param name="input" type="data" format="fasta" label="Fasta file"/>
+ </inputs>
+ <outputs>
+ <data name="output" format="bowtie_base_index"/>
+ </outputs>
+ <help>
+ </help>
+</tool>
--- a/lib/galaxy/datatypes/registry.py
+++ b/lib/galaxy/datatypes/registry.py
@@ -3,7 +3,7 @@ Provides mapping between extensions and
"""
import os, tempfile
import logging
-import data, tabular, interval, images, sequence, qualityscore, genetics, xml, coverage, tracks, chrominfo, binary, assembly
+import data, tabular, interval, images, sequence, qualityscore, genetics, xml, coverage, tracks, chrominfo, binary, assembly, ngsindex
import galaxy.util
from galaxy.util.odict import odict
from display_applications.application import DisplayApplication
--- a/tools/sr_mapping/bowtie_wrapper.py
+++ b/tools/sr_mapping/bowtie_wrapper.py
@@ -56,6 +56,7 @@ usage: bowtie_wrapper.py [options]
-c, --icutoff=c: Number of first bases of the reference sequence to index
-x, --indexSettings=x: Whether or not indexing options are to be set
-H, --suppressHeader=H: Suppress header
+ --do_not_build_index: Flag to specify that provided file is already indexed and to just use 'as is'
"""
import optparse, os, shutil, subprocess, sys, tempfile
@@ -118,6 +119,7 @@ def __main__():
parser.add_option( '-c', '--icutoff', dest='icutoff', help='Number of first bases of the reference sequence to index' )
parser.add_option( '-x', '--indexSettings', dest='index_settings', help='Whether or not indexing options are to be set' )
parser.add_option( '-H', '--suppressHeader', dest='suppressHeader', help='Suppress header' )
+ parser.add_option( '--do_not_build_index', dest='do_not_build_index', action="store_true", default=False, help='Flag to specify that provided file is already indexed, use as is' )
(options, args) = parser.parse_args()
stdout = ''
@@ -129,7 +131,7 @@ def __main__():
else:
colorspace = ''
# index if necessary
- if options.genomeSource == 'history':
+ if options.genomeSource == 'history' and not options.do_not_build_index:
# set up commands
if options.index_settings =='indexPreSet':
indexing_cmds = '%s' % colorspace
--- a/tools/sr_mapping/bowtie_color_wrapper.xml
+++ b/tools/sr_mapping/bowtie_color_wrapper.xml
@@ -9,6 +9,10 @@
--suppressHeader=$suppressHeader
--genomeSource=$refGenomeSource.genomeSource
#if $refGenomeSource.genomeSource == "history":
+ #if $refGenomeSource.ownFile.extension.startswith( 'bowtie_' ):
+ --ref="${refGenomeSource.ownFile.extra_files_path}/${refGenomeSource.ownFile.metadata.base_name}"
+ --do_not_build_index
+ #else:
--ref=$refGenomeSource.ownFile
--indexSettings=$refGenomeSource.indexParams.indexSettings
#if $refGenomeSource.indexParams.indexSettings == "indexFull":
@@ -47,6 +51,7 @@
--iseed="None"
--icutoff="None"
#end if
+ #end if
#else:
--ref=$refGenomeSource.index
--indexSettings="None"
@@ -206,9 +211,9 @@
</param></when><when value="history">
- <param name="ownFile" type="data" format="fasta" metadata_name="dbkey" label="Select the reference genome" />
+ <param name="ownFile" type="data" format="bowtie_color_index,fasta" metadata_name="dbkey" label="Select the reference genome" /><conditional name="indexParams">
- <param name="indexSettings" type="select" label="Choose whether to use Default options for building indices or to Set your own">
+ <param name="indexSettings" type="select" label="Choose whether to use Default options for building indices or to Set your own" help="These settings are ignored when using a prebuilt index"><option value="indexPreSet">Default</option><option value="indexFull">Set your own</option></param>
--- /dev/null
+++ b/lib/galaxy/datatypes/ngsindex.py
@@ -0,0 +1,75 @@
+"""
+NGS indexes
+"""
+import logging
+from metadata import MetadataElement
+from images import Html
+
+log = logging.getLogger(__name__)
+
+class BowtieIndex( Html ):
+ """
+ base class for BowtieIndex
+ is subclassed by BowtieColorIndex and BowtieBaseIndex
+ """
+ MetadataElement( name="base_name", desc="base name for this index set", default='galaxy_generated_bowtie_index', set_in_upload=True, readonly=True )
+ MetadataElement( name="sequence_space", desc="sequence_space for this index set", default='unknown', set_in_upload=True, readonly=True )
+
+ file_ext = 'bowtie_index'
+ is_binary = True
+ composite_type = 'auto_primary_file'
+ allow_datatype_change = False
+
+ def generate_primary_file( self, dataset = None ):
+ """
+ This is called only at upload to write the html file
+ cannot rename the datasets here - they come with the default unfortunately
+ """
+ return '<html><head></head><body>AutoGenerated Primary File for Composite Dataset</body></html>'
+
+ def regenerate_primary_file(self,dataset):
+ """
+ cannot do this until we are setting metadata
+ """
+ bn = dataset.metadata.base_name
+ flist = os.listdir(dataset.extra_files_path)
+ rval = ['<html><head><title>Files for Composite Dataset %s</title></head><p/>Comprises the following files:<p/><ul>' % (bn)]
+ for i,fname in enumerate(flist):
+ sfname = os.path.split(fname)[-1]
+ rval.append( '<li><a href="%s">%s</a>' % ( sfname, sfname ) )
+ rval.append( '</ul></html>' )
+ f = file(dataset.file_name,'w')
+ f.write("\n".join( rval ))
+ f.write('\n')
+ f.close()
+
+ def set_peek( self, dataset, is_multi_byte=False ):
+ if not dataset.dataset.purged:
+ dataset.peek = "Bowtie index file (%s)" % ( dataset.metadata.sequence_space )
+ dataset.blurb = "%s space" % ( dataset.metadata.sequence_space )
+ else:
+ dataset.peek = 'file does not exist'
+ dataset.blurb = 'file purged from disk'
+ def display_peek( self, dataset ):
+ try:
+ return dataset.peek
+ except:
+ return "Bowtie index file"
+ def sniff( self, filename ):
+ return False
+
+class BowtieColorIndex( BowtieIndex ):
+ """
+ Bowtie color space index
+ """
+ MetadataElement( name="sequence_space", desc="sequence_space for this index set", default='color', set_in_upload=True, readonly=True )
+
+ file_ext = 'bowtie_color_index'
+
+class BowtieBaseIndex( BowtieIndex ):
+ """
+ Bowtie base space index
+ """
+ MetadataElement( name="sequence_space", desc="sequence_space for this index set", default='base', set_in_upload=True, readonly=True )
+
+ file_ext = 'bowtie_base_index'
--- /dev/null
+++ b/lib/galaxy/datatypes/converters/fasta_to_bowtie_color_index_converter.xml
@@ -0,0 +1,19 @@
+<tool id="CONVERTER_fasta_to_bowtie_color_index" name="Convert FASTA to Bowtie color space Index" version="1.0.0">
+ <!-- <description>__NOT_USED_CURRENTLY_FOR_CONVERTERS__</description> -->
+ <!-- Used on the metadata edit page. -->
+ <command>
+ mkdir ${output.files_path}
+ && bowtie-build --quiet
+ --color
+ -f
+ $input ${output.files_path}/${output.metadata.base_name}
+ </command>
+ <inputs>
+ <param name="input" type="data" format="fasta" label="Fasta file"/>
+ </inputs>
+ <outputs>
+ <data name="output" format="bowtie_color_index"/>
+ </outputs>
+ <help>
+ </help>
+</tool>
1
0