galaxy-dev
Threads by month
- ----- 2025 -----
- July
- June
- May
- April
- March
- February
- January
- ----- 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
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- 10008 discussions

07 Nov '09
details: http://www.bx.psu.edu/hg/galaxy/rev/979534de254d
changeset: 2934:979534de254d
user: Kanwei Li <kanwei(a)gmail.com>
date: Thu Oct 29 18:28:11 2009 -0400
description:
trackster: fixed browser crashing (were drawing huge canvas tiles because of resolution restriction), implemented simple LRU
diffstat:
static/scripts/lrucache.js | 238 ---------------------------------------
static/scripts/packed/lrucache.js | 1 -
static/scripts/packed/trackster.js | 2 +-
static/scripts/trackster.js | 46 ++++++-
templates/tracks/browser.mako | 2 +-
5 files changed, 39 insertions(+), 250 deletions(-)
diffs (359 lines):
diff -r 28ec4708840f -r 979534de254d static/scripts/lrucache.js
--- a/static/scripts/lrucache.js Thu Oct 29 17:57:30 2009 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,238 +0,0 @@
-/*
-MIT LICENSE
-Copyright (c) 2007 Monsur Hossain (http://www.monsur.com)
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-*/
-
-// ****************************************************************************
-// CachePriority ENUM
-// An easier way to refer to the priority of a cache item
-var CachePriority = {
- Low: 1,
- Normal: 2,
- High: 4
-}
-
-// ****************************************************************************
-// Cache constructor
-// Creates a new cache object
-// INPUT: maxSize (optional) - indicates how many items the cache can hold.
-// default is -1, which means no limit on the
-// number of items.
-function Cache(maxSize) {
- this.items = {};
- this.count = 0;
- if (maxSize == null)
- maxSize = -1;
- this.maxSize = maxSize;
- this.fillFactor = .75;
- this.purgeSize = Math.round(this.maxSize * this.fillFactor);
-
- this.stats = {}
- this.stats.hits = 0;
- this.stats.misses = 0;
-}
-
-// ****************************************************************************
-// Cache.getItem
-// retrieves an item from the cache, returns null if the item doesn't exist
-// or it is expired.
-// INPUT: key - the key to load from the cache
-Cache.prototype.getItem = function(key) {
-
- // retrieve the item from the cache
- var item = this.items[key];
-
- if (item != null) {
- if (!this._isExpired(item)) {
- // if the item is not expired
- // update its last accessed date
- item.lastAccessed = new Date().getTime();
- } else {
- // if the item is expired, remove it from the cache
- this._removeItem(key);
- item = null;
- }
- }
-
- // return the item value (if it exists), or null
- var returnVal = null;
- if (item != null) {
- returnVal = item.value;
- this.stats.hits++;
- } else {
- this.stats.misses++;
- }
- return returnVal;
-}
-
-// ****************************************************************************
-// Cache.setItem
-// sets an item in the cache
-// parameters: key - the key to refer to the object
-// value - the object to cache
-// options - an optional parameter described below
-// the last parameter accepts an object which controls various caching options:
-// expirationAbsolute: the datetime when the item should expire
-// expirationSliding: an integer representing the seconds since
-// the last cache access after which the item
-// should expire
-// priority: How important it is to leave this item in the cache.
-// You can use the values CachePriority.Low, .Normal, or
-// .High, or you can just use an integer. Note that
-// placing a priority on an item does not guarantee
-// it will remain in cache. It can still be purged if
-// an expiration is hit, or if the cache is full.
-// callback: A function that gets called when the item is purged
-// from cache. The key and value of the removed item
-// are passed as parameters to the callback function.
-Cache.prototype.setItem = function(key, value, options) {
-
- function CacheItem(k, v, o) {
- if ((k == null) || (k == ''))
- throw new Error("key cannot be null or empty");
- this.key = k;
- this.value = v;
- if (o == null)
- o = {};
- if (o.expirationAbsolute != null)
- o.expirationAbsolute = o.expirationAbsolute.getTime();
- if (o.priority == null)
- o.priority = CachePriority.Normal;
- this.options = o;
- this.lastAccessed = new Date().getTime();
- }
-
- // add a new cache item to the cache
- if (this.items[key] != null)
- this._removeItem(key);
- this._addItem(new CacheItem(key, value, options));
-
- // if the cache is full, purge it
- if ((this.maxSize > 0) && (this.count > this.maxSize)) {
- this._purge();
- }
-}
-
-// ****************************************************************************
-// Cache.clear
-// Remove all items from the cache
-Cache.prototype.clear = function() {
-
- // loop through each item in the cache and remove it
- for (var key in this.items) {
- this._removeItem(key);
- }
-}
-
-// ****************************************************************************
-// Cache._purge (PRIVATE FUNCTION)
-// remove old elements from the cache
-Cache.prototype._purge = function() {
-
- var tmparray = new Array();
-
- // loop through the cache, expire items that should be expired
- // otherwise, add the item to an array
- for (var key in this.items) {
- var item = this.items[key];
- if (this._isExpired(item)) {
- this._removeItem(key);
- } else {
- tmparray.push(item);
- }
- }
-
- if (tmparray.length > this.purgeSize) {
-
- // sort this array based on cache priority and the last accessed date
- tmparray = tmparray.sort(function(a, b) {
- if (a.options.priority != b.options.priority) {
- return b.options.priority - a.options.priority;
- } else {
- return b.lastAccessed - a.lastAccessed;
- }
- });
-
- // remove items from the end of the array
- while (tmparray.length > this.purgeSize) {
- var ritem = tmparray.pop();
- this._removeItem(ritem.key);
- }
- }
-}
-
-// ****************************************************************************
-// Cache._addItem (PRIVATE FUNCTION)
-// add an item to the cache
-Cache.prototype._addItem = function(item) {
- this.items[item.key] = item;
- this.count++;
-}
-
-// ****************************************************************************
-// Cache._removeItem (PRIVATE FUNCTION)
-// Remove an item from the cache, call the callback function (if necessary)
-Cache.prototype._removeItem = function(key) {
- var item = this.items[key];
- delete this.items[key];
- this.count--;
-
- // if there is a callback function, call it at the end of execution
- if (item.options.callback != null) {
- var callback = function() {
- item.options.callback(item.key, item.value);
- }
- setTimeout(callback, 0);
- }
-}
-
-// ****************************************************************************
-// Cache._isExpired (PRIVATE FUNCTION)
-// Returns true if the item should be expired based on its expiration options
-Cache.prototype._isExpired = function(item) {
- var now = new Date().getTime();
- var expired = false;
- if ((item.options.expirationAbsolute) && (item.options.expirationAbsolute < now)) {
- // if the absolute expiration has passed, expire the item
- expired = true;
- }
- if ((expired == false) && (item.options.expirationSliding)) {
- // if the sliding expiration has passed, expire the item
- var lastAccess = item.lastAccessed + (item.options.expirationSliding * 1000);
- if (lastAccess < now) {
- expired = true;
- }
- }
- return expired;
-}
-
-Cache.prototype.toHtmlString = function() {
- var returnStr = this.count + " item(s) in cache<br /><ul>";
- for (var key in this.items) {
- var item = this.items[key];
- returnStr = returnStr + "<li>" + item.key.toString() + " = " + item.value.toString() + "</li>";
- }
- returnStr = returnStr + "</ul>";
- return returnStr;
-}
diff -r 28ec4708840f -r 979534de254d static/scripts/packed/lrucache.js
--- a/static/scripts/packed/lrucache.js Thu Oct 29 17:57:30 2009 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-var CachePriority={Low:1,Normal:2,High:4};function Cache(a){this.items={};this.count=0;if(a==null){a=-1}this.maxSize=a;this.fillFactor=0.75;this.purgeSize=Math.round(this.maxSize*this.fillFactor);this.stats={};this.stats.hits=0;this.stats.misses=0}Cache.prototype.getItem=function(a){var c=this.items[a];if(c!=null){if(!this._isExpired(c)){c.lastAccessed=new Date().getTime()}else{this._removeItem(a);c=null}}var b=null;if(c!=null){b=c.value;this.stats.hits++}else{this.stats.misses++}return b};Cache.prototype.setItem=function(c,d,b){function a(f,e,g){if((f==null)||(f=="")){throw new Error("key cannot be null or empty")}this.key=f;this.value=e;if(g==null){g={}}if(g.expirationAbsolute!=null){g.expirationAbsolute=g.expirationAbsolute.getTime()}if(g.priority==null){g.priority=CachePriority.Normal}this.options=g;this.lastAccessed=new Date().getTime()}if(this.items[c]!=null){this._removeItem(c)}this._addItem(new a(c,d,b));if((this.maxSize>0)&&(this.count>this.maxSize)){this._purge()}}
;Cache.prototype.clear=function(){for(var a in this.items){this._removeItem(a)}};Cache.prototype._purge=function(){var d=new Array();for(var a in this.items){var b=this.items[a];if(this._isExpired(b)){this._removeItem(a)}else{d.push(b)}}if(d.length>this.purgeSize){d=d.sort(function(f,e){if(f.options.priority!=e.options.priority){return e.options.priority-f.options.priority}else{return e.lastAccessed-f.lastAccessed}});while(d.length>this.purgeSize){var c=d.pop();this._removeItem(c.key)}}};Cache.prototype._addItem=function(a){this.items[a.key]=a;this.count++};Cache.prototype._removeItem=function(a){var b=this.items[a];delete this.items[a];this.count--;if(b.options.callback!=null){var c=function(){b.options.callback(b.key,b.value)};setTimeout(c,0)}};Cache.prototype._isExpired=function(c){var a=new Date().getTime();var b=false;if((c.options.expirationAbsolute)&&(c.options.expirationAbsolute<a)){b=true}if((b==false)&&(c.options.expirationSliding)){var d=c.lastAccessed+(c.options.
expirationSliding*1000);if(d<a){b=true}}return b};Cache.prototype.toHtmlString=function(){var b=this.count+" item(s) in cache<br /><ul>";for(var a in this.items){var c=this.items[a];b=b+"<li>"+c.key.toString()+" = "+c.value.toString()+"</li>"}b=b+"</ul>";return b};
\ No newline at end of file
diff -r 28ec4708840f -r 979534de254d static/scripts/packed/trackster.js
--- a/static/scripts/packed/trackster.js Thu Oct 29 17:57:30 2009 -0400
+++ b/static/scripts/packed/trackster.js Thu Oct 29 18:28:11 2009 -0400
@@ -1,1 +1,1 @@
-var DENSITY=1000,DATA_ERROR="There was an error in indexing this dataset.",DATA_NONE="No data for this chrom/contig.",CACHED_TILES=50,CACHED_DATA=20;function commatize(b){b+="";var a=/(\d+)(\d{3})/;while(a.test(b)){b=b.replace(a,"$1,$2")}return b}var View=function(b,a){this.chrom=b;this.tracks=[];this.max_low=0;this.max_high=a;this.center=(this.max_high-this.max_low)/2;this.span=this.max_high-this.max_low;this.zoom_factor=2;this.zoom_level=0};$.extend(View.prototype,{add_track:function(a){a.view=this;this.tracks.push(a);if(a.init){a.init()}},redraw:function(){var d=this.span/Math.pow(this.zoom_factor,this.zoom_level),b=this.center-(d/2),e=b+d;if(b<0){b=0;e=b+d}else{if(e>this.max_high){e=this.max_high;b=e-d}}this.low=Math.floor(b);this.high=Math.ceil(e);this.center=Math.round(this.low+(this.high-this.low)/2);$("#overview-box").css({left:(this.low/this.span)*$("#overview-viewport").width(),width:Math.max(12,((this.high-this.low)/this.span)*$("#overview-viewport").width())}).sh
ow();$("#low").text(commatize(this.low));$("#high").text(commatize(this.high));for(var c=0,a=this.tracks.length;c<a;c++){this.tracks[c].draw()}$("#bottom-spacer").remove();$("#viewport").append('<div id="bottom-spacer" style="height: 200px;"></div>')},zoom_in:function(a){if(this.max_high===0||this.high-this.low<5){return}if(a){this.center=a/$(document).width()*(this.high-this.low)+this.low}this.zoom_level+=1},zoom_out:function(){if(this.max_high===0){return}if(this.zoom_level<=0){this.zoom_level=0;return}this.zoom_level-=1}});var Track=function(a,b){this.name=a;this.parent_element=b;this.make_container()};$.extend(Track.prototype,{make_container:function(){this.header_div=$("<div class='track-header'>").text(this.name);this.content_div=$("<div class='track-content'>");this.container_div=$("<div class='track'></div>").append(this.header_div).append(this.content_div);this.parent_element.append(this.container_div)}});var TiledTrack=function(){this.tile_cache=new Cache(CACHED_TI
LES)};$.extend(TiledTrack.prototype,Track.prototype,{draw:function(){var i=this.view.low,c=this.view.high,e=c-i;var b=Math.pow(10,Math.ceil(Math.log(e/DENSITY)/Math.log(10)));b=Math.max(b,1);b=Math.min(b,100000);var l=$("<div style='position: relative;'></div>");this.content_div.children(":first").remove();this.content_div.append(l);var j=this.content_div.width(),d=this.content_div.height(),m=j/e;var g;var a=Math.floor(i/b/DENSITY);while((a*DENSITY*b)<c){var k=this.view.zoom_level+"_"+a;if(this.tile_cache[k]){g=this.tile_cache[k];var f=a*DENSITY*b;g.css({left:(f-this.view.low)*m});l.append(g)}else{g=this.draw_tile(b,a,l,m,d)}if(g){this.tile_cache[k]=g}a+=1}}});var LabelTrack=function(a){Track.call(this,null,a);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 LineTrack=function(c,b,a){Track.call(this,c,$("#viewport"));TiledTrack.call(this);this.track_type="line";this.height_px=(a?a:100);this.container_div.addClass("line-track");this.dataset_id=b;this.cache=new Cache(CACHED_DATA)};$.extend(LineTrack.prototype,TiledTrack.prototype,{init:function(){var a=this;$.getJSON(data_url,{stats:true,track_type:a.track_type,chrom:a.view.chrom,low:null,high:null,dataset_id:a.dataset_id},function(b){if(!b||b=="error"){a.content_div.addClass("error").text(DATA_ERROR)}else{if(b=="no data"){a.content_div.addClass("nodata").text(DATA_NONE)}else{a.content_div.css("height",a.height_px+"px");a.min_value=b.min;a.max_value=b.max;a.vertical_range=a.max_value-a.min_value;a.view.redraw()}}})},get_data:f
unction(d,b){var c=this,a=b*DENSITY*d,f=(b+1)*DENSITY*d,e=d+"_"+b;$.getJSON(data_url,{track_type:this.track_type,chrom:this.view.chrom,low:a,high:f,dataset_id:this.dataset_id},function(g){c.cache[e]=g;$(document).trigger("redraw")})},draw_tile:function(d,a,m,o){if(!this.vertical_range){return}var h=a*DENSITY*d,b=DENSITY*d,c=$("<canvas class='tile'></canvas>"),l=d+"_"+a;if(!this.cache[l]){this.get_data(d,a);return}var g=this.cache[l];c.css({position:"absolute",top:0,left:(h-this.view.low)*o});c.get(0).width=Math.ceil(b*o);c.get(0).height=this.height_px;var n=c.get(0).getContext("2d");var e=false;n.beginPath();for(var f=0;f<g.length-1;f++){var k=g[f][0]-h;var j=g[f][1];if(isNaN(j)){e=false}else{k=k*o;j=(j-this.min_value)/this.vertical_range*this.height_px;if(e){n.lineTo(k,j)}else{n.moveTo(k,j);e=true}}}n.stroke();m.append(c);return c}});var FeatureTrack=function(c,b,a){Track.call(this,c,$("#viewport"));TiledTrack.call(this);this.track_type="feature";this.height_px=(a?a:100);th
is.container_div.addClass("feature-track");this.dataset_id=b;this.zo_slots={};this.show_labels_scale=0.001;this.showing_labels=false;this.vertical_gap=10};$.extend(FeatureTrack.prototype,TiledTrack.prototype,{init:function(){var a=this;$.getJSON(data_url,{track_type:a.track_type,low:a.view.max_low,high:a.view.max_high,dataset_id:a.dataset_id,chrom:a.view.chrom},function(b){if(b=="error"){a.content_div.addClass("error").text(DATA_ERROR)}else{if(b.length===0||b=="no data"){a.content_div.addClass("nodata").text(DATA_NONE)}else{a.content_div.css("height",a.height_px+"px");a.values=b;a.calc_slots();a.slots=a.zo_slots;a.draw()}}})},calc_slots:function(o){var c=[],b=this.container_div.width()/(this.view.high-this.view.low),g=this.show_labels_scale,a=this.view.max_high,e=this.view.max_low;if(o){this.zi_slots={}}var m=$("<canvas></canvas>").get(0).getContext("2d");for(var f=0,h=this.values.length;f<h;f++){var k,l,n=this.values[f];if(o){k=Math.floor(Math.max(e,(n.start-e)*g));k-=m.mea
sureText(n.name).width;l=Math.ceil(Math.min(a,(n.end-e)*g))}else{k=Math.floor(Math.max(e,(n.start-e)*b));l=Math.ceil(Math.min(a,(n.end-e)*b))}var d=0;while(true){if(c[d]===undefined||c[d]<k){c[d]=l;if(o){this.zi_slots[n.name]=d}else{this.zo_slots[n.name]=d}break}d++}}this.height_px=c.length*this.vertical_gap+15;this.content_div.css("height",this.height_px+"px")},draw_tile:function(t,y,g,n){if(!this.values){return null}if(n>this.show_labels_scale&&!this.showing_labels){this.showing_labels=true;if(!this.zi_slots){this.calc_slots(true)}this.slots=this.zi_slots}else{if(n<=this.show_labels_scale&&this.showing_labels){this.showing_labels=false;this.slots=this.zo_slots}}var z=y*DENSITY*t,b=(y+1)*DENSITY*t,o=DENSITY*t;var r=Math.ceil(o*n),q=this.height_px,p=$("<canvas class='tile'></canvas>");p.css({position:"absolute",top:0,left:(z-this.view.low)*n});p.get(0).width=r;p.get(0).height=q;var s=p.get(0).getContext("2d");s.fillStyle="#000";s.font="10px monospace";s.textAlign="right";var
v=0;for(var w=0,x=this.values.length;w<x;w++){var f=this.values[w];if(f.start<=b&&f.end>=z){var e=Math.floor(Math.max(0,(f.start-z)*n)),h=Math.ceil(Math.min(r,(f.end-z)*n)),d=this.slots[f.name]*this.vertical_gap;s.fillRect(e,d+5,h-e,1);if(this.showing_labels&&s.fillText){s.fillText(f.name,e,d+8)}var c,D;if(f.exon_start&&f.exon_end){c=Math.floor(Math.max(0,(f.exon_start-z)*n));D=Math.ceil(Math.min(r,(f.exon_end-z)*n));s.fillRect(c,d+4,D-c,3)}if(f.blocks){for(var u=0,B=f.blocks.length;u<B;u++){var m=f.blocks[u],l=Math.floor(Math.max(0,(m[0]-z)*n)),A=Math.ceil(Math.min(r,(m[1]-z)*n));var a=3,C=4;if(c&&l>=c&&A<=D){a=5;C=3}s.fillRect(l,d+C,A-l,a)}}v++}}g.append(p);return p}});
\ No newline at end of file
+var DENSITY=1000,DATA_ERROR="There was an error in indexing this dataset.",DATA_NONE="No data for this chrom/contig.",DATA_PENDING="Currently indexing... please wait",DATA_LOADING="Loading data...",CACHED_TILES=5,CACHED_DATA=20,CONTEXT=$("<canvas></canvas>").get(0).getContext("2d"),RIGHT_STRAND,LEFT_STRAND;var right_img=new Image();right_img.src="../images/visualization/strand_right.png";right_img.onload=function(){RIGHT_STRAND=CONTEXT.createPattern(right_img,"repeat")};var left_img=new Image();left_img.src="../images/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="../images/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="../images/visualization/strand_left_inv.png";left_img_inv.onload=function(){LEFT_STRAND_INV=CONTEXT.createPattern(l
eft_img_inv,"repeat")};function commatize(b){b+="";var a=/(\d+)(\d{3})/;while(a.test(b)){b=b.replace(a,"$1,$2")}return b}var Cache=function(a){this.num_elements=a;this.obj_cache={};this.key_ary=[]};$.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}});var View=function(b,a){this.chrom=b;this.tracks=[];this.max_low=0;this.max_high=a;this.center=(this.max_high-this.max_low)/2;this.span=this.max_high-this.max_low;this.zoom_factor=2;this.zoom_level=0};$.extend(View.prototype,{add_track:function(a){a.view=this;this.tracks.push(a);if(a.init){a.init()}},redraw:function(){var d=this.span/Math.pow(this.zoom_factor,this.zoom_level),b=this.center-(d/2),e=b+d;if(b<0){b=0;e=b+d}else{if(e>this.max_high){e
=this.max_high;b=e-d}}this.low=Math.floor(b);this.high=Math.ceil(e);this.center=Math.round(this.low+(this.high-this.low)/2);$("#overview-box").css({left:(this.low/this.span)*$("#overview-viewport").width(),width:Math.max(12,((this.high-this.low)/this.span)*$("#overview-viewport").width())}).show();$("#low").val(commatize(this.low));$("#high").val(commatize(this.high));for(var c=0,a=this.tracks.length;c<a;c++){this.tracks[c].draw()}$("#bottom-spacer").remove();$("#viewport").append('<div id="bottom-spacer" style="height: 200px;"></div>')},zoom_in:function(a){if(this.max_high===0||this.high-this.low<30){return}if(a){this.center=a/$(document).width()*(this.high-this.low)+this.low}this.zoom_level+=1;this.redraw()},zoom_out:function(){if(this.max_high===0){return}if(this.zoom_level<=0){this.zoom_level=0;return}this.zoom_level-=1;this.redraw()}});var Track=function(a,b){this.name=a;this.parent_element=b;this.make_container()};$.extend(Track.prototype,{make_container:function(){thi
s.header_div=$("<div class='track-header'>").text(this.name);this.content_div=$("<div class='track-content'>");this.container_div=$("<div class='track'></div>").append(this.header_div).append(this.content_div);this.parent_element.append(this.container_div)}});var TiledTrack=function(){this.tile_cache=new Cache(CACHED_TILES)};$.extend(TiledTrack.prototype,Track.prototype,{draw:function(){var h=this.view.low,d=this.view.high,e=d-h;var c=Math.pow(10,Math.ceil(Math.log(e/DENSITY)/Math.log(10)));c=Math.max(c,0.1);c=Math.min(c,1000000);var j=$("<div style='position: relative;'></div>");this.content_div.children(":first").remove();this.content_div.append(j);var k=this.content_div.width()/e;var g;var a=Math.floor(h/c/DENSITY);while((a*DENSITY*c)<d){var i=this.view.zoom_level+"_"+a;var b=this.tile_cache.get(i);if(b){var f=a*DENSITY*c;b.css({left:(f-this.view.low)*k});j.append(b)}else{g=this.draw_tile(c,a,j,k)}if(g){this.tile_cache.set(i,g)}a+=1}}});var LabelTrack=function(a){Track.ca
ll(this,null,a);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 LineTrack=function(c,b,a){Track.call(this,c,$("#viewport"));TiledTrack.call(this);this.track_type="line";this.height_px=(a?a:100);this.container_div.addClass("line-track");this.dataset_id=b;this.cache=new Cache(CACHED_DATA)};$.extend(LineTrack.prototype,TiledTrack.prototype,{init:function(){var a=this;a.content_div.text(DATA_LOADING);$.getJSON(data_url,{stats:true,track_type:a.track_type,chrom:a.view.chrom,low:null,high:null,dataset_id:a.dat
aset_id},function(c){if(!c||c=="error"){a.container_div.addClass("error");a.content_div.text(DATA_ERROR)}else{if(c=="no data"){a.container_div.addClass("nodata");a.content_div.text(DATA_NONE)}else{if(c=="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.min_value=c.min;a.max_value=c.max;a.vertical_range=a.max_value-a.min_value;var d=$("<div class='yaxislabel'>"+a.min_value+"</div>");var b=$("<div class='yaxislabel'>"+a.max_value+"</div>");b.css({position:"relative",top:"35px"});b.prependTo(a.container_div);d.css({position:"relative",top:a.height_px+32+"px",});d.prependTo(a.container_div);a.draw()}}}})},get_data:function(d,b){var c=this,a=b*DENSITY*d,f=(b+1)*DENSITY*d,e=d+"_"+b;$.getJSON(data_url,{track_type:this.track_type,chrom:this.view.chrom,low:a,high:f,dataset_id:this.dataset_id},function(g){c.cache[e]=g;$(document).trigger("redra
w")})},draw_tile:function(d,a,m,o){if(!this.vertical_range){return}var h=a*DENSITY*d,b=DENSITY*d,c=$("<canvas class='tile'></canvas>"),l=d+"_"+a;if(!this.cache[l]){this.get_data(d,a);return}var g=this.cache[l];c.css({position:"absolute",top:0,left:(h-this.view.low)*o});c.get(0).width=Math.ceil(b*o);c.get(0).height=this.height_px;var n=c.get(0).getContext("2d");var e=false;n.beginPath();for(var f=0;f<g.length-1;f++){var k=g[f][0]-h;var j=g[f][1];if(isNaN(j)){e=false}else{k=k*o;j=(j-this.min_value)/this.vertical_range*this.height_px;if(e){n.lineTo(k,j)}else{n.moveTo(k,j);e=true}}}n.stroke();m.append(c);return c}});var FeatureTrack=function(c,b,a){Track.call(this,c,$("#viewport"));TiledTrack.call(this);this.track_type="feature";this.height_px=(a?a:100);this.container_div.addClass("feature-track");this.dataset_id=b;this.zo_slots={};this.show_labels_scale=0.001;this.showing_labels=false;this.vertical_gap=10;this.base_color="#2C3143"};$.extend(FeatureTrack.prototype,TiledTrack.pro
totype,{init:function(){var a=this;a.content_div.text(DATA_LOADING);$.getJSON(data_url,{track_type:a.track_type,low:a.view.max_low,high:a.view.max_high,dataset_id:a.dataset_id,chrom:a.view.chrom},function(b){if(b=="error"){a.container_div.addClass("error");a.content_div.text(DATA_ERROR)}else{if(b.length===0||b=="no data"){a.container_div.addClass("nodata");a.content_div.text(DATA_NONE)}else{if(b=="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.values=b;a.calc_slots();a.slots=a.zo_slots;a.draw()}}}})},calc_slots:function(o){var c=[],b=this.container_div.width()/(this.view.high-this.view.low),g=this.show_labels_scale,a=this.view.max_high,e=this.view.max_low;if(o){this.zi_slots={}}var m=$("<canvas></canvas>").get(0).getContext("2d");for(var f=0,h=this.values.length;f<h;f++){var k,l,n=this.values[f];if(o){k=Math.floor(Math.max(e,(n.star
t-e)*g));k-=m.measureText(n.name).width;l=Math.ceil(Math.min(a,(n.end-e)*g))}else{k=Math.floor(Math.max(e,(n.start-e)*b));l=Math.ceil(Math.min(a,(n.end-e)*b))}var d=0;while(true){if(c[d]===undefined||c[d]<k){c[d]=l;if(o){this.zi_slots[n.name]=d}else{this.zo_slots[n.name]=d}break}d++}}this.height_px=c.length*this.vertical_gap+15;this.content_div.css("height",this.height_px+"px")},draw_tile:function(w,B,g,n){if(!this.values){return null}if(n>this.show_labels_scale&&!this.showing_labels){this.showing_labels=true;if(!this.zi_slots){this.calc_slots(true)}this.slots=this.zi_slots}else{if(n<=this.show_labels_scale&&this.showing_labels){this.showing_labels=false;this.slots=this.zo_slots}}var C=B*DENSITY*w,c=(B+1)*DENSITY*w,q=DENSITY*w;var u=Math.ceil(q*n),t=this.height_px,s=$("<canvas class='tile'></canvas>");s.css({position:"absolute",top:0,left:(C-this.view.low)*n});s.get(0).width=u;s.get(0).height=t;var v=s.get(0).getContext("2d");v.fillStyle=this.base_color;v.font="10px monospac
e";v.textAlign="right";var y=0;for(var z=0,A=this.values.length;z<A;z++){var f=this.values[z];if(f.start<=c&&f.end>=C){var e=Math.floor(Math.max(0,(f.start-C)*n)),h=Math.ceil(Math.min(u,(f.end-C)*n)),d=this.slots[f.name]*this.vertical_gap;var a,G,b=null,o=null;if(f.thick_start&&f.thick_end){b=Math.floor(Math.max(0,(f.thick_start-C)*n));o=Math.ceil(Math.min(u,(f.thick_end-C)*n))}if(!this.showing_labels){v.fillRect(e,d+5,h-e,1)}else{if(v.fillText){v.fillText(f.name,e-1,d+8)}var E=f.blocks;if(E){if(f.strand){if(f.strand=="+"){v.fillStyle=RIGHT_STRAND}else{if(f.strand=="-"){v.fillStyle=LEFT_STRAND}}v.fillRect(e,d,h-e,10);v.fillStyle=this.base_color}for(var x=0,F=E.length;x<F;x++){var m=E[x],l=Math.floor(Math.max(0,(m[0]-C)*n)),D=Math.ceil(Math.min(u,(m[1]-C)*n));a=5;G=3;v.fillRect(l,d+G,D-l,a);if(b&&(l<o||D>b)){a=9;G=1;var r=Math.max(l,b),p=Math.min(D,o);v.fillRect(r,d+G,p-r,a)}}}else{a=9;G=1;v.fillRect(e,d+G,h-e,a);if(f.strand){if(f.strand=="+"){v.fillStyle=RIGHT_STRAND_INV}els
e{if(f.strand=="-"){v.fillStyle=LEFT_STRAND_INV}}v.fillRect(e,d,h-e,10);v.fillStyle=this.base_color}}}y++}}g.append(s);return s}});
\ No newline at end of file
diff -r 28ec4708840f -r 979534de254d static/scripts/trackster.js
--- a/static/scripts/trackster.js Thu Oct 29 17:57:30 2009 -0400
+++ b/static/scripts/trackster.js Thu Oct 29 18:28:11 2009 -0400
@@ -7,7 +7,7 @@
DATA_NONE = "No data for this chrom/contig.",
DATA_PENDING = "Currently indexing... please wait",
DATA_LOADING = "Loading data...",
- CACHED_TILES = 50,
+ CACHED_TILES = 5,
CACHED_DATA = 20,
CONTEXT = $("<canvas></canvas>").get(0).getContext("2d"),
RIGHT_STRAND, LEFT_STRAND;
@@ -42,6 +42,36 @@
}
return number;
}
+
+var Cache = function( num_elements ) {
+ this.num_elements = num_elements;
+ this.obj_cache = {};
+ this.key_ary = [];
+}
+$.extend( Cache.prototype, {
+ get: function( key ) {
+ var index = this.key_ary.indexOf(key);
+ if (index != -1) {
+ // Move to the end
+ this.key_ary.splice(index, 1);
+ this.key_ary.push(key);
+ }
+ return this.obj_cache[key];
+ },
+ set: function( key, value ) {
+ if (!this.obj_cache[key]) {
+ if (this.key_ary.length >= this.num_elements) {
+ // Remove first element
+ var deleted_key = this.key_ary.shift();
+ delete this.obj_cache[deleted_key];
+ }
+ this.key_ary.push(key);
+ }
+ this.obj_cache[key] = value;
+ return value;
+ }
+});
+
var View = function( chrom, max_high ) {
this.chrom = chrom;
this.tracks = [];
@@ -138,16 +168,14 @@
range = high - low;
var resolution = Math.pow( 10, Math.ceil( Math.log( range / DENSITY ) / Math.log( 10 ) ) );
- resolution = Math.max( resolution, 1 );
- resolution = Math.min( resolution, 100000 );
+ resolution = Math.max( resolution, 0.1 );
+ resolution = Math.min( resolution, 1000000 );
var parent_element = $("<div style='position: relative;'></div>");
this.content_div.children( ":first" ).remove();
this.content_div.append( parent_element );
- var w = this.content_div.width(),
- h = this.content_div.height(),
- w_scale = w / range;
+ var w_scale = this.content_div.width() / range;
var tile_element;
// Index of first tile that overlaps visible region
@@ -155,7 +183,7 @@
while ( ( tile_index * DENSITY * resolution ) < high ) {
// Check in cache
var key = this.view.zoom_level + "_" + tile_index;
- var cached = this.tile_cache.getItem(key);
+ var cached = this.tile_cache.get(key);
if ( cached ) {
// console.log("cached tile");
var tile_low = tile_index * DENSITY * resolution;
@@ -165,10 +193,10 @@
// Our responsibility to move the element to the new parent
parent_element.append( cached );
} else {
- tile_element = this.draw_tile( resolution, tile_index, parent_element, w_scale, h );
+ tile_element = this.draw_tile( resolution, tile_index, parent_element, w_scale );
}
if ( tile_element ) {
- this.tile_cache.setItem(key, tile_element);
+ this.tile_cache.set(key, tile_element);
}
tile_index += 1;
}
diff -r 28ec4708840f -r 979534de254d templates/tracks/browser.mako
--- a/templates/tracks/browser.mako Thu Oct 29 17:57:30 2009 -0400
+++ b/templates/tracks/browser.mako Thu Oct 29 18:28:11 2009 -0400
@@ -7,7 +7,7 @@
<%def name="javascripts()">
${parent.javascripts()}
-${h.js( "jquery", "jquery.event.drag", "jquery.mousewheel", "lrucache", "trackster" )}
+${h.js( "jquery", "jquery.event.drag", "jquery.mousewheel", "trackster" )}
<script type="text/javascript">
1
0
details: http://www.bx.psu.edu/hg/galaxy/rev/28ec4708840f
changeset: 2933:28ec4708840f
user: Ross Lazarus <ross.lazarus(a)gmail.com>
date: Thu Oct 29 17:57:30 2009 -0400
description:
updated rgenetics test files
diffstat:
test-data/tinywga.bed | 2 +-
test-data/tinywga.bim | 35 ++++++++---
test-data/tinywga.fam | 130 +++++++++++++------------------------------
test-data/tinywga.map | 35 ++++++++---
test-data/tinywga.ped | 130 +++++++++++++------------------------------
test-data/tinywga.pphe | 42 ++++++++++++++
6 files changed, 173 insertions(+), 201 deletions(-)
diffs (400 lines):
diff -r 5d80e32d989b -r 28ec4708840f test-data/tinywga.bed
--- a/test-data/tinywga.bed Thu Oct 29 13:34:44 2009 -0400
+++ b/test-data/tinywga.bed Thu Oct 29 17:57:30 2009 -0400
@@ -1,1 +1,1 @@
-lÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿï¾î¸ÿÿüþ¿ÿ¿ûú¿¿ï/ÿÿþÿï¯ê¸ëê°®¾î®ãê¸;ì/âïú¯ï¯Îê¼ïâ°¯þÏªã¯ø+ì?âÿú¯ïëÿî¾ÿºþÿþ¯þï¿ÿ;ï?þÿÿÿïÿÿÿÿÿºÿÿþ¯þï¿ÿ»ÿÿþÿÿÿïëÿî¾ÿºþÿþ¯þï¿ÿ;ï?þÿÿÿÿÿÿÿþïÿÿÿþÿÿÿÿûÿûÿÿÿ»ÿïëÿî¾ÿºþÿþ¯þï¿ÿ;ï?þÿÿÿïëÿê¾ÿºúïþ¯îë¿þ;¯>âïþ»
\ No newline at end of file
+lÿëþ¿¾+êóª¿ü £ïªîþ¨êÿïªûÿÿÿÿÿÿþﮨª"ëú £ïªîþ¨ÿÿ»ÿÿïïþÿèÿþ"ÿ«ïªîþ¨:*ÿïêüº.«ë:*ÿïêüº.«ëÿÿÿÿ¯ÿ¿ïþ¿ÿþªÿ¯û¿ïþ¿:*»ïêìª,«À:*»ïêìª,«Àÿëþ¿¾+êóª¿ÿÿÿÿûÿúÿÿÿÿÿÿÿÿÿ¿þ¿ÿëþ¿¾+ê󪿺ûÿÿ¿»ÿÿþ¿êÿÿªûÿÿÿÿÿºûÿÿ¿»ÿÿþ¿mÿÿÿýÿÿÿÿÿ ú¢ª±«¯ü(:ú¢ÿ¿«¯ü(:ú¢ÿ¿«¯ü(:ú¢ÿ¿«¯ü(
\ No newline at end of file
diff -r 5d80e32d989b -r 28ec4708840f test-data/tinywga.bim
--- a/test-data/tinywga.bim Thu Oct 29 13:34:44 2009 -0400
+++ b/test-data/tinywga.bim Thu Oct 29 17:57:30 2009 -0400
@@ -1,10 +1,25 @@
-22 rs5992809 16.5965 16596539 0 C
-22 rs12168131 16.6573 16657262 G A
-22 rs390041 16.6629 16662916 T C
-22 rs437633 16.6697 16669684 A G
-22 rs450960 16.6909 16690858 T C
-22 rs450975 16.6909 16690887 T C
-22 rs451740 16.6912 16691174 T C
-22 rs8139723 16.6917 16691696 T C
-22 rs405490 16.6922 16692175 G A
-22 rs415170 16.6935 16693517 G C
+22 rs2283802 0 21784722 4 2
+22 rs2267000 0 21785366 4 2
+22 rs16997606 0 21794754 1 3
+22 rs4820537 0 21794810 1 3
+22 rs3788347 0 21797804 3 1
+22 rs756632 0 21799918 4 2
+22 rs4820539 0 21807970 1 3
+22 rs2283804 0 21820335 1 2
+22 rs2267006 0 21820990 3 1
+22 rs4822363 0 21821000 4 2
+22 rs5751592 0 21827674 4 2
+22 rs5759608 0 21832708 2 4
+22 rs5759612 0 21833170 3 1
+22 rs2267009 0 21860168 3 4
+22 rs2267010 0 21864366 3 1
+22 rs5759636 0 21868698 4 2
+22 rs2071436 0 21871488 4 2
+22 rs2267013 0 21875879 3 1
+22 rs6003566 0 21889806 3 1
+22 rs2256725 0 21892891 2 1
+22 rs12160770 0 21892925 1 3
+22 rs5751611 0 21896019 2 4
+22 rs762601 0 21898858 1 3
+22 rs2156921 0 21899063 3 1
+22 rs4822375 0 21905642 1 3
diff -r 5d80e32d989b -r 28ec4708840f test-data/tinywga.fam
--- a/test-data/tinywga.fam Thu Oct 29 13:34:44 2009 -0400
+++ b/test-data/tinywga.fam Thu Oct 29 17:57:30 2009 -0400
@@ -1,90 +1,40 @@
-CH18526 NA18526 0 0 2 1
-CH18524 NA18524 0 0 1 1
-CH18529 NA18529 0 0 2 1
-CH18558 NA18558 0 0 1 1
-CH18532 NA18532 0 0 2 1
-CH18561 NA18561 0 0 1 1
-CH18562 NA18562 0 0 1 1
-CH18537 NA18537 0 0 2 2
-CH18603 NA18603 0 0 1 2
-CH18540 NA18540 0 0 2 1
-CH18605 NA18605 0 0 1 1
-CH18542 NA18542 0 0 2 1
-CH18545 NA18545 0 0 2 1
-CH18572 NA18572 0 0 1 2
-CH18547 NA18547 0 0 2 2
-CH18609 NA18609 0 0 1 1
-CH18550 NA18550 0 0 2 1
-CH18608 NA18608 0 0 1 1
-CH18552 NA18552 0 0 2 1
-CH18611 NA18611 0 0 1 1
-CH18555 NA18555 0 0 2 1
-CH18564 NA18564 0 0 2 2
-CH18566 NA18566 0 0 2 1
-CH18563 NA18563 0 0 1 1
-CH18570 NA18570 0 0 2 1
-CH18612 NA18612 0 0 1 2
-CH18571 NA18571 0 0 2 1
-CH18620 NA18620 0 0 1 1
-CH18621 NA18621 0 0 1 1
-CH18594 NA18594 0 0 2 1
-CH18622 NA18622 0 0 1 2
-CH18573 NA18573 0 0 2 2
-CH18623 NA18623 0 0 1 1
-CH18576 NA18576 0 0 2 1
-CH18577 NA18577 0 0 2 1
-CH18624 NA18624 0 0 1 1
-CH18579 NA18579 0 0 2 1
-CH18632 NA18632 0 0 1 2
-CH18582 NA18582 0 0 2 1
-CH18633 NA18633 0 0 1 1
-CH18635 NA18635 0 0 1 2
-CH18592 NA18592 0 0 2 1
-CH18636 NA18636 0 0 1 1
-CH18593 NA18593 0 0 2 2
-CH18637 NA18637 0 0 1 1
-JA18942 NA18942 0 0 2 2
-JA18940 NA18940 0 0 1 2
-JA18951 NA18951 0 0 2 2
-JA18943 NA18943 0 0 1 2
-JA18947 NA18947 0 0 2 2
-JA18944 NA18944 0 0 1 2
-JA18945 NA18945 0 0 1 2
-JA18949 NA18949 0 0 2 2
-JA18948 NA18948 0 0 1 2
-JA18952 NA18952 0 0 1 2
-JA18956 NA18956 0 0 2 2
-JA18964 NA18964 0 0 2 2
-JA18953 NA18953 0 0 1 1
-JA18968 NA18968 0 0 2 2
-JA18959 NA18959 0 0 1 2
-JA18969 NA18969 0 0 2 1
-JA18960 NA18960 0 0 1 2
-JA18961 NA18961 0 0 1 2
-JA18972 NA18972 0 0 2 2
-JA18965 NA18965 0 0 1 2
-JA18973 NA18973 0 0 2 2
-JA18966 NA18966 0 0 1 2
-JA18975 NA18975 0 0 2 2
-JA18967 NA18967 0 0 1 2
-JA18976 NA18976 0 0 2 1
-JA18978 NA18978 0 0 2 2
-JA18970 NA18970 0 0 1 1
-JA18980 NA18980 0 0 2 2
-JA18995 NA18995 0 0 1 1
-JA18981 NA18981 0 0 2 2
-JA18971 NA18971 0 0 1 2
-JA18974 NA18974 0 0 1 1
-JA18987 NA18987 0 0 2 2
-JA18990 NA18990 0 0 1 1
-JA18991 NA18991 0 0 2 2
-JA18994 NA18994 0 0 1 2
-JA18992 NA18992 0 0 2 2
-JA18997 NA18997 0 0 2 2
-JA18998 NA18998 0 0 2 2
-JA19000 NA19000 0 0 1 2
-JA19005 NA19005 0 0 1 2
-JA18999 NA18999 0 0 2 2
-JA19007 NA19007 0 0 1 2
-JA19003 NA19003 0 0 2 2
-JA19012 NA19012 0 0 1 2
+101 1 3 2 2 2
+101 2 0 0 2 1
+101 3 0 0 1 1
+105 1 3 2 2 2
+105 2 0 0 2 1
+105 3 0 0 1 1
+112 1 3 2 1 2
+112 2 0 0 2 1
+112 3 0 0 1 1
+117 1 3 2 2 2
+117 2 0 0 2 1
+117 3 0 0 1 1
+12 1 3 2 1 2
+12 2 0 0 2 1
+12 3 0 0 1 1
+13 1 3 2 1 2
+13 2 0 0 2 1
+13 3 0 0 1 1
+1334 1 10 11 1 2
+1334 10 0 0 1 1
+1334 11 0 0 2 1
+1334 12 0 0 1 1
+1334 13 0 0 2 1
+1334 2 12 13 2 2
+1340 1 9 10 1 2
+1340 10 0 0 2 1
+1340 11 0 0 1 1
+1340 12 0 0 2 1
+1340 2 11 12 2 2
+1340 9 0 0 1 1
+1341 1 11 12 1 1
+1341 11 0 0 1 1
+1341 12 0 0 2 1
+1341 13 0 0 1 1
+1341 14 0 0 2 1
+1341 2 13 14 2 1
+1344 1 12 13 1 1
+1344 12 0 0 1 1
+1344 13 0 0 2 1
+1345 12 0 0 1 1
diff -r 5d80e32d989b -r 28ec4708840f test-data/tinywga.map
--- a/test-data/tinywga.map Thu Oct 29 13:34:44 2009 -0400
+++ b/test-data/tinywga.map Thu Oct 29 17:57:30 2009 -0400
@@ -1,10 +1,25 @@
-22 rs5992809 16.5965 16596539
-22 rs12168131 16.6573 16657262
-22 rs390041 16.6629 16662916
-22 rs437633 16.6697 16669684
-22 rs450960 16.6909 16690858
-22 rs450975 16.6909 16690887
-22 rs451740 16.6912 16691174
-22 rs8139723 16.6917 16691696
-22 rs405490 16.6922 16692175
-22 rs415170 16.6935 16693517
+22 rs2283802 0 21784722
+22 rs2267000 0 21785366
+22 rs16997606 0 21794754
+22 rs4820537 0 21794810
+22 rs3788347 0 21797804
+22 rs756632 0 21799918
+22 rs4820539 0 21807970
+22 rs2283804 0 21820335
+22 rs2267006 0 21820990
+22 rs4822363 0 21821000
+22 rs5751592 0 21827674
+22 rs5759608 0 21832708
+22 rs5759612 0 21833170
+22 rs2267009 0 21860168
+22 rs2267010 0 21864366
+22 rs5759636 0 21868698
+22 rs2071436 0 21871488
+22 rs2267013 0 21875879
+22 rs6003566 0 21889806
+22 rs2256725 0 21892891
+22 rs12160770 0 21892925
+22 rs5751611 0 21896019
+22 rs762601 0 21898858
+22 rs2156921 0 21899063
+22 rs4822375 0 21905642
diff -r 5d80e32d989b -r 28ec4708840f test-data/tinywga.ped
--- a/test-data/tinywga.ped Thu Oct 29 13:34:44 2009 -0400
+++ b/test-data/tinywga.ped Thu Oct 29 17:57:30 2009 -0400
@@ -1,90 +1,40 @@
-CH18526 NA18526 0 0 2 1 C C A A C C G G C C C C C C C C A A C C
-CH18524 NA18524 0 0 1 1 C C A A C C G G C C C C C C C C A A C C
-CH18529 NA18529 0 0 2 1 C C A A T C A G T C T C T C C C G A G C
-CH18558 NA18558 0 0 1 1 C C A A C C G G C C C C C C C C A A C C
-CH18532 NA18532 0 0 2 1 C C A A C C G G C C C C C C C C A A C C
-CH18561 NA18561 0 0 1 1 C C A A C C G G T C C C T C C C G A G C
-CH18562 NA18562 0 0 1 1 C C G A T C A G T C C C T C C C G A G C
-CH18537 NA18537 0 0 2 2 C C A A T C A G C C C C C C C C A A C C
-CH18603 NA18603 0 0 1 2 C C G A T C A G C C C C C C C C A A C C
-CH18540 NA18540 0 0 2 1 C C A A C C G G C C C C C C C C A A C C
-CH18605 NA18605 0 0 1 1 C C A A T T A A C C C C C C C C A A C C
-CH18542 NA18542 0 0 2 1 C C G A T C G G C C C C C C C C A A C C
-CH18545 NA18545 0 0 2 1 C C G A T C A G T C C C T C C C G A G C
-CH18572 NA18572 0 0 1 2 C C A A T C A G C C C C C C C C A A G C
-CH18547 NA18547 0 0 2 2 C C G A T C A G T C C C T C C C G A G C
-CH18609 NA18609 0 0 1 1 C C A A C C G G C C C C C C C C A A C C
-CH18550 NA18550 0 0 2 1 C C G G T T A A T C C C T C T C G A G C
-CH18608 NA18608 0 0 1 1 C C G A T C G G C C C C C C C C A A C C
-CH18552 NA18552 0 0 2 1 C C A A C C G G C C C C C C C C A A C C
-CH18611 NA18611 0 0 1 1 C C G A T C A G T C C C T C C C G A G C
-CH18555 NA18555 0 0 2 1 C C A A C C G G C C C C C C C C A A C C
-CH18564 NA18564 0 0 2 2 C C A A T C G G C C C C C C C C A A C C
-CH18566 NA18566 0 0 2 1 C C A A T C A G C C C C C C T C A A C C
-CH18563 NA18563 0 0 1 1 C C A A C C G G C C C C C C C C A A C C
-CH18570 NA18570 0 0 2 1 C C A A T C A G T C T C T C C C G A G C
-CH18612 NA18612 0 0 1 2 C C A A T C A A T C T C T C C C G A G C
-CH18571 NA18571 0 0 2 1 C C A A T C A G C C C C C C C C A A C C
-CH18620 NA18620 0 0 1 1 C C A A C C G G T C T C T C C C G A G C
-CH18621 NA18621 0 0 1 1 C C G G T T A A T C C C T C C C G A G C
-CH18594 NA18594 0 0 2 1 C C A A T T A A C C C C C C C C A A G C
-CH18622 NA18622 0 0 1 2 C C A A C C G G C C C C C C C C A A C C
-CH18573 NA18573 0 0 2 2 C C A A T C A G C C C C C C C C A A C C
-CH18623 NA18623 0 0 1 1 C C G A T C G G C C C C C C C C A A C C
-CH18576 NA18576 0 0 2 1 C C A A C C G G C C C C C C C C A A C C
-CH18577 NA18577 0 0 2 1 C C A A T C A G C C C C C C C C A A G C
-CH18624 NA18624 0 0 1 1 C C A A T C A G C C C C C C C C A A C C
-CH18579 NA18579 0 0 2 1 C C A A T C A G T C T C T C T C G A G C
-CH18632 NA18632 0 0 1 2 C C A A C C G G C C C C C C C C A A C C
-CH18582 NA18582 0 0 2 1 C C A A C C G G C C C C C C C C A A C C
-CH18633 NA18633 0 0 1 1 C C G A T C G G C C C C C C C C A A C C
-CH18635 NA18635 0 0 1 2 C C A A T C G G C C C C C C C C A A C C
-CH18592 NA18592 0 0 2 1 C C A A C C G G C C C C C C C C A A C C
-CH18636 NA18636 0 0 1 1 C C A A T C A A T C T C T C C C G A G C
-CH18593 NA18593 0 0 2 2 C C A A C C G G T C T C T C C C G A G C
-CH18637 NA18637 0 0 1 1 C C A A T C A G T C T C T C C C G A G C
-JA18942 NA18942 0 0 2 2 C C A A C C A G C C C C C C C C A A C C
-JA18940 NA18940 0 0 1 2 C C A A T C A G C C C C C C C C A A G C
-JA18951 NA18951 0 0 2 2 C C G A T C A G C C C C C C C C A A C C
-JA18943 NA18943 0 0 1 2 C C A A C C G G C C C C C C C C A A C C
-JA18947 NA18947 0 0 2 2 C C G A T T A A C C C C C C C C A A G C
-JA18944 NA18944 0 0 1 2 C C A A T C A G T C T C T C C C G A G C
-JA18945 NA18945 0 0 1 2 C C A A C C G G C C C C C C C C A A C C
-JA18949 NA18949 0 0 2 2 C C G A T C G G C C C C C C C C A A C C
-JA18948 NA18948 0 0 1 2 C C G A T C G G C C C C C C C C A A C C
-JA18952 NA18952 0 0 1 2 C C A A T C A G C C C C C C C C A A C C
-JA18956 NA18956 0 0 2 2 C C A A C C A G T C T C T C C C G A G C
-JA18964 NA18964 0 0 2 2 C C A A T T A A C C C C C C C C A A G C
-JA18953 NA18953 0 0 1 1 C C A A T C A G C C C C C C T C A A C C
-JA18968 NA18968 0 0 2 2 C C A A C C G G C C C C C C C C A A C C
-JA18959 NA18959 0 0 1 2 C C G A T C G G C C C C C C C C A A C C
-JA18969 NA18969 0 0 2 1 C C A A C C G G C C C C C C C C A A C C
-JA18960 NA18960 0 0 1 2 C C A A T C A G T C T C T C C C G A G C
-JA18961 NA18961 0 0 1 2 C C A A C C A G C C C C C C C C A A C C
-JA18972 NA18972 0 0 2 2 C C G A T T A A T T T C T T C C G G G G
-JA18965 NA18965 0 0 1 2 C C A A T T A A C C C C C C C C A A C C
-JA18973 NA18973 0 0 2 2 C C A A C C G G C C C C C C T C A A C C
-JA18966 NA18966 0 0 1 2 C C G A T C A G T C C C T C C C G A G C
-JA18975 NA18975 0 0 2 2 C C A A C C G G C C C C C C C C A A G C
-JA18967 NA18967 0 0 1 2 C C A A C C G G C C C C C C C C A A G C
-JA18976 NA18976 0 0 2 1 C C A A C C G G C C C C C C C C A A C C
-JA18978 NA18978 0 0 2 2 C C G A T C G G C C C C C C C C A A C C
-JA18970 NA18970 0 0 1 1 C C G G T T A A T T C C T T C C G G G G
-JA18980 NA18980 0 0 2 2 C C A A T C A G T C T C T C C C G A G C
-JA18995 NA18995 0 0 1 1 C C A A T T A A C C C C C C C C A A G G
-JA18981 NA18981 0 0 2 2 C C A A T C A G C C C C C C C C A A G C
-JA18971 NA18971 0 0 1 2 C C A A C C G G C C C C C C C C A A C C
-JA18974 NA18974 0 0 1 1 C C A A C C G G C C C C C C C C A A C C
-JA18987 NA18987 0 0 2 2 C C A A C C G G C C C C C C C C A A C C
-JA18990 NA18990 0 0 1 1 C C A A T C G G C C C C C C C C A A G C
-JA18991 NA18991 0 0 2 2 C C A A C C G G C C C C C C C C A A C C
-JA18994 NA18994 0 0 1 2 C C G A T C A G C C C C C C C C A A G C
-JA18992 NA18992 0 0 2 2 C C A A T C A G C C C C C C T C A A C C
-JA18997 NA18997 0 0 2 2 C C A A C C G G C C C C C C C C A A C C
-JA18998 NA18998 0 0 2 2 C C A A C C G G C C C C C C T C A A C C
-JA19000 NA19000 0 0 1 2 C C A A C C G G C C C C C C C C A A C C
-JA19005 NA19005 0 0 1 2 C C A A C C G G C C C C C C C C A A G C
-JA18999 NA18999 0 0 2 2 C C A A T C A G C C C C C C C C A A C C
-JA19007 NA19007 0 0 1 2 C C A A T C A G C C C C C C C C A A G C
-JA19003 NA19003 0 0 2 2 C C A A T C G G C C C C C C C C A A C C
-JA19012 NA19012 0 0 1 2 C C A A 0 0 G G C C C C C C 0 0 A A C C
+101 1 3 2 2 2 2 2 4 2 1 3 3 3 3 3 2 2 3 3 1 2 3 1 2 2 2 2 2 4 3 1 4 4 1 1 2 2 2 2 3 1 3 1 2 1 0 0 2 2 1 3 3 1 1 3
+101 2 0 0 2 1 2 2 4 2 1 3 3 3 3 3 2 2 3 3 1 2 3 1 2 2 2 2 2 4 3 1 4 4 1 1 2 2 2 2 3 1 3 1 2 1 3 3 2 2 1 3 3 1 1 3
+101 3 0 0 1 1 2 2 4 4 1 3 3 3 3 3 2 2 3 3 2 2 1 1 2 2 2 2 4 4 1 1 4 4 1 1 2 2 2 2 1 1 3 1 1 1 1 3 2 4 3 3 1 1 3 3
+105 1 3 2 2 2 2 2 4 2 3 3 3 3 3 1 2 2 3 3 1 1 3 3 2 2 2 2 2 2 3 3 4 4 1 1 2 2 2 2 3 1 1 1 2 1 0 0 2 2 1 1 3 3 1 1
+105 2 0 0 2 1 2 2 4 4 3 3 3 3 3 1 2 2 1 3 1 2 3 1 2 2 4 2 2 4 3 1 4 4 1 1 2 2 2 2 1 1 1 1 1 1 3 3 2 4 1 3 3 1 1 3
+105 3 0 0 1 1 4 2 2 2 3 3 3 3 3 1 2 2 3 3 1 2 3 1 2 2 2 2 2 4 3 1 3 4 1 1 2 2 4 2 3 1 1 1 2 1 3 3 2 4 1 3 3 1 1 3
+112 1 3 2 1 2 4 2 2 2 3 3 1 1 1 1 2 2 3 3 1 2 3 1 2 2 2 2 2 4 3 1 3 4 1 1 2 2 4 2 1 1 1 1 1 1 3 3 4 4 3 3 1 1 3 3
+112 2 0 0 2 1 2 2 2 2 3 3 1 1 1 1 2 2 3 3 1 1 3 3 2 2 2 2 2 2 3 3 4 4 1 1 2 2 2 2 1 1 1 1 1 1 3 3 4 4 3 3 1 1 3 3
+112 3 0 0 1 1 4 2 4 2 3 3 1 3 3 1 2 2 1 3 2 2 1 1 2 2 4 2 4 4 1 1 3 4 1 1 2 2 4 2 1 1 1 1 1 1 3 3 2 4 1 3 3 1 1 3
+117 1 3 2 2 2 2 2 4 2 3 3 3 3 3 3 4 2 1 1 2 2 1 1 2 2 4 2 2 4 3 1 4 4 1 1 2 2 2 2 1 1 1 1 1 1 3 3 2 2 1 1 3 3 1 1
+117 2 0 0 2 1 2 2 4 4 1 3 3 3 3 3 2 2 1 3 2 2 1 1 2 2 4 2 4 4 1 1 4 4 1 1 2 2 2 2 1 1 1 1 1 1 3 3 2 4 1 3 3 1 1 3
+117 3 0 0 1 1 2 2 4 2 3 3 3 3 3 3 4 2 1 1 2 2 1 1 2 2 4 2 2 4 3 1 4 4 1 1 2 2 2 2 1 1 1 1 1 1 3 3 2 4 1 3 3 1 1 3
+12 1 3 2 1 2 2 2 4 4 1 3 3 3 3 3 2 2 3 3 2 2 1 1 2 2 2 2 4 4 1 1 4 4 1 1 2 2 2 2 1 1 3 1 1 1 3 3 2 4 3 3 1 1 3 3
+12 2 0 0 2 1 2 2 4 4 1 3 3 3 3 3 2 2 3 3 2 2 1 1 2 2 2 2 4 4 1 1 4 4 1 1 2 2 2 2 1 1 3 1 1 1 3 3 2 4 3 3 1 1 3 3
+12 3 0 0 1 1 2 2 4 2 1 3 1 3 3 1 2 2 3 3 1 2 3 1 2 2 2 2 2 4 3 1 4 4 1 1 2 2 2 2 1 1 3 1 1 1 3 3 2 4 3 3 1 1 3 3
+13 1 3 2 1 2 4 2 4 2 1 3 3 3 3 1 2 2 3 3 2 2 1 1 2 2 2 2 4 4 1 1 3 4 1 1 2 2 4 2 1 1 3 1 1 1 3 3 2 4 3 3 1 1 3 3
+13 2 0 0 2 1 4 2 2 2 3 3 1 3 1 1 2 2 3 3 1 2 3 1 2 2 2 2 2 4 3 1 3 4 1 1 2 2 4 2 1 1 1 1 1 1 0 0 0 0 3 3 1 1 3 3
+13 3 0 0 1 1 2 2 4 4 1 3 3 3 3 3 2 2 1 3 1 2 3 1 2 2 2 2 2 4 3 1 4 4 3 1 2 2 2 2 1 1 3 1 1 1 3 3 2 2 3 3 1 1 3 3
+1334 1 10 11 1 2 2 2 4 2 3 3 1 3 3 1 2 2 1 3 1 2 3 1 4 2 4 2 2 4 3 1 4 4 1 1 2 2 2 2 1 1 1 1 1 1 3 3 4 4 3 3 1 1 3 3
+1334 10 0 0 1 1 4 2 4 2 3 3 1 3 3 1 2 2 1 3 2 2 1 1 4 2 4 2 4 4 1 1 3 4 1 1 2 2 4 2 3 1 1 1 2 1 3 3 2 4 1 3 3 1 1 3
+1334 11 0 0 2 1 2 2 2 2 3 3 1 1 1 1 2 2 3 3 1 1 3 3 2 2 2 2 2 2 3 3 4 4 1 1 2 2 2 2 1 1 1 1 1 1 3 3 4 4 3 3 1 1 3 3
+1334 12 0 0 1 1 4 2 2 2 3 3 1 3 1 1 2 2 3 3 2 2 1 1 2 2 4 2 4 4 1 1 3 4 1 1 2 2 4 2 3 1 1 1 2 1 3 3 2 4 1 3 3 1 1 3
+1334 13 0 0 2 1 4 2 4 2 3 3 1 3 3 1 4 2 1 3 2 2 1 1 2 2 2 2 2 4 3 1 3 4 1 1 2 2 4 2 1 1 1 1 1 1 3 3 2 4 1 3 3 1 1 3
+1334 2 12 13 2 2 4 4 2 2 3 3 1 3 1 1 2 2 3 3 2 2 1 1 2 2 2 2 4 4 1 1 3 3 1 1 2 2 4 4 3 1 1 1 2 1 3 3 2 4 1 3 3 1 1 3
+1340 1 9 10 1 2 4 2 4 2 3 3 1 3 3 1 2 2 1 3 1 2 3 1 2 2 2 2 2 4 3 1 3 4 3 1 2 2 4 2 1 1 1 1 1 1 3 3 4 4 3 3 1 1 3 3
+1340 10 0 0 2 1 4 2 4 2 3 3 1 3 3 1 2 2 1 3 1 2 3 1 2 2 2 2 2 4 3 1 3 4 3 1 2 2 4 2 1 1 1 1 1 1 3 3 4 4 3 3 1 1 3 3
+1340 11 0 0 1 1 4 2 4 2 3 3 1 3 3 1 4 2 1 3 2 2 1 1 2 2 2 2 2 4 3 1 3 4 1 1 2 2 4 2 1 1 1 1 1 1 3 3 2 4 1 3 3 1 1 3
+1340 12 0 0 2 1 2 2 4 2 3 3 1 3 3 1 2 2 1 3 1 2 3 1 4 2 4 2 2 4 3 1 4 4 1 1 4 2 2 2 1 1 1 1 1 1 3 3 2 4 1 3 3 1 1 3
+1340 2 11 12 2 2 2 2 4 2 3 3 1 3 3 1 4 2 1 3 1 2 3 1 2 2 2 2 2 2 3 3 4 4 1 1 2 2 2 2 1 1 1 1 1 1 3 3 2 4 1 3 3 1 1 3
+1340 9 0 0 1 1 4 4 2 2 3 3 1 1 1 1 2 2 3 3 2 2 1 1 2 2 2 2 4 4 1 1 3 3 1 1 2 2 4 4 1 1 1 1 1 1 3 3 4 4 3 3 1 1 3 3
+1341 1 11 12 1 1 2 2 4 2 3 3 1 3 3 1 2 2 1 3 1 2 3 1 4 2 4 2 2 4 3 1 4 4 1 1 0 0 2 2 1 1 1 1 1 1 3 3 2 2 1 1 3 3 1 1
+1341 11 0 0 1 1 2 2 2 2 3 3 1 1 1 1 2 2 3 3 1 1 3 3 2 2 2 2 2 2 3 3 4 4 1 1 4 2 2 2 1 1 1 1 1 1 3 3 2 4 1 3 3 1 1 3
+1341 12 0 0 2 1 4 2 4 2 3 3 1 3 3 1 2 2 1 3 2 2 1 1 4 2 4 2 4 4 1 1 3 4 1 1 4 2 4 2 3 1 1 1 2 1 3 3 2 2 1 1 3 3 1 1
+1341 13 0 0 1 1 4 2 2 2 3 3 1 1 1 1 2 2 3 3 1 2 3 1 2 2 2 2 2 4 3 1 3 4 1 1 2 2 4 2 1 1 1 1 1 1 3 3 4 4 3 3 1 1 3 3
+1341 14 0 0 2 1 4 2 2 2 3 3 1 1 1 1 2 2 3 3 1 2 3 1 2 2 2 2 2 4 3 1 3 4 1 1 2 2 4 2 1 1 1 1 1 1 3 3 4 4 3 3 1 1 3 3
+1341 2 13 14 2 1 4 2 2 2 3 3 1 1 1 1 2 2 3 3 1 2 3 1 2 2 2 2 2 4 3 1 3 4 1 1 2 2 4 2 1 1 1 1 1 1 3 3 4 4 3 3 1 1 3 3
+1344 1 12 13 1 1 2 2 4 4 3 3 3 3 3 3 4 4 1 1 2 2 1 1 2 2 2 2 2 2 3 3 4 4 1 1 2 2 2 2 1 1 1 1 1 1 3 3 2 2 1 1 3 3 1 1
+1344 12 0 0 1 1 2 2 4 2 3 3 1 3 3 1 4 2 1 3 1 2 3 1 2 2 2 2 2 2 3 3 4 4 1 1 2 2 2 2 1 1 1 1 1 1 3 3 2 4 1 3 3 1 1 3
+1344 13 0 0 2 1 2 2 4 2 3 3 1 3 3 1 4 2 1 3 1 2 3 1 2 2 2 2 2 2 3 3 4 4 1 1 2 2 2 2 1 1 1 1 1 1 3 3 2 4 1 3 3 1 1 3
+1345 12 0 0 1 1 4 2 4 2 3 3 3 3 3 1 2 2 1 3 2 2 1 1 4 2 4 2 4 4 1 1 3 4 1 1 4 2 4 2 3 1 1 1 2 1 3 3 2 2 1 1 3 3 1 1
diff -r 5d80e32d989b -r 28ec4708840f test-data/tinywga.pphe
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/tinywga.pphe Thu Oct 29 17:57:30 2009 -0400
@@ -0,0 +1,42 @@
+FID IID c1 c2
+101 1 0.545103 0.918463
+101 2 0.491123 0.309616
+101 3 0.651988 0.048298
+105 1 0.424657 0.853486
+105 2 0.813036 0.767600
+105 3 0.042279 0.786226
+112 1 0.538062 0.116152
+112 2 0.038197 0.911567
+112 3 0.991881 0.647654
+117 1 0.553303 0.672842
+117 2 0.231171 0.197314
+117 3 0.245332 0.517846
+12 1 0.311838 0.108011
+12 2 0.764390 0.968887
+12 3 0.393993 0.857926
+13 1 0.291201 0.288068
+13 2 0.113351 0.782368
+13 3 0.130878 0.927257
+1334 1 0.539897 0.932499
+1334 10 0.204083 0.893518
+1334 11 0.441118 0.900758
+1334 12 0.325336 0.271307
+1334 13 0.910762 0.636606
+1334 2 0.630607 0.537458
+1340 1 0.598157 0.813064
+1340 10 0.162311 0.956523
+1340 11 0.891147 0.987962
+1340 12 0.302027 0.786424
+1340 2 0.375225 0.338616
+1340 9 0.691503 0.965552
+1341 1 0.971333 0.115437
+1341 11 0.171352 0.873480
+1341 12 0.778930 0.179902
+1341 13 0.092468 0.050435
+1341 14 0.898538 0.913943
+1341 2 0.969939 0.086483
+1344 1 0.318008 0.376770
+1344 12 0.290673 0.870879
+1344 13 0.716322 0.087859
+1345 12 0.886441 0.717204
+
1
0

07 Nov '09
details: http://www.bx.psu.edu/hg/galaxy/rev/fabb2f6abc45
changeset: 2928:fabb2f6abc45
user: James Taylor <james(a)jamestaylor.org>
date: Wed Oct 28 15:09:05 2009 -0400
description:
Specify color for feature tracks in one place (eventually should be configurable)
diffstat:
static/scripts/trackster.js | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diffs (51 lines):
diff -r edb48f2816b5 -r fabb2f6abc45 static/scripts/trackster.js
--- a/static/scripts/trackster.js Tue Oct 27 22:34:30 2009 -0400
+++ b/static/scripts/trackster.js Wed Oct 28 15:09:05 2009 -0400
@@ -240,10 +240,10 @@
var min_label = $("<div class='yaxislabel'>" + track.min_value + "</div>");
var max_label = $("<div class='yaxislabel'>" + track.max_value + "</div>");
- max_label.css({ position: "relative", top: "20px" });
+ max_label.css({ position: "relative", top: "35px" });
max_label.prependTo(track.container_div)
- min_label.css({ position: "relative", top: track.height_px + 50 + "px", });
+ min_label.css({ position: "relative", top: track.height_px + 32 + "px", });
min_label.prependTo(track.container_div);
track.draw();
@@ -324,6 +324,7 @@
this.show_labels_scale = 0.001;
this.showing_labels = false;
this.vertical_gap = 10;
+ this.base_color = "#2C3143";
};
$.extend( FeatureTrack.prototype, TiledTrack.prototype, {
init: function() {
@@ -427,7 +428,7 @@
new_canvas.get(0).height = height;
// console.log(( tile_low - this.view.low ) * w_scale, tile_index, w_scale);
var ctx = new_canvas.get(0).getContext("2d");
- ctx.fillStyle = "#000";
+ ctx.fillStyle = this.base_color;
ctx.font = "10px monospace";
ctx.textAlign = "right";
@@ -462,7 +463,7 @@
ctx.fillStyle = LEFT_STRAND;
}
ctx.fillRect(f_start, y_center, f_end - f_start, 10);
- ctx.fillStyle = "#000";
+ ctx.fillStyle = this.base_color;
}
for (var k = 0, k_len = blocks.length; k < k_len; k++) {
@@ -497,7 +498,7 @@
ctx.fillStyle = LEFT_STRAND_INV;
}
ctx.fillRect(f_start, y_center, f_end - f_start, 10);
- ctx.fillStyle = "#000";
+ ctx.fillStyle = this.base_color;
}
}
}
1
0
details: http://www.bx.psu.edu/hg/galaxy/rev/86cc0b2b9e09
changeset: 2931:86cc0b2b9e09
user: James Taylor <james(a)jamestaylor.org>
date: Thu Oct 29 10:06:11 2009 -0400
description:
Fix page migration for mysql
diffstat:
lib/galaxy/model/migrate/versions/0024_page_slug_unique_constraint.py | 17 ++++++--
1 files changed, 13 insertions(+), 4 deletions(-)
diffs (29 lines):
diff -r 1aafea08f0e8 -r 86cc0b2b9e09 lib/galaxy/model/migrate/versions/0024_page_slug_unique_constraint.py
--- a/lib/galaxy/model/migrate/versions/0024_page_slug_unique_constraint.py Thu Oct 29 09:25:52 2009 -0400
+++ b/lib/galaxy/model/migrate/versions/0024_page_slug_unique_constraint.py Thu Oct 29 10:06:11 2009 -0400
@@ -21,12 +21,21 @@
Page_table = Table( "page", metadata, autoload=True )
- i = Index( "ix_page_slug", Page_table.c.slug )
- i.drop()
+ try:
+
+ # Sqlite doesn't support .alter, so we need to drop an recreate
- i = Index( "ix_page_slug", Page_table.c.slug, unique=False )
- i.create()
+ i = Index( "ix_page_slug", Page_table.c.slug )
+ i.drop()
+
+ i = Index( "ix_page_slug", Page_table.c.slug, unique=False )
+ i.create()
+ except:
+
+ # Mysql doesn't have a named index, but alter should work
+
+ Page_table.c.slug.alter( unique=False )
def downgrade():
metadata.reflect()
1
0

07 Nov '09
details: http://www.bx.psu.edu/hg/galaxy/rev/1aafea08f0e8
changeset: 2930:1aafea08f0e8
user: Dan Blankenberg <dan(a)bx.psu.edu>
date: Thu Oct 29 09:25:52 2009 -0400
description:
Fix for Nate's get_platform monkey patch.
diffstat:
lib/galaxy/__init__.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diffs (12 lines):
diff -r a9426ddbe468 -r 1aafea08f0e8 lib/galaxy/__init__.py
--- a/lib/galaxy/__init__.py Wed Oct 28 15:09:10 2009 -0400
+++ b/lib/galaxy/__init__.py Thu Oct 29 09:25:52 2009 -0400
@@ -12,7 +12,7 @@
import os, sys
from distutils.sysconfig import get_config_vars
-if ( os.uname()[-1] in ( 'i386', 'ppc' ) and sys.platform == 'darwin' and sys.prefix.startswith( '/System' ) ) or \
+if ( os.uname()[-1] in ( 'i386', 'ppc' ) and sys.platform == 'darwin' and os.path.abspath( sys.prefix ).startswith( '/System' ) ) or \
( sys.platform == 'darwin' and get_config_vars().get('UNIVERSALSDK', '').strip() ):
# Has to be before anything imports pkg_resources
def _get_platform_monkeypatch():
1
0

07 Nov '09
details: http://www.bx.psu.edu/hg/galaxy/rev/a9426ddbe468
changeset: 2929:a9426ddbe468
user: James Taylor <james(a)jamestaylor.org>
date: Wed Oct 28 15:09:10 2009 -0400
description:
Pages can now be deleted. Pages have a 'published' attribute that determines whether they are publicly accessible. There is now a list of all published pages from all users
diffstat:
lib/galaxy/model/mapping.py | 2 +
lib/galaxy/model/migrate/versions/0023_page_published_and_deleted_columns.py | 35 ++
lib/galaxy/model/migrate/versions/0024_page_slug_unique_constraint.py | 34 ++
lib/galaxy/web/controllers/page.py | 141 +++++++-
lib/galaxy/web/framework/helpers/grids.py | 2 +-
templates/base_panels.mako | 3 +
6 files changed, 194 insertions(+), 23 deletions(-)
diffs (332 lines):
diff -r fabb2f6abc45 -r a9426ddbe468 lib/galaxy/model/mapping.py
--- a/lib/galaxy/model/mapping.py Wed Oct 28 15:09:05 2009 -0400
+++ b/lib/galaxy/model/mapping.py Wed Oct 28 15:09:10 2009 -0400
@@ -545,6 +545,8 @@
ForeignKey( "page_revision.id", use_alter=True, name='page_latest_revision_id_fk' ), index=True ),
Column( "title", TEXT ),
Column( "slug", TEXT, unique=True, index=True ),
+ Column( "published", Boolean, index=True, default=False ),
+ Column( "deleted", Boolean, index=True, default=False ),
)
PageRevision.table = Table( "page_revision", metadata,
diff -r fabb2f6abc45 -r a9426ddbe468 lib/galaxy/model/migrate/versions/0023_page_published_and_deleted_columns.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/galaxy/model/migrate/versions/0023_page_published_and_deleted_columns.py Wed Oct 28 15:09:10 2009 -0400
@@ -0,0 +1,35 @@
+"""
+Migration script to add columns for tracking whether pages are deleted and
+publicly accessible.
+"""
+
+from sqlalchemy import *
+from migrate import *
+from migrate.changeset import *
+
+import logging
+log = logging.getLogger( __name__ )
+
+metadata = MetaData( migrate_engine )
+
+def upgrade():
+
+ print __doc__
+ metadata.reflect()
+
+ Page_table = Table( "page", metadata, autoload=True )
+
+ c = Column( "published", Boolean, index=True, default=False )
+ c.create( Page_table )
+ assert c is Page_table.c.published
+
+ c = Column( "deleted", Boolean, index=True, default=False )
+ c.create( Page_table )
+ assert c is Page_table.c.deleted
+
+def downgrade():
+ metadata.reflect()
+
+ Page_table = Table( "page", metadata, autoload=True )
+ Page_table.c.published.drop()
+ Page_table.c.deleted.drop()
diff -r fabb2f6abc45 -r a9426ddbe468 lib/galaxy/model/migrate/versions/0024_page_slug_unique_constraint.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/galaxy/model/migrate/versions/0024_page_slug_unique_constraint.py Wed Oct 28 15:09:10 2009 -0400
@@ -0,0 +1,34 @@
+"""
+Remove unique constraint from page slugs to allow creating a page with
+the same slug as a deleted page.
+"""
+
+from sqlalchemy import *
+from migrate import *
+from migrate.changeset import *
+
+import datetime
+now = datetime.datetime.utcnow
+
+import logging
+log = logging.getLogger( __name__ )
+
+metadata = MetaData( migrate_engine )
+
+def upgrade():
+ print __doc__
+ metadata.reflect()
+
+ Page_table = Table( "page", metadata, autoload=True )
+
+ i = Index( "ix_page_slug", Page_table.c.slug )
+ i.drop()
+
+ i = Index( "ix_page_slug", Page_table.c.slug, unique=False )
+ i.create()
+
+
+def downgrade():
+ metadata.reflect()
+ #Page_table = Table( "page", metadata, autoload=True )
+ #Page_table.c.slug.alter( unique=True )
diff -r fabb2f6abc45 -r a9426ddbe468 lib/galaxy/web/controllers/page.py
--- a/lib/galaxy/web/controllers/page.py Wed Oct 28 15:09:05 2009 -0400
+++ b/lib/galaxy/web/controllers/page.py Wed Oct 28 15:09:10 2009 -0400
@@ -6,16 +6,27 @@
VALID_SLUG_RE = re.compile( "^[a-z0-9\-]+$" )
+def format_bool( b ):
+ if b:
+ return "yes"
+ else:
+ return ""
+
+class PublicURLColumn( grids.GridColumn ):
+ def get_value( self, trans, grid, item ):
+ username = trans.user.username or "???"
+ return username + "/" + item.slug
+ def get_link( self, trans, grid, item ):
+ if trans.user.username:
+ return dict( action='display_by_username_and_slug', username=item.user.username, slug=item.slug )
+ else:
+ return None
+
+class OwnerColumn( grids.GridColumn ):
+ def get_value( self, trans, grid, item ):
+ return item.user.username
+
class PageListGrid( grids.Grid ):
- class URLColumn( grids.GridColumn ):
- def get_value( self, trans, grid, item ):
- username = trans.user.username or "???"
- return username + "/" + item.slug
- def get_link( self, trans, grid, item ):
- if trans.user.username:
- return dict( action='display_by_username_and_slug', username=item.user.username, slug=item.slug )
- else:
- return None
# Grid definition
use_panels = True
title = "Your pages"
@@ -23,7 +34,8 @@
default_sort_key = "-create_time"
columns = [
grids.GridColumn( "Title", key="title", attach_popup=True ),
- URLColumn( "Public URL" ),
+ PublicURLColumn( "Public URL" ),
+ grids.GridColumn( "Published", key="published", format=format_bool ),
grids.GridColumn( "Created", key="create_time", format=time_ago ),
grids.GridColumn( "Last Updated", key="update_time", format=time_ago ),
]
@@ -32,25 +44,67 @@
]
operations = [
grids.GridOperation( "View", allow_multiple=False, url_args=dict( action='display') ),
- grids.GridOperation( "Edit", allow_multiple=False, url_args=dict( action='edit') )
+ grids.GridOperation( "Edit name/id", allow_multiple=False, url_args=dict( action='edit') ),
+ grids.GridOperation( "Edit content", allow_multiple=False, url_args=dict( action='edit_content') ),
+ grids.GridOperation( "Delete" ),
+ grids.GridOperation( "Publish", condition=( lambda item: not item.published ) ),
+ grids.GridOperation( "Unpublish", condition=( lambda item: item.published ) ),
]
def apply_default_filter( self, trans, query, **kwargs ):
- return query.filter_by( user=trans.user )
+ return query.filter_by( user=trans.user, deleted=False )
+
+class PageAllPublishedGrid( grids.Grid ):
+ # Grid definition
+ use_panels = True
+ title = "Published pages from all users"
+ model_class = model.Page
+ default_sort_key = "-create_time"
+ columns = [
+ grids.GridColumn( "Title", key="title" ),
+ PublicURLColumn( "Public URL" ),
+ OwnerColumn( "Published by" ),
+ grids.GridColumn( "Created", key="create_time", format=time_ago ),
+ grids.GridColumn( "Last Updated", key="update_time", format=time_ago ),
+ ]
+ def apply_default_filter( self, trans, query, **kwargs ):
+ return query.filter_by( deleted=False, published=True )
class PageController( BaseController ):
- list = PageListGrid()
+ _page_list = PageListGrid()
+ _all_published_list = PageAllPublishedGrid()
@web.expose
- @web.require_admin
+ @web.require_login()
def index( self, trans, *args, **kwargs ):
+ # Handle operation
+ if 'operation' in kwargs and 'id' in kwargs:
+ session = trans.sa_session
+ operation = kwargs['operation']
+ ids = util.listify( kwargs['id'] )
+ for id in ids:
+ item = session.query( model.Page ).get( trans.security.decode_id( id ) )
+ if operation == "Delete":
+ item.deleted = True
+ elif operation == "Publish":
+ item.published = True
+ elif operation == "Unpublish":
+ item.published = False
+ session.flush()
# Build grid
- grid = self.list( trans, *args, **kwargs )
+ grid = self._page_list( trans, *args, **kwargs )
# Render grid wrapped in panels
return trans.fill_template( "page/index.mako", grid=grid )
@web.expose
- @web.require_admin
+ @web.require_login()
+ def list_published( self, trans, *args, **kwargs ):
+ grid = self._all_published_list( trans, *args, **kwargs )
+ # Render grid wrapped in panels
+ return trans.fill_template( "page/index.mako", grid=grid )
+
+
+ @web.expose
@web.require_login( "create pages" )
def create( self, trans, page_title="", page_slug="" ):
"""
@@ -65,7 +119,7 @@
page_slug_err = "Page id is required"
elif not VALID_SLUG_RE.match( page_slug ):
page_slug_err = "Page identifier must consist of only lowercase letters, numbers, and the '-' character"
- elif trans.sa_session.query( model.Page ).filter_by( user=user, slug=page_slug ).first():
+ elif trans.sa_session.query( model.Page ).filter_by( user=user, slug=page_slug, deleted=False ).first():
page_slug_err = "Page id must be unique"
else:
# Create the new stored workflow
@@ -98,9 +152,50 @@
template="page/create.mako" )
@web.expose
- @web.require_admin
+ @web.require_login( "create pages" )
+ def edit( self, trans, id, page_title="", page_slug="" ):
+ """
+ Create a new page
+ """
+ encoded_id = id
+ id = trans.security.decode_id( id )
+ session = trans.sa_session
+ page = session.query( model.Page ).get( id )
+ user = trans.user
+ assert page.user == user
+ page_title_err = page_slug_err = ""
+ if trans.request.method == "POST":
+ if not page_title:
+ page_title_err = "Page name is required"
+ elif not page_slug:
+ page_slug_err = "Page id is required"
+ elif not VALID_SLUG_RE.match( page_slug ):
+ page_slug_err = "Page identifier must consist of only lowercase letters, numbers, and the '-' character"
+ elif page_slug == page.slug or trans.sa_session.query( model.Page ).filter_by( user=user, slug=page_slug, deleted=False ).first():
+ page_slug_err = "Page id must be unique"
+ else:
+ page.title = page_title
+ page.slug = page_slug
+ session.flush()
+ # Display the management page
+ return trans.response.send_redirect( web.url_for( action='index' ) )
+ else:
+ page_title = page.title
+ page_slug = page.slug
+ return trans.show_form(
+ web.FormBuilder( web.url_for( id=encoded_id ), "Edit page attributes", submit_text="Submit" )
+ .add_text( "page_title", "Page title", value=page_title, error=page_title_err )
+ .add_text( "page_slug", "Page identifier", value=page_slug, error=page_slug_err,
+ help="""A unique identifier that will be used for
+ public links to this page. A default is generated
+ from the page title, but can be edited. This field
+ must contain only lowercase letters, numbers, and
+ the '-' character.""" ),
+ template="page/create.mako" )
+
+ @web.expose
@web.require_login( "edit pages" )
- def edit( self, trans, id ):
+ def edit_content( self, trans, id ):
"""
Render the main page editor interface.
"""
@@ -110,7 +205,7 @@
return trans.fill_template( "page/editor.mako", page=page )
@web.expose
- @web.require_admin
+ @web.require_login()
def save( self, trans, id, content ):
id = trans.security.decode_id( id )
page = trans.sa_session.query( model.Page ).get( id )
@@ -126,10 +221,12 @@
trans.sa_session.flush()
@web.expose
- @web.require_admin
+ @web.require_login()
def display( self, trans, id ):
id = trans.security.decode_id( id )
page = trans.sa_session.query( model.Page ).get( id )
+ if page.user is not trans.user:
+ error( "Page is not owned by current user" )
return trans.fill_template( "page/display.mako", page=page )
@web.expose
@@ -138,7 +235,7 @@
user = session.query( model.User ).filter_by( username=username ).first()
if user is None:
raise web.httpexceptions.HTTPNotFound()
- page = trans.sa_session.query( model.Page ).filter_by( user=user, slug=slug ).first()
+ page = trans.sa_session.query( model.Page ).filter_by( user=user, slug=slug, deleted=False, published=True ).first()
if page is None:
raise web.httpexceptions.HTTPNotFound()
return trans.fill_template( "page/display.mako", page=page )
diff -r fabb2f6abc45 -r a9426ddbe468 lib/galaxy/web/framework/helpers/grids.py
--- a/lib/galaxy/web/framework/helpers/grids.py Wed Oct 28 15:09:05 2009 -0400
+++ b/lib/galaxy/web/framework/helpers/grids.py Wed Oct 28 15:09:10 2009 -0400
@@ -279,7 +279,7 @@
temp['id'] = item.id
return temp
else:
- return dict( operation=operation.label, id=item.id )
+ return dict( operation=self.label, id=item.id )
def allowed( self, item ):
if self.condition:
diff -r fabb2f6abc45 -r a9426ddbe468 templates/base_panels.mako
--- a/templates/base_panels.mako Wed Oct 28 15:09:05 2009 -0400
+++ b/templates/base_panels.mako Wed Oct 28 15:09:10 2009 -0400
@@ -243,6 +243,9 @@
<li><hr style="color: inherit; background-color: gray"/></li>
<li><a target="galaxy_main" href="${h.url_for( controller='history', action='list' )}">Histories</a></li>
<li><a target="galaxy_main" href="${h.url_for( controller='dataset', action='list' )}">Datasets</a></li>
+ %if app.config.get_bool( 'enable_pages', False ):
+ <li><a href="${h.url_for( controller='page' )}">Pages</a></li>
+ %endif
%endif
</ul>
</div>
1
0

07 Nov '09
details: http://www.bx.psu.edu/hg/galaxy/rev/edb48f2816b5
changeset: 2927:edb48f2816b5
user: Kanwei Li <kanwei(a)gmail.com>
date: Tue Oct 27 22:34:30 2009 -0400
description:
trackster: y-axis labels for linetracks, thin/thick blocks are correct for featuretracks, messages when data is loading and being indexed
diffstat:
lib/galaxy/visualization/tracks/data/interval_index.py | 4 +-
static/scripts/trackster.js | 171 ++++++++++++---------
static/trackster.css | 10 +
templates/tracks/browser.mako | 4 -
4 files changed, 110 insertions(+), 79 deletions(-)
diffs (326 lines):
diff -r ea0342f2df03 -r edb48f2816b5 lib/galaxy/visualization/tracks/data/interval_index.py
--- a/lib/galaxy/visualization/tracks/data/interval_index.py Tue Oct 27 15:11:41 2009 -0400
+++ b/lib/galaxy/visualization/tracks/data/interval_index.py Tue Oct 27 22:34:30 2009 -0400
@@ -35,8 +35,8 @@
pass
try:
- payload['exon_start'] = int(feature[6])
- payload['exon_end'] = int(feature[7])
+ payload['thick_start'] = int(feature[6])
+ payload['thick_end'] = int(feature[7])
except IndexError:
pass
diff -r ea0342f2df03 -r edb48f2816b5 static/scripts/trackster.js
--- a/static/scripts/trackster.js Tue Oct 27 15:11:41 2009 -0400
+++ b/static/scripts/trackster.js Tue Oct 27 22:34:30 2009 -0400
@@ -5,6 +5,8 @@
var DENSITY = 1000,
DATA_ERROR = "There was an error in indexing this dataset.",
DATA_NONE = "No data for this chrom/contig.",
+ DATA_PENDING = "Currently indexing... please wait",
+ DATA_LOADING = "Loading data...",
CACHED_TILES = 50,
CACHED_DATA = 20,
CONTEXT = $("<canvas></canvas>").get(0).getContext("2d"),
@@ -34,11 +36,11 @@
function commatize( number ) {
number += ''; // Convert to string
- var rgx = /(\d+)(\d{3})/;
- while (rgx.test(number)) {
- number = number.replace(rgx, '$1' + ',' + '$2');
- }
- return number;
+ var rgx = /(\d+)(\d{3})/;
+ while (rgx.test(number)) {
+ number = number.replace(rgx, '$1' + ',' + '$2');
+ }
+ return number;
}
var View = function( chrom, max_high ) {
this.chrom = chrom;
@@ -88,7 +90,7 @@
$("#viewport").append('<div id="bottom-spacer" style="height: 200px;"></div>');
},
zoom_in: function ( point ) {
- if (this.max_high === 0 || this.high - this.low < 5) {
+ if (this.max_high === 0 || this.high - this.low < 30) {
return;
}
@@ -96,6 +98,7 @@
this.center = point / $(document).width() * (this.high - this.low) + this.low;
}
this.zoom_level += 1;
+ this.redraw();
},
zoom_out: function () {
if (this.max_high === 0) {
@@ -106,6 +109,7 @@
return;
}
this.zoom_level -= 1;
+ this.redraw();
}
});
@@ -137,13 +141,13 @@
resolution = Math.max( resolution, 1 );
resolution = Math.min( resolution, 100000 );
- var parent_element = $("<div style='position: relative;'></div>");
+ var parent_element = $("<div style='position: relative;'></div>");
this.content_div.children( ":first" ).remove();
this.content_div.append( parent_element );
var w = this.content_div.width(),
h = this.content_div.height(),
- w_scale = w / range;
+ w_scale = w / range;
var tile_element;
// Index of first tile that overlaps visible region
@@ -211,21 +215,38 @@
$.extend( LineTrack.prototype, TiledTrack.prototype, {
init: function() {
var track = this;
+ track.content_div.text(DATA_LOADING);
$.getJSON( data_url, { stats: true, track_type: track.track_type,
chrom: track.view.chrom, low: null, high: null,
dataset_id: track.dataset_id }, function ( data ) {
if (!data || data == "error") {
track.container_div.addClass("error");
- track.content_div.text(DATA_ERROR);
+ track.content_div.text(DATA_ERROR);
} else if (data == "no data") {
track.container_div.addClass("nodata");
- track.content_div.text(DATA_NONE);
+ track.content_div.text(DATA_NONE);
+ } else if (data == "pending") {
+ track.container_div.addClass("pending");
+ track.content_div.text(DATA_PENDING);
+ setTimeout(function() { track.init(); }, 5000);
} else {
+ track.content_div.text("");
track.content_div.css( "height", track.height_px + "px" );
track.min_value = data.min;
track.max_value = data.max;
track.vertical_range = track.max_value - track.min_value;
- track.view.redraw();
+
+ // Draw y-axis labels
+ var min_label = $("<div class='yaxislabel'>" + track.min_value + "</div>");
+ var max_label = $("<div class='yaxislabel'>" + track.max_value + "</div>");
+
+ max_label.css({ position: "relative", top: "20px" });
+ max_label.prependTo(track.container_div)
+
+ min_label.css({ position: "relative", top: track.height_px + 50 + "px", });
+ min_label.prependTo(track.container_div);
+
+ track.draw();
}
});
},
@@ -307,16 +328,22 @@
$.extend( FeatureTrack.prototype, TiledTrack.prototype, {
init: function() {
var track = this;
+ track.content_div.text(DATA_LOADING);
$.getJSON( data_url, { track_type: track.track_type, low: track.view.max_low,
high: track.view.max_high, dataset_id: track.dataset_id,
chrom: track.view.chrom }, function ( data ) {
if (data == "error") {
track.container_div.addClass("error");
- track.content_div.text(DATA_ERROR);
+ track.content_div.text(DATA_ERROR);
} else if (data.length === 0 || data == "no data") {
track.container_div.addClass("nodata");
- track.content_div.text(DATA_NONE);
+ track.content_div.text(DATA_NONE);
+ } else if (data == "pending") {
+ track.container_div.addClass("pending");
+ track.content_div.text(DATA_PENDING);
+ setTimeout(function() { track.init(); }, 5000);
} else {
+ track.content_div.text("");
track.content_div.css( "height", track.height_px + "px" );
track.values = data;
track.calc_slots();
@@ -412,68 +439,66 @@
f_end = Math.ceil( Math.min(width, (feature.end - tile_low) * w_scale) ),
y_center = this.slots[feature.name] * this.vertical_gap;
- if (feature.strand && this.showing_labels) {
- if (feature.strand == "+") {
- ctx.fillStyle = RIGHT_STRAND;
- } else if (feature.strand == "-") {
- ctx.fillStyle = LEFT_STRAND;
+ var thickness, y_start, thick_start = null, thick_end = null;
+ if (feature.thick_start && feature.thick_end) {
+ thick_start = Math.floor( Math.max(0, (feature.thick_start - tile_low) * w_scale) );
+ thick_end = Math.ceil( Math.min(width, (feature.thick_end - tile_low) * w_scale) );
+ }
+ if (!this.showing_labels) {
+ // Non-detail levels
+ ctx.fillRect(f_start, y_center + 5, f_end - f_start, 1);
+ } else {
+ // Showing labels, blocks, details
+ if (ctx.fillText) {
+ ctx.fillText(feature.name, f_start - 1, y_center + 8);
}
- ctx.fillRect(f_start, y_center, f_end - f_start, 10);
- ctx.fillStyle = "#000";
- } else {
- ctx.fillStyle = "#000";
- ctx.fillRect(f_start, y_center + 5, f_end - f_start, 1);
- }
-
- if (this.showing_labels && ctx.fillText) {
- ctx.fillText(feature.name, f_start - 1, y_center + 8);
- }
-
- // If there is no thickStart/thickEnd, draw the whole thing
- // as thick.
- var exon_start, exon_end;
- if (feature.exon_start && feature.exon_end) {
- exon_start = Math.floor( Math.max(0, (feature.exon_start - tile_low) * w_scale) );
- exon_end = Math.ceil( Math.min(width, (feature.exon_end - tile_low) * w_scale) );
- } else {
- exon_start = Math.floor( Math.max(0, (feature.start - tile_low) * w_scale) );
- exon_end = Math.ceil( Math.min(width, (feature.end - tile_low) * w_scale) );
- }
-
- if (this.showing_labels) {
- // If there are no blocks, we treat the feature as one
- // big exon
- var blocks = feature.blocks;
- var arrows_in_blocks = false;
- if ( ! blocks ) {
- blocks = [[feature.start,feature.end]];
- arrows_in_blocks = true
- }
- for (var k = 0, k_len = blocks.length; k < k_len; k++) {
- var block = blocks[k],
- block_start = Math.floor( Math.max(0, (block[0] - tile_low) * w_scale) ),
- block_end = Math.ceil( Math.min(width, (block[1] - tile_low) * w_scale) );
- var thickness, y_start;
- if (exon_start && block_start >= exon_start && block_end <= exon_end) {
- thickness = 9;
- y_start = 1;
- ctx.fillRect(block_start, y_center + y_start, block_end - block_start, thickness);
- if ( feature.strand && arrows_in_blocks ) {
- if (feature.strand == "+") {
- ctx.fillStyle = RIGHT_STRAND_INV;
- } else if (feature.strand == "-") {
- ctx.fillStyle = LEFT_STRAND_INV;
- }
- ctx.fillRect(block_start, y_center, block_end - block_start, 10);
- ctx.fillStyle = "#000";
- }
- } else {
- thickness = 5;
- y_start = 3;
- ctx.fillRect(block_start, y_center + y_start, block_end - block_start, thickness);
- }
+ var blocks = feature.blocks;
+ if (blocks) {
+ // Draw introns
+ if (feature.strand) {
+ if (feature.strand == "+") {
+ ctx.fillStyle = RIGHT_STRAND;
+ } else if (feature.strand == "-") {
+ ctx.fillStyle = LEFT_STRAND;
+ }
+ ctx.fillRect(f_start, y_center, f_end - f_start, 10);
+ ctx.fillStyle = "#000";
+ }
- // console.log(block_start, block_end);
+ for (var k = 0, k_len = blocks.length; k < k_len; k++) {
+ var block = blocks[k],
+ block_start = Math.floor( Math.max(0, (block[0] - tile_low) * w_scale) ),
+ block_end = Math.ceil( Math.min(width, (block[1] - tile_low) * w_scale) );
+
+ // Draw the block
+ thickness = 5;
+ y_start = 3;
+ ctx.fillRect(block_start, y_center + y_start, block_end - block_start, thickness);
+
+ if (thick_start && (block_start < thick_end || block_end > thick_start) ) {
+ thickness = 9;
+ y_start = 1;
+ var block_thick_start = Math.max(block_start, thick_start),
+ block_thick_end = Math.min(block_end, thick_end);
+
+ ctx.fillRect(block_thick_start, y_center + y_start, block_thick_end - block_thick_start, thickness);
+
+ }
+ }
+ } else {
+ // If there are no blocks, we treat the feature as one big exon
+ thickness = 9;
+ y_start = 1;
+ ctx.fillRect(f_start, y_center + y_start, f_end - f_start, thickness);
+ if ( feature.strand ) {
+ if (feature.strand == "+") {
+ ctx.fillStyle = RIGHT_STRAND_INV;
+ } else if (feature.strand == "-") {
+ ctx.fillStyle = LEFT_STRAND_INV;
+ }
+ ctx.fillRect(f_start, y_center, f_end - f_start, 10);
+ ctx.fillStyle = "#000";
+ }
}
}
j++;
diff -r ea0342f2df03 -r edb48f2816b5 static/trackster.css
--- a/static/trackster.css Tue Oct 27 15:11:41 2009 -0400
+++ b/static/trackster.css Tue Oct 27 22:34:30 2009 -0400
@@ -95,6 +95,16 @@
width: 100%;
height: 100px;
}
+
+.yaxislabel {
+ color: #777;
+}
+/* Line track needs borders to show range */
+.line-track .track-content {
+ border-top: 1px solid #ddd;
+ border-bottom: 1px solid #ddd;
+}
+
.track {
/* border-top: solid gray 1px; */
/* border-bottom: solid gray 1px; */
diff -r ea0342f2df03 -r edb48f2816b5 templates/tracks/browser.mako
--- a/templates/tracks/browser.mako Tue Oct 27 15:11:41 2009 -0400
+++ b/templates/tracks/browser.mako Tue Oct 27 22:34:30 2009 -0400
@@ -30,16 +30,13 @@
$(document).bind("mousewheel", function( e, delta ) {
if (delta > 0) {
view.zoom_in(e.pageX);
- view.redraw();
} else {
view.zoom_out();
- view.redraw();
}
});
$(document).bind("dblclick", function( e ) {
view.zoom_in(e.pageX);
- view.redraw();
});
// To let the overview box be draggable
@@ -96,7 +93,6 @@
});
});
})();
- view.redraw();
$(window).trigger("resize");
});
1
0
Hi
I installed a copy of Galaxy on my server under public_html Folder. I also
modified the universe_wsgi.ini file and changed the host setting to 0.0.0.0.
Invoking sh run.sh command, Galaxy tends to start starting : serving on
0.0.0.0:8080 view at http://127.0.0.1:8080
But http://127.0.0.1:8080 gives a "*page load error*" on viewing in browser.
If I change host setting to the IP address of my server, it displays a
bunch of errors and does not start Galaxy. Those errors are: -
*Starting server in PID 29836.
Traceback (most recent call last):
File "./scripts/paster.py", line 32, in ?
command.run()
File
"/nfs/home/raghav/public_html/galaxy/eggs/py2.4-noplatform/PasteScript-1.3.6-py2.4.egg/paste/script/command.py",
line 78, in run
invoke(command, command_name, options, args[1:])
File
"/nfs/home/raghav/public_html/galaxy/eggs/py2.4-noplatform/PasteScript-1.3.6-py2.4.egg/paste/script/command.py",
line 117, in invoke
exit_code = runner.run(args)
File
"/nfs/home/raghav/public_html/galaxy/eggs/py2.4-noplatform/PasteScript-1.3.6-py2.4.egg/paste/script/command.py",
line 212, in run
result = self.command()
File
"/nfs/home/raghav/public_html/galaxy/eggs/py2.4-noplatform/PasteScript-1.3.6-py2.4.egg/paste/script/serve.py",
line 232, in command
server(app)
File
"/nfs/home/raghav/public_html/galaxy/eggs/py2.4-noplatform/PasteDeploy-1.3.1-py2.4.egg/paste/deploy/loadwsgi.py",
line 139, in server_wrapper
wsgi_app, context.global_conf,
File
"/nfs/home/raghav/public_html/galaxy/eggs/py2.4-noplatform/PasteDeploy-1.3.1-py2.4.egg/paste/deploy/util/fixtypeerror.py",
line 57, in fix_call
val = callable(*args, **kw)
File
"/nfs/home/raghav/public_html/galaxy/eggs/py2.4-noplatform/Paste-1.5.1-py2.4.egg/paste/httpserver.py",
line 1307, in server_runner
serve(wsgi_app, **kwargs)
File
"/nfs/home/raghav/public_html/galaxy/eggs/py2.4-noplatform/Paste-1.5.1-py2.4.egg/paste/httpserver.py",
line 1257, in serve
threadpool_options=threadpool_options)
File
"/nfs/home/raghav/public_html/galaxy/eggs/py2.4-noplatform/Paste-1.5.1-py2.4.egg/paste/httpserver.py",
line 1107, in __init__
RequestHandlerClass, ssl_context)
File
"/nfs/home/raghav/public_html/galaxy/eggs/py2.4-noplatform/Paste-1.5.1-py2.4.egg/paste/httpserver.py",
line 1087, in __init__
RequestHandlerClass, ssl_context)
File
"/nfs/home/raghav/public_html/galaxy/eggs/py2.4-noplatform/Paste-1.5.1-py2.4.egg/paste/httpserver.py",
line 328, in __init__
HTTPServer.__init__(self, server_address, RequestHandlerClass)
File "/usr/lib/python2.4/SocketServer.py", line 330, in __init__
self.server_bind()
File "/usr/lib/python2.4/BaseHTTPServer.py", line 99, in server_bind
SocketServer.TCPServer.server_bind(self)
File "/usr/lib/python2.4/SocketServer.py", line 341, in server_bind
self.socket.bind(self.server_address)
File "<string>", line 1, in bind
socket.gaierror: (-2, 'Name or service not known')
galaxy.jobs INFO 2009-11-05 21:30:08,204 sending stop signal to worker
thread
galaxy.jobs INFO 2009-11-05 21:30:08,204 job queue stopped
galaxy.jobs.runners.local INFO 2009-11-05 21:30:08,204 sending stop signal
to worker threads
galaxy.jobs.runners.local INFO 2009-11-05 21:30:08,205 local job runner
stopped
galaxy.jobs INFO 2009-11-05 21:30:08,205 sending stop signal to worker
thread
galaxy.jobs INFO 2009-11-05 21:30:08,206 job stopper stopped
*
What changes do I have to make in order to run the Galaxy on my server?
--
Raghav Bhatnagar
Graduate Student (CS)
Viterbi School of Engineering
University of Southern California
2
1
Hi Galaxy team.
Im pretty new to Galaxy and currently trying to put it into production.
I was wondering if it is possible to have a program that outputs many
output many results file and incorporate it into Galaxy?
Can you give an example of how the XML looks like?
Thanks loads!
Luqman
2
1
Hi,
we have a local galaxy installation behind a apache proxy. So far it's
working flawless. But now we noticed that the images referenced in the
example text of Operate on Genomic Intervals don't show.
If I use the "real" address of the galaxy without proxy, it's working
(no config change or restart!)
The generated HTML contains:
<img alt="../static/operation_icons/gops_complement.gif"
src="../static/operation_icons/gops_complement.gif">
This are the settings in universe_wsgi.ini
[filter:proxy-prefix]
use=egg:PasteDeploy#prefix
prefix = /galaxy
[app:main]
filter-with = proxy-prefix
regards, Andreas
2
1