galaxy-commits
Threads by month
- ----- 2025 -----
- 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
- 15302 discussions
galaxy-dist commit 23844e86e616: Fix error on all uploads < 4b. An exception was raised in the bigwig sniffer, which does a binary unpack.
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 1288376296 14400
# Node ID 23844e86e6167c79737a7e0396c39e350e95d1c4
# Parent 247c19db7f8987d9da245bc750043188d4a7c373
Fix error on all uploads < 4b. An exception was raised in the bigwig sniffer, which does a binary unpack.
--- a/lib/galaxy/datatypes/binary.py
+++ b/lib/galaxy/datatypes/binary.py
@@ -213,8 +213,11 @@ class BigWig(Binary):
def _unpack( self, pattern, handle ):
return struct.unpack( pattern, handle.read( struct.calcsize( pattern ) ) )
def sniff( self, filename ):
- magic = self._unpack( "I", open( filename ) )
- return magic[0] == self._magic
+ try:
+ magic = self._unpack( "I", open( filename ) )
+ return magic[0] == self._magic
+ except:
+ return False
def set_peek( self, dataset, is_multi_byte=False ):
if not dataset.dataset.purged:
dataset.peek = "Binary UCSC %s file" % self._name
1
0
galaxy-dist commit 243d80d9905a: adding setup_rabbitmq.sh script.
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 rc
# Date 1288197416 14400
# Node ID 243d80d9905af9121452f1a0955b2b49c076d66e
# Parent 9c6040ab75a8397a5708cfec4edfe216927b8220
adding setup_rabbitmq.sh script.
web api minor code fixes
--- a/scripts/api/common.py
+++ b/scripts/api/common.py
@@ -91,7 +91,10 @@ def submit( api_key, url, data, return_f
except urllib2.HTTPError, e:
print e
print e.read( 1024 )
- sys.exit( 1 )
+ if return_formatted:
+ sys.exit( 1 )
+ else:
+ return 'Error. '+ str( e )
if not return_formatted:
return r
print 'Response'
--- /dev/null
+++ b/setup_rabbitmq.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+cd `dirname $0`
+python scripts/galaxy_messaging/server/setup_rabbitmq.py universe_wsgi.ini
--- a/scripts/galaxy_messaging/server/data_transfer.py
+++ b/scripts/galaxy_messaging/server/data_transfer.py
@@ -184,10 +184,11 @@ class DataTransfer(object):
url = "http://%s:%s/api/libraries/%s/contents" % ( self.server_host,
self.server_port,
api.encode_id( self.config_id_secret, self.library_id ) )
- log.debug(str((self.api_key, url, data)))
+ log.debug( str( ( self.api_key, url, data ) ) )
retval = api.submit( self.api_key, url, data, return_formatted=False )
- except:
- self.error_and_exit(str(e))
+ log.debug( str( retval ) )
+ except Exception, e:
+ self.error_and_exit( str( e ) )
def update_status(self, status, dataset_id='All', msg=''):
'''
@@ -212,7 +213,7 @@ class DataTransfer(object):
api.encode_id( self.config_id_secret, self.request_id ) )
log.debug(str((self.api_key, url, data)))
retval = api.update( self.api_key, url, data, return_formatted=False )
- log.debug('done.')
+ log.debug( str( retval ) )
except urllib2.URLError, e:
log.debug( 'ERROR(sample_dataset_transfer_status (%s)): %s' % ( url, str(e) ) )
log.error(traceback.format_exc())
--- a/scripts/galaxy_messaging/server/setup_rabbitmq.py
+++ b/scripts/galaxy_messaging/server/setup_rabbitmq.py
@@ -11,13 +11,17 @@
import os, sys, csv, ConfigParser
def main( config_file ):
- config = ConfigParser.ConfigParser()
- config.read( config_file )
- rabbitmqctl_path = config.get( 'galaxy_amqp', 'rabbitmqctl_path' )
- username = config.get( 'galaxy_amqp', 'userid' )
- password = config.get( 'galaxy_amqp', 'password' )
- virtual_host = config.get( 'galaxy_amqp', 'virtual_host' )
-
+ try:
+ config = ConfigParser.ConfigParser()
+ config.read( config_file )
+ rabbitmqctl_path = config.get( 'galaxy_amqp', 'rabbitmqctl_path' )
+ username = config.get( 'galaxy_amqp', 'userid' )
+ password = config.get( 'galaxy_amqp', 'password' )
+ virtual_host = config.get( 'galaxy_amqp', 'virtual_host' )
+ except Exception, e:
+ print 'Fatal error:', str(e)
+ sys.exit(1)
+
cmd_list = [
'add_user %s %s' % ( username, password ),
'add_vhost %s' % config.get( 'galaxy_amqp', 'virtual_host' ),
1
0
galaxy-dist commit 121be69ca306: Make Cuffdiff wrapper compatible with v0.9.1 of Cufflinks tool suite and add full functional test.
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 1288197699 14400
# Node ID 121be69ca30675593dc9fc247a4b10a118fed227
# Parent 243d80d9905af9121452f1a0955b2b49c076d66e
Make Cuffdiff wrapper compatible with v0.9.1 of Cufflinks tool suite and add full functional test.
--- /dev/null
+++ b/test-data/cuffdiff_out8.txt
@@ -0,0 +1,1 @@
+tracking_id class_code nearest_ref_id gene_short_name tss_id locus
--- /dev/null
+++ b/test-data/cuffdiff_out9.txt
@@ -0,0 +1,1 @@
+test_id gene locus sample_1 sample_2 status value_1 value_2 sqrt(JS) test_stat p_value significant
--- /dev/null
+++ b/test-data/cuffdiff_out11.txt
@@ -0,0 +1,1 @@
+test_id gene locus sample_1 sample_2 status value_1 value_2 sqrt(JS) test_stat p_value significant
--- /dev/null
+++ b/test-data/cuffdiff_out6.txt
@@ -0,0 +1,88 @@
+tracking_id class_code nearest_ref_id gene_short_name tss_id locus q1_FPKM q1_conf_lo q1_conf_hi q2_FPKM q2_conf_lo q2_conf_hi
+XLOC_000001 - - - - chr1:3204754-3204833 0 0 0 0 0 0
+XLOC_000002 - - - - chr1:3111449-3111490 0 0 0 0 0 0
+XLOC_000003 - - - - chr1:3111545-3111576 0 0 0 0 0 0
+XLOC_000004 - - - - chr1:3174765-3174792 0 0 0 0 0 0
+XLOC_000005 - - - - chr1:3187401-3187428 0 0 0 0 0 0
+XLOC_000006 - - - - chr1:3188521-3188548 0 0 0 0 0 0
+XLOC_000007 - - - - chr1:3189810-3190789 343500 342328 344672 947555 680603 1.21451e+06
+XLOC_000008 - - - - chr1:3190858-3191434 328433 327286 329579 254485 253476 255494
+XLOC_000009 - - - - chr1:3191512-3192077 345096 343921 346271 1.07827e+06 822433 1.33412e+06
+XLOC_000010 - - - - chr1:3192250-3192336 0 0 0 0 0 0
+XLOC_000011 - - - - chr1:3192441-3192494 0 0 0 0 0 0
+XLOC_000012 - - - - chr1:3192550-3192629 0 0 0 0 0 0
+XLOC_000013 - - - - chr1:3192649-3192676 0 0 0 0 0 0
+XLOC_000014 - - - - chr1:3192731-3192811 0 0 0 0 0 0
+XLOC_000015 - - - - chr1:3192940-3193042 0 0 0 0 0 0
+XLOC_000016 - - - - chr1:3194185-3194226 0 0 0 0 0 0
+XLOC_000017 - - - - chr1:3194302-3194329 0 0 0 0 0 0
+XLOC_000018 - - - - chr1:3194706-3194733 0 0 0 0 0 0
+XLOC_000019 - - - - chr1:3195083-3195110 0 0 0 0 0 0
+XLOC_000020 - - - - chr1:3195450-3195477 0 0 0 0 0 0
+XLOC_000021 - - - - chr1:3197089-3197116 0 0 0 0 0 0
+XLOC_000022 - - - - chr1:3197246-3197273 0 0 0 0 0 0
+XLOC_000023 - - - - chr1:3197346-3197373 0 0 0 0 0 0
+XLOC_000024 - - - - chr1:3197425-3197452 0 0 0 0 0 0
+XLOC_000025 - - - - chr1:3200022-3200191 0 0 0 0 0 0
+XLOC_000026 - - - - chr1:3200325-3200352 0 0 0 0 0 0
+XLOC_000027 - - - - chr1:3200430-3200457 0 0 0 0 0 0
+XLOC_000028 - - - - chr1:3201007-3201039 0 0 0 0 0 0
+XLOC_000029 - - - - chr1:3201077-3201481 0 0 0 155328 154540 156116
+XLOC_000030 - - - - chr1:3201596-3201666 0 0 0 0 0 0
+XLOC_000031 - - - - chr1:3201672-3201699 0 0 0 0 0 0
+XLOC_000032 - - - - chr1:3201725-3201809 0 0 0 0 0 0
+XLOC_000033 - - - - chr1:3211521-3211561 0 0 0 0 0 0
+XLOC_000034 - - - - chr1:3212213-3212292 0 0 0 0 0 0
+XLOC_000035 - - - - chr1:3212367-3212439 0 0 0 0 0 0
+XLOC_000036 - - - - chr1:3212717-3212801 0 0 0 0 0 0
+XLOC_000037 - - - - chr1:3213095-3213192 0 0 0 0 0 0
+XLOC_000038 - - - - chr1:3240606-3240633 0 0 0 0 0 0
+XLOC_000039 - - - - chr1:3242479-3242512 0 0 0 0 0 0
+XLOC_000040 - - - - chr1:3242633-3242923 0 0 0 0 0 0
+XLOC_000041 - - - - chr1:3242924-3243005 0 0 0 0 0 0
+XLOC_000042 - - - - chr1:3243018-3243079 0 0 0 0 0 0
+XLOC_000043 - - - - chr1:3243108-3243154 0 0 0 0 0 0
+XLOC_000044 - - - - chr1:3243347-3243401 0 0 0 0 0 0
+XLOC_000045 - - - - chr1:3254079-3254106 0 0 0 0 0 0
+XLOC_000046 - - - - chr1:3256974-3257011 0 0 0 0 0 0
+XLOC_000047 - - - - chr1:3277155-3277182 0 0 0 0 0 0
+XLOC_000048 - - - - chr1:3277190-3277218 0 0 0 0 0 0
+XLOC_000049 - - - - chr1:3277913-3278390 165459 164646 166273 0 0 0
+XLOC_000050 - - - - chr1:3280117-3280144 0 0 0 0 0 0
+XLOC_000051 - - - - chr1:3280498-3280525 0 0 0 0 0 0
+XLOC_000052 - - - - chr1:3280686-3280741 0 0 0 0 0 0
+XLOC_000053 - - - - chr1:3282504-3282531 0 0 0 0 0 0
+XLOC_000054 - - - - chr1:3282650-3282677 0 0 0 0 0 0
+XLOC_000055 - - - - chr1:3282760-3282832 0 0 0 0 0 0
+XLOC_000056 - - - - chr1:3284966-3284993 0 0 0 0 0 0
+XLOC_000057 - - - - chr1:3290488-3290553 0 0 0 0 0 0
+XLOC_000058 - - - - chr1:3290798-3290859 0 0 0 0 0 0
+XLOC_000059 - - - - chr1:3290919-3291273 163613 162804 164422 0 0 0
+XLOC_000060 - - - - chr1:3299443-3299664 0 0 0 0 0 0
+XLOC_000061 - - - - chr1:3299691-3299733 0 0 0 0 0 0
+XLOC_000062 - - - - chr1:3300051-3300078 0 0 0 0 0 0
+XLOC_000063 - - - - chr1:3307748-3307775 0 0 0 0 0 0
+XLOC_000064 - - - - chr1:3318620-3318647 0 0 0 0 0 0
+XLOC_000065 - - - - chr1:3318999-3319051 0 0 0 0 0 0
+XLOC_000066 - - - - chr1:3330527-3330554 0 0 0 0 0 0
+XLOC_000067 - - - - chr1:3351240-3351311 0 0 0 0 0 0
+XLOC_000068 - - - - chr1:3355887-3356119 0 0 0 0 0 0
+XLOC_000069 - - - - chr1:3356180-3356225 0 0 0 0 0 0
+XLOC_000070 - - - - chr1:3363076-3363176 0 0 0 0 0 0
+XLOC_000071 - - - - chr1:3363214-3363278 0 0 0 0 0 0
+XLOC_000072 - - - - chr1:3363387-3363446 0 0 0 0 0 0
+XLOC_000073 - - - - chr1:3363753-3363849 0 0 0 0 0 0
+XLOC_000074 - - - - chr1:3364871-3364919 0 0 0 0 0 0
+XLOC_000075 - - - - chr1:3367135-3367162 0 0 0 0 0 0
+XLOC_000076 - - - - chr1:3367210-3367237 0 0 0 0 0 0
+XLOC_000077 - - - - chr1:3367333-3367382 0 0 0 0 0 0
+XLOC_000078 - - - - chr1:3369580-3369607 0 0 0 0 0 0
+XLOC_000079 - - - - chr1:3375001-3375028 0 0 0 0 0 0
+XLOC_000080 - - - - chr1:3377211-3377262 0 0 0 0 0 0
+XLOC_000081 - - - - chr1:3379888-3379915 0 0 0 0 0 0
+XLOC_000082 - - - - chr1:3386739-3386836 0 0 0 0 0 0
+XLOC_000083 - - - - chr1:3391325-3391352 0 0 0 0 0 0
+XLOC_000084 - - - - chr1:3435841-3435880 0 0 0 0 0 0
+XLOC_000085 - - - - chr1:3447761-3447788 0 0 0 0 0 0
+XLOC_000086 - - - - chr1:3450906-3450965 0 0 0 0 0 0
+XLOC_000087 - - - - chr1:3451051-3451109 0 0 0 0 0 0
--- /dev/null
+++ b/test-data/cuffdiff_out10.txt
@@ -0,0 +1,1 @@
+test_id gene locus sample_1 sample_2 status value_1 value_2 sqrt(JS) test_stat p_value significant
--- /dev/null
+++ b/test-data/cuffdiff_out7.txt
@@ -0,0 +1,1 @@
+tracking_id class_code nearest_ref_id gene_short_name tss_id locus
--- /dev/null
+++ b/test-data/cuffdiff_out1.txt
@@ -0,0 +1,99 @@
+test_id gene locus sample_1 sample_2 status value_1 value_2 ln(fold_change) test_stat p_value significant
+TCONS_00000001 - chr1:3204754-3204833 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000002 - chr1:3111449-3111490 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000003 - chr1:3111545-3111576 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000004 - chr1:3189810-3190789 q1 q2 OK 0 645918 6.95322e-310 1.79769e+308 0 yes
+TCONS_00000005 - chr1:3189810-3190789 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000006 - chr1:3189810-3190789 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000007 - chr1:3191512-3192077 q1 q2 OK 0 704881 6.95322e-310 1.79769e+308 0 yes
+TCONS_00000008 - chr1:3191512-3192077 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000009 - chr1:3192441-3192494 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000010 - chr1:3192550-3192629 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000011 - chr1:3192731-3192811 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000012 - chr1:3192940-3193042 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000013 - chr1:3194185-3194226 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000014 - chr1:3194302-3194329 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000015 - chr1:3195083-3195110 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000016 - chr1:3195450-3195477 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000017 - chr1:3197089-3197116 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000018 - chr1:3197246-3197273 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000019 - chr1:3197346-3197373 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000020 - chr1:3200022-3200191 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000021 - chr1:3200325-3200352 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000022 - chr1:3201077-3201481 q1 q2 OK 0 155328 0 1.79769e+308 0 yes
+TCONS_00000023 - chr1:3201672-3201699 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000024 - chr1:3212213-3212292 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000025 - chr1:3212367-3212439 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000026 - chr1:3213095-3213192 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000027 - chr1:3242633-3242923 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000028 - chr1:3243018-3243079 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000029 - chr1:3243347-3243401 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000030 - chr1:3256974-3257011 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000031 - chr1:3277190-3277218 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000032 - chr1:3277913-3278390 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000033 - chr1:3280686-3280741 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000034 - chr1:3290488-3290553 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000035 - chr1:3290919-3291273 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000036 - chr1:3290919-3291273 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000037 - chr1:3299443-3299664 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000038 - chr1:3300051-3300078 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000039 - chr1:3318999-3319051 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000040 - chr1:3355887-3356119 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000041 - chr1:3363214-3363278 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000042 - chr1:3363753-3363849 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000043 - chr1:3367135-3367162 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000044 - chr1:3367333-3367382 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000045 - chr1:3377211-3377262 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000046 - chr1:3391325-3391352 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000047 - chr1:3435841-3435880 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000048 - chr1:3447761-3447788 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000049 - chr1:3450906-3450965 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000050 - chr1:3451051-3451109 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000051 - chr1:3174765-3174792 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000052 - chr1:3187401-3187428 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000053 - chr1:3188521-3188548 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000054 - chr1:3189810-3190789 q1 q2 OK 343500 303241 -0.124659 2.28891 0.0220846 no
+TCONS_00000055 - chr1:3190858-3191434 q1 q2 OK 328433 254485 -0.255089 96.5921 0 yes
+TCONS_00000056 - chr1:3191512-3192077 q1 q2 OK 345096 376320 0.0866161 -1.17079 0.241685 no
+TCONS_00000057 - chr1:3192250-3192336 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000058 - chr1:3192649-3192676 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000059 - chr1:3194706-3194733 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000060 - chr1:3197425-3197452 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000061 - chr1:3200430-3200457 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000062 - chr1:3201007-3201039 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000063 - chr1:3201077-3201481 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000064 - chr1:3201596-3201666 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000065 - chr1:3201725-3201809 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000066 - chr1:3211521-3211561 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000067 - chr1:3212717-3212801 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000068 - chr1:3240606-3240633 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000069 - chr1:3242479-3242512 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000070 - chr1:3242924-3243005 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000071 - chr1:3243108-3243154 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000072 - chr1:3254079-3254106 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000073 - chr1:3277155-3277182 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000074 - chr1:3277913-3278390 q1 q2 OK 165459 0 0 2.22507e-308 0 yes
+TCONS_00000075 - chr1:3280117-3280144 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000076 - chr1:3280498-3280525 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000077 - chr1:3282504-3282531 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000078 - chr1:3282650-3282677 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000079 - chr1:3282760-3282832 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000080 - chr1:3284966-3284993 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000081 - chr1:3290798-3290859 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000082 - chr1:3290919-3291273 q1 q2 OK 163613 0 0 2.22507e-308 0 yes
+TCONS_00000083 - chr1:3299443-3299664 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000084 - chr1:3299691-3299733 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000085 - chr1:3307748-3307775 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000086 - chr1:3318620-3318647 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000087 - chr1:3330527-3330554 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000088 - chr1:3351240-3351311 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000089 - chr1:3355887-3356119 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000090 - chr1:3356180-3356225 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000091 - chr1:3363076-3363176 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000092 - chr1:3363387-3363446 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000093 - chr1:3364871-3364919 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000094 - chr1:3367210-3367237 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000095 - chr1:3369580-3369607 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000096 - chr1:3375001-3375028 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000097 - chr1:3379888-3379915 q1 q2 OK 0 0 0 0 1 no
+TCONS_00000098 - chr1:3386739-3386836 q1 q2 OK 0 0 0 0 1 no
--- a/tools/ngs_rna/cuffdiff_wrapper.xml
+++ b/tools/ngs_rna/cuffdiff_wrapper.xml
@@ -73,11 +73,21 @@
<param name="min_mapqual" value="0" ftype="sam" /><param name="min_alignment_count" value="0" ftype="sam" /><param name="sPaired" value="single" ftype="sam" />
-
- <!-- This won't pass until the test harness is updated to handle outputs better. -->
- <!--
- <output name="XXXX" file="cuffdiff_out5.tracking" />
+ <!--
+ Line diffs are needed because cuffdiff does not produce deterministic output.
+ TODO: can we find datasets that lead to deterministic behavior?
-->
+ <output name="isoforms_exp" file="cuffdiff_out1.txt" lines_diff="8"/>
+ <output name="genes_exp" file="cuffdiff_out2.txt" lines_diff="4"/>
+ <output name="tss_groups_exp" file="cuffdiff_out3.txt"/>
+ <output name="cds_exp_fpkm_tracking" file="cuffdiff_out4.txt"/>
+ <output name="isoforms_fpkm_tracking" file="cuffdiff_out5.txt" lines_diff="8"/>
+ <output name="genes_fpkm_tracking" file="cuffdiff_out6.txt" lines_diff="4"/>
+ <output name="tss_groups_fpkm_tracking" file="cuffdiff_out7.txt"/>
+ <output name="cds_fpkm_tracking" file="cuffdiff_out8.txt"/>
+ <output name="splicing_diff" file="cuffdiff_out9.txt"/>
+ <output name="promoters_diff" file="cuffdiff_out10.txt"/>
+ <output name="cds_diff" file="cuffdiff_out11.txt"/></test></tests>
--- a/tools/ngs_rna/cuffdiff_wrapper.py
+++ b/tools/ngs_rna/cuffdiff_wrapper.py
@@ -111,13 +111,13 @@ def __main__():
shutil.copyfile( os.path.join( tmp_output_dir, "genes.fpkm_tracking" ), options.genes_fpkm_tracking_output )
shutil.copyfile( os.path.join( tmp_output_dir, "cds.fpkm_tracking" ), options.cds_fpkm_tracking_output )
shutil.copyfile( os.path.join( tmp_output_dir, "tss_groups.fpkm_tracking" ), options.tss_groups_fpkm_tracking_output )
- shutil.copyfile( os.path.join( tmp_output_dir, "0_1_isoform_exp.diff" ), options.isoforms_exp_output )
- shutil.copyfile( os.path.join( tmp_output_dir, "0_1_gene_exp.diff" ), options.genes_exp_output )
- shutil.copyfile( os.path.join( tmp_output_dir, "0_1_tss_group_exp.diff" ), options.tss_groups_exp_output )
- shutil.copyfile( os.path.join( tmp_output_dir, "0_1_splicing.diff" ), options.splicing_diff_output )
- shutil.copyfile( os.path.join( tmp_output_dir, "0_1_cds.diff" ), options.cds_diff_output )
- shutil.copyfile( os.path.join( tmp_output_dir, "0_1_cds_exp.diff" ), options.cds_diff_output )
- shutil.copyfile( os.path.join( tmp_output_dir, "0_1_promoters.diff" ), options.promoters_diff_output )
+ shutil.copyfile( os.path.join( tmp_output_dir, "isoform_exp.diff" ), options.isoforms_exp_output )
+ shutil.copyfile( os.path.join( tmp_output_dir, "gene_exp.diff" ), options.genes_exp_output )
+ shutil.copyfile( os.path.join( tmp_output_dir, "tss_group_exp.diff" ), options.tss_groups_exp_output )
+ shutil.copyfile( os.path.join( tmp_output_dir, "splicing.diff" ), options.splicing_diff_output )
+ shutil.copyfile( os.path.join( tmp_output_dir, "cds.diff" ), options.cds_diff_output )
+ shutil.copyfile( os.path.join( tmp_output_dir, "cds_exp.diff" ), options.cds_exp_fpkm_tracking_output )
+ shutil.copyfile( os.path.join( tmp_output_dir, "promoters.diff" ), options.promoters_diff_output )
except Exception, e:
stop_err( 'Error in cuffdiff:\n' + str( e ) )
finally:
--- /dev/null
+++ b/test-data/cuffdiff_out5.txt
@@ -0,0 +1,99 @@
+tracking_id class_code nearest_ref_id gene_short_name tss_id locus q1_FPKM q1_conf_lo q1_conf_hi q2_FPKM q2_conf_lo q2_conf_hi
+TCONS_00000001 c Xkr4 - - chr1:3204754-3204833 0 0 0 0 0 0
+TCONS_00000002 - - - - chr1:3111449-3111490 0 0 0 0 0 0
+TCONS_00000003 - - - - chr1:3111545-3111576 0 0 0 0 0 0
+TCONS_00000004 - - - - chr1:3189810-3190789 0 0 0 645918 357201 934636
+TCONS_00000005 - - - - chr1:3189810-3190789 0 0 0 0 0 0
+TCONS_00000006 - - - - chr1:3189810-3190789 0 0 0 0 0 0
+TCONS_00000007 - - - - chr1:3191512-3192077 0 0 0 704881 400219 1.00954e+06
+TCONS_00000008 - - - - chr1:3191512-3192077 0 0 0 0 0 0
+TCONS_00000009 - - - - chr1:3192441-3192494 0 0 0 0 0 0
+TCONS_00000010 - - - - chr1:3192550-3192629 0 0 0 0 0 0
+TCONS_00000011 - - - - chr1:3192731-3192811 0 0 0 0 0 0
+TCONS_00000012 - - - - chr1:3192940-3193042 0 0 0 0 0 0
+TCONS_00000013 - - - - chr1:3194185-3194226 0 0 0 0 0 0
+TCONS_00000014 - - - - chr1:3194302-3194329 0 0 0 0 0 0
+TCONS_00000015 - - - - chr1:3195083-3195110 0 0 0 0 0 0
+TCONS_00000016 - - - - chr1:3195450-3195477 0 0 0 0 0 0
+TCONS_00000017 - - - - chr1:3197089-3197116 0 0 0 0 0 0
+TCONS_00000018 - - - - chr1:3197246-3197273 0 0 0 0 0 0
+TCONS_00000019 - - - - chr1:3197346-3197373 0 0 0 0 0 0
+TCONS_00000020 - - - - chr1:3200022-3200191 0 0 0 0 0 0
+TCONS_00000021 - - - - chr1:3200325-3200352 0 0 0 0 0 0
+TCONS_00000022 - - - - chr1:3201077-3201481 0 0 0 155328 154540 156116
+TCONS_00000023 - - - - chr1:3201672-3201699 0 0 0 0 0 0
+TCONS_00000024 i Xkr4 - - chr1:3212213-3212292 0 0 0 0 0 0
+TCONS_00000025 i Xkr4 - - chr1:3212367-3212439 0 0 0 0 0 0
+TCONS_00000026 i Xkr4 - - chr1:3213095-3213192 0 0 0 0 0 0
+TCONS_00000027 i Xkr4 - - chr1:3242633-3242923 0 0 0 0 0 0
+TCONS_00000028 i Xkr4 - - chr1:3243018-3243079 0 0 0 0 0 0
+TCONS_00000029 i Xkr4 - - chr1:3243347-3243401 0 0 0 0 0 0
+TCONS_00000030 i Xkr4 - - chr1:3256974-3257011 0 0 0 0 0 0
+TCONS_00000031 i Xkr4 - - chr1:3277190-3277218 0 0 0 0 0 0
+TCONS_00000032 i Xkr4 - - chr1:3277913-3278390 0 0 0 0 0 0
+TCONS_00000033 i Xkr4 - - chr1:3280686-3280741 0 0 0 0 0 0
+TCONS_00000034 i Xkr4 - - chr1:3290488-3290553 0 0 0 0 0 0
+TCONS_00000035 i Xkr4 - - chr1:3290919-3291273 0 0 0 0 0 0
+TCONS_00000036 i Xkr4 - - chr1:3290919-3291273 0 0 0 0 0 0
+TCONS_00000037 i Xkr4 - - chr1:3299443-3299664 0 0 0 0 0 0
+TCONS_00000038 i Xkr4 - - chr1:3300051-3300078 0 0 0 0 0 0
+TCONS_00000039 i Xkr4 - - chr1:3318999-3319051 0 0 0 0 0 0
+TCONS_00000040 i Xkr4 - - chr1:3355887-3356119 0 0 0 0 0 0
+TCONS_00000041 i Xkr4 - - chr1:3363214-3363278 0 0 0 0 0 0
+TCONS_00000042 i Xkr4 - - chr1:3363753-3363849 0 0 0 0 0 0
+TCONS_00000043 i Xkr4 - - chr1:3367135-3367162 0 0 0 0 0 0
+TCONS_00000044 i Xkr4 - - chr1:3367333-3367382 0 0 0 0 0 0
+TCONS_00000045 i Xkr4 - - chr1:3377211-3377262 0 0 0 0 0 0
+TCONS_00000046 i Xkr4 - - chr1:3391325-3391352 0 0 0 0 0 0
+TCONS_00000047 i Xkr4 - - chr1:3435841-3435880 0 0 0 0 0 0
+TCONS_00000048 i Xkr4 - - chr1:3447761-3447788 0 0 0 0 0 0
+TCONS_00000049 i Xkr4 - - chr1:3450906-3450965 0 0 0 0 0 0
+TCONS_00000050 i Xkr4 - - chr1:3451051-3451109 0 0 0 0 0 0
+TCONS_00000051 - - - - chr1:3174765-3174792 0 0 0 0 0 0
+TCONS_00000052 - - - - chr1:3187401-3187428 0 0 0 0 0 0
+TCONS_00000053 - - - - chr1:3188521-3188548 0 0 0 0 0 0
+TCONS_00000054 - - - - chr1:3189810-3190789 343500 342328 344672 303241 270227 336255
+TCONS_00000055 - - - - chr1:3190858-3191434 328433 327286 329579 254485 253476 255494
+TCONS_00000056 - - - - chr1:3191512-3192077 345096 343921 346271 376320 320653 431986
+TCONS_00000057 - - - - chr1:3192250-3192336 0 0 0 0 0 0
+TCONS_00000058 - - - - chr1:3192649-3192676 0 0 0 0 0 0
+TCONS_00000059 - - - - chr1:3194706-3194733 0 0 0 0 0 0
+TCONS_00000060 - - - - chr1:3197425-3197452 0 0 0 0 0 0
+TCONS_00000061 - - - - chr1:3200430-3200457 0 0 0 0 0 0
+TCONS_00000062 - - - - chr1:3201007-3201039 0 0 0 0 0 0
+TCONS_00000063 - - - - chr1:3201077-3201481 0 0 0 0 0 0
+TCONS_00000064 - - - - chr1:3201596-3201666 0 0 0 0 0 0
+TCONS_00000065 - - - - chr1:3201725-3201809 0 0 0 0 0 0
+TCONS_00000066 i Xkr4 - - chr1:3211521-3211561 0 0 0 0 0 0
+TCONS_00000067 i Xkr4 - - chr1:3212717-3212801 0 0 0 0 0 0
+TCONS_00000068 i Xkr4 - - chr1:3240606-3240633 0 0 0 0 0 0
+TCONS_00000069 i Xkr4 - - chr1:3242479-3242512 0 0 0 0 0 0
+TCONS_00000070 i Xkr4 - - chr1:3242924-3243005 0 0 0 0 0 0
+TCONS_00000071 i Xkr4 - - chr1:3243108-3243154 0 0 0 0 0 0
+TCONS_00000072 i Xkr4 - - chr1:3254079-3254106 0 0 0 0 0 0
+TCONS_00000073 i Xkr4 - - chr1:3277155-3277182 0 0 0 0 0 0
+TCONS_00000074 i Xkr4 - - chr1:3277913-3278390 165459 164646 166273 0 0 0
+TCONS_00000075 i Xkr4 - - chr1:3280117-3280144 0 0 0 0 0 0
+TCONS_00000076 i Xkr4 - - chr1:3280498-3280525 0 0 0 0 0 0
+TCONS_00000077 i Xkr4 - - chr1:3282504-3282531 0 0 0 0 0 0
+TCONS_00000078 i Xkr4 - - chr1:3282650-3282677 0 0 0 0 0 0
+TCONS_00000079 i Xkr4 - - chr1:3282760-3282832 0 0 0 0 0 0
+TCONS_00000080 i Xkr4 - - chr1:3284966-3284993 0 0 0 0 0 0
+TCONS_00000081 i Xkr4 - - chr1:3290798-3290859 0 0 0 0 0 0
+TCONS_00000082 i Xkr4 - - chr1:3290919-3291273 163613 162804 164422 0 0 0
+TCONS_00000083 i Xkr4 - - chr1:3299443-3299664 0 0 0 0 0 0
+TCONS_00000084 i Xkr4 - - chr1:3299691-3299733 0 0 0 0 0 0
+TCONS_00000085 i Xkr4 - - chr1:3307748-3307775 0 0 0 0 0 0
+TCONS_00000086 i Xkr4 - - chr1:3318620-3318647 0 0 0 0 0 0
+TCONS_00000087 i Xkr4 - - chr1:3330527-3330554 0 0 0 0 0 0
+TCONS_00000088 i Xkr4 - - chr1:3351240-3351311 0 0 0 0 0 0
+TCONS_00000089 i Xkr4 - - chr1:3355887-3356119 0 0 0 0 0 0
+TCONS_00000090 i Xkr4 - - chr1:3356180-3356225 0 0 0 0 0 0
+TCONS_00000091 i Xkr4 - - chr1:3363076-3363176 0 0 0 0 0 0
+TCONS_00000092 i Xkr4 - - chr1:3363387-3363446 0 0 0 0 0 0
+TCONS_00000093 i Xkr4 - - chr1:3364871-3364919 0 0 0 0 0 0
+TCONS_00000094 i Xkr4 - - chr1:3367210-3367237 0 0 0 0 0 0
+TCONS_00000095 i Xkr4 - - chr1:3369580-3369607 0 0 0 0 0 0
+TCONS_00000096 i Xkr4 - - chr1:3375001-3375028 0 0 0 0 0 0
+TCONS_00000097 i Xkr4 - - chr1:3379888-3379915 0 0 0 0 0 0
+TCONS_00000098 i Xkr4 - - chr1:3386739-3386836 0 0 0 0 0 0
--- a/test-data/cuffdiff_out5.tracking
+++ /dev/null
@@ -1,2 +0,0 @@
-tracking_id class_code nearest_ref_id gene_short_name tss_id locus q0_FPKM q0_conf_lo q0_conf_hi q1_FPKM q1_conf_lo q1_conf_hi
-TCONS_00000001 c Xkr4 - - chr1:3204754-3204833 0 0 0 67745 0 163551
--- /dev/null
+++ b/test-data/cuffdiff_out2.txt
@@ -0,0 +1,88 @@
+test_id gene locus sample_1 sample_2 status value_1 value_2 ln(fold_change) test_stat p_value significant
+XLOC_000001 - chr1:3204754-3204833 q1 q2 OK 0 0 0 0 1 no
+XLOC_000002 - chr1:3111449-3111490 q1 q2 OK 0 0 0 0 1 no
+XLOC_000003 - chr1:3111545-3111576 q1 q2 OK 0 0 0 0 1 no
+XLOC_000004 - chr1:3174765-3174792 q1 q2 OK 0 0 0 0 1 no
+XLOC_000005 - chr1:3187401-3187428 q1 q2 OK 0 0 0 0 1 no
+XLOC_000006 - chr1:3188521-3188548 q1 q2 OK 0 0 0 0 1 no
+XLOC_000007 - chr1:3189810-3190789 q1 q2 OK 343500 949159 1.01639 -7.54436 4.55191e-14 yes
+XLOC_000008 - chr1:3190858-3191434 q1 q2 OK 328433 254485 -0.255089 96.5921 0 yes
+XLOC_000009 - chr1:3191512-3192077 q1 q2 OK 345096 1.0812e+06 1.142 -9.91597 0 yes
+XLOC_000010 - chr1:3192250-3192336 q1 q2 OK 0 0 0 0 1 no
+XLOC_000011 - chr1:3192441-3192494 q1 q2 OK 0 0 0 0 1 no
+XLOC_000012 - chr1:3192550-3192629 q1 q2 OK 0 0 0 0 1 no
+XLOC_000013 - chr1:3192649-3192676 q1 q2 OK 0 0 0 0 1 no
+XLOC_000014 - chr1:3192731-3192811 q1 q2 OK 0 0 0 0 1 no
+XLOC_000015 - chr1:3192940-3193042 q1 q2 OK 0 0 0 0 1 no
+XLOC_000016 - chr1:3194185-3194226 q1 q2 OK 0 0 0 0 1 no
+XLOC_000017 - chr1:3194302-3194329 q1 q2 OK 0 0 0 0 1 no
+XLOC_000018 - chr1:3194706-3194733 q1 q2 OK 0 0 0 0 1 no
+XLOC_000019 - chr1:3195083-3195110 q1 q2 OK 0 0 0 0 1 no
+XLOC_000020 - chr1:3195450-3195477 q1 q2 OK 0 0 0 0 1 no
+XLOC_000021 - chr1:3197089-3197116 q1 q2 OK 0 0 0 0 1 no
+XLOC_000022 - chr1:3197246-3197273 q1 q2 OK 0 0 0 0 1 no
+XLOC_000023 - chr1:3197346-3197373 q1 q2 OK 0 0 0 0 1 no
+XLOC_000024 - chr1:3197425-3197452 q1 q2 OK 0 0 0 0 1 no
+XLOC_000025 - chr1:3200022-3200191 q1 q2 OK 0 0 0 0 1 no
+XLOC_000026 - chr1:3200325-3200352 q1 q2 OK 0 0 0 0 1 no
+XLOC_000027 - chr1:3200430-3200457 q1 q2 OK 0 0 0 0 1 no
+XLOC_000028 - chr1:3201007-3201039 q1 q2 OK 0 0 0 0 1 no
+XLOC_000029 - chr1:3201077-3201481 q1 q2 OK 0 155328 6.95322e-310 1.79769e+308 0 yes
+XLOC_000030 - chr1:3201596-3201666 q1 q2 OK 0 0 0 0 1 no
+XLOC_000031 - chr1:3201672-3201699 q1 q2 OK 0 0 0 0 1 no
+XLOC_000032 - chr1:3201725-3201809 q1 q2 OK 0 0 0 0 1 no
+XLOC_000033 - chr1:3211521-3211561 q1 q2 OK 0 0 0 0 1 no
+XLOC_000034 - chr1:3212213-3212292 q1 q2 OK 0 0 0 0 1 no
+XLOC_000035 - chr1:3212367-3212439 q1 q2 OK 0 0 0 0 1 no
+XLOC_000036 - chr1:3212717-3212801 q1 q2 OK 0 0 0 0 1 no
+XLOC_000037 - chr1:3213095-3213192 q1 q2 OK 0 0 0 0 1 no
+XLOC_000038 - chr1:3240606-3240633 q1 q2 OK 0 0 0 0 1 no
+XLOC_000039 - chr1:3242479-3242512 q1 q2 OK 0 0 0 0 1 no
+XLOC_000040 - chr1:3242633-3242923 q1 q2 OK 0 0 0 0 1 no
+XLOC_000041 - chr1:3242924-3243005 q1 q2 OK 0 0 0 0 1 no
+XLOC_000042 - chr1:3243018-3243079 q1 q2 OK 0 0 0 0 1 no
+XLOC_000043 - chr1:3243108-3243154 q1 q2 OK 0 0 0 0 1 no
+XLOC_000044 - chr1:3243347-3243401 q1 q2 OK 0 0 0 0 1 no
+XLOC_000045 - chr1:3254079-3254106 q1 q2 OK 0 0 0 0 1 no
+XLOC_000046 - chr1:3256974-3257011 q1 q2 OK 0 0 0 0 1 no
+XLOC_000047 - chr1:3277155-3277182 q1 q2 OK 0 0 0 0 1 no
+XLOC_000048 - chr1:3277190-3277218 q1 q2 OK 0 0 0 0 1 no
+XLOC_000049 - chr1:3277913-3278390 q1 q2 OK 165459 0 6.95322e-310 2.22507e-308 0 yes
+XLOC_000050 - chr1:3280117-3280144 q1 q2 OK 0 0 0 0 1 no
+XLOC_000051 - chr1:3280498-3280525 q1 q2 OK 0 0 0 0 1 no
+XLOC_000052 - chr1:3280686-3280741 q1 q2 OK 0 0 0 0 1 no
+XLOC_000053 - chr1:3282504-3282531 q1 q2 OK 0 0 0 0 1 no
+XLOC_000054 - chr1:3282650-3282677 q1 q2 OK 0 0 0 0 1 no
+XLOC_000055 - chr1:3282760-3282832 q1 q2 OK 0 0 0 0 1 no
+XLOC_000056 - chr1:3284966-3284993 q1 q2 OK 0 0 0 0 1 no
+XLOC_000057 - chr1:3290488-3290553 q1 q2 OK 0 0 0 0 1 no
+XLOC_000058 - chr1:3290798-3290859 q1 q2 OK 0 0 0 0 1 no
+XLOC_000059 - chr1:3290919-3291273 q1 q2 OK 163613 0 6.95322e-310 2.22507e-308 0 yes
+XLOC_000060 - chr1:3299443-3299664 q1 q2 OK 0 0 0 0 1 no
+XLOC_000061 - chr1:3299691-3299733 q1 q2 OK 0 0 0 0 1 no
+XLOC_000062 - chr1:3300051-3300078 q1 q2 OK 0 0 0 0 1 no
+XLOC_000063 - chr1:3307748-3307775 q1 q2 OK 0 0 0 0 1 no
+XLOC_000064 - chr1:3318620-3318647 q1 q2 OK 0 0 0 0 1 no
+XLOC_000065 - chr1:3318999-3319051 q1 q2 OK 0 0 0 0 1 no
+XLOC_000066 - chr1:3330527-3330554 q1 q2 OK 0 0 0 0 1 no
+XLOC_000067 - chr1:3351240-3351311 q1 q2 OK 0 0 0 0 1 no
+XLOC_000068 - chr1:3355887-3356119 q1 q2 OK 0 0 0 0 1 no
+XLOC_000069 - chr1:3356180-3356225 q1 q2 OK 0 0 0 0 1 no
+XLOC_000070 - chr1:3363076-3363176 q1 q2 OK 0 0 0 0 1 no
+XLOC_000071 - chr1:3363214-3363278 q1 q2 OK 0 0 0 0 1 no
+XLOC_000072 - chr1:3363387-3363446 q1 q2 OK 0 0 0 0 1 no
+XLOC_000073 - chr1:3363753-3363849 q1 q2 OK 0 0 0 0 1 no
+XLOC_000074 - chr1:3364871-3364919 q1 q2 OK 0 0 0 0 1 no
+XLOC_000075 - chr1:3367135-3367162 q1 q2 OK 0 0 0 0 1 no
+XLOC_000076 - chr1:3367210-3367237 q1 q2 OK 0 0 0 0 1 no
+XLOC_000077 - chr1:3367333-3367382 q1 q2 OK 0 0 0 0 1 no
+XLOC_000078 - chr1:3369580-3369607 q1 q2 OK 0 0 0 0 1 no
+XLOC_000079 - chr1:3375001-3375028 q1 q2 OK 0 0 0 0 1 no
+XLOC_000080 - chr1:3377211-3377262 q1 q2 OK 0 0 0 0 1 no
+XLOC_000081 - chr1:3379888-3379915 q1 q2 OK 0 0 0 0 1 no
+XLOC_000082 - chr1:3386739-3386836 q1 q2 OK 0 0 0 0 1 no
+XLOC_000083 - chr1:3391325-3391352 q1 q2 OK 0 0 0 0 1 no
+XLOC_000084 - chr1:3435841-3435880 q1 q2 OK 0 0 0 0 1 no
+XLOC_000085 - chr1:3447761-3447788 q1 q2 OK 0 0 0 0 1 no
+XLOC_000086 - chr1:3450906-3450965 q1 q2 OK 0 0 0 0 1 no
+XLOC_000087 - chr1:3451051-3451109 q1 q2 OK 0 0 0 0 1 no
--- /dev/null
+++ b/test-data/cuffdiff_out3.txt
@@ -0,0 +1,1 @@
+test_id gene locus sample_1 sample_2 status value_1 value_2 ln(fold_change) test_stat p_value significant
--- /dev/null
+++ b/test-data/cuffdiff_out4.txt
@@ -0,0 +1,1 @@
+test_id gene locus sample_1 sample_2 status value_1 value_2 ln(fold_change) test_stat p_value significant
1
0
galaxy-dist commit 522c99a05163: fixed Lab menu access bug
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 rc
# Date 1288298593 14400
# Node ID 522c99a05163c1816e9fe3be4c0b4ad05bff3ea0
# Parent 7327a60e33968cb067edf6541cc84643f970180d
fixed Lab menu access bug
fixed rabbitmq setup script bug
--- a/templates/webapps/galaxy/base_panels.mako
+++ b/templates/webapps/galaxy/base_panels.mako
@@ -84,7 +84,7 @@
[ 'Find Samples', h.url_for( controller='/requests', action='find_samples_index' ) ],
[ 'Help', app.config.get( "lims_doc_url", "http://main.g2.bx.psu.edu/u/rkchak/p/sts" ), "galaxy_main" ]
]
- tab( "lab", "Lab", None, menu_options=menu_options, visible=( trans.user and trans.user.requests ) )
+ tab( "lab", "Lab", None, menu_options=menu_options, visible=( trans.user and ( trans.user.requests or trans.user.accessible_request_types() ) ) )
%>
## Visualization menu.
--- a/scripts/galaxy_messaging/server/setup_rabbitmq.py
+++ b/scripts/galaxy_messaging/server/setup_rabbitmq.py
@@ -25,7 +25,7 @@ def main( config_file ):
cmd_list = [
'add_user %s %s' % ( username, password ),
'add_vhost %s' % config.get( 'galaxy_amqp', 'virtual_host' ),
- 'set_permissions -p %s %s "%s.*" ".*" ".*"' % ( virtual_host, username, username )
+ 'set_permissions -p %s %s ".*" ".*" ".*"' % ( virtual_host, username )
]
for cmd in cmd_list:
1
0
galaxy-dist commit 6a97d4fc4268: Update test data for GFF-to-BED to accomodate change made in 4475:aaacde471f03.
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 1288198736 14400
# Node ID 6a97d4fc4268493480a0a3e7462e91f48d926a72
# Parent 121be69ca30675593dc9fc247a4b10a118fed227
Update test data for GFF-to-BED to accomodate change made in 4475:aaacde471f03.
--- a/test-data/gff2bed_out2.bed
+++ b/test-data/gff2bed_out2.bed
@@ -1,3 +1,3 @@
-chr1 3204562 3661579 Xkr4 0 - 3204562 3204562 0 3 2487,200,947 0,207220,456070
-chr1 4481008 4486494 Sox17 0 - 4481008 4481008 0 5 1741,367,92,807,123 0,2172,2844,4208,5363
-chr1 4763278 4775807 Mrpl15 0 - 4763278 4763278 0 5 3604,124,166,155,154 0,4327,9370,10753,12375
+chr1 3204562 3661579 Xkr4 0 - 3204562 3661579 0 3 2487,200,947 0,207220,456070
+chr1 4481008 4486494 Sox17 0 - 4481008 4486494 0 5 1741,367,92,807,123 0,2172,2844,4208,5363
+chr1 4763278 4775807 Mrpl15 0 - 4763278 4775807 0 5 3604,124,166,155,154 0,4327,9370,10753,12375
1
0
galaxy-dist commit 7327a60e3396: pbs_deljob bugfix from Glen Beane.
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 1288287803 14400
# Node ID 7327a60e33968cb067edf6541cc84643f970180d
# Parent 0b278c24c19f0a0f7a57b8a33bd6d992461c04c3
pbs_deljob bugfix from Glen Beane.
--- a/lib/galaxy/jobs/runners/pbs.py
+++ b/lib/galaxy/jobs/runners/pbs.py
@@ -563,7 +563,7 @@ class PBSJobRunner( object ):
if c <= 0:
log.debug("(%s/%s) Connection to PBS server for job delete failed" % ( job.id, job.job_runner_external_id ) )
return
- pbs.pbs_deljob( c, str( job.job_runner_external_id ), 'NULL' )
+ pbs.pbs_deljob( c, str( job.job_runner_external_id ), '' )
pbs.pbs_disconnect( c )
log.debug( "(%s/%s) Removed from PBS queue before job completion" % ( job.id, job.job_runner_external_id ) )
1
0
galaxy-dist commit 9c6040ab75a8: Fix for refresh_on_change javascript.
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 Daniel Blankenberg <dan(a)bx.psu.edu>
# Date 1288196760 14400
# Node ID 9c6040ab75a8397a5708cfec4edfe216927b8220
# Parent a2e4d36c4318bc4ce73af9df869ae4071af33d55
Fix for refresh_on_change javascript.
--- a/static/scripts/galaxy.base.js
+++ b/static/scripts/galaxy.base.js
@@ -290,8 +290,8 @@ function replace_big_select_inputs(min_l
var try_refresh_fn = function() {
// Get new value and see if it can be matched.
var new_value = select_mapping[text_input_elt.attr('value')];
- if (new_value !== null && new_value !== undefined) {
- if ($.inArray(new_value, ref_on_change_vals) === -1 && $.inArray(last_selected_value, ref_on_change_vals) === -1) {
+ if (last_selected_value !== new_value && new_value !== null && new_value !== undefined) {
+ if (ref_on_change_vals !== undefined && $.inArray(new_value, ref_on_change_vals) === -1 && $.inArray(last_selected_value, ref_on_change_vals) === -1) {
return;
}
text_input_elt.attr('value', new_value);
--- a/static/scripts/packed/galaxy.base.js
+++ b/static/scripts/packed/galaxy.base.js
@@ -1,1 +1,1 @@
-if(!Array.indexOf){Array.prototype.indexOf=function(c){for(var b=0,a=this.length;b<a;b++){if(this[b]==c){return b}}return -1}}function obj_length(c){if(c.length!==undefined){return c.length}var b=0;for(var a in c){b++}return b}$.fn.makeAbsolute=function(a){return this.each(function(){var b=$(this);var c=b.position();b.css({position:"absolute",marginLeft:0,marginTop:0,top:c.top,left:c.left,right:$(window).width()-(c.left+b.width())});if(a){b.remove().appendTo("body")}})};function ensure_popup_helper(){if($("#popup-helper").length===0){$("<div id='popup-helper'/>").css({background:"white",opacity:0,zIndex:15000,position:"absolute",top:0,left:0,width:"100%",height:"100%"}).appendTo("body").hide()}}function attach_popupmenu(b,d){var a=function(){d.unbind().hide();$("#popup-helper").unbind("click.popupmenu").hide()};var c=function(g){$("#popup-helper").bind("click.popupmenu",a).show();d.click(a).css({left:0,top:-1000}).show();var f=g.pageX-d.width()/2;f=Math.min(f,$(document).scr
ollLeft()+$(window).width()-$(d).width()-20);f=Math.max(f,$(document).scrollLeft()+20);d.css({top:g.pageY-5,left:f});return false};$(b).bind("click",c)}function make_popupmenu(c,b){ensure_popup_helper();var a=$("<ul id='"+c.attr("id")+"-menu'></ul>");if(obj_length(b)<=0){$("<li/>").html("No options").appendTo(a)}$.each(b,function(f,e){if(e){$("<li/>").html(f).click(e).appendTo(a)}else{$("<li class='head'/>").html(f).appendTo(a)}});var d=$("<div class='popmenu-wrapper'>");d.append(a).append("<div class='overlay-border'>").css("position","absolute").appendTo("body").hide();attach_popupmenu(c,d);return a}function show_hide_popupmenu_options(d,c,a){var a=(a===undefined?true:a);var b=new RegExp(c);$(d).find("li").each(function(){if(b.exec($(this).text())){if(a){$(this).show()}else{$(this).hide()}}})}function make_popup_menus(){jQuery("div[popupmenu]").each(function(){var c={};$(this).find("a").each(function(){var b=$(this).attr("confirm"),d=$(this).attr("href"),e=$(this).attr("ta
rget");c[$(this).text()]=function(){if(!b||confirm(b)){var g=window;if(e=="_parent"){g=window.parent}else{if(e=="_top"){g=window.top}}g.location=d}}});var a=$("#"+$(this).attr("popupmenu"));a.find("a").bind("click",function(b){b.stopPropagation();return true});make_popupmenu(a,c);$(this).remove();a.addClass("popup").show()})}function naturalSort(i,g){var n=/(-?[0-9\.]+)/g,j=i.toString().toLowerCase()||"",f=g.toString().toLowerCase()||"",k=String.fromCharCode(0),l=j.replace(n,k+"$1"+k).split(k),e=f.replace(n,k+"$1"+k).split(k),d=(new Date(j)).getTime(),m=d?(new Date(f)).getTime():null;if(m){if(d<m){return -1}else{if(d>m){return 1}}}for(var h=0,c=Math.max(l.length,e.length);h<c;h++){oFxNcL=parseFloat(l[h])||l[h];oFyNcL=parseFloat(e[h])||e[h];if(oFxNcL<oFyNcL){return -1}else{if(oFxNcL>oFyNcL){return 1}}}return 0}function replace_big_select_inputs(a,b){if(!jQuery().autocomplete){return}if(a===undefined){a=20}if(b===undefined){b=3000}$("select").each(function(){var d=$(this);var
g=d.find("option").length;if((g<a)||(g>b)){return}if(d.attr("multiple")==true){return}if(d.hasClass("no-autocomplete")){return}var m=d.attr("value");var c=$("<input type='text' class='text-and-autocomplete-select'></input>");c.attr("size",40);c.attr("name",d.attr("name"));c.attr("id",d.attr("id"));c.click(function(){var n=$(this).val();$(this).val("Loading...");$(this).showAllInCache();$(this).val(n);$(this).select()});var e=[];var i={};d.children("option").each(function(){var o=$(this).text();var n=$(this).attr("value");e.push(o);i[o]=n;i[n]=n;if(n==m){c.attr("value",o)}});if(m==""||m=="?"){c.attr("value","Click to Search or Select")}if(d.attr("name")=="dbkey"){e=e.sort(naturalSort)}var f={selectFirst:false,autoFill:false,mustMatch:false,matchContains:true,max:b,minChars:0,hideForLessThanMinChars:false};c.autocomplete(e,f);d.replaceWith(c);var k=function(){var o=c.attr("value");var n=i[o];if(n!==null&&n!==undefined){c.attr("value",n)}else{if(m!=""){c.attr("value",m)}else{c.
attr("value","?")}}};c.parents("form").submit(function(){k()});$(document).bind("convert_dbkeys",function(){k()});if(d.attr("refresh_on_change")=="true"){var h=d.attr("refresh_on_change_values"),l=d.attr("last_selected_value");if(h!==undefined){h=h.split(",")}var j=function(){var n=i[c.attr("value")];if(n!==null&&n!==undefined){if($.inArray(n,h)===-1&&$.inArray(l,h)===-1){return}c.attr("value",n);$(window).trigger("refresh_on_change");c.parents("form").submit()}};c.bind("result",j);c.keyup(function(n){if(n.keyCode===13){j()}});c.keydown(function(n){if(n.keyCode===13){return false}})}})}function async_save_text(d,f,e,a,c,h,i,g,b){if(c===undefined){c=30}if(i===undefined){i=4}$("#"+d).live("click",function(){if($("#renaming-active").length>0){return}var l=$("#"+f),k=l.text(),j;if(h){j=$("<textarea></textarea>").attr({rows:i,cols:c}).text($.trim(k))}else{j=$("<input type='text'></input>").attr({value:$.trim(k),size:c})}j.attr("id","renaming-active");j.blur(function(){$(this).rem
ove();l.show();if(b){b(j)}});j.keyup(function(n){if(n.keyCode===27){$(this).trigger("blur")}else{if(n.keyCode===13){var m={};m[a]=$(this).val();$(this).trigger("blur");$.ajax({url:e,data:m,error:function(){alert("Text editing for elt "+f+" failed")},success:function(o){if(o!=""){l.text(o)}else{l.html("<em>None</em>")}if(b){b(j)}}})}}});if(g){g(j)}l.hide();j.insertAfter(l);j.focus();j.select();return})}function init_history_items(d,a,c){var b=function(){try{var e=$.jStore.store("history_expand_state");if(e){for(var g in e){$("#"+g+" div.historyItemBody").show()}}}catch(f){$.jStore.remove("history_expand_state")}if($.browser.mozilla){$("div.historyItemBody").each(function(){if(!$(this).is(":visible")){$(this).find("pre.peek").css("overflow","hidden")}})}d.each(function(){var j=this.id;var h=$(this).children("div.historyItemBody");var i=h.find("pre.peek");$(this).find(".historyItemTitleBar > .historyItemTitle").wrap("<a href='javascript:void(0);'></a>").click(function(){if(h.is
(":visible")){if($.browser.mozilla){i.css("overflow","hidden")}h.slideUp("fast");if(!c){var k=$.jStore.store("history_expand_state");if(k){delete k[j];$.jStore.store("history_expand_state",k)}}}else{h.slideDown("fast",function(){if($.browser.mozilla){i.css("overflow","auto")}});if(!c){var k=$.jStore.store("history_expand_state");if(k===undefined){k={}}k[j]=true;$.jStore.store("history_expand_state",k)}}return false})});$("#top-links > a.toggle").click(function(){var h=$.jStore.store("history_expand_state");if(h===undefined){h={}}$("div.historyItemBody:visible").each(function(){if($.browser.mozilla){$(this).find("pre.peek").css("overflow","hidden")}$(this).slideUp("fast");if(h){delete h[$(this).parent().attr("id")]}});$.jStore.store("history_expand_state",h)}).show()};if(a){b()}else{$.jStore.init("galaxy");$.jStore.engineReady(function(){b()})}}function commatize(b){b+="";var a=/(\d+)(\d{3})/;while(a.test(b)){b=b.replace(a,"$1,$2")}return b}function reset_tool_search(a){var c
=$("#galaxy_tools").contents();if(c.length==0){c=$(document)}$(this).removeClass("search_active");c.find(".toolTitle").removeClass("search_match");c.find(".toolSectionBody").hide();c.find(".toolTitle").show();c.find(".toolPanelLabel").show();c.find(".toolSectionWrapper").each(function(){if($(this).attr("id")!="recently_used_wrapper"){$(this).show()}else{if($(this).hasClass("user_pref_visible")){$(this).show()}}});c.find("#search-no-results").hide();c.find("#search-spinner").hide();if(a){var b=c.find("#tool-search-query");b.val("search tools");b.css("font-style","italic")}}var GalaxyAsync=function(a){this.url_dict={};this.log_action=(a===undefined?false:a)};GalaxyAsync.prototype.set_func_url=function(a,b){this.url_dict[a]=b};GalaxyAsync.prototype.set_user_pref=function(a,b){var c=this.url_dict[arguments.callee];if(c===undefined){return false}$.ajax({url:c,data:{pref_name:a,pref_value:b},error:function(){return false},success:function(){return true}})};GalaxyAsync.prototype.lo
g_user_action=function(c,b,d){if(!this.log_action){return}var a=this.url_dict[arguments.callee];if(a===undefined){return false}$.ajax({url:a,data:{action:c,context:b,params:d},error:function(){return false},success:function(){return true}})};$(".trackster-add").live("click",function(){var b=this,a=$(this);$.ajax({url:a.attr("data-url"),dataType:"html",error:function(){alert("Could not add this dataset to browser.")},success:function(c){var d=window.parent;d.show_modal("Add to Browser:",c,{Cancel:function(){d.hide_modal()},"Insert into selected":function(){$(d.document).find("input[name=id]:checked").each(function(){var e=$(this).val();d.location=a.attr("action-url")+"&id="+e})},"Insert into new browser":function(){d.location=a.attr("new-url")}})}})});$(document).ready(function(){$("select[refresh_on_change='true']").change(function(){var a=$(this),e=a.val(),d=false,c=a.attr("refresh_on_change_values");if(c){c=c.split(",");var b=a.attr("last_selected_value");if($.inArray(e,c)
===-1&&$.inArray(b,c)===-1){return}}$(window).trigger("refresh_on_change");a.get(0).form.submit()});$("a[confirm]").click(function(){return confirm($(this).attr("confirm"))});if($.fn.tipsy){$(".tooltip").tipsy({gravity:"s"})}make_popup_menus();replace_big_select_inputs(20,1500)});
+if(!Array.indexOf){Array.prototype.indexOf=function(c){for(var b=0,a=this.length;b<a;b++){if(this[b]==c){return b}}return -1}}function obj_length(c){if(c.length!==undefined){return c.length}var b=0;for(var a in c){b++}return b}$.fn.makeAbsolute=function(a){return this.each(function(){var b=$(this);var c=b.position();b.css({position:"absolute",marginLeft:0,marginTop:0,top:c.top,left:c.left,right:$(window).width()-(c.left+b.width())});if(a){b.remove().appendTo("body")}})};function ensure_popup_helper(){if($("#popup-helper").length===0){$("<div id='popup-helper'/>").css({background:"white",opacity:0,zIndex:15000,position:"absolute",top:0,left:0,width:"100%",height:"100%"}).appendTo("body").hide()}}function attach_popupmenu(b,d){var a=function(){d.unbind().hide();$("#popup-helper").unbind("click.popupmenu").hide()};var c=function(g){$("#popup-helper").bind("click.popupmenu",a).show();d.click(a).css({left:0,top:-1000}).show();var f=g.pageX-d.width()/2;f=Math.min(f,$(document).scr
ollLeft()+$(window).width()-$(d).width()-20);f=Math.max(f,$(document).scrollLeft()+20);d.css({top:g.pageY-5,left:f});return false};$(b).bind("click",c)}function make_popupmenu(c,b){ensure_popup_helper();var a=$("<ul id='"+c.attr("id")+"-menu'></ul>");if(obj_length(b)<=0){$("<li/>").html("No options").appendTo(a)}$.each(b,function(f,e){if(e){$("<li/>").html(f).click(e).appendTo(a)}else{$("<li class='head'/>").html(f).appendTo(a)}});var d=$("<div class='popmenu-wrapper'>");d.append(a).append("<div class='overlay-border'>").css("position","absolute").appendTo("body").hide();attach_popupmenu(c,d);return a}function show_hide_popupmenu_options(d,c,a){var a=(a===undefined?true:a);var b=new RegExp(c);$(d).find("li").each(function(){if(b.exec($(this).text())){if(a){$(this).show()}else{$(this).hide()}}})}function make_popup_menus(){jQuery("div[popupmenu]").each(function(){var c={};$(this).find("a").each(function(){var b=$(this).attr("confirm"),d=$(this).attr("href"),e=$(this).attr("ta
rget");c[$(this).text()]=function(){if(!b||confirm(b)){var g=window;if(e=="_parent"){g=window.parent}else{if(e=="_top"){g=window.top}}g.location=d}}});var a=$("#"+$(this).attr("popupmenu"));a.find("a").bind("click",function(b){b.stopPropagation();return true});make_popupmenu(a,c);$(this).remove();a.addClass("popup").show()})}function naturalSort(i,g){var n=/(-?[0-9\.]+)/g,j=i.toString().toLowerCase()||"",f=g.toString().toLowerCase()||"",k=String.fromCharCode(0),l=j.replace(n,k+"$1"+k).split(k),e=f.replace(n,k+"$1"+k).split(k),d=(new Date(j)).getTime(),m=d?(new Date(f)).getTime():null;if(m){if(d<m){return -1}else{if(d>m){return 1}}}for(var h=0,c=Math.max(l.length,e.length);h<c;h++){oFxNcL=parseFloat(l[h])||l[h];oFyNcL=parseFloat(e[h])||e[h];if(oFxNcL<oFyNcL){return -1}else{if(oFxNcL>oFyNcL){return 1}}}return 0}function replace_big_select_inputs(a,b){if(!jQuery().autocomplete){return}if(a===undefined){a=20}if(b===undefined){b=3000}$("select").each(function(){var d=$(this);var
g=d.find("option").length;if((g<a)||(g>b)){return}if(d.attr("multiple")==true){return}if(d.hasClass("no-autocomplete")){return}var m=d.attr("value");var c=$("<input type='text' class='text-and-autocomplete-select'></input>");c.attr("size",40);c.attr("name",d.attr("name"));c.attr("id",d.attr("id"));c.click(function(){var n=$(this).val();$(this).val("Loading...");$(this).showAllInCache();$(this).val(n);$(this).select()});var e=[];var i={};d.children("option").each(function(){var o=$(this).text();var n=$(this).attr("value");e.push(o);i[o]=n;i[n]=n;if(n==m){c.attr("value",o)}});if(m==""||m=="?"){c.attr("value","Click to Search or Select")}if(d.attr("name")=="dbkey"){e=e.sort(naturalSort)}var f={selectFirst:false,autoFill:false,mustMatch:false,matchContains:true,max:b,minChars:0,hideForLessThanMinChars:false};c.autocomplete(e,f);d.replaceWith(c);var k=function(){var o=c.attr("value");var n=i[o];if(n!==null&&n!==undefined){c.attr("value",n)}else{if(m!=""){c.attr("value",m)}else{c.
attr("value","?")}}};c.parents("form").submit(function(){k()});$(document).bind("convert_dbkeys",function(){k()});if(d.attr("refresh_on_change")=="true"){var h=d.attr("refresh_on_change_values"),l=d.attr("last_selected_value");if(h!==undefined){h=h.split(",")}var j=function(){var n=i[c.attr("value")];if(l!==n&&n!==null&&n!==undefined){if(h!==undefined&&$.inArray(n,h)===-1&&$.inArray(l,h)===-1){return}c.attr("value",n);$(window).trigger("refresh_on_change");c.parents("form").submit()}};c.bind("result",j);c.keyup(function(n){if(n.keyCode===13){j()}});c.keydown(function(n){if(n.keyCode===13){return false}})}})}function async_save_text(d,f,e,a,c,h,i,g,b){if(c===undefined){c=30}if(i===undefined){i=4}$("#"+d).live("click",function(){if($("#renaming-active").length>0){return}var l=$("#"+f),k=l.text(),j;if(h){j=$("<textarea></textarea>").attr({rows:i,cols:c}).text($.trim(k))}else{j=$("<input type='text'></input>").attr({value:$.trim(k),size:c})}j.attr("id","renaming-active");j.blur(
function(){$(this).remove();l.show();if(b){b(j)}});j.keyup(function(n){if(n.keyCode===27){$(this).trigger("blur")}else{if(n.keyCode===13){var m={};m[a]=$(this).val();$(this).trigger("blur");$.ajax({url:e,data:m,error:function(){alert("Text editing for elt "+f+" failed")},success:function(o){if(o!=""){l.text(o)}else{l.html("<em>None</em>")}if(b){b(j)}}})}}});if(g){g(j)}l.hide();j.insertAfter(l);j.focus();j.select();return})}function init_history_items(d,a,c){var b=function(){try{var e=$.jStore.store("history_expand_state");if(e){for(var g in e){$("#"+g+" div.historyItemBody").show()}}}catch(f){$.jStore.remove("history_expand_state")}if($.browser.mozilla){$("div.historyItemBody").each(function(){if(!$(this).is(":visible")){$(this).find("pre.peek").css("overflow","hidden")}})}d.each(function(){var j=this.id;var h=$(this).children("div.historyItemBody");var i=h.find("pre.peek");$(this).find(".historyItemTitleBar > .historyItemTitle").wrap("<a href='javascript:void(0);'></a>").cl
ick(function(){if(h.is(":visible")){if($.browser.mozilla){i.css("overflow","hidden")}h.slideUp("fast");if(!c){var k=$.jStore.store("history_expand_state");if(k){delete k[j];$.jStore.store("history_expand_state",k)}}}else{h.slideDown("fast",function(){if($.browser.mozilla){i.css("overflow","auto")}});if(!c){var k=$.jStore.store("history_expand_state");if(k===undefined){k={}}k[j]=true;$.jStore.store("history_expand_state",k)}}return false})});$("#top-links > a.toggle").click(function(){var h=$.jStore.store("history_expand_state");if(h===undefined){h={}}$("div.historyItemBody:visible").each(function(){if($.browser.mozilla){$(this).find("pre.peek").css("overflow","hidden")}$(this).slideUp("fast");if(h){delete h[$(this).parent().attr("id")]}});$.jStore.store("history_expand_state",h)}).show()};if(a){b()}else{$.jStore.init("galaxy");$.jStore.engineReady(function(){b()})}}function commatize(b){b+="";var a=/(\d+)(\d{3})/;while(a.test(b)){b=b.replace(a,"$1,$2")}return b}function rese
t_tool_search(a){var c=$("#galaxy_tools").contents();if(c.length==0){c=$(document)}$(this).removeClass("search_active");c.find(".toolTitle").removeClass("search_match");c.find(".toolSectionBody").hide();c.find(".toolTitle").show();c.find(".toolPanelLabel").show();c.find(".toolSectionWrapper").each(function(){if($(this).attr("id")!="recently_used_wrapper"){$(this).show()}else{if($(this).hasClass("user_pref_visible")){$(this).show()}}});c.find("#search-no-results").hide();c.find("#search-spinner").hide();if(a){var b=c.find("#tool-search-query");b.val("search tools");b.css("font-style","italic")}}var GalaxyAsync=function(a){this.url_dict={};this.log_action=(a===undefined?false:a)};GalaxyAsync.prototype.set_func_url=function(a,b){this.url_dict[a]=b};GalaxyAsync.prototype.set_user_pref=function(a,b){var c=this.url_dict[arguments.callee];if(c===undefined){return false}$.ajax({url:c,data:{pref_name:a,pref_value:b},error:function(){return false},success:function(){return true}})};Ga
laxyAsync.prototype.log_user_action=function(c,b,d){if(!this.log_action){return}var a=this.url_dict[arguments.callee];if(a===undefined){return false}$.ajax({url:a,data:{action:c,context:b,params:d},error:function(){return false},success:function(){return true}})};$(".trackster-add").live("click",function(){var b=this,a=$(this);$.ajax({url:a.attr("data-url"),dataType:"html",error:function(){alert("Could not add this dataset to browser.")},success:function(c){var d=window.parent;d.show_modal("Add to Browser:",c,{Cancel:function(){d.hide_modal()},"Insert into selected":function(){$(d.document).find("input[name=id]:checked").each(function(){var e=$(this).val();d.location=a.attr("action-url")+"&id="+e})},"Insert into new browser":function(){d.location=a.attr("new-url")}})}})});$(document).ready(function(){$("select[refresh_on_change='true']").change(function(){var a=$(this),e=a.val(),d=false,c=a.attr("refresh_on_change_values");if(c){c=c.split(",");var b=a.attr("last_selected_val
ue");if($.inArray(e,c)===-1&&$.inArray(b,c)===-1){return}}$(window).trigger("refresh_on_change");a.get(0).form.submit()});$("a[confirm]").click(function(){return confirm($(this).attr("confirm"))});if($.fn.tipsy){$(".tooltip").tipsy({gravity:"s"})}make_popup_menus();replace_big_select_inputs(20,1500)});
1
0
galaxy-dist commit 61c786bd2efb: Fix path to closebox.png image; this will show the close button for screencasts.
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 1288148380 14400
# Node ID 61c786bd2efb6f9cc4d5fa4d43dfb056ed99b909
# Parent af2d04e3568078d8d7ad94e229a17983f8282e20
Fix path to closebox.png image; this will show the close button for screencasts.
--- a/static/scripts/packed/galaxy.panels.js
+++ b/static/scripts/packed/galaxy.panels.js
@@ -1,1 +1,1 @@
-function ensure_dd_helper(){if($("#DD-helper").length==0){$("<div id='DD-helper'/>").css({background:"white",opacity:0,zIndex:9000,position:"absolute",top:0,left:0,width:"100%",height:"100%"}).appendTo("body").hide()}}function make_left_panel(h,c,e){var g=false;var f=null;var d=function(i){var j=i;if(i<0){i=0}$(h).css("width",i);$(e).css("left",j);$(c).css("left",i+7);if(document.recalc){document.recalc()}};var a=function(){if(g){$(e).removeClass("hover");$(e).animate({left:f},"fast");$(h).css("left",-f).show().animate({left:0},"fast",function(){d(f);$(e).removeClass("hidden")});g=false}else{f=$(e).position().left;$(c).css("left",$(e).innerWidth());if(document.recalc){document.recalc()}$(e).removeClass("hover");$(h).animate({left:-f},"fast");$(e).animate({left:-1},"fast",function(){$(this).addClass("hidden")});g=true}};$(e).hover(function(){$(this).addClass("hover")},function(){$(this).removeClass("hover")}).bind("dragstart",function(i){$("#DD-helper").show()}).bind("dragend
",function(i){$("#DD-helper").hide()}).bind("drag",function(i){x=i.offsetX;x=Math.min(400,Math.max(100,x));if(g){$(h).css("left",0);$(e).removeClass("hidden");g=false}d(x)}).bind("dragclickonly",function(i){a()}).find("div").show();var b=function(i){if((g&&i=="show")||(!g&&i=="hide")){a()}};return{force_panel:b}}function make_right_panel(a,e,h){var j=false;var g=false;var c=null;var d=function(k){$(a).css("width",k);$(e).css("right",k+9);$(h).css("right",k).css("left","");if(document.recalc){document.recalc()}};var i=function(){if(j){$(h).removeClass("hover");$(h).animate({right:c},"fast");$(a).css("right",-c).show().animate({right:0},"fast",function(){d(c);$(h).removeClass("hidden")});j=false}else{c=$(document).width()-$(h).position().left-$(h).outerWidth();$(e).css("right",$(h).innerWidth()+1);if(document.recalc){document.recalc()}$(h).removeClass("hover");$(a).animate({right:-c},"fast");$(h).animate({right:-1},"fast",function(){$(this).addClass("hidden")});j=true}g=false}
;var b=function(k){var l=$(e).width()-(j?c:0);if(l<k){if(!j){i();g=true}}else{if(g){i();g=false}}};$(h).hover(function(){$(this).addClass("hover")},function(){$(this).removeClass("hover")}).bind("dragstart",function(k){$("#DD-helper").show()}).bind("dragend",function(k){$("#DD-helper").hide()}).bind("drag",function(k){x=k.offsetX;w=$(window).width();x=Math.min(w-100,x);x=Math.max(w-400,x);if(j){$(a).css("right",0);$(h).removeClass("hidden");j=false}d(w-x-$(this).outerWidth())}).bind("dragclickonly",function(k){i()}).find("div").show();var f=function(k){if((j&&k=="show")||(!j&&k=="hide")){i()}};return{handle_minwidth_hint:b,force_panel:f}}function hide_modal(){$(".dialog-box-container").fadeOut(function(){$("#overlay").hide();$(".dialog-box").find(".body").children().remove()})}function show_modal(g,c,e,d,f){if(g){$(".dialog-box").find(".title").html(g);$(".dialog-box").find(".unified-panel-header").show()}else{$(".dialog-box").find(".unified-panel-header").hide()}var a=$(".d
ialog-box").find(".buttons").html("");if(e){$.each(e,function(b,h){a.append($("<button/>").text(b).click(h));a.append(" ")});a.show()}else{a.hide()}var a=$(".dialog-box").find(".extra_buttons").html("");if(d){$.each(d,function(b,h){a.append($("<button/>").text(b).click(h));a.append(" ")});a.show()}else{a.hide()}if(c=="progress"){c=$("<img/>").attr("src",image_path+"/yui/rel_interstitial_loading.gif")}$(".dialog-box").find(".body").html(c);if(!$(".dialog-box-container").is(":visible")){$("#overlay").show();$(".dialog-box-container").fadeIn()}if(f){f()}}function show_in_overlay(c){var d=c.width||"600";var b=c.height||"400";var a=c.scroll||"auto";$("#overlay-background").bind("click.overlay",function(){hide_modal();$("#overlay-background").unbind("click.overlay")});show_modal(null,$("<div style='margin: -5px;'><img id='close_button' style='position:absolute;right:-17px;top:-15px;' src='../images/closebox.png'><iframe style='margin: 0; padding: 0;' src='"+c.url+"' width='"+d+"'
height='"+b+"' scrolling='"+a+"' frameborder='0'></iframe></div>"));$("#close_button").bind("click",function(){hide_modal()})}$(function(){$(".tab").each(function(){var a=$(this).children(".submenu");if(a.length>0){if($.browser.msie){a.prepend("<iframe style=\"position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; filter:Alpha(Opacity='0');\"></iframe>")}$(this).hover(function(){a.show()},function(){a.hide()});a.click(function(){a.hide()})}})});function user_changed(a,b){if(a){$(".loggedin-only").show();$(".loggedout-only").hide();$("#user-email").text(a);if(b){$(".admin-only").show()}}else{$(".loggedin-only").hide();$(".loggedout-only").show();$(".admin-only").hide()}};
+function ensure_dd_helper(){if($("#DD-helper").length==0){$("<div id='DD-helper'/>").css({background:"white",opacity:0,zIndex:9000,position:"absolute",top:0,left:0,width:"100%",height:"100%"}).appendTo("body").hide()}}function make_left_panel(h,c,e){var g=false;var f=null;var d=function(i){var j=i;if(i<0){i=0}$(h).css("width",i);$(e).css("left",j);$(c).css("left",i+7);if(document.recalc){document.recalc()}};var a=function(){if(g){$(e).removeClass("hover");$(e).animate({left:f},"fast");$(h).css("left",-f).show().animate({left:0},"fast",function(){d(f);$(e).removeClass("hidden")});g=false}else{f=$(e).position().left;$(c).css("left",$(e).innerWidth());if(document.recalc){document.recalc()}$(e).removeClass("hover");$(h).animate({left:-f},"fast");$(e).animate({left:-1},"fast",function(){$(this).addClass("hidden")});g=true}};$(e).hover(function(){$(this).addClass("hover")},function(){$(this).removeClass("hover")}).bind("dragstart",function(i){$("#DD-helper").show()}).bind("dragend
",function(i){$("#DD-helper").hide()}).bind("drag",function(i){x=i.offsetX;x=Math.min(400,Math.max(100,x));if(g){$(h).css("left",0);$(e).removeClass("hidden");g=false}d(x)}).bind("dragclickonly",function(i){a()}).find("div").show();var b=function(i){if((g&&i=="show")||(!g&&i=="hide")){a()}};return{force_panel:b}}function make_right_panel(a,e,h){var j=false;var g=false;var c=null;var d=function(k){$(a).css("width",k);$(e).css("right",k+9);$(h).css("right",k).css("left","");if(document.recalc){document.recalc()}};var i=function(){if(j){$(h).removeClass("hover");$(h).animate({right:c},"fast");$(a).css("right",-c).show().animate({right:0},"fast",function(){d(c);$(h).removeClass("hidden")});j=false}else{c=$(document).width()-$(h).position().left-$(h).outerWidth();$(e).css("right",$(h).innerWidth()+1);if(document.recalc){document.recalc()}$(h).removeClass("hover");$(a).animate({right:-c},"fast");$(h).animate({right:-1},"fast",function(){$(this).addClass("hidden")});j=true}g=false}
;var b=function(k){var l=$(e).width()-(j?c:0);if(l<k){if(!j){i();g=true}}else{if(g){i();g=false}}};$(h).hover(function(){$(this).addClass("hover")},function(){$(this).removeClass("hover")}).bind("dragstart",function(k){$("#DD-helper").show()}).bind("dragend",function(k){$("#DD-helper").hide()}).bind("drag",function(k){x=k.offsetX;w=$(window).width();x=Math.min(w-100,x);x=Math.max(w-400,x);if(j){$(a).css("right",0);$(h).removeClass("hidden");j=false}d(w-x-$(this).outerWidth())}).bind("dragclickonly",function(k){i()}).find("div").show();var f=function(k){if((j&&k=="show")||(!j&&k=="hide")){i()}};return{handle_minwidth_hint:b,force_panel:f}}function hide_modal(){$(".dialog-box-container").fadeOut(function(){$("#overlay").hide();$(".dialog-box").find(".body").children().remove()})}function show_modal(g,c,e,d,f){if(g){$(".dialog-box").find(".title").html(g);$(".dialog-box").find(".unified-panel-header").show()}else{$(".dialog-box").find(".unified-panel-header").hide()}var a=$(".d
ialog-box").find(".buttons").html("");if(e){$.each(e,function(b,h){a.append($("<button/>").text(b).click(h));a.append(" ")});a.show()}else{a.hide()}var a=$(".dialog-box").find(".extra_buttons").html("");if(d){$.each(d,function(b,h){a.append($("<button/>").text(b).click(h));a.append(" ")});a.show()}else{a.hide()}if(c=="progress"){c=$("<img/>").attr("src",image_path+"/yui/rel_interstitial_loading.gif")}$(".dialog-box").find(".body").html(c);if(!$(".dialog-box-container").is(":visible")){$("#overlay").show();$(".dialog-box-container").fadeIn()}if(f){f()}}function show_in_overlay(c){var d=c.width||"600";var b=c.height||"400";var a=c.scroll||"auto";$("#overlay-background").bind("click.overlay",function(){hide_modal();$("#overlay-background").unbind("click.overlay")});show_modal(null,$("<div style='margin: -5px;'><img id='close_button' style='position:absolute;right:-17px;top:-15px;src='"+image_path+"/closebox.png'><iframe style='margin: 0; padding: 0;' src='"+c.url+"' width='"+d+
"' height='"+b+"' scrolling='"+a+"' frameborder='0'></iframe></div>"));$("#close_button").bind("click",function(){hide_modal()})}$(function(){$(".tab").each(function(){var a=$(this).children(".submenu");if(a.length>0){if($.browser.msie){a.prepend("<iframe style=\"position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; filter:Alpha(Opacity='0');\"></iframe>")}$(this).hover(function(){a.show()},function(){a.hide()});a.click(function(){a.hide()})}})});function user_changed(a,b){if(a){$(".loggedin-only").show();$(".loggedout-only").hide();$("#user-email").text(a);if(b){$(".admin-only").show()}}else{$(".loggedin-only").hide();$(".loggedout-only").show();$(".admin-only").hide()}};
--- a/static/scripts/galaxy.panels.js
+++ b/static/scripts/galaxy.panels.js
@@ -213,7 +213,7 @@ function show_in_overlay( options ) {
hide_modal();
$("#overlay-background").unbind( "click.overlay" );
});
- show_modal( null, $("<div style='margin: -5px;'><img id='close_button' style='position:absolute;right:-17px;top:-15px;' src='../images/closebox.png'><iframe style='margin: 0; padding: 0;' src='" + options.url + "' width='" + width + "' height='" + height + "' scrolling='" + scroll + "' frameborder='0'></iframe></div>" ) );
+ show_modal( null, $( "<div style='margin: -5px;'><img id='close_button' style='position:absolute;right:-17px;top:-15px;src='" + image_path + "/closebox.png'><iframe style='margin: 0; padding: 0;' src='" + options.url + "' width='" + width + "' height='" + height + "' scrolling='" + scroll + "' frameborder='0'></iframe></div>" ) );
$("#close_button").bind( "click", function() { hide_modal() } );
}
1
0
galaxy-dist commit af2d04e35680: Radio boxes in tool forms now have clickable labels as well. Update unit tests to reflect changes
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 1288137500 14400
# Node ID af2d04e3568078d8d7ad94e229a17983f8282e20
# Parent 6a1ea9b6029416945caba087f2696c64a9a06621
Radio boxes in tool forms now have clickable labels as well. Update unit tests to reflect changes
--- a/lib/galaxy/web/form_builder.py
+++ b/lib/galaxy/web/form_builder.py
@@ -184,16 +184,16 @@ class SelectField(BaseField):
>>> t.add_option( "tuti", 1 )
>>> t.add_option( "fruity", "x" )
>>> print t.get_html()
- <div><input type="radio" name="foo" value="1">tuti</div>
- <div><input type="radio" name="foo" value="x">fruity</div>
+ <div><input type="radio" name="foo" value="1" id="foo|1"><label for="foo|1">tuti</label></div>
+ <div><input type="radio" name="foo" value="x" id="foo|x"><label for="foo|x">fruity</label></div>
>>> t = SelectField( "bar", multiple=True, display="checkboxes" )
>>> t.add_option( "automatic", 3 )
>>> t.add_option( "bazooty", 4, selected=True )
>>> print t.get_html()
<div class="checkUncheckAllPlaceholder" checkbox_name="bar"></div>
- <div><input type="checkbox" name="bar" value="3">automatic</div>
- <div><input type="checkbox" name="bar" value="4" checked>bazooty</div>
+ <div><input type="checkbox" name="bar" value="3" id="bar|3"><label for="bar|3">automatic</label></div>
+ <div><input type="checkbox" name="bar" value="4" id="bar|4" checked='checked'><label for="bar|4">bazooty</label></div>
"""
def __init__( self, name, multiple=None, display=None, refresh_on_change=False, refresh_on_change_values=[], size=None ):
self.name = name
@@ -232,13 +232,14 @@ class SelectField(BaseField):
for text, value, selected in self.options:
style = ""
escaped_value = escape( str( value ), quote=True )
+ uniq_id = "%s%s|%s" % (prefix, self.name, escaped_value)
if len(self.options) > 2 and ctr % 2 == 1:
style = " class=\"odd_row\""
selected_text = ""
if selected:
- selected_text = "checked='checked'"
- rval.append( '<div%s><input type="checkbox" name="%s%s" value="%s" id="%s" %s%s><label for="%s">%s</label></div>' % \
- ( style, prefix, self.name, escaped_value, escaped_value, selected_text, self.get_disabled_str( disabled ), escaped_value, text ) )
+ selected_text = " checked='checked'"
+ rval.append( '<div%s><input type="checkbox" name="%s%s" value="%s" id="%s"%s%s><label for="%s">%s</label></div>' % \
+ ( style, prefix, self.name, escaped_value, uniq_id, selected_text, self.get_disabled_str( disabled ), uniq_id, text ) )
ctr += 1
return "\n".join( rval )
def get_html_radio( self, prefix="", disabled=False ):
@@ -246,18 +247,23 @@ class SelectField(BaseField):
ctr = 0
for text, value, selected in self.options:
style = ""
+ escaped_value = escape( str( value ), quote=True )
+ uniq_id = "%s%s|%s" % (prefix, self.name, escaped_value)
if len(self.options) > 2 and ctr % 2 == 1:
style = " class=\"odd_row\""
- if selected: selected_text = " checked"
- else: selected_text = ""
- rval.append( '<div%s><input type="radio" name="%s%s"%s value="%s"%s%s>%s</div>' % \
+ selected_text = ""
+ if selected:
+ selected_text = " checked='checked'"
+ rval.append( '<div%s><input type="radio" name="%s%s"%s value="%s" id="%s"%s%s><label for="%s">%s</label></div>' % \
( style,
prefix,
self.name,
self.refresh_on_change_text,
- escape( str( value ), quote=True ),
+ escaped_value,
+ uniq_id,
selected_text,
self.get_disabled_str( disabled ),
+ uniq_id,
text ) )
ctr += 1
return "\n".join( rval )
--- a/lib/galaxy/tools/parameters/basic.py
+++ b/lib/galaxy/tools/parameters/basic.py
@@ -474,14 +474,14 @@ class SelectToolParameter( ToolParameter
blah
>>> print p.get_html()
<div class="checkUncheckAllPlaceholder" checkbox_name="blah"></div>
- <div><input type="checkbox" name="blah" value="x">I am X</div>
- <div class="odd_row"><input type="checkbox" name="blah" value="y" checked>I am Y</div>
- <div><input type="checkbox" name="blah" value="z" checked>I am Z</div>
+ <div><input type="checkbox" name="blah" value="x" id="blah|x"><label for="blah|x">I am X</label></div>
+ <div class="odd_row"><input type="checkbox" name="blah" value="y" id="blah|y" checked='checked'><label for="blah|y">I am Y</label></div>
+ <div><input type="checkbox" name="blah" value="z" id="blah|z" checked='checked'><label for="blah|z">I am Z</label></div>
>>> print p.get_html( value=["x","y"])
<div class="checkUncheckAllPlaceholder" checkbox_name="blah"></div>
- <div><input type="checkbox" name="blah" value="x" checked>I am X</div>
- <div class="odd_row"><input type="checkbox" name="blah" value="y" checked>I am Y</div>
- <div><input type="checkbox" name="blah" value="z">I am Z</div>
+ <div><input type="checkbox" name="blah" value="x" id="blah|x" checked='checked'><label for="blah|x">I am X</label></div>
+ <div class="odd_row"><input type="checkbox" name="blah" value="y" id="blah|y" checked='checked'><label for="blah|y">I am Y</label></div>
+ <div><input type="checkbox" name="blah" value="z" id="blah|z"><label for="blah|z">I am Z</label></div>
>>> print p.to_param_dict_string( ["y", "z"] )
y,z
"""
1
0
galaxy-dist commit 6a1ea9b60294: trackster: Fix LineTrack rendering bug when more than one tile on screen. Refactored to pass JSLint
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 1288135466 14400
# Node ID 6a1ea9b6029416945caba087f2696c64a9a06621
# Parent c22562b86d0f62d361fd2531d22d42cfd6bf07c1
trackster: Fix LineTrack rendering bug when more than one tile on screen. Refactored to pass JSLint
--- a/static/scripts/trackster.js
+++ b/static/scripts/trackster.js
@@ -13,7 +13,7 @@ var DENSITY = 200,
DATA_LOADING = "Loading data...",
FILTERABLE_CLASS = "filterable",
CACHED_TILES_FEATURE = 10,
- CACHED_TILES_LINE = 30,
+ CACHED_TILES_LINE = 5,
CACHED_DATA = 5,
DUMMY_CANVAS = document.createElement("canvas"),
RIGHT_STRAND, LEFT_STRAND;
@@ -120,7 +120,7 @@ var View = function( container, title, v
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_form = $("<form/>").attr("action", function() {} ).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 submit_nav = function(e) {
if (e.type === "focusout" || (e.keyCode || e.which) === 13 || (e.keyCode || e.which) === 27 ) {
@@ -145,21 +145,21 @@ var View = function( container, title, v
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() { view.zoom_out(); view.redraw() }).html('<img src="'+image_path+'/fugue/magnifier-zoom-out.png" />').appendTo(this.chrom_form);
- this.zi_link = $("<a/>").click(function() { view.zoom_in(); view.redraw() }).html('<img src="'+image_path+'/fugue/magnifier-zoom.png" />').appendTo(this.chrom_form);
+ this.zo_link = $("<a/>").click(function() { view.zoom_out(); view.redraw(); }).html('<img src="'+image_path+'/fugue/magnifier-zoom-out.png" />').appendTo(this.chrom_form);
+ this.zi_link = $("<a/>").click(function() { view.zoom_in(); view.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 ( result ) {
- if (result['reference']) {
+ if (result.reference) {
view.add_label_track( new ReferenceTrack(view) );
}
- view.chrom_data = result['chrom_info'];
+ view.chrom_data = result.chrom_info;
var chrom_options = '<option value="">Select Chrom/Contig</option>';
- for (i in view.chrom_data) {
- var chrom = view.chrom_data[i]['chrom'];
+ for (var i = 0, len = view.chrom_data.length; i < len; i++) {
+ var chrom = view.chrom_data[i].chrom;
chrom_options += '<option value="' + chrom + '">' + chrom + '</option>';
}
view.chrom_select.html(chrom_options);
@@ -203,7 +203,7 @@ var View = function( container, title, v
});
this.overview_close.bind("click", function() {
- for (var track_id in view.tracks) {
+ for (var track_id = 0, len = view.tracks.length; track_id < len; track_id++) {
view.tracks[track_id].is_overview = false;
}
$(this).siblings().filter("canvas").remove();
@@ -293,7 +293,7 @@ var View = function( container, title, v
view.reset();
view.redraw(true);
- for (var track_id in view.tracks) {
+ for (var track_id = 0, len = view.tracks.length; track_id < len; track_id++) {
var track = view.tracks[track_id];
if (track.init) {
track.init();
@@ -310,15 +310,17 @@ var View = function( container, title, v
},
go_to: function(str) {
var view = this,
+ new_low,
+ new_high,
chrom_pos = str.split(":"),
chrom = chrom_pos[0],
pos = chrom_pos[1];
if (pos !== undefined) {
try {
- var pos_split = pos.split("-"),
- new_low = parseInt(pos_split[0].replace(/,/g, "")),
- new_high = parseInt(pos_split[1].replace(/,/g, ""));
+ var pos_split = pos.split("-");
+ new_low = parseInt(pos_split[0].replace(/,/g, ""), 10);
+ new_high = parseInt(pos_split[1].replace(/,/g, ""), 10);
} catch (e) {
return false;
}
@@ -406,7 +408,7 @@ var View = function( container, title, v
this.tracks[i].draw();
}
}
- for (var i = 0, len = this.label_tracks.length; i < len; i++) {
+ for (i = 0, len = this.label_tracks.length; i < len; i++) {
this.label_tracks[i].draw();
}
}
@@ -475,15 +477,17 @@ var NumberFilter = function( name, index
$.extend( NumberFilter.prototype, {
// Returns true if filter can be applied to element.
applies_to: function( element ) {
- if ( element.length > this.index )
+ if ( element.length > this.index ) {
return true;
+ }
return false;
},
// Returns true iff element is in [low, high]; range is inclusive.
keep: function( element ) {
- if ( !this.applies_to( element ) )
+ if ( !this.applies_to( element ) ) {
// No element to filter on.
return true;
+ }
return ( element[this.index] >= this.low && element[this.index] <= this.high );
},
// Update filter's min and max values based on element's values.
@@ -526,15 +530,15 @@ var NumberFilter = function( name, index
// Parse filters dict and return filters.
var get_filters = function( filters_dict ) {
- var filters = []
+ var filters = [];
for (var i = 0; i < filters_dict.length; i++) {
var filter_dict = filters_dict[i];
- var name = filter_dict['name'], type = filter_dict['type'], index = filter_dict['index'];
+ var name = filter_dict.name, type = filter_dict.type, index = filter_dict.index;
if ( type == 'int' || type == 'float' ) {
filters[i] = new NumberFilter( name, index );
+ } else {
+ filters[i] = new Filter( name, index, type );
}
- else
- filters[i] = new Filter( name, index, type );
}
return filters;
};
@@ -673,10 +677,10 @@ var TiledTrack = function() {
track.draw();
};
var mode_mapping = {};
- for (var i in track.display_modes) {
+ for (var i, len = track.display_modes.length; i < len; i++) {
var mode = track.display_modes[i];
mode_mapping[mode] = function(mode) {
- return function() { change_mode(mode); }
+ return function() { change_mode(mode); };
}(mode);
}
make_popupmenu(track.mode_div, mode_mapping);
@@ -728,7 +732,7 @@ var TiledTrack = function() {
track.filtering_div.toggle();
};
}
- track_dropdown["Remove"] = function() {
+ track_dropdown.Remove = function() {
view.remove_track(track);
if (view.num_tracks === 0) {
$("#no-tracks").show();
@@ -762,19 +766,19 @@ var TiledTrack = function() {
resolution = this.view.resolution;
var parent_element = $("<div style='position: relative;'></div>"),
- w_scale = this.content_div.width() / range,
- tile_element;
+ w_scale = this.content_div.width() / range;
- this.content_div.append( parent_element ),
+ this.content_div.append( parent_element );
this.max_height = 0;
// Index of first tile that overlaps visible region
var tile_index = Math.floor( low / resolution / DENSITY );
// A list of setTimeout() ids used when drawing tiles.
- var draw_tile_ids = new Object();
+ var draw_tile_ids = {};
while ( ( tile_index * DENSITY * resolution ) < high ) {
// Check in cache
var key = this.content_div.width() + '_' + w_scale + '_' + tile_index;
var cached = this.tile_cache.get(key);
+ // console.log(cached, this.tile_cache);
if ( !force && cached ) {
var tile_low = tile_index * DENSITY * resolution;
var left = ( tile_low - low ) * w_scale;
@@ -796,7 +800,7 @@ var TiledTrack = function() {
//
var track = this;
var intervalId = setInterval(function() {
- if ( draw_tile_ids.length != 0 ) {
+ if ( draw_tile_ids.length !== 0 ) {
// Add drawing has finished; if there is more than one child in the content div,
// remove the first one, which is the oldest.
if ( track.content_div.children().length > 1 ) {
@@ -814,8 +818,8 @@ var TiledTrack = function() {
}, delayed_draw: function(track, key, low, high, tile_index, resolution, parent_element, w_scale, draw_tile_ids) {
// Put a 50ms delay on drawing so that if the user scrolls fast, we don't load extra data
var id = setTimeout(function() {
- if ( !(low > track.view.high || high < track.view.low) ) {
- tile_element = track.draw_tile( resolution, tile_index, parent_element, w_scale );
+ if (low <= track.view.high && high >= track.view.low) {
+ var tile_element = track.draw_tile( resolution, tile_index, parent_element, w_scale );
if (tile_element) {
// Store initial canvas in case we need to use it for overview
if (!track.initial_canvas && !window.G_vmlCanvasManager) {
@@ -828,13 +832,13 @@ var TiledTrack = function() {
}
// Add tile to cache and show tile.
track.tile_cache.set(key, tile_element);
- track.show_tile( tile_element, parent_element )
+ track.show_tile(tile_element, parent_element);
}
}
// Remove setTimeout id.
- delete draw_tile_ids.id;
+ delete draw_tile_ids[id];
}, 50);
- draw_tile_ids.id = true;
+ draw_tile_ids[id] = true;
},
// Show track tile and perform associated actions.
show_tile: function( tile_element, parent_element ) {
@@ -849,10 +853,10 @@ var TiledTrack = function() {
// Show/hide filters based on whether tile is filterable.
if ( tile_element.hasClass(FILTERABLE_CLASS) ) {
show_hide_popupmenu_options(track.popup_menu, "(Show|Hide) filters");
- if (track.filters_visible)
- track.filtering_div.show();
- }
- else {
+ if (track.filters_visible) {
+ track.filtering_div.show();
+ }
+ } else {
show_hide_popupmenu_options(track.popup_menu, "(Show|Hide) filters", false);
track.filtering_div.hide();
}
@@ -998,7 +1002,7 @@ var LineTrack = function ( name, view, d
dataset_id: track.dataset_id }, function(result) {
track.container_div.addClass( "line-track" );
- data = result.data;
+ var data = result.data;
if ( isNaN(parseFloat(track.prefs.min_value)) || isNaN(parseFloat(track.prefs.max_value)) ) {
track.prefs.min_value = data.min;
track.prefs.max_value = data.max;
@@ -1041,7 +1045,7 @@ var LineTrack = function ( name, view, d
"low": low, "high": high, "dataset_id": this.dataset_id,
"resolution": this.view.resolution },
success: function (result) {
- data = result.data;
+ var data = result.data;
track.data_cache.set(key, data);
delete track.data_queue[key];
track.draw();
@@ -1069,8 +1073,8 @@ var LineTrack = function ( name, view, d
return;
}
- var result = this.data_cache.get(key);
- if (result === null) { return; }
+ var data = this.data_cache.get(key);
+ if (!data) { return; }
canvas.css( {
position: "absolute",
@@ -1091,15 +1095,12 @@ var LineTrack = function ( name, view, d
ctx.beginPath();
ctx.fillStyle = this.prefs.color;
- // for intensity, calculate delta x in pixels to for width of box
+ var x_scaled, y, delta_x_px;
if (data.length > 1) {
- var delta_x_px = Math.ceil((data[1][0] - data[0][0]) * w_scale);
+ delta_x_px = Math.ceil((data[1][0] - data[0][0]) * w_scale);
} else {
- var delta_x_px = 10;
+ delta_x_px = 10;
}
-
- var x_scaled, y;
-
for (var i = 0, len = data.length; i < len; i++) {
x_scaled = Math.round((data[i][0] - tile_low) * w_scale);
y = data[i][1];
@@ -1169,7 +1170,7 @@ var LineTrack = function ( name, view, d
.append(max_input).append(color_label).append(color_input);
}, update_options: function(track_id) {
var min_value = $('#track_' + track_id + '_minval').val(),
- max_value = $('#track_' + track_id + '_maxval').val();
+ max_value = $('#track_' + track_id + '_maxval').val(),
color = $('#track_' + track_id + '_color').val();
if ( min_value !== this.prefs.min_value || max_value !== this.prefs.max_value || color !== this.prefs.color ) {
this.prefs.min_value = parseFloat(min_value);
@@ -1324,7 +1325,7 @@ var FeatureTrack = function ( name, view
var cur_offset = 0,
gap = Math.round(w_scale / 2);
- for (cig_id in cigar) {
+ for (var cig_id = 0, len = cigar.length; cig_id < len; cig_id++) {
var cig = cigar[cig_id],
cig_op = "MIDNSHP"[cig[0]],
cig_len = cig[1];
@@ -1396,7 +1397,6 @@ var FeatureTrack = function ( name, view
}
var width = Math.ceil( tile_span * w_scale ),
- canvas = $("<canvas class='tile'></canvas>"),
label_color = this.prefs.label_color,
block_color = this.prefs.block_color,
mode = this.mode,
@@ -1417,7 +1417,7 @@ var FeatureTrack = function ( name, view
} else {
// Calculate new slots incrementally for this new chunk of data and update height if necessary
y_scale = ( no_detail ? this.vertical_nodetail_px : this.vertical_detail_px );
- var inc_scale = (w_scale < 0.0001 ? 1/view.zoom_res : w_scale);
+ var inc_scale = (w_scale < 0.0001 ? 1/this.view.zoom_res : w_scale);
required_height = this.incremental_slots( inc_scale, result.data, no_detail, mode ) * y_scale + min_height;
slots = this.inc_slots[inc_scale];
}
@@ -1440,7 +1440,6 @@ var FeatureTrack = function ( name, view
if (result.dataset_type == "summary_tree") {
var points = result.data,
max = result.max,
- avg = result.avg,
delta_x_px = Math.ceil(result.delta * w_scale);
var max_label = $("<div />").addClass('yaxislabel').text(max);
@@ -1485,14 +1484,15 @@ var FeatureTrack = function ( name, view
// See if tile is filterable. If so, add class.
var filterable = false;
- if ( result.data.length != 0 ) {
+ if (result.data) {
filterable = true;
- for (var f = 0; f < this.filters.length; f++)
+ for (var f = 0; f < this.filters.length; f++) {
if ( !this.filters[f].applies_to( result.data[0] ) ) {
filterable = false;
}
+ }
}
- if ( filterable ) {
+ if (filterable) {
canvas.addClass(FILTERABLE_CLASS);
}
@@ -1521,14 +1521,17 @@ var FeatureTrack = function ( name, view
break;
}
}
- if ( hide_feature )
+ if (hide_feature) {
continue;
+ }
if (feature_start <= tile_high && feature_end >= tile_low) {
var f_start = Math.floor( Math.max(0, (feature_start - tile_low) * w_scale) ),
f_end = Math.ceil( Math.min(width, Math.max(0, (feature_end - tile_low) * w_scale)) ),
y_center = (mode === "Dense" ? 1 : (1 + slots[feature_uid])) * y_scale;
+ var thickness, y_start, thick_start = null, thick_end = null;
+
if (result.dataset_type === "bai") {
var cigar = feature[4];
ctx.fillStyle = block_color;
@@ -1577,8 +1580,7 @@ var FeatureTrack = function ( name, view
feature_ts = feature[5],
feature_te = feature[6],
feature_blocks = feature[7];
-
- var thickness, y_start, thick_start = null, thick_end = null;
+
if (feature_ts && feature_te) {
thick_start = Math.floor( Math.max(0, (feature_ts - tile_low) * w_scale) );
thick_end = Math.ceil( Math.min(width, Math.max(0, (feature_te - tile_low) * w_scale)) );
@@ -1704,7 +1706,6 @@ var FeatureTrack = function ( name, view
}, update_options: function(track_id) {
var block_color = $('#track_' + track_id + '_block_color').val(),
label_color = $('#track_' + track_id + '_label_color').val(),
- mode = $('#track_' + track_id + '_mode option:selected').val(),
show_counts = $('#track_' + track_id + '_show_count').attr("checked");
if (block_color !== this.prefs.block_color || label_color !== this.prefs.label_color || show_counts !== this.prefs.show_counts) {
this.prefs.block_color = block_color;
--- a/templates/tracks/browser.mako
+++ b/templates/tracks/browser.mako
@@ -139,7 +139,6 @@
view.add_track(new_track);
view.has_changes = true;
$("#no-tracks").hide();
- sidebar_box(new_track);
};
%if add_dataset is not None:
--- 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=50,CONNECTOR_COLOR="#ccc",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...",FILTERABLE_CLASS="filterable",CACHED_TILES_FEATURE=10,CACHED_TILES_LINE=30,CACHED_DATA=5,DUMMY_CANVAS=document.createElement("canvas"),RIGHT_STRAND,LEFT_STRAND;if(window.G_vmlCanvasManager){G_vmlCanvasManager.initElement(DUMMY_CANVAS)}CONTEXT=DUMMY_CANVAS.getContext("2d");PX_PER_CHAR=CONTEXT.measureText("A").width;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.createP
attern(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,d,c,b){this.container=a;this.vis_id=c;this.dbkey=b;this.t
itle=d;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/>").addCla
ss("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.keyC
ode||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.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("he
ight",a.overview_box.height());a.overview_highlight.hide();$(this).hide()});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(this,this.top_labeltrack));this.add_label_track(new LabelTrack(this,this.nav_labeltrack));$(window).bind("resize",function(){a.resize_window()});$(document).bind("redraw",function(){a.redraw()});this.reset();$(window).trigger("resize")},update_location:function(a,b){this.location_span.text(commatize(a)+" - "+commatize(b));this.nav_input.val(this.chrom+":"+commatize(a)+"-"+commatize(b))},change_chr
om: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 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.reset_overview();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.contai
ner_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())||0;var e=((t
his.high-this.low)/(this.max_high-this.max_low)*this.overview_viewport.width())||0;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,width: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()},resize_
window:function(){this.viewport_container.height(this.container.height()-this.nav_container.height()-45);this.nav_container.width(this.container.width());this.redraw()},reset_overview:function(){this.overview_viewport.find("canvas").remove();this.overview_viewport.height(this.default_overview_height);this.overview_box.height(this.default_overview_height);this.overview_close.hide();this.overview_highlight.hide()}});var Filter=function(b,a,c){this.name=b;this.index=a;this.value=c};var NumberFilter=function(b,a){this.name=b;this.index=a;this.low=-Number.MAX_VALUE;this.high=Number.MAX_VALUE;this.slider_min=Number.MAX_VALUE;this.slider_max=-Number.MAX_VALUE;this.slider=null;this.slider_label=null};$.extend(NumberFilter.prototype,{applies_to:function(a){if(a.length>this.index){return true}return false},keep:function(a){if(!this.applies_to(a)){return true}return(a[this.index]>=this.low&&a[this.index]<=this.high)},update_attrs:function(b){var a=false;if(!this.applies_to(b)){return a
}if(b[this.index]<this.slider_min){this.slider_min=b[this.index];a=true}if(b[this.index]>this.slider_max){this.slider_max=b[this.index];a=false}return a},update_ui_elt:function(){var b=this.slider.slider("option","min"),a=this.slider.slider("option","max");if(this.slider_min<b||this.slider_max>a){this.slider.slider("option","min",this.slider_min);this.slider.slider("option","max",this.slider_max);this.slider.slider("option","values",[this.slider_min,this.slider_max])}}});var get_filters=function(a){var g=[];for(var d=0;d<a.length;d++){var f=a[d];var c=f.name,e=f.type,b=f.index;if(e=="int"||e=="float"){g[d]=new NumberFilter(c,b)}else{g[d]=new Filter(c,b,e)}}return g};var Track=function(b,a,d,c){this.name=b;this.view=a;this.parent_element=d;this.filters=(c!==undefined?get_filters(c):[]);this.init_global()};$.extend(Track.prototype,{init_global:function(){this.container_div=$("<div />").addClass("track").css("position","relative");if(!this.hidden){this.header_div=$("<div class=
'track-header' />").appendTo(this.container_div);if(this.view.editor){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.name_div.attr("id",this.name.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9\-]/g,"").toLowerCase())}this.filtering_div=$("<div class='track-filters'>").appendTo(this.container_div);this.filtering_div.hide();this.filtering_div.bind("drag",function(k){k.stopPropagation()});var b=$("<table class='filters'>").appendTo(this.filtering_div);var c=this;for(var e=0;e<this.filters.length;e++){var a=this.filters[e];var f=$("<tr>").appendTo(b);var g=$("<th class='filter-info'>").appendTo(f);var j=$("<span class='name'>").appendTo(g);j.text(a.name+" ");var d=$("<span class='values'>").appendTo(g);var h=$("<td>").appendTo(f);a.control_element=$("<div id='"+a.name+"-filter-control' style='width: 200px; position: relative'>").appendTo(h);a.contr
ol_element.slider({range:true,min:Number.MAX_VALUE,max:-Number.MIN_VALUE,values:[0,0],slide:function(l,m){var k=m.values;d.text("["+k[0]+"-"+k[1]+"]");a.low=k[0];a.high=k[1];c.draw(true)},change:function(k,l){a.control_element.slider("option","slide").call(a.control_element,k,l)}});a.slider=a.control_element;a.slider_label=d}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 l=function(){hide_modal();$(window).unbind("keypress.check_enter_esc")},j=function(){d.update_options(d.track_id);hide_modal();$(window).unbind("keypress.check_enter_esc")},k=function(m){if((m.keyCode||m.which)===27){l()}else{if((m.keyCode||m.which)===13){j()}}};$(window).bind("keypress.check_enter_esc",k);show_modal("Configure Track",d.gen_options(d.track_id),{Cancel:l,OK:j})};if(d.filters.length>0){b["Show filters"]=function(){var j;if(!d.filtering_div.is(":visible")){j="Hide filters";d.filters_visible=tru
e}else{j="Show filters";d.filters_visible=false}$("#"+d.name_div.attr("id")+"-menu").find("li").eq(2).text(j);d.filtering_div.toggle()}}b.Remove=function(){c.remove_track(d);if(c.num_tracks===0){$("#no-tracks").show()}};d.popup_menu=make_popupmenu(d.name_div,b);show_hide_popupmenu_options(d.popup_menu,"(Show|Hide) filters",false)};$.extend(TiledTrack.prototype,Track.prototype,{draw:function(b){var m=this.view.low,g=this.view.high,h=g-m,f=this.view.resolution;var p=$("<div style='position: relative;'></div>"),q=this.content_div.width()/h,k;this.content_div.append(p),this.max_height=0;var a=Math.floor(m/f/DENSITY);var l=new Object();while((a*DENSITY*f)<g){var n=this.content_div.width()+"_"+q+"_"+a;var e=this.tile_cache.get(n);if(!b&&e){var j=a*DENSITY*f;var d=(j-m)*q;if(this.left_offset){d-=this.left_offset}e.css({left:d});this.show_tile(e,p)}else{this.delayed_draw(this,n,m,g,a,f,p,q,l)}a+=1}var c=this;var o=setInterval(function(){if(l.length!=0){if(c.content_div.children().le
ngth>1){c.content_div.children(":first").remove()}for(var r=0;r<c.filters.length;r++){c.filters[r].update_ui_elt()}clearInterval(o)}},50)},delayed_draw:function(c,h,g,e,b,d,j,k,f){var a=setTimeout(function(){if(!(g>c.view.high||e<c.view.low)){tile_element=c.draw_tile(d,b,j,k);if(tile_element){if(!c.initial_canvas&&!window.G_vmlCanvasManager){c.initial_canvas=$(tile_element).clone();var n=tile_element.get(0).getContext("2d");var l=c.initial_canvas.get(0).getContext("2d");var m=n.getImageData(0,0,n.canvas.width,n.canvas.height);l.putImageData(m,0,0);c.set_overview()}c.tile_cache.set(h,tile_element);c.show_tile(tile_element,j)}}delete f.id},50);f.id=true},show_tile:function(a,c){var b=this;c.append(a);b.max_height=Math.max(b.max_height,a.height());b.content_div.css("height",b.max_height+"px");if(a.hasClass(FILTERABLE_CLASS)){show_hide_popupmenu_options(b.popup_menu,"(Show|Hide) filters");if(b.filters_visible){b.filtering_div.show()}}else{show_hide_popupmenu_options(b.popup_menu
,"(Show|Hide) filters",false);b.filtering_div.hide()}},set_overview:function(){var a=this.view;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.con
tent_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.left_offset=200;this.height_px=12;this.container_div.addClass("reference-track");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,l,p){var g=b*DENSITY*f,d=DENSITY*f,k=f+"_"+b;var e=document.createElement("canvas");if(window.G_vmlCanvasManager){G_vmlCanvasManager.initElement(e)}e=$(e);var o=e.get(0).getContext("2d");if(p>PX_PER_CHAR){if(t
his.data_cache.get(k)===undefined){this.get_data(f,b);return}var n=this.data_cache.get(k);if(n===null){this.content_div.css("height","0px");return}e.get(0).width=Math.ceil(d*p+this.left_offset);e.get(0).height=this.height_px;e.css({position:"absolute",top:0,left:(g-this.view.low)*p-this.left_offset});for(var h=0,m=n.length;h<m;h++){var a=Math.round(h*p),j=Math.round(p/2);o.fillText(n[h],a+this.left_offset+j,10)}l.append(e);return e}this.content_div.css("height","0px")}});var LineTrack=function(d,b,a,c){this.track_type="LineTrack";this.display_modes=["Histogram","Line","Filled","Intensity"];this.mode="Histogram";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={color:"black",min_value:undefined,max_value:undefined,mode:this.mode}};$.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;a.container_div.find(".yaxislabel").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:"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_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,s,c,e){if(this.vertical_range===undefined){return}var t=s*DENSITY*p,a=DENSITY*p,w=p+"_"+s;var b=document.createElement("canvas");if(window.G_vmlCanvasManager){G_vmlCanvasManager.initElement(b)}b=$(b);if(this.data_cache.get(w)===undefined){this.get_data(p,s);return}var j=this.data_cache.get(w);if(j===null){return}b.css({position:"absolute",top:0,left:(t-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,u=this.total_frequency,d=this.height_px,m=this.mode;o.beginPath();o.
fillStyle=this.prefs.color;if(data.length>1){var f=Math.ceil((data[1][0]-data[0][0])*e)}else{var f=10}var v,h;for(var q=0,r=data.length;q<r;q++){v=Math.round((data[q][0]-t)*e);h=data[q][1];if(h===null){if(k&&m==="Filled"){o.lineTo(v,d)}k=false;continue}if(h<l){h=l}else{if(h>g){h=g}}if(m==="Histogram"){h=Math.round(d-(h-l)/n*d);o.fillRect(v,h,f,d-h)}else{if(m==="Intensity"){h=255-Math.floor((h-l)/n*255);o.fillStyle="rgb("+h+","+h+","+h+")";o.fillRect(v,0,f,d)}else{h=Math.round(d-(h-l)/n*d);if(k){o.lineTo(v,h)}else{k=true;if(m==="Filled"){o.moveTo(v,d);o.lineTo(v,h)}else{o.moveTo(v,h)}}}}}if(m==="Filled"){if(k){o.lineTo(v,d)}o.fill()}else{o.stroke()}c.append(b);return b},gen_options:function(n){var a=$("<div />").addClass("form-row");var e="track_"+n+"_color",b=$("<label />").attr("for",e).text("Color:"),c=$("<input />").attr("id",e).attr("name",e).val(this.prefs.color),h="track_"+n+"_minval",m=$("<label></label>").attr("for",h).text("Min value:"),d=(this.prefs.min_value===und
efined?"":this.prefs.min_value),l=$("<input></input>").attr("id",h).val(d),k="track_"+n+"_maxval",g=$("<label></label>").attr("for",k).text("Max value:"),j=(this.prefs.max_value===undefined?"":this.prefs.max_value),f=$("<input></input>").attr("id",k).val(j);return a.append(m).append(l).append(g).append(f).append(b).append(c)},update_options:function(c){var a=$("#track_"+c+"_minval").val(),b=$("#track_"+c+"_maxval").val();color=$("#track_"+c+"_color").val();if(a!==this.prefs.min_value||b!==this.prefs.max_value||color!==this.prefs.color){this.prefs.min_value=parseFloat(a);this.prefs.max_value=parseFloat(b);this.prefs.color=color;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,e,c){this.track_type="FeatureTrack";this.display_modes=["Auto","Dense","Squish","Pack"];Track.call(this,d,b,
b.viewport_container,e);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=30;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:"#444",label_color:"black",show_counts:true}};$.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.chr
om,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,g,b,q){if(!this.inc_slots[a]){this.inc_slots[a]={};this.inc_slots[a].w_scale=a;this.inc_slots[a].mode=q;this.s_e_by_tile[a]={}}var m=this.inc_slots[a].w_scale,y=[],h=0,n=this.view.max_low;var A=[];if(this.inc_slots[a].mode!==q){delete this.inc_slots[a];this.inc_slots[a]={mode:q,w_scale:m};delete this.s_e_by_tile[a];this.s_e_by_tile[a]={}}for(var v=0,w=g.length;v<w;v++){var f=g[v],l=f[0];if(this.inc_slots[a][l]!==undefined){h=Math.max(h,this.inc_slots[a][l]);A.push(this.inc_slots[a][l])}else{y.push(v)}}for(var v=0,w=y.length;v<w;v++){var f=g[y[v]],l=f[0],r=f[1],c=f[2],p=f[3],d=Math.floor((r-n)*m),e=Math.ceil((c-n)*m);if(p!==undefined&&!b){var s=CONTEXT.measureText(p).width;if(d-s<0){e+=s}else{d-=s}}var u=0;while(u<=MAX_FEATURE_DEPTH){var o=true;if(this.s_e_by_tile[a][u]!==undefined){for(var t
=0,z=this.s_e_by_tile[a][u].length;t<z;t++){var x=this.s_e_by_tile[a][u][t];if(e>x[0]&&d<x[1]){o=false;break}}}if(o){if(this.s_e_by_tile[a][u]===undefined){this.s_e_by_tile[a][u]=[]}this.s_e_by_tile[a][u].push([d,e]);this.inc_slots[a][l]=u;h=Math.max(h,u);break}u++}}return h},rect_or_text:function(r,m,s,b,q,f,h,e){r.textAlign="center";var l=0,p=Math.round(m/2);for(cig_id in h){var k=h[cig_id],d="MIDNSHP"[k[0]],n=k[1];if(d==="H"||d==="S"){l-=n}var g=q+l,v=Math.floor(Math.max(0,(g-s)*m)),j=Math.floor(Math.max(0,(g+n-s)*m));switch(d){case"S":case"H":case"M":var o=f.slice(l,n);if((this.mode==="Pack"||this.mode==="Auto")&&f!==undefined&&m>PX_PER_CHAR){r.fillStyle=this.prefs.block_color;r.fillRect(v+this.left_offset,e+1,j-v,9);r.fillStyle=CONNECTOR_COLOR;for(var t=0,a=o.length;t<a;t++){if(g+t>=s&&g+t<=b){var u=Math.floor(Math.max(0,(g+t-s)*m));r.fillText(o[t],u+this.left_offset+p,e+9)}}}else{r.fillStyle=this.prefs.block_color;r.fillRect(v+this.left_offset,e+4,j-v,3)}break;case"N":
r.fillStyle=CONNECTOR_COLOR;r.fillRect(v+this.left_offset,e+5,j-v,1);break;case"D":r.fillStyle="red";r.fillRect(v+this.left_offset,e+4,j-v,3);break;case"P":case"I":break}l+=n}},draw_tile:function(ah,o,t,aw){var O=o*DENSITY*ah,am=(o+1)*DENSITY*ah,N=am-O;var ao=(!this.initial_canvas?"initial":O+"_"+am);var J=this.data_cache.get(ao);var e;if(J===undefined||(this.mode!=="Auto"&&J.dataset_type==="summary_tree")){this.data_queue[[O,am]]=true;this.get_data(O,am);return}var a=Math.ceil(N*aw),r=$("<canvas class='tile'></canvas>"),aj=this.prefs.label_color,l=this.prefs.block_color,s=this.mode,A=25,af=(s==="Squish")||(s==="Dense")&&(s!=="Pack")||(s==="Auto"&&(J.extra_info==="no_detail")),X=this.left_offset,av,E,ax;var r=document.createElement("canvas");if(window.G_vmlCanvasManager){G_vmlCanvasManager.initElement(r)}r=$(r);if(J.dataset_type==="summary_tree"){E=this.summary_draw_height}else{if(s==="Dense"){E=A;ax=10}else{ax=(af?this.vertical_nodetail_px:this.vertical_detail_px);var B=(aw
<0.0001?1/view.zoom_res:aw);E=this.incremental_slots(B,J.data,af,s)*ax+A;av=this.inc_slots[B]}}r.css({position:"absolute",top:0,left:(O-this.view.low)*aw-X});r.get(0).width=a+X;r.get(0).height=E;t.parent().css("height",Math.max(this.height_px,E)+"px");var K=r.get(0).getContext("2d");K.fillStyle=l;K.font=this.default_font;K.textAlign="right";this.container_div.find(".yaxislabel").remove();if(J.dataset_type=="summary_tree"){var Z=J.data,M=J.max,q=J.avg,b=Math.ceil(J.delta*aw);var p=$("<div />").addClass("yaxislabel").text(M);p.css({position:"absolute",top:"22px",left:"10px"});p.prependTo(this.container_div);for(var aq=0,I=Z.length;aq<I;aq++){var ab=Math.floor((Z[aq][0]-O)*aw);var aa=Z[aq][1];if(!aa){continue}var an=aa/M*this.summary_draw_height;K.fillStyle="black";K.fillRect(ab+X,this.summary_draw_height-an,b,an);if(this.prefs.show_counts&&K.measureText(aa).width<b){K.fillStyle="#bbb";K.textAlign="center";K.fillText(aa,ab+X+(b/2),this.summary_draw_height-5)}}e="Summary";t.appe
nd(r);return r}if(J.message){r.css({border:"solid red","border-width":"2px 2px 2px 0px"});K.fillStyle="red";K.textAlign="left";K.fillText(J.message,100+X,ax)}var ae=false;if(J.data.length!=0){ae=true;for(var at=0;at<this.filters.length;at++){if(!this.filters[at].applies_to(J.data[0])){ae=false}}}if(ae){r.addClass(FILTERABLE_CLASS)}var au=J.data;var ap=0;for(var aq=0,I=au.length;aq<I;aq++){var T=au[aq],S=T[0],ar=T[1],ad=T[2],P=T[3];if(av[S]===undefined){continue}var ac=false;var V;for(var at=0;at<this.filters.length;at++){V=this.filters[at];V.update_attrs(T);if(!V.keep(T)){ac=true;break}}if(ac){continue}if(ar<=am&&ad>=O){var ag=Math.floor(Math.max(0,(ar-O)*aw)),L=Math.ceil(Math.min(a,Math.max(0,(ad-O)*aw))),Y=(s==="Dense"?1:(1+av[S]))*ax;if(J.dataset_type==="bai"){var w=T[4];K.fillStyle=l;if(T[5] instanceof Array){var F=Math.floor(Math.max(0,(T[5][0]-O)*aw)),R=Math.ceil(Math.min(a,Math.max(0,(T[5][1]-O)*aw))),D=Math.floor(Math.max(0,(T[6][0]-O)*aw)),z=Math.ceil(Math.min(a,Mat
h.max(0,(T[6][1]-O)*aw)));if(T[5][1]>=O&&T[5][0]<=am){this.rect_or_text(K,aw,O,am,T[5][0],T[5][2],w,Y)}if(T[6][1]>=O&&T[6][0]<=am){this.rect_or_text(K,aw,O,am,T[6][0],T[6][2],w,Y)}if(D>R){K.fillStyle=CONNECTOR_COLOR;K.fillRect(R+X,Y+5,D-R,1)}}else{K.fillStyle=l;this.rect_or_text(K,aw,O,am,ar,P,w,Y)}if(s!=="Dense"&&!af&&ar>O){K.fillStyle=this.prefs.label_color;if(o===0&&ag-K.measureText(P).width<0){K.textAlign="left";K.fillText(S,L+2+X,Y+8)}else{K.textAlign="right";K.fillText(S,ag-2+X,Y+8)}K.fillStyle=l}}else{if(J.dataset_type==="interval_index"){if(af){K.fillStyle=l;K.fillRect(ag+X,Y+5,L-ag,1)}else{var H=T[4],W=T[5],ai=T[6],h=T[7];var G,ak,Q=null,ay=null;if(W&&ai){Q=Math.floor(Math.max(0,(W-O)*aw));ay=Math.ceil(Math.min(a,Math.max(0,(ai-O)*aw)))}if(s!=="Dense"&&P!==undefined&&ar>O){K.fillStyle=aj;if(o===0&&ag-K.measureText(P).width<0){K.textAlign="left";K.fillText(P,L+2+X,Y+8)}else{K.textAlign="right";K.fillText(P,ag-2+X,Y+8)}K.fillStyle=l}if(h){if(H){if(H=="+"){K.fillStyle=
RIGHT_STRAND}else{if(H=="-"){K.fillStyle=LEFT_STRAND}}K.fillRect(ag+X,Y,L-ag,10);K.fillStyle=l}for(var ao=0,g=h.length;ao<g;ao++){var v=h[ao],d=Math.floor(Math.max(0,(v[0]-O)*aw)),U=Math.ceil(Math.min(a,Math.max((v[1]-O)*aw)));if(d>U){continue}G=5;ak=3;K.fillRect(d+X,Y+ak,U-d,G);if(Q!==undefined&&!(d>ay||U<Q)){G=9;ak=1;var al=Math.max(d,Q),C=Math.min(U,ay);K.fillRect(al+X,Y+ak,C-al,G)}}}else{G=9;ak=1;K.fillRect(ag+X,Y+ak,L-ag,G);if(T.strand){if(T.strand=="+"){K.fillStyle=RIGHT_STRAND_INV}else{if(T.strand=="-"){K.fillStyle=LEFT_STRAND_INV}}K.fillRect(ag+X,Y,L-ag,10);K.fillStyle=l}}}}else{if(J.dataset_type==="vcf"){if(af){K.fillStyle=l;K.fillRect(ag+X,Y+5,L-ag,1)}else{var u=T[4],n=T[5],c=T[6];G=9;ak=1;K.fillRect(ag+X,Y,L-ag,G);if(s!=="Dense"&&P!==undefined&&ar>O){K.fillStyle=aj;if(o===0&&ag-K.measureText(P).width<0){K.textAlign="left";K.fillText(P,L+2+X,Y+8)}else{K.textAlign="right";K.fillText(P,ag-2+X,Y+8)}K.fillStyle=l}var m=u+" / "+n;if(ar>O&&K.measureText(m).width<(L-ag)){
K.fillStyle="white";K.textAlign="center";K.fillText(m,X+ag+(L-ag)/2,Y+8);K.fillStyle=l}}}}}ap++}}return r},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");i
f(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,e,c){FeatureTrack.call(this,d,b,a,e,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=50,CONNECTOR_COLOR="#ccc",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...",FILTERABLE_CLASS="filterable",CACHED_TILES_FEATURE=10,CACHED_TILES_LINE=5,CACHED_DATA=5,DUMMY_CANVAS=document.createElement("canvas"),RIGHT_STRAND,LEFT_STRAND;if(window.G_vmlCanvasManager){G_vmlCanvasManager.initElement(DUMMY_CANVAS)}CONTEXT=DUMMY_CANVAS.getContext("2d");PX_PER_CHAR=CONTEXT.measureText("A").width;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.createPa
ttern(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,d,c,b){this.container=a;this.vis_id=c;this.dbkey=b;this.ti
tle=d;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/>").addClas
s("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(){}).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.wh
ich)!==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.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(e){if(e.reference){a.add_label_track(new ReferenceTrack(a))}a.chrom_data=e.chrom_info;var h='<option value="">Select Chrom/Contig</option>';for(var g=0,d=a.chrom_data.length;g<d;g++){var f=a.chrom_data[g].chrom;h+='<option value="'+f+'">'+f+"</option>"}a.chrom_select.html(h);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 e=0,d=a.tracks.length;e<d;e++){a.tracks[e].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.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 i=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(i/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(i){var f=Math.min(i.clientX,this.drag_origin_x)-a.container.offset().left,d=Math.max(i.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(j){var f=Math.min(j.clientX,this.drag_origin_x),d=Math.max(j.clientX,this.drag_origin_x),h=(a.high-a.low),g=a.viewport_container.width(),i=a.low;a.low=Math.round(f/g*h)+i;a.high=Math.round(d/g*h)+i;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));$(window).bind("resize",function(){a.resize_window()});$(document).bind("redraw",function(){a.redraw()});this.reset();$(window).trigger("resize")},update_location:function(a,b){this.location_span.text(commatize(a)+" - "+commatize(b));this.nav_input.val(this.chrom+":"+commatize(a)+"-"+c
ommatize(b))},change_chrom:function(e,b,g){var d=this;var f=$.grep(d.chrom_data,function(j,k){return j.chrom===e})[0];if(f===undefined){return}if(e!==d.chrom){d.chrom=e;if(!d.chrom){d.intro_div.show()}else{d.intro_div.hide()}d.chrom_select.val(d.chrom);d.max_high=f.len;d.reset();d.redraw(true);for(var h=0,a=d.tracks.length;h<a;h++){var c=d.tracks[h];if(c.init){c.init()}}}if(b!==undefined&&g!==undefined){d.low=Math.max(b,0);d.high=Math.min(g,d.max_high)}d.reset_overview();d.redraw()},go_to:function(f){var j=this,a,d,b=f.split(":"),h=b[0],i=b[1];if(i!==undefined){try{var g=i.split("-");a=parseInt(g[0].replace(/,/g,""),10);d=parseInt(g[1].replace(/,/g,""),10)}catch(c){return false}}j.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_counte
r;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())||0;var e=((this.high-this.low)/(this.max_high-this.max_low)*this.overview_viewport.width())||0;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,width: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(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);th
is.high=Math.round(c+a);this.redraw()},resize_window:function(){this.viewport_container.height(this.container.height()-this.nav_container.height()-45);this.nav_container.width(this.container.width());this.redraw()},reset_overview:function(){this.overview_viewport.find("canvas").remove();this.overview_viewport.height(this.default_overview_height);this.overview_box.height(this.default_overview_height);this.overview_close.hide();this.overview_highlight.hide()}});var Filter=function(b,a,c){this.name=b;this.index=a;this.value=c};var NumberFilter=function(b,a){this.name=b;this.index=a;this.low=-Number.MAX_VALUE;this.high=Number.MAX_VALUE;this.slider_min=Number.MAX_VALUE;this.slider_max=-Number.MAX_VALUE;this.slider=null;this.slider_label=null};$.extend(NumberFilter.prototype,{applies_to:function(a){if(a.length>this.index){return true}return false},keep:function(a){if(!this.applies_to(a)){return true}return(a[this.index]>=this.low&&a[this.index]<=this.high)},update_attrs:function(b
){var a=false;if(!this.applies_to(b)){return a}if(b[this.index]<this.slider_min){this.slider_min=b[this.index];a=true}if(b[this.index]>this.slider_max){this.slider_max=b[this.index];a=false}return a},update_ui_elt:function(){var b=this.slider.slider("option","min"),a=this.slider.slider("option","max");if(this.slider_min<b||this.slider_max>a){this.slider.slider("option","min",this.slider_min);this.slider.slider("option","max",this.slider_max);this.slider.slider("option","values",[this.slider_min,this.slider_max])}}});var get_filters=function(a){var g=[];for(var d=0;d<a.length;d++){var f=a[d];var c=f.name,e=f.type,b=f.index;if(e=="int"||e=="float"){g[d]=new NumberFilter(c,b)}else{g[d]=new Filter(c,b,e)}}return g};var Track=function(b,a,d,c){this.name=b;this.view=a;this.parent_element=d;this.filters=(c!==undefined?get_filters(c):[]);this.init_global()};$.extend(Track.prototype,{init_global:function(){this.container_div=$("<div />").addClass("track").css("position","relative");i
f(!this.hidden){this.header_div=$("<div class='track-header' />").appendTo(this.container_div);if(this.view.editor){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.name_div.attr("id",this.name.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9\-]/g,"").toLowerCase())}this.filtering_div=$("<div class='track-filters'>").appendTo(this.container_div);this.filtering_div.hide();this.filtering_div.bind("drag",function(i){i.stopPropagation()});var b=$("<table class='filters'>").appendTo(this.filtering_div);var c=this;for(var e=0;e<this.filters.length;e++){var a=this.filters[e];var f=$("<tr>").appendTo(b);var g=$("<th class='filter-info'>").appendTo(f);var j=$("<span class='name'>").appendTo(g);j.text(a.name+" ");var d=$("<span class='values'>").appendTo(g);var h=$("<td>").appendTo(f);a.control_element=$("<div id='"+a.name+"-filter-control' style='width: 200
px; position: relative'>").appendTo(h);a.control_element.slider({range:true,min:Number.MAX_VALUE,max:-Number.MIN_VALUE,values:[0,0],slide:function(k,l){var i=l.values;d.text("["+i[0]+"-"+i[1]+"]");a.low=i[0];a.high=i[1];c.draw(true)},change:function(i,k){a.control_element.slider("option","slide").call(a.control_element,i,k)}});a.slider=a.control_element;a.slider_label=d}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 b=this,j=b.view;if(b.hidden){return}if(b.display_modes!==undefined){if(b.mode_div===undefined){b.mode_div=$("<div class='right-float menubutton popup' />").appendTo(b.header_div);var e=
b.display_modes[0];b.mode=e;b.mode_div.text(e);var c=function(i){b.mode_div.text(i);b.mode=i;b.tile_cache.clear();b.draw()};var a={};for(var f,h=b.display_modes.length;f<h;f++){var g=b.display_modes[f];a[g]=function(i){return function(){c(i)}}(g)}make_popupmenu(b.mode_div,a)}else{b.mode_div.hide()}}var d={};d["Set as overview"]=function(){j.overview_viewport.find("canvas").remove();b.is_overview=true;b.set_overview();for(var i in j.tracks){if(j.tracks[i]!==b){j.tracks[i].is_overview=false}}};d["Edit configuration"]=function(){var l=function(){hide_modal();$(window).unbind("keypress.check_enter_esc")},i=function(){b.update_options(b.track_id);hide_modal();$(window).unbind("keypress.check_enter_esc")},k=function(m){if((m.keyCode||m.which)===27){l()}else{if((m.keyCode||m.which)===13){i()}}};$(window).bind("keypress.check_enter_esc",k);show_modal("Configure Track",b.gen_options(b.track_id),{Cancel:l,OK:i})};if(b.filters.length>0){d["Show filters"]=function(){var i;if(!b.filterin
g_div.is(":visible")){i="Hide filters";b.filters_visible=true}else{i="Show filters";b.filters_visible=false}$("#"+b.name_div.attr("id")+"-menu").find("li").eq(2).text(i);b.filtering_div.toggle()}}d.Remove=function(){j.remove_track(b);if(j.num_tracks===0){$("#no-tracks").show()}};b.popup_menu=make_popupmenu(b.name_div,d);show_hide_popupmenu_options(b.popup_menu,"(Show|Hide) filters",false)};$.extend(TiledTrack.prototype,Track.prototype,{draw:function(a){var k=this.view.low,g=this.view.high,h=g-k,f=this.view.resolution;var n=$("<div style='position: relative;'></div>"),o=this.content_div.width()/h;this.content_div.append(n);this.max_height=0;var b=Math.floor(k/f/DENSITY);var j={};while((b*DENSITY*f)<g){var l=this.content_div.width()+"_"+o+"_"+b;var e=this.tile_cache.get(l);if(!a&&e){var i=b*DENSITY*f;var d=(i-k)*o;if(this.left_offset){d-=this.left_offset}e.css({left:d});this.show_tile(e,n)}else{this.delayed_draw(this,l,k,g,b,f,n,o,j)}b+=1}var c=this;var m=setInterval(function(
){if(j.length!==0){if(c.content_div.children().length>1){c.content_div.children(":first").remove()}for(var p=0;p<c.filters.length;p++){c.filters[p].update_ui_elt()}clearInterval(m)}},50)},delayed_draw:function(c,h,g,e,b,d,i,j,f){var a=setTimeout(function(){if(g<=c.view.high&&e>=c.view.low){var k=c.draw_tile(d,b,i,j);if(k){if(!c.initial_canvas&&!window.G_vmlCanvasManager){c.initial_canvas=$(k).clone();var n=k.get(0).getContext("2d");var l=c.initial_canvas.get(0).getContext("2d");var m=n.getImageData(0,0,n.canvas.width,n.canvas.height);l.putImageData(m,0,0);c.set_overview()}c.tile_cache.set(h,k);c.show_tile(k,i)}}delete f[a]},50);f[a]=true},show_tile:function(a,c){var b=this;c.append(a);b.max_height=Math.max(b.max_height,a.height());b.content_div.css("height",b.max_height+"px");if(a.hasClass(FILTERABLE_CLASS)){show_hide_popupmenu_options(b.popup_menu,"(Show|Hide) filters");if(b.filters_visible){b.filtering_div.show()}}else{show_hide_popupmenu_options(b.popup_menu,"(Show|Hide)
filters",false);b.filtering_div.hide()}},set_overview:function(){var a=this.view;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.appen
d(b)}});var ReferenceTrack=function(a){this.track_type="ReferenceTrack";this.hidden=true;Track.call(this,null,a,a.top_labeltrack);TiledTrack.call(this);this.left_offset=200;this.height_px=12;this.container_div.addClass("reference-track");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,i){console.log(h,g,i)}})}},draw_tile:function(f,b,k,o){var g=b*DENSITY*f,d=DENSITY*f,j=f+"_"+b;var e=document.createElement("canvas");if(window.G_vmlCanvasManager){G_vmlCanvasManager.initElement(e)}e=$(e);var n=e.get(0).getContext("2d");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),i=Math.round(o/2);n.fillText(m[h],a+this.left_offset+i,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=["Histogram","Line","Filled","Intensity"];this.mode="Histogram";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={color:"black",min_value:undefined,max_value:undefined,mode:this.mode}};$.extend(LineTrack.prototype,TiledTrack.prototype,{init:function(){var a=this,b=a.view.tracks.indexOf(a);a.vertical_r
ange=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");var e=c.data;if(isNaN(parseFloat(a.prefs.min_value))||isNaN(parseFloat(a.prefs.max_value))){a.prefs.min_value=e.min;a.prefs.max_value=e.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=e.total_frequency;a.container_div.find(".yaxislabel").remove();var f=$("<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);f.css({position:"absolute",top:a.height_px+11+"px",left:"10px"});f.prependTo(a.container_div)})},get_data:function(d,b){var c=this,a=b*DENSITY*d,f=(b+1)*D
ENSITY*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){var h=g.data;c.data_cache.set(e,h);delete c.data_queue[e];c.draw()},error:function(h,g,i){console.log(h,g,i)}})}},draw_tile:function(o,r,c,e){if(this.vertical_range===undefined){return}var s=r*DENSITY*o,a=DENSITY*o,w=o+"_"+r;var b=document.createElement("canvas");if(window.G_vmlCanvasManager){G_vmlCanvasManager.initElement(b)}b=$(b);if(this.data_cache.get(w)===undefined){this.get_data(o,r);return}var v=this.data_cache.get(w);if(!v){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 n=b.get(0).getContext("2d"),j=false,k=this.prefs.min_value,g=this.prefs.max_value,m=this.vertical_range,t=this.total_frequency,d=this.height_px,l=this.mode;n.beginPath();n.fillStyle=this.prefs.color;var
u,h,f;if(v.length>1){f=Math.ceil((v[1][0]-v[0][0])*e)}else{f=10}for(var p=0,q=v.length;p<q;p++){u=Math.round((v[p][0]-s)*e);h=v[p][1];if(h===null){if(j&&l==="Filled"){n.lineTo(u,d)}j=false;continue}if(h<k){h=k}else{if(h>g){h=g}}if(l==="Histogram"){h=Math.round(d-(h-k)/m*d);n.fillRect(u,h,f,d-h)}else{if(l==="Intensity"){h=255-Math.floor((h-k)/m*255);n.fillStyle="rgb("+h+","+h+","+h+")";n.fillRect(u,0,f,d)}else{h=Math.round(d-(h-k)/m*d);if(j){n.lineTo(u,h)}else{j=true;if(l==="Filled"){n.moveTo(u,d);n.lineTo(u,h)}else{n.moveTo(u,h)}}}}}if(l==="Filled"){if(j){n.lineTo(u,d)}n.fill()}else{n.stroke()}c.append(b);return b},gen_options:function(m){var a=$("<div />").addClass("form-row");var e="track_"+m+"_color",b=$("<label />").attr("for",e).text("Color:"),c=$("<input />").attr("id",e).attr("name",e).val(this.prefs.color),h="track_"+m+"_minval",l=$("<label></label>").attr("for",h).text("Min value:"),d=(this.prefs.min_value===undefined?"":this.prefs.min_value),k=$("<input></input>")
.attr("id",h).val(d),j="track_"+m+"_maxval",g=$("<label></label>").attr("for",j).text("Max value:"),i=(this.prefs.max_value===undefined?"":this.prefs.max_value),f=$("<input></input>").attr("id",j).val(i);return a.append(l).append(k).append(g).append(f).append(b).append(c)},update_options:function(d){var a=$("#track_"+d+"_minval").val(),c=$("#track_"+d+"_maxval").val(),b=$("#track_"+d+"_color").val();if(a!==this.prefs.min_value||c!==this.prefs.max_value||b!==this.prefs.color){this.prefs.min_value=parseFloat(a);this.prefs.max_value=parseFloat(c);this.prefs.color=b;this.vertical_range=this.prefs.max_value-this.prefs.min_value;$("#linetrack_"+d+"_minval").text(this.prefs.min_value);$("#linetrack_"+d+"_maxval").text(this.prefs.max_value);this.tile_cache.clear();this.draw()}}});var FeatureTrack=function(d,b,a,e,c){this.track_type="FeatureTrack";this.display_modes=["Auto","Dense","Squish","Pack"];Track.call(this,d,b,b.viewport_container,e);TiledTrack.call(this);this.height_px=0;thi
s.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=30;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:"#444",label_color:"black",show_counts:true}};$.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.resol
ution,mode:this.mode},function(e){b.data_cache.set(c,e);delete b.data_queue[c];b.draw()})}},incremental_slots:function(a,g,b,q){if(!this.inc_slots[a]){this.inc_slots[a]={};this.inc_slots[a].w_scale=a;this.inc_slots[a].mode=q;this.s_e_by_tile[a]={}}var m=this.inc_slots[a].w_scale,y=[],h=0,n=this.view.max_low;var A=[];if(this.inc_slots[a].mode!==q){delete this.inc_slots[a];this.inc_slots[a]={mode:q,w_scale:m};delete this.s_e_by_tile[a];this.s_e_by_tile[a]={}}for(var v=0,w=g.length;v<w;v++){var f=g[v],l=f[0];if(this.inc_slots[a][l]!==undefined){h=Math.max(h,this.inc_slots[a][l]);A.push(this.inc_slots[a][l])}else{y.push(v)}}for(var v=0,w=y.length;v<w;v++){var f=g[y[v]],l=f[0],r=f[1],c=f[2],p=f[3],d=Math.floor((r-n)*m),e=Math.ceil((c-n)*m);if(p!==undefined&&!b){var s=CONTEXT.measureText(p).width;if(d-s<0){e+=s}else{d-=s}}var u=0;while(u<=MAX_FEATURE_DEPTH){var o=true;if(this.s_e_by_tile[a][u]!==undefined){for(var t=0,z=this.s_e_by_tile[a][u].length;t<z;t++){var x=this.s_e_by_tile
[a][u][t];if(e>x[0]&&d<x[1]){o=false;break}}}if(o){if(this.s_e_by_tile[a][u]===undefined){this.s_e_by_tile[a][u]=[]}this.s_e_by_tile[a][u].push([d,e]);this.inc_slots[a][l]=u;h=Math.max(h,u);break}u++}}return h},rect_or_text:function(r,l,t,b,q,f,i,e){r.textAlign="center";var k=0,p=Math.round(l/2);for(var m=0,s=i.length;m<s;m++){var j=i[m],d="MIDNSHP"[j[0]],n=j[1];if(d==="H"||d==="S"){k-=n}var g=q+k,w=Math.floor(Math.max(0,(g-t)*l)),h=Math.floor(Math.max(0,(g+n-t)*l));switch(d){case"S":case"H":case"M":var o=f.slice(k,n);if((this.mode==="Pack"||this.mode==="Auto")&&f!==undefined&&l>PX_PER_CHAR){r.fillStyle=this.prefs.block_color;r.fillRect(w+this.left_offset,e+1,h-w,9);r.fillStyle=CONNECTOR_COLOR;for(var u=0,a=o.length;u<a;u++){if(g+u>=t&&g+u<=b){var v=Math.floor(Math.max(0,(g+u-t)*l));r.fillText(o[u],v+this.left_offset+p,e+9)}}}else{r.fillStyle=this.prefs.block_color;r.fillRect(w+this.left_offset,e+4,h-w,3)}break;case"N":r.fillStyle=CONNECTOR_COLOR;r.fillRect(w+this.left_offse
t,e+5,h-w,1);break;case"D":r.fillStyle="red";r.fillRect(w+this.left_offset,e+4,h-w,3);break;case"P":case"I":break}k+=n}},draw_tile:function(ag,o,s,av){var N=o*DENSITY*ag,al=(o+1)*DENSITY*ag,M=al-N;var an=(!this.initial_canvas?"initial":N+"_"+al);var I=this.data_cache.get(an);var e;if(I===undefined||(this.mode!=="Auto"&&I.dataset_type==="summary_tree")){this.data_queue[[N,al]]=true;this.get_data(N,al);return}var a=Math.ceil(M*av),ai=this.prefs.label_color,l=this.prefs.block_color,r=this.mode,z=25,ae=(r==="Squish")||(r==="Dense")&&(r!=="Pack")||(r==="Auto"&&(I.extra_info==="no_detail")),W=this.left_offset,au,D,aw;var q=document.createElement("canvas");if(window.G_vmlCanvasManager){G_vmlCanvasManager.initElement(q)}q=$(q);if(I.dataset_type==="summary_tree"){D=this.summary_draw_height}else{if(r==="Dense"){D=z;aw=10}else{aw=(ae?this.vertical_nodetail_px:this.vertical_detail_px);var A=(av<0.0001?1/this.view.zoom_res:av);D=this.incremental_slots(A,I.data,ae,r)*aw+z;au=this.inc_slot
s[A]}}q.css({position:"absolute",top:0,left:(N-this.view.low)*av-W});q.get(0).width=a+W;q.get(0).height=D;s.parent().css("height",Math.max(this.height_px,D)+"px");var J=q.get(0).getContext("2d");J.fillStyle=l;J.font=this.default_font;J.textAlign="right";this.container_div.find(".yaxislabel").remove();if(I.dataset_type=="summary_tree"){var Y=I.data,L=I.max,b=Math.ceil(I.delta*av);var p=$("<div />").addClass("yaxislabel").text(L);p.css({position:"absolute",top:"22px",left:"10px"});p.prependTo(this.container_div);for(var ap=0,H=Y.length;ap<H;ap++){var aa=Math.floor((Y[ap][0]-N)*av);var Z=Y[ap][1];if(!Z){continue}var am=Z/L*this.summary_draw_height;J.fillStyle="black";J.fillRect(aa+W,this.summary_draw_height-am,b,am);if(this.prefs.show_counts&&J.measureText(Z).width<b){J.fillStyle="#bbb";J.textAlign="center";J.fillText(Z,aa+W+(b/2),this.summary_draw_height-5)}}e="Summary";s.append(q);return q}if(I.message){q.css({border:"solid red","border-width":"2px 2px 2px 0px"});J.fillStyle=
"red";J.textAlign="left";J.fillText(I.message,100+W,aw)}var ad=false;if(I.data){ad=true;for(var ar=0;ar<this.filters.length;ar++){if(!this.filters[ar].applies_to(I.data[0])){ad=false}}}if(ad){q.addClass(FILTERABLE_CLASS)}var at=I.data;var ao=0;for(var ap=0,H=at.length;ap<H;ap++){var S=at[ap],R=S[0],aq=S[1],ac=S[2],O=S[3];if(au[R]===undefined){continue}var ab=false;var U;for(var ar=0;ar<this.filters.length;ar++){U=this.filters[ar];U.update_attrs(S);if(!U.keep(S)){ab=true;break}}if(ab){continue}if(aq<=al&&ac>=N){var af=Math.floor(Math.max(0,(aq-N)*av)),K=Math.ceil(Math.min(a,Math.max(0,(ac-N)*av))),X=(r==="Dense"?1:(1+au[R]))*aw;var G,aj,P=null,ax=null;if(I.dataset_type==="bai"){var v=S[4];J.fillStyle=l;if(S[5] instanceof Array){var E=Math.floor(Math.max(0,(S[5][0]-N)*av)),Q=Math.ceil(Math.min(a,Math.max(0,(S[5][1]-N)*av))),C=Math.floor(Math.max(0,(S[6][0]-N)*av)),w=Math.ceil(Math.min(a,Math.max(0,(S[6][1]-N)*av)));if(S[5][1]>=N&&S[5][0]<=al){this.rect_or_text(J,av,N,al,S[5][0
],S[5][2],v,X)}if(S[6][1]>=N&&S[6][0]<=al){this.rect_or_text(J,av,N,al,S[6][0],S[6][2],v,X)}if(C>Q){J.fillStyle=CONNECTOR_COLOR;J.fillRect(Q+W,X+5,C-Q,1)}}else{J.fillStyle=l;this.rect_or_text(J,av,N,al,aq,O,v,X)}if(r!=="Dense"&&!ae&&aq>N){J.fillStyle=this.prefs.label_color;if(o===0&&af-J.measureText(O).width<0){J.textAlign="left";J.fillText(R,K+2+W,X+8)}else{J.textAlign="right";J.fillText(R,af-2+W,X+8)}J.fillStyle=l}}else{if(I.dataset_type==="interval_index"){if(ae){J.fillStyle=l;J.fillRect(af+W,X+5,K-af,1)}else{var F=S[4],V=S[5],ah=S[6],h=S[7];if(V&&ah){P=Math.floor(Math.max(0,(V-N)*av));ax=Math.ceil(Math.min(a,Math.max(0,(ah-N)*av)))}if(r!=="Dense"&&O!==undefined&&aq>N){J.fillStyle=ai;if(o===0&&af-J.measureText(O).width<0){J.textAlign="left";J.fillText(O,K+2+W,X+8)}else{J.textAlign="right";J.fillText(O,af-2+W,X+8)}J.fillStyle=l}if(h){if(F){if(F=="+"){J.fillStyle=RIGHT_STRAND}else{if(F=="-"){J.fillStyle=LEFT_STRAND}}J.fillRect(af+W,X,K-af,10);J.fillStyle=l}for(var an=0,g=h.
length;an<g;an++){var u=h[an],d=Math.floor(Math.max(0,(u[0]-N)*av)),T=Math.ceil(Math.min(a,Math.max((u[1]-N)*av)));if(d>T){continue}G=5;aj=3;J.fillRect(d+W,X+aj,T-d,G);if(P!==undefined&&!(d>ax||T<P)){G=9;aj=1;var ak=Math.max(d,P),B=Math.min(T,ax);J.fillRect(ak+W,X+aj,B-ak,G)}}}else{G=9;aj=1;J.fillRect(af+W,X+aj,K-af,G);if(S.strand){if(S.strand=="+"){J.fillStyle=RIGHT_STRAND_INV}else{if(S.strand=="-"){J.fillStyle=LEFT_STRAND_INV}}J.fillRect(af+W,X,K-af,10);J.fillStyle=l}}}}else{if(I.dataset_type==="vcf"){if(ae){J.fillStyle=l;J.fillRect(af+W,X+5,K-af,1)}else{var t=S[4],n=S[5],c=S[6];G=9;aj=1;J.fillRect(af+W,X,K-af,G);if(r!=="Dense"&&O!==undefined&&aq>N){J.fillStyle=ai;if(o===0&&af-J.measureText(O).width<0){J.textAlign="left";J.fillText(O,K+2+W,X+8)}else{J.textAlign="right";J.fillText(O,af-2+W,X+8)}J.fillStyle=l}var m=t+" / "+n;if(aq>N&&J.measureText(m).width<(K-af)){J.fillStyle="white";J.textAlign="center";J.fillText(m,W+af+(K-af)/2,X+8);J.fillStyle=l}}}}}ao++}}return q},gen_o
ptions:function(i){var a=$("<div />").addClass("form-row");var e="track_"+i+"_block_color",k=$("<label />").attr("for",e).text("Block color:"),l=$("<input />").attr("id",e).attr("name",e).val(this.prefs.block_color),j="track_"+i+"_label_color",g=$("<label />").attr("for",j).text("Text color:"),h=$("<input />").attr("id",j).attr("name",j).val(this.prefs.label_color),f="track_"+i+"_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(k).append(l).append(g).append(h).append(d)},update_options:function(d){var b=$("#track_"+d+"_block_color").val(),c=$("#track_"+d+"_label_color").val(),a=$("#track_"+d+"_show_count").attr("checked");if(b!==this.prefs.block_color||c!==this.prefs.label_color||a!==this.prefs.show_counts){this.prefs.block_color=b;this.prefs.label_color=c;this.prefs.show_counts=
a;this.tile_cache.clear();this.draw()}}});var ReadTrack=function(d,b,a,e,c){FeatureTrack.call(this,d,b,a,e,c);this.track_type="ReadTrack";this.vertical_detail_px=10;this.vertical_nodetail_px=5};$.extend(ReadTrack.prototype,TiledTrack.prototype,FeatureTrack.prototype,{});
1
0