galaxy-dev
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
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- 10007 discussions
25 Sep '09
details: http://www.bx.psu.edu/hg/galaxy/rev/c7446ed27839
changeset: 2754:c7446ed27839
user: Greg Von Kuster <greg(a)bx.psu.edu>
date: Wed Sep 23 11:08:36 2009 -0400
description:
Added new get_showable_folders() method to the security agent for use by the sample requests. The sample request UI is now a bit broken.
2 file(s) affected in this change:
lib/galaxy/security/__init__.py
lib/galaxy/web/controllers/requests.py
diffs (94 lines):
diff -r be3c27418de9 -r c7446ed27839 lib/galaxy/security/__init__.py
--- a/lib/galaxy/security/__init__.py Wed Sep 23 09:24:10 2009 -0400
+++ b/lib/galaxy/security/__init__.py Wed Sep 23 11:08:36 2009 -0400
@@ -425,7 +425,8 @@
comma-separated string of folder ids whose folders do NOT meet the criteria for showing. Along with
the string, True is returned if the current user has permission to perform any 1 of actions_to_check
on library_item. Otherwise, cycle through all sub-folders in library_item until one is found that meets
- this criteria, if it exists.
+ this criteria, if it exists. This method does not necessarily scan the entire library as it returns
+ when it finds the first library_item that allows user to perform any one action in actions_to_check.
"""
for action in actions_to_check:
if self.allow_library_item_action( user, roles, action, library_item ):
@@ -442,6 +443,22 @@
else:
hidden_folder_ids = '%d' % folder.id
return False, hidden_folder_ids
+ def get_showable_folders( self, user, roles, library_item, actions_to_check, showable_folders=[] ):
+ """
+ This method must be sent an instance of Library(), all the folders of which are scanned to determine if
+ user is allowed to perform any action in actions_to_check. A list of showable folders is generated.
+ This method scans the entire library.
+ """
+ if isinstance( library_item, self.model.Library ):
+ return self.get_showable_folders( user, roles, library_item.root_folder, actions_to_check, showable_folders=showable_folders )
+ if isinstance( library_item, self.model.LibraryFolder ):
+ for action in actions_to_check:
+ if self.allow_library_item_action( user, roles, action, library_item ):
+ showable_folders.append( library_item )
+ break
+ for folder in library_item.active_folders:
+ self.get_showable_folders( user, roles, folder, actions_to_check, showable_folders=showable_folders )
+ return showable_folders
def set_entity_user_associations( self, users=[], roles=[], groups=[], delete_existing_assocs=True ):
for user in users:
if delete_existing_assocs:
@@ -495,6 +512,8 @@
comma-separated string of folder ids whose folders do NOT meet the criteria for showing. Along
with the string, True is returned if the current user has permission to access folder. Otherwise,
cycle through all sub-folders in folder until one is found that meets this criteria, if it exists.
+ This method does not necessarily scan the entire library as it returns when it finds the first
+ folder that is accessible to user.
"""
action = self.permitted_actions.DATASET_ACCESS
lddas = self.sa_session.query( self.model.LibraryDatasetDatasetAssociation ) \
diff -r be3c27418de9 -r c7446ed27839 lib/galaxy/web/controllers/requests.py
--- a/lib/galaxy/web/controllers/requests.py Wed Sep 23 09:24:10 2009 -0400
+++ b/lib/galaxy/web/controllers/requests.py Wed Sep 23 11:08:36 2009 -0400
@@ -474,9 +474,9 @@
# select lists are rendered.
libraries = odict()
for library in all_libraries:
- can_show, hidden_folder_ids = trans.app.security_agent.show_library_item( user, roles, library, actions_to_check )
- if can_show:
- libraries[ library ] = hidden_folder_ids
+ showable_folders = trans.app.security_agent.get_showable_folders( user, roles, library, actions_to_check )
+ if showable_folders:
+ libraries[ library ] = showable_folders
libui = self.__library_ui(libraries, **kwd)
widgets = widgets + libui
widgets = widgets + request_type.request_form.get_widgets( user, **kwd )
@@ -491,7 +491,6 @@
lib_id = params.get( 'library_id', 'none' )
lib_id_list = ['new'] + [str(lib.id) for lib in libraries.keys()]
lib_list = SelectField( 'library_id', refresh_on_change=True, refresh_on_change_values=lib_id_list )
- folders = []
if request and lib_id == 'none':
if request.library:
lib_id = str(request.library.id)
@@ -499,13 +498,9 @@
lib_list.add_option('Select one', 'none', selected=True)
else:
lib_list.add_option('Select one', 'none')
- for lib, hidden_folder_ids in libraries.items():
+ for lib, folders in libraries.items():
if str(lib.id) == lib_id:
lib_list.add_option(lib.name, lib.id, selected=True)
- folders.append( lib.root_folder )
- for f in lib.root_folder.folders:
- if str(f.id) not in hidden_folder_ids.split(','):
- folders.append( f )
else:
lib_list.add_option(lib.name, lib.id)
lib_list.refresh_on_change_values.append(lib.id)
@@ -516,7 +511,8 @@
lib_widget = dict(label='Data library',
widget=lib_list,
helptext='Data library where the resultant dataset will be stored.')
- if folders:
+ selected, value = lib_widget[ 'widget' ].get_selected()
+ if selected not in [ 'new', 'none' ]:
if request:
if request.folder:
current_fid = request.folder.id
1
0
25 Sep '09
details: http://www.bx.psu.edu/hg/galaxy/rev/69615210cf99
changeset: 2755:69615210cf99
user: rc
date: Wed Sep 23 13:25:22 2009 -0400
description:
Fixed a bug in the new/edit request code. Now user can select all permitted folders & subfolders of a selected library when creating or editing a request.
2 file(s) affected in this change:
lib/galaxy/security/__init__.py
lib/galaxy/web/controllers/requests.py
diffs (150 lines):
diff -r c7446ed27839 -r 69615210cf99 lib/galaxy/security/__init__.py
--- a/lib/galaxy/security/__init__.py Wed Sep 23 11:08:36 2009 -0400
+++ b/lib/galaxy/security/__init__.py Wed Sep 23 13:25:22 2009 -0400
@@ -443,19 +443,21 @@
else:
hidden_folder_ids = '%d' % folder.id
return False, hidden_folder_ids
- def get_showable_folders( self, user, roles, library_item, actions_to_check, showable_folders=[] ):
+ def get_showable_folders( self, user, roles, library_item, actions_to_check, hidden_folder_ids=[], showable_folders=[] ):
"""
This method must be sent an instance of Library(), all the folders of which are scanned to determine if
- user is allowed to perform any action in actions_to_check. A list of showable folders is generated.
- This method scans the entire library.
+ user is allowed to perform any action in actions_to_check. The param hidden_folder_ids, if passed, should
+ contain a list of folder IDs which was generated when the library was previously scanned
+ using the same actions_to_check. A list of showable folders is generated. This method scans the entire library.
"""
if isinstance( library_item, self.model.Library ):
- return self.get_showable_folders( user, roles, library_item.root_folder, actions_to_check, showable_folders=showable_folders )
+ return self.get_showable_folders( user, roles, library_item.root_folder, actions_to_check, showable_folders=[] )
if isinstance( library_item, self.model.LibraryFolder ):
- for action in actions_to_check:
- if self.allow_library_item_action( user, roles, action, library_item ):
- showable_folders.append( library_item )
- break
+ if library_item.id not in hidden_folder_ids:
+ for action in actions_to_check:
+ if self.allow_library_item_action( user, roles, action, library_item ):
+ showable_folders.append( library_item )
+ break
for folder in library_item.active_folders:
self.get_showable_folders( user, roles, folder, actions_to_check, showable_folders=showable_folders )
return showable_folders
diff -r c7446ed27839 -r 69615210cf99 lib/galaxy/web/controllers/requests.py
--- a/lib/galaxy/web/controllers/requests.py Wed Sep 23 11:08:36 2009 -0400
+++ b/lib/galaxy/web/controllers/requests.py Wed Sep 23 13:25:22 2009 -0400
@@ -474,45 +474,57 @@
# select lists are rendered.
libraries = odict()
for library in all_libraries:
- showable_folders = trans.app.security_agent.get_showable_folders( user, roles, library, actions_to_check )
- if showable_folders:
- libraries[ library ] = showable_folders
- libui = self.__library_ui(libraries, **kwd)
+ can_show, hidden_folder_ids = trans.app.security_agent.show_library_item( user, roles, library, actions_to_check )
+ if can_show:
+ libraries[ library ] = hidden_folder_ids
+ libui = self.__library_ui(trans, libraries, **kwd)
widgets = widgets + libui
widgets = widgets + request_type.request_form.get_widgets( user, **kwd )
return trans.fill_template( '/requests/new_request.mako',
select_request_type=select_request_type,
- request_type=request_type,
+ request_type=request_type,
widgets=widgets,
msg=msg,
messagetype=messagetype)
- def __library_ui(self, libraries, request=None, **kwd):
+ def __library_ui(self, trans, libraries, request=None, **kwd):
params = util.Params( kwd )
lib_id = params.get( 'library_id', 'none' )
- lib_id_list = ['new'] + [str(lib.id) for lib in libraries.keys()]
- lib_list = SelectField( 'library_id', refresh_on_change=True, refresh_on_change_values=lib_id_list )
+ # if editing a request
if request and lib_id == 'none':
if request.library:
lib_id = str(request.library.id)
+ selected_lib = request.library
+ else:
+ # new request
+ selected_lib = None
+ lib_id_list = ['new'] + [str(lib.id) for lib in libraries.keys()]
+ lib_list = SelectField( 'library_id', refresh_on_change=True, refresh_on_change_values=lib_id_list )
+ # fill up the options in the Library selectfield
+ # first option
if lib_id == 'none':
lib_list.add_option('Select one', 'none', selected=True)
else:
lib_list.add_option('Select one', 'none')
- for lib, folders in libraries.items():
+ # all the libraries available to the user
+ for lib, hidden_folder_ids in libraries.items():
if str(lib.id) == lib_id:
lib_list.add_option(lib.name, lib.id, selected=True)
+ selected_lib, selected_hidden_folder_ids = lib, hidden_folder_ids.split(',')
else:
lib_list.add_option(lib.name, lib.id)
lib_list.refresh_on_change_values.append(lib.id)
+ # new library
if lib_id == 'new':
lib_list.add_option('Create a new data library', 'new', selected=True)
else:
lib_list.add_option('Create a new data library', 'new')
+ # data library widget
lib_widget = dict(label='Data library',
widget=lib_list,
helptext='Data library where the resultant dataset will be stored.')
- selected, value = lib_widget[ 'widget' ].get_selected()
- if selected not in [ 'new', 'none' ]:
+ # show the folder widget only if the user has selected a valid library above
+ if selected_lib:
+ # when editing a request
if request:
if request.folder:
current_fid = request.folder.id
@@ -521,11 +533,24 @@
else:
current_fid = params.get( 'folder_id', 'none' )
folder_list = SelectField( 'folder_id')
- for f in folders:
- if str(f.id) == current_fid:
+ # first option
+ if lib_id == 'none':
+ folder_list.add_option('Select one', 'none', selected=True)
+ else:
+ folder_list.add_option('Select one', 'none')
+ # get all show-able folders for the selected library
+ user, roles = trans.get_user_and_roles()
+ actions_to_check = [ trans.app.security_agent.permitted_actions.LIBRARY_ADD ]
+ showable_folders = trans.app.security_agent.get_showable_folders( user, roles,
+ selected_lib,
+ actions_to_check,
+ selected_hidden_folder_ids )
+ for f in showable_folders:
+ if str(f.id) == str(current_fid):
folder_list.add_option(f.name, f.id, selected=True)
else:
folder_list.add_option(f.name, f.id)
+ # folder widget
folder_widget = dict(label='Folder',
widget=folder_list,
helptext='Folder of the selected data library where the resultant dataset will be stored.')
@@ -536,7 +561,7 @@
helptext='Enter a name here to request a new data library')
return [lib_widget, new_lib]
else:
- if folders:
+ if selected_lib:
return [lib_widget, folder_widget]
else:
return [lib_widget]
@@ -715,7 +740,7 @@
can_show, hidden_folder_ids = trans.app.security_agent.show_library_item( user, roles, library, actions_to_check )
if can_show:
libraries[ library ] = hidden_folder_ids
- libui = self.__library_ui(libraries, request, **kwd)
+ libui = self.__library_ui(trans, libraries, request, **kwd)
widgets = widgets + libui
widgets = widgets + request.type.request_form.get_widgets( user, request.values.content, **kwd )
return trans.fill_template( '/requests/edit_request.mako',
1
0
25 Sep '09
details: http://www.bx.psu.edu/hg/galaxy/rev/be3c27418de9
changeset: 2753:be3c27418de9
user: Greg Von Kuster <greg(a)bx.psu.edu>
date: Wed Sep 23 09:24:10 2009 -0400
description:
Fix bug in security helpers encode_id and decode_id methods that resulted in overriding the Python built in id - resolves ticket # 167.
1 file(s) affected in this change:
lib/galaxy/web/security/__init__.py
diffs (23 lines):
diff -r afa7946a126c -r be3c27418de9 lib/galaxy/web/security/__init__.py
--- a/lib/galaxy/web/security/__init__.py Tue Sep 22 21:51:11 2009 -0400
+++ b/lib/galaxy/web/security/__init__.py Wed Sep 23 09:24:10 2009 -0400
@@ -34,15 +34,15 @@
def __init__( self, **config ):
self.id_secret = config['id_secret']
self.id_cipher = Blowfish.new( self.id_secret )
- def encode_id( self, id ):
+ def encode_id( self, obj_id ):
# Convert to string
- s = str( id )
+ s = str( obj_id )
# Pad to a multiple of 8 with leading "!"
s = ( "!" * ( 8 - len(s) % 8 ) ) + s
# Encrypt
return self.id_cipher.encrypt( s ).encode( 'hex' )
- def decode_id( self, id ):
- return int( self.id_cipher.decrypt( id.decode( 'hex' ) ).lstrip( "!" ) )
+ def decode_id( self, obj_id ):
+ return int( self.id_cipher.decrypt( obj_id.decode( 'hex' ) ).lstrip( "!" ) )
def encode_session_key( self, session_key ):
# Session keys are strings
# Pad to a multiple of 8 with leading "!"
1
0
details: http://www.bx.psu.edu/hg/galaxy/rev/9118054983c3
changeset: 2751:9118054983c3
user: Greg Von Kuster <greg(a)bx.psu.edu>
date: Tue Sep 22 14:47:47 2009 -0400
description:
Eliminate the encode data functional test.
1 file(s) affected in this change:
test/functional/test_get_data.py
diffs (27 lines):
diff -r d42c5698798b -r 9118054983c3 test/functional/test_get_data.py
--- a/test/functional/test_get_data.py Tue Sep 22 14:04:48 2009 -0400
+++ b/test/functional/test_get_data.py Tue Sep 22 14:47:47 2009 -0400
@@ -57,23 +57,3 @@
self.check_history_for_string( 'Pasted Entry' )
self.check_history_for_string( 'hello world' )
self.delete_history( id=self.security.encode_id( history2.id ) )
- def test_010_upload_encode_data( self ):
- """Test uploading encode data"""
- # Deleting the current history should have created a new history
- self.check_history_for_string( 'Your history is empty' )
- history3 = galaxy.model.History.filter( and_( galaxy.model.History.table.c.deleted==False,
- galaxy.model.History.table.c.user_id==admin_user.id ) ) \
- .order_by( desc( galaxy.model.History.table.c.create_time ) ).first()
- self.run_tool( 'encode_import_chromatin_and_chromosomes1', hg17=['cc.EarlyRepSeg.20051216.bed'] )
- self.wait()
- hda7 = galaxy.model.HistoryDatasetAssociation.query() \
- .order_by( desc( galaxy.model.HistoryDatasetAssociation.table.c.create_time ) ).first()
- assert hda7 is not None, "Problem retrieving hda7 from database"
- self.verify_dataset_correctness( 'cc.EarlyRepSeg.20051216.bed', hid=str( hda7.hid ) )
- self.run_tool('encode_import_gencode1', hg17=['gencode.CDS.20051206.bed'])
- self.wait()
- hda8 = galaxy.model.HistoryDatasetAssociation.query() \
- .order_by( desc( galaxy.model.HistoryDatasetAssociation.table.c.create_time ) ).first()
- assert hda8 is not None, "Problem retrieving hda8 from database"
- self.verify_dataset_correctness( 'sc_3D_cds.bed', hid=str( hda8.hid ) )
- self.delete_history( id=self.security.encode_id( history3.id ) )
1
0
details: http://www.bx.psu.edu/hg/galaxy/rev/afa7946a126c
changeset: 2752:afa7946a126c
user: Kanwei Li <kanwei(a)gmail.com>
date: Tue Sep 22 21:51:11 2009 -0400
description:
new trackster lands
10 file(s) affected in this change:
lib/galaxy/visualization/tracks/data/array_tree.py
lib/galaxy/web/controllers/tracks.py
static/scripts/jquery.mousewheel.js
static/scripts/packed/autocomplete_tagging.js
static/scripts/packed/jquery.mousewheel.js
static/scripts/packed/trackster.js
static/scripts/trackster.js
static/trackster.css
templates/tracks/browser.mako
templates/tracks/new_browser.mako
diffs (1182 lines):
diff -r 9118054983c3 -r afa7946a126c lib/galaxy/visualization/tracks/data/array_tree.py
--- a/lib/galaxy/visualization/tracks/data/array_tree.py Tue Sep 22 14:47:47 2009 -0400
+++ b/lib/galaxy/visualization/tracks/data/array_tree.py Tue Sep 22 21:51:11 2009 -0400
@@ -18,6 +18,17 @@
class ArrayTreeDataProvider( object ):
def __init__( self, dataset ):
self.dataset = dataset
+
+ def get_stats( self, chrom ):
+ d = FileArrayTreeDict( open( self.dataset.file_name ) )
+ try:
+ chrom_array_tree = d[chrom]
+ except KeyError:
+ return None
+
+ root_summary = chrom_array_tree.get_summary( 0, chrom_array_tree.levels )
+ return { 'max': float( max(root_summary.maxs) ), 'min': float( min(root_summary.mins) ) }
+
def get_data( self, chrom, start, end ):
start = int( start )
end = int( end )
diff -r 9118054983c3 -r afa7946a126c lib/galaxy/web/controllers/tracks.py
--- a/lib/galaxy/web/controllers/tracks.py Tue Sep 22 14:47:47 2009 -0400
+++ b/lib/galaxy/web/controllers/tracks.py Tue Sep 22 21:51:11 2009 -0400
@@ -15,7 +15,8 @@
need to support that, but need to make user defined build support better)
"""
-import math
+import math, logging
+log = logging.getLogger(__name__)
from galaxy.util.json import to_json_string
from galaxy.web.base.controller import *
@@ -100,7 +101,7 @@
tracks.append( {
"type": dataset.datatype.get_track_type(),
"name": dataset.name,
- "id": dataset.id
+ "dataset_id": dataset.id
} )
dbkey = dataset.dbkey
chrom_lengths = self._chroms( trans, dbkey )
@@ -111,18 +112,20 @@
tracks=tracks,
chrom=chrom,
dbkey=dbkey,
- LEN=chrom_lengths.get( chrom, 0 ) )
+ LEN=chrom_lengths.get(chrom, 0) )
@web.json
def chroms(self, trans, dbkey=None ):
- return self._chroms( trans, dbkey )
+ chroms = self._chroms( trans, dbkey )
+ unsorted = [{ 'chrom': chrom, 'len': length } for chrom, length in chroms.iteritems()]
+ unsorted.sort( lambda a,b: cmp(a['chrom'], b['chrom']) )
+ return unsorted
def _chroms( self, trans, dbkey ):
"""
Called by the browser to get a list of valid chromosomes and lengths
"""
- # If there is any dataset in the history of extension `len`, this will
- # use it
+ # If there is any dataset in the history of extension `len`, this will use it
db_manifest = trans.db_dataset_for( dbkey )
if not db_manifest:
db_manifest = os.path.join( trans.app.config.tool_data_path, 'shared','ucsc','chrom', "%s.len" % dbkey )
@@ -139,7 +142,7 @@
return manifest
@web.json
- def data( self, trans, dataset_id, track_type, chrom, low, high ):
+ def data( self, trans, dataset_id, track_type, chrom, low, high, stats=False ):
"""
Called by the browser to request a block of data
"""
@@ -169,6 +172,10 @@
# We have a dataset in the right format that is ready to use, wrap in
# a data provider that knows how to access it
data_provider = dataset_type_to_data_provider[ converted_dataset_type ]( converted_dataset )
+
+ # Return stats if we need them
+ if stats: return data_provider.get_stats( chrom )
+
# Get the requested chunk of data
data = data_provider.get_data( chrom, low, high )
# Pack into a dictionary and return
diff -r 9118054983c3 -r afa7946a126c static/scripts/jquery.mousewheel.js
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/static/scripts/jquery.mousewheel.js Tue Sep 22 21:51:11 2009 -0400
@@ -0,0 +1,60 @@
+/*! Copyright (c) 2009 Brandon Aaron (http://brandonaaron.net)
+ * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
+ * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
+ * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
+ * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
+ *
+ * Version: 3.0.2
+ *
+ * Requires: 1.2.2+
+ */
+
+(function($) {
+
+var types = ['DOMMouseScroll', 'mousewheel'];
+
+$.event.special.mousewheel = {
+ setup: function() {
+ if ( this.addEventListener )
+ for ( var i=types.length; i; )
+ this.addEventListener( types[--i], handler, false );
+ else
+ this.onmousewheel = handler;
+ },
+
+ teardown: function() {
+ if ( this.removeEventListener )
+ for ( var i=types.length; i; )
+ this.removeEventListener( types[--i], handler, false );
+ else
+ this.onmousewheel = null;
+ }
+};
+
+$.fn.extend({
+ mousewheel: function(fn) {
+ return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");
+ },
+
+ unmousewheel: function(fn) {
+ return this.unbind("mousewheel", fn);
+ }
+});
+
+
+function handler(event) {
+ var args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true;
+
+ event = $.event.fix(event || window.event);
+ event.type = "mousewheel";
+
+ if ( event.wheelDelta ) delta = event.wheelDelta/120;
+ if ( event.detail ) delta = -event.detail/3;
+
+ // Add events and delta to the front of the arguments
+ args.unshift(event, delta);
+
+ return $.event.handle.apply(this, args);
+}
+
+})(jQuery);
\ No newline at end of file
diff -r 9118054983c3 -r afa7946a126c static/scripts/packed/autocomplete_tagging.js
--- a/static/scripts/packed/autocomplete_tagging.js Tue Sep 22 14:47:47 2009 -0400
+++ b/static/scripts/packed/autocomplete_tagging.js Tue Sep 22 21:51:11 2009 -0400
@@ -1,1 +1,1 @@
-var ac_tag_area_id_gen=1;jQuery.fn.autocomplete_tagging=function(c){var e={get_toggle_link_text_fn:function(u){var w="";var v=o(u);if(v!=0){w=v+(v!=0?" Tags":" Tag")}else{w="Add tags"}return w},tag_click_fn:function(u){},input_size:20,in_form:false,tags:{},use_toggle_link:true,item_id:"",add_tag_img:"",add_tag_img_rollover:"",delete_tag_img:"",ajax_autocomplete_tag_url:"",ajax_retag_url:"",ajax_delete_tag_url:"",ajax_add_tag_url:""};var p=jQuery.extend(e,c);var k="tag-area-"+(ac_tag_area_id_gen)++;var m=$("<div>").attr("id",k).addClass("tag-area");this.append(m);var o=function(u){if(u.length){return u.length}var v=0;for(element in u){v++}return v};var b=function(){var u=p.get_toggle_link_text_fn(p.tags);var v=$("<a href='/history/tags'>").text(u).addClass("toggle-link");v.click(function(){var w=(m.css("display")=="none");var x;if(w){x=function(){var y=o(p.tags);if(y==0){m.click()}}}else{x=function(){m.blur()}}m.slideToggle("fast",x);return false});return v};var s=b();if(p.us
e_toggle_link){this.prepend(s)}var t=function(u){var v=new Array();for(key in u){v[v.length]=key+"-->"+u[key]}return"{"+v.join(",")+"}"};var a=function(v,u){return v+((u!=""&&u)?":"+u:"")};var h=function(u){return u.split(":")};var i=function(u){var v=$("<img src='"+p.add_tag_img+"' rollover='"+p.add_tag_img_rollover+"'/>").addClass("add-tag-button");v.click(function(){$(this).hide();m.click();return false});return v};var j=function(u){var v=$("<img src='"+p.delete_tag_img+"'/>").addClass("delete-tag-img");v.mouseenter(function(){$(this).attr("src",p.delete_tag_img_rollover)});v.mouseleave(function(){$(this).attr("src",p.delete_tag_img)});v.click(function(){var D=$(this).parent();var C=D.find(".tag-name").eq(0);var B=C.text();var z=h(B);var F=z[0];var y=z[1];var E=D.prev();D.remove();delete p.tags[F];var A=p.get_toggle_link_text_fn(p.tags);s.text(A);$.ajax({url:p.ajax_delete_tag_url,data:{tag_name:F},error:function(){p.tags[F]=y;if(E.hasClass("tag-button")){E.after(D)}else{m
.prepend(D)}var G=p.get_toggle_link_text_fn(p.tags);alert("Remove tag failed");s.text(G);v.mouseenter(function(){$(this).attr("src",p.delete_tag_img_rollover)});v.mouseleave(function(){$(this).attr("src",p.delete_tag_img)})},success:function(){}});return true});var w=$("<span>").text(u).addClass("tag-name");w.click(function(){p.tag_click_fn(u);return true});var x=$("<span></span>").addClass("tag-button");x.append(w);x.append(v);return x};var d=function(v){var u;if(p.in_form){u=$("<textarea id='history-tag-input' rows='1' cols='"+p.input_size+"' value='"+escape(v)+"'></textarea>")}else{u=$("<input id='history-tag-input' type='text' size='"+p.input_size+"' value='"+escape(v)+"'></input>")}u.keyup(function(D){if(D.keyCode==27){$(this).trigger("blur")}else{if((D.keyCode==13)||(D.keyCode==188)||(D.keyCode==32)){new_value=this.value;if(return_key_pressed_for_autocomplete==true){return_key_pressed_for_autocomplete=false;return false}if(new_value.indexOf(": ",new_value.length-2)!=-1
){this.value=new_value.substring(0,new_value.length-1);return false}if((D.keyCode==188)||(D.keyCode==32)){new_value=new_value.substring(0,new_value.length-1)}new_value=new_value.replace(/^\s+|\s+$/g,"");if(new_value.length<3){return false}this.value="";var A=j(new_value);var z=m.children(".tag-button");if(z.length!=0){var E=z.slice(z.length-1);E.after(A)}else{m.prepend(A)}var y=new_value.split(":");p.tags[y[0]]=y[1];var B=p.get_toggle_link_text_fn(p.tags);s.text(B);var C=$(this);$.ajax({url:p.ajax_add_tag_url,data:{new_tag:new_value},error:function(){A.remove();delete p.tags[y[0]];var F=p.get_toggle_link_text_fn(p.tags);s.text(F);alert("Add tag failed")},success:function(){C.flushCache()}});return false}}});var w=function(A,z,y,C,B){tag_name_and_value=C.split(":");return(tag_name_and_value.length==1?tag_name_and_value[0]:tag_name_and_value[1])};var x={selectFirst:false,formatItem:w,autoFill:false,highlight:false};u.autocomplete(p.ajax_autocomplete_tag_url,x);u.addClass("tag-
input");return u};for(tag_name in p.tags){var q=p.tags[tag_name];var l=a(tag_name,q);var g=j(l,s,p.tags);m.append(g)}var n=d("");var f=i(n);m.blur(function(u){r=o(p.tags);if(r!=0){f.show();n.hide();m.removeClass("active-tag-area")}else{}});m.append(f);m.append(n);n.hide();m.click(function(w){var v=$(this).hasClass("active-tag-area");if($(w.target).hasClass("delete-tag-img")&&!v){return false}if($(w.target).hasClass("tag-name")&&!v){return false}$(this).addClass("active-tag-area");f.hide();n.show();n.focus();var u=function(y){var x=m.attr("id");if(($(y.target).attr("id")!=x)&&($(y.target).parents().filter(x).length==0)){m.blur();$(document).unbind("click",u)}};$(window).click(u);return false});if(p.use_toggle_link){m.hide()}else{var r=o(p.tags);if(r==0){f.hide();n.show()}}return this.addClass("tag-element")};
\ No newline at end of file
+var ac_tag_area_id_gen=1;jQuery.fn.autocomplete_tagging=function(c){var e={get_toggle_link_text_fn:function(u){var w="";var v=o(u);if(v!=0){w=v+(v!=0?" Tags":" Tag")}else{w="Add tags"}return w},tag_click_fn:function(u,v){},input_size:20,in_form:false,tags:{},use_toggle_link:true,item_id:"",add_tag_img:"",add_tag_img_rollover:"",delete_tag_img:"",ajax_autocomplete_tag_url:"",ajax_retag_url:"",ajax_delete_tag_url:"",ajax_add_tag_url:""};var p=jQuery.extend(e,c);var k="tag-area-"+(ac_tag_area_id_gen)++;var m=$("<div>").attr("id",k).addClass("tag-area");this.append(m);var o=function(u){if(u.length){return u.length}var v=0;for(element in u){v++}return v};var b=function(){var u=p.get_toggle_link_text_fn(p.tags);var v=$("<a href='/history/tags'>").text(u).addClass("toggle-link");v.click(function(){var w=(m.css("display")=="none");var x;if(w){x=function(){var y=o(p.tags);if(y==0){m.click()}}}else{x=function(){m.blur()}}m.slideToggle("fast",x);return false});return v};var s=b();if(p.
use_toggle_link){this.prepend(s)}var t=function(u){var v=new Array();for(key in u){v[v.length]=key+"-->"+u[key]}return"{"+v.join(",")+"}"};var a=function(v,u){return v+((u!=""&&u)?":"+u:"")};var h=function(u){return u.split(":")};var i=function(u){var v=$("<img src='"+p.add_tag_img+"' rollover='"+p.add_tag_img_rollover+"'/>").addClass("add-tag-button");v.click(function(){$(this).hide();m.click();return false});return v};var j=function(u){var v=$("<img src='"+p.delete_tag_img+"'/>").addClass("delete-tag-img");v.mouseenter(function(){$(this).attr("src",p.delete_tag_img_rollover)});v.mouseleave(function(){$(this).attr("src",p.delete_tag_img)});v.click(function(){var D=$(this).parent();var C=D.find(".tag-name").eq(0);var B=C.text();var z=h(B);var F=z[0];var y=z[1];var E=D.prev();D.remove();delete p.tags[F];var A=p.get_toggle_link_text_fn(p.tags);s.text(A);$.ajax({url:p.ajax_delete_tag_url,data:{tag_name:F},error:function(){p.tags[F]=y;if(E.hasClass("tag-button")){E.after(D)}else
{m.prepend(D)}var G=p.get_toggle_link_text_fn(p.tags);alert("Remove tag failed");s.text(G);v.mouseenter(function(){$(this).attr("src",p.delete_tag_img_rollover)});v.mouseleave(function(){$(this).attr("src",p.delete_tag_img)})},success:function(){}});return true});var w=$("<span>").text(u).addClass("tag-name");w.click(function(){tag_name_and_value=u.split(":");p.tag_click_fn(tag_name_and_value[0],tag_name_and_value[1]);return true});var x=$("<span></span>").addClass("tag-button");x.append(w);x.append(v);return x};var d=function(v){var u;if(p.in_form){u=$("<textarea id='history-tag-input' rows='1' cols='"+p.input_size+"' value='"+escape(v)+"'></textarea>")}else{u=$("<input id='history-tag-input' type='text' size='"+p.input_size+"' value='"+escape(v)+"'></input>")}u.keyup(function(D){if(D.keyCode==27){$(this).trigger("blur")}else{if((D.keyCode==13)||(D.keyCode==188)||(D.keyCode==32)){new_value=this.value;if(return_key_pressed_for_autocomplete==true){return_key_pressed_for_autoc
omplete=false;return false}if(new_value.indexOf(": ",new_value.length-2)!=-1){this.value=new_value.substring(0,new_value.length-1);return false}if((D.keyCode==188)||(D.keyCode==32)){new_value=new_value.substring(0,new_value.length-1)}new_value=new_value.replace(/^\s+|\s+$/g,"");if(new_value.length<3){return false}this.value="";var A=j(new_value);var z=m.children(".tag-button");if(z.length!=0){var E=z.slice(z.length-1);E.after(A)}else{m.prepend(A)}var y=new_value.split(":");p.tags[y[0]]=y[1];var B=p.get_toggle_link_text_fn(p.tags);s.text(B);var C=$(this);$.ajax({url:p.ajax_add_tag_url,data:{new_tag:new_value},error:function(){A.remove();delete p.tags[y[0]];var F=p.get_toggle_link_text_fn(p.tags);s.text(F);alert("Add tag failed")},success:function(){C.flushCache()}});return false}}});var w=function(A,z,y,C,B){tag_name_and_value=C.split(":");return(tag_name_and_value.length==1?tag_name_and_value[0]:tag_name_and_value[1])};var x={selectFirst:false,formatItem:w,autoFill:false,hig
hlight:false};u.autocomplete(p.ajax_autocomplete_tag_url,x);u.addClass("tag-input");return u};for(tag_name in p.tags){var q=p.tags[tag_name];var l=a(tag_name,q);var g=j(l,s,p.tags);m.append(g)}var n=d("");var f=i(n);m.blur(function(u){r=o(p.tags);if(r!=0){f.show();n.hide();m.removeClass("active-tag-area")}else{}});m.append(f);m.append(n);n.hide();m.click(function(w){var v=$(this).hasClass("active-tag-area");if($(w.target).hasClass("delete-tag-img")&&!v){return false}if($(w.target).hasClass("tag-name")&&!v){return false}$(this).addClass("active-tag-area");f.hide();n.show();n.focus();var u=function(y){var x=m.attr("id");if(($(y.target).attr("id")!=x)&&($(y.target).parents().filter(x).length==0)){m.blur();$(document).unbind("click",u)}};$(window).click(u);return false});if(p.use_toggle_link){m.hide()}else{var r=o(p.tags);if(r==0){f.hide();n.show()}}return this.addClass("tag-element")};
\ No newline at end of file
diff -r 9118054983c3 -r afa7946a126c static/scripts/packed/jquery.mousewheel.js
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/static/scripts/packed/jquery.mousewheel.js Tue Sep 22 21:51:11 2009 -0400
@@ -0,0 +1,11 @@
+/* Copyright (c) 2009 Brandon Aaron (http://brandonaaron.net)
+ * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
+ * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
+ * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
+ * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
+ *
+ * Version: 3.0.2
+ *
+ * Requires: 1.2.2+
+ */
+(function(c){var a=["DOMMouseScroll","mousewheel"];c.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var d=a.length;d;){this.addEventListener(a[--d],b,false)}}else{this.onmousewheel=b}},teardown:function(){if(this.removeEventListener){for(var d=a.length;d;){this.removeEventListener(a[--d],b,false)}}else{this.onmousewheel=null}}};c.fn.extend({mousewheel:function(d){return d?this.bind("mousewheel",d):this.trigger("mousewheel")},unmousewheel:function(d){return this.unbind("mousewheel",d)}});function b(f){var d=[].slice.call(arguments,1),g=0,e=true;f=c.event.fix(f||window.event);f.type="mousewheel";if(f.wheelDelta){g=f.wheelDelta/120}if(f.detail){g=-f.detail/3}d.unshift(f,g);return c.event.handle.apply(this,d)}})(jQuery);
\ No newline at end of file
diff -r 9118054983c3 -r afa7946a126c static/scripts/packed/trackster.js
--- a/static/scripts/packed/trackster.js Tue Sep 22 14:47:47 2009 -0400
+++ b/static/scripts/packed/trackster.js Tue Sep 22 21:51:11 2009 -0400
@@ -1,1 +1,1 @@
-var DENSITY=1000;var View=function(b,c,a,d){this.chr=b;this.length=c;this.low=a;this.high=d};$.extend(View.prototype,{move:function(b,a){this.low=Math.max(0,Math.floor(b));this.high=Math.min(this.length,Math.ceil(a))},zoom_in:function(c){var a=(this.low+this.high)/2;var b=this.high-this.low;var d=b/c/2;this.low=Math.floor(a-d);this.high=Math.ceil(a+d);if(this.high-this.low<1){this.high=this.low+1}},zoom_out:function(c){var a=(this.low+this.high)/2;var b=this.high-this.low;var d=b*c/2;this.low=Math.floor(Math.max(0,a-d));this.high=Math.ceil(Math.min(this.length,a+d))},left:function(b){var a=this.high-this.low;var c=Math.floor(a/b);if(this.low-c<0){this.low=0;this.high=this.low+a}else{this.low-=c;this.high-=c}},right:function(b){var a=this.high-this.low;var c=Math.floor(a/b);if(this.high+c>this.length){this.high=this.length;this.low=this.high-a}else{this.low+=c;this.high+=c}}});var Track=function(b,a,c){this.name=b;this.view=a;this.parent_element=c;this.make_container()};$.ext
end(Track.prototype,{make_container:function(){this.header_div=$("<div class='track-header'>");this.header_div.text(this.name);this.content_div=$("<div class='track-content'>");this.container_div=$("<div class='track'></div>");this.container_div.append(this.header_div);this.container_div.append(this.content_div);this.parent_element.append(this.container_div)}});var TiledTrack=function(b,a,c){Track.call(this,b,a,c);this.last_resolution=null;this.last_w_scale=null;this.tile_cache={}};$.extend(TiledTrack.prototype,Track.prototype,{draw:function(){var k=this.view.low,c=this.view.high,e=c-k;var b=Math.pow(10,Math.ceil(Math.log(e/DENSITY)/Math.log(10)));b=Math.max(b,1);b=Math.min(b,100000);var o=$("<div style='position: relative;'></div>");this.content_div.children(":first").remove();this.content_div.append(o);var m=this.content_div.width(),d=this.content_div.height(),p=m/e,l={},n={};if(this.last_resolution==b&&this.last_w_scale==p){l=this.tile_cache}var g;var a=Math.floor(k/b/DEN
SITY);var j=0;while((a*1000*b)<c){if(a in l){g=l[a];var f=a*DENSITY*b;g.css({left:(f-this.view.low)*p});o.append(g)}else{g=this.draw_tile(b,a,o,p,d)}if(g){n[a]=g;j=Math.max(j,g.height())}a+=1}o.css("height",j);this.last_resolution=b;this.last_w_scale=p;this.tile_cache=n}});var DataCache=function(c,b,a){this.type=c;this.track=b;this.view=a;this.cache=Object()};$.extend(DataCache.prototype,{get:function(d,b){var c=this.cache;if(!(c[d]&&c[d][b])){if(!c[d]){c[d]=Object()}var a=b*DENSITY*d;var f=(b+1)*DENSITY*d;c[d][b]={state:"loading"};var e=function(g){return function(){$.getJSON(TRACKSTER_DATA_URL+g.type,{chrom:g.view.chr,low:a,high:f,dataset_id:g.track.dataset_id},function(h){if(h=="pending"){setTimeout(e,5000)}else{c[d][b]={state:"loaded",values:h}}$(document).trigger("redraw")})}}(this);e()}return c[d][b]}});var LineTrack=function(c,b,d,a){Track.call(this,c,b,d);this.container_div.addClass("line-track");this.dataset_id=a;this.cache=new DataCache("",this,b)};$.extend(LineTra
ck.prototype,TiledTrack.prototype,{make_container:function(){Track.prototype.make_container.call(this);this.content_div.css("height",100)},draw_tile:function(n,q,g,j,h){var s=q*DENSITY*n,d=(q+1)*DENSITY*n,a=DENSITY*n;var k=this.cache.get(n,q);var b;if(k.state=="loading"){b=$("<div class='loading tile'></div>")}else{b=$("<canvas class='tile'></canvas>")}b.css({position:"absolute",top:0,left:(s-this.view.low)*j,width:Math.ceil(a*j),height:100});g.append(b);if(k.state=="loading"){l=false;return null}var f=b;f.get(0).width=f.width();f.get(0).height=f.height();var m=f.get(0).getContext("2d");var l=false;m.beginPath();var t=k.values;for(var o=0;o<t.length-1;o++){var r=t[o][0]-s;var e=t[o][1];var p=t[o+1][0]-s;var c=t[o+1][1];console.log(r,e,p,c);if(isNaN(e)||isNaN(c)){l=false}else{r=r*j;p=p*j;e=h-e*(h);c=h-c*(h);if(l){m.lineTo(r,e,p,c)}else{m.moveTo(r,e,p,c);l=true}}}m.stroke();return b}});var LabelTrack=function(a,b){Track.call(this,null,a,b);this.container_div.addClass("label-tr
ack")};$.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'>"+a+"</div>").css({position:"absolute",left:f-1}));a+=g}this.content_div.children(":first").remove();this.content_div.append(b)}});var itemHeight=13,itemPad=3,thinHeight=7,thinOffset=3;var FeatureTrack=function(c,b,d,a){Track.call(this,c,b,d);this.container_div.addClass("feature-track");this.dataset_id=a;this.cache=new DataCache("",this,b)};$.extend(FeatureTrack.prototype,TiledTrack.prototype,{get_data_async:function(){var a=this;$.getJSON("data",{chr:this.view.chr,dataset_id:this.dataset_id},function(b){a.values=b;a.draw()})},draw_tile:function(x,y,h,m,l){var z=y*DENSITY*x,c=(y+1)*DENSITY*x,a=DENSITY*x;var q=this.view,s=q.high-q.low,u=
this.content_div.width(),p=[],A=$("<div class='tile' style='position: relative;'></div>");var o=this.cache.get(x,y);if(o.state=="loading"){h.addClass("loading");return null}else{h.removeClass("loading")}var b=o.values;for(var k in b){var v=b[k];var f=v[1],e=v[2],t=v[5];var g=(f-z)*m;var n=(e-z)*m;var w=n-g;var j=g;var d=p.length;for(i in p){if(p[i]<j){d=i;break}}p[d]=Math.ceil(n);var r=$("<div class='feature'></div>").css({position:"absolute",left:g,top:(d*(itemHeight+itemPad)),height:itemHeight,width:Math.max(w,1)});A.append(r)}A.css({position:"absolute",top:0,left:(z-this.view.low)*m,width:Math.ceil(a*m),height:p.length*(itemHeight+itemPad)+itemPad});h.append(A);return A}});var TrackLayout=function(a){this.view=a;this.tracks=[]};$.extend(TrackLayout.prototype,{add:function(a){this.tracks.push(a)},redraw:function(){for(var a in this.tracks){this.tracks[a].draw()}$("#overview-box").css({left:(this.view.low/this.view.length)*$("#overview-viewport").width(),width:Math.max(1,((
this.view.high-this.view.low)/this.view.length)*$("#overview-viewport").width())}).show();$("#low").text(this.view.low);$("#high").text(this.view.high)}});
\ No newline at end of file
+var DENSITY=1000;var DataCache=function(b,a){this.type=b;this.track=a;this.cache=Object()};$.extend(DataCache.prototype,{get:function(d,b){var c=this.cache;if(!(c[d]&&c[d][b])){if(!c[d]){c[d]=Object()}var a=b*DENSITY*d;var e=(b+1)*DENSITY*d;c[d][b]={state:"loading"};$.getJSON(data_url,{track_type:this.track.track_type,chrom:this.track.view.chrom,low:a,high:e,dataset_id:this.track.dataset_id},function(f){if(f=="pending"){setTimeout(fetcher,5000)}else{c[d][b]={state:"loaded",values:f}}$(document).trigger("redraw")})}return c[d][b]}});var View=function(a,b){this.chrom=a;this.tracks=[];this.max_low=0;this.max_high=b;this.low=this.max_low;this.high=this.max_high;this.length=this.max_high-this.max_low};$.extend(View.prototype,{add_track:function(a){a.view=this;this.tracks.push(a);if(a.init){a.init()}},redraw:function(){$("#overview-box").css({left:(this.low/this.length)*$("#overview-viewport").width(),width:Math.max(4,((this.high-this.low)/this.length)*$("#overview-viewport").widt
h())}).show();$("#low").text(this.low);$("#high").text(this.high);for(var a in this.tracks){this.tracks[a].draw()}$("#bottom-spacer").remove();$("#viewport").append('<div id="bottom-spacer" style="height: 200px;"></div>')},move:function(b,a){this.low=Math.max(this.max_low,Math.floor(b));this.high=Math.min(this.length,Math.ceil(a))},zoom_in:function(d,b){var c=this.high-this.low;var e=c/d/2;if(b==undefined){var a=(this.low+this.high)/2}else{var a=this.low+c*b/$(document).width()}this.low=Math.floor(a-e);this.high=Math.ceil(a+e);if(this.low<this.max_low){this.low=this.max_low;this.high=c/d}else{if(this.high>this.max_high){this.high=this.max_high;this.low=this.max_high-c/d}}if(this.high-this.low<1){this.high=this.low+1}},zoom_out:function(c){var a=(this.low+this.high)/2;var b=this.high-this.low;var d=b*c/2;this.low=Math.floor(Math.max(0,a-d));this.high=Math.ceil(Math.min(this.length,a+d))},left:function(b){var a=this.high-this.low;var c=Math.floor(a/b);if(this.low-c<0){this.low
=0;this.high=this.low+a}else{this.low-=c;this.high-=c}},right:function(b){var a=this.high-this.low;var c=Math.floor(a/b);if(this.high+c>this.length){this.high=this.length;this.low=this.high-a}else{this.low+=c;this.high+=c}}});var Track=function(a,b){this.name=a;this.parent_element=b;this.make_container()};$.extend(Track.prototype,{make_container:function(){this.header_div=$("<div class='track-header'>").text(this.name);this.content_div=$("<div class='track-content'>");this.container_div=$("<div class='track'></div>").append(this.header_div).append(this.content_div);this.parent_element.append(this.container_div)}});var TiledTrack=function(){this.last_resolution=null;this.last_w_scale=null;this.tile_cache={}};$.extend(TiledTrack.prototype,Track.prototype,{draw:function(){var k=this.view.low,c=this.view.high,e=c-k;var b=Math.pow(10,Math.ceil(Math.log(e/DENSITY)/Math.log(10)));b=Math.max(b,1);b=Math.min(b,100000);var o=$("<div style='position: relative;'></div>");this.content_di
v.children(":first").remove();this.content_div.append(o);var m=this.content_div.width(),d=this.content_div.height(),p=m/e,l={},n={};if(this.last_resolution==b&&this.last_w_scale==p){l=this.tile_cache}var g;var a=Math.floor(k/b/DENSITY);var i=0;while((a*1000*b)<c){if(a in l){g=l[a];var f=a*DENSITY*b;g.css({left:(f-this.view.low)*p});o.append(g)}else{g=this.draw_tile(b,a,o,p,d)}if(g){n[a]=g;i=Math.max(i,g.height())}a+=1}o.css("height",i);this.last_resolution=b;this.last_w_scale=p;this.tile_cache=n}});var LineTrack=function(c,b,a){Track.call(this,c,$("#viewport"));this.track_type="line";this.height_px=(a?a:100);this.container_div.addClass("line-track");this.dataset_id=b;this.cache=new DataCache("",this)};$.extend(LineTrack.prototype,TiledTrack.prototype,{make_container:function(){Track.prototype.make_container.call(this);this.content_div.css("height",this.height_px)},init:function(){track=this;$.getJSON(data_url,{stats:true,track_type:track.track_type,chrom:this.view.chrom,low:
null,high:null,dataset_id:this.dataset_id},function(a){if(a){track.min_value=a.min;track.max_value=a.max;track.vertical_range=track.max_value-track.min_value;track.view.redraw()}})},draw_tile:function(d,a,o,s,p){if(!this.vertical_range){return}var k=a*DENSITY*d,r=(a+1)*DENSITY*d,c=DENSITY*d;var n=this.cache.get(d,a);var h;if(n.state=="loading"){h=$("<div class='loading tile'></div>")}else{h=$("<canvas class='tile'></canvas>")}h.css({position:"absolute",top:0,left:(k-this.view.low)*s,});o.append(h);if(n.state=="loading"){e=false;return null}var b=h;b.get(0).width=Math.ceil(c*s);b.get(0).height=this.height_px;var q=b.get(0).getContext("2d");var e=false;q.beginPath();var g=n.values;if(!g){return}for(var f=0;f<g.length-1;f++){var m=g[f][0]-k;var l=g[f][1];if(isNaN(l)){e=false}else{m=m*s;y_above_min=l-this.min_value;l=y_above_min/this.vertical_range*this.height_px;if(e){q.lineTo(m,l)}else{q.moveTo(m,l);e=true}}}q.stroke();return h}});var LabelTrack=function(a){Track.call(this,nul
l,a);this.container_div.addClass("label-track")};$.extend(LabelTrack.prototype,Track.prototype,{draw:function(){var c=this.view,d=c.high-c.low,g=Math.floor(Math.pow(10,Math.floor(Math.log(d)/Math.log(10)))),a=Math.floor(c.low/g)*g,e=this.content_div.width(),b=$("<div style='position: relative; height: 1.3em;'></div>");while(a<c.high){var f=(a-c.low)/d*e;b.append($("<div class='label'>"+a+"</div>").css({position:"absolute",left:f-1}));a+=g}this.content_div.children(":first").remove();this.content_div.append(b)}});var itemHeight=13,itemPad=3,thinHeight=7,thinOffset=3;var FeatureTrack=function(b,a){Track.call(this,b,$("#viewport"));this.track_type="feature";this.container_div.addClass("feature-track");this.dataset_id=a;this.zo_slots=new Object();this.show_labels_scale=0.01;this.showing_labels=false};$.extend(FeatureTrack.prototype,TiledTrack.prototype,{calc_slots:function(d){end_ary=new Array();var c=this.container_div.width()/(this.view.high-this.view.low);if(d){this.zi_slots=
new Object()}var b=$("<canvas></canvas>").get(0).getContext("2d");for(var a in this.values){feature=this.values[a];f_start=Math.floor(Math.max(this.view.max_low,(feature.start-this.view.max_low)*c));if(d){f_start-=b.measureText(feature.name).width}f_end=Math.ceil(Math.min(this.view.max_high,(feature.end-this.view.max_low)*c));j=0;while(true){if(end_ary[j]==undefined||end_ary[j]<f_start){end_ary[j]=f_end;if(d){this.zi_slots[feature.name]=j}else{this.zo_slots[feature.name]=j}break}j++}}},init:function(){var a=this;$.getJSON("getfeature",{start:this.view.max_low,end:this.view.max_high,dataset_id:this.dataset_id,chrom:this.view.chrom},function(b){a.values=b;a.calc_slots();a.slots=a.zo_slots;a.draw()})},draw_tile:function(q,t,e,g,f){if(!this.values){return null}if(g>this.show_labels_scale&&!this.showing_labels){this.showing_labels=true;if(!this.zi_slots){this.calc_slots(true)}this.slots=this.zi_slots}else{if(g<=this.show_labels_scale&&this.showing_labels){this.showing_labels=fals
e;this.slots=this.zo_slots}}var u=t*DENSITY*q,c=(t+1)*DENSITY*q,b=DENSITY*q;var k=this.view,m=k.high-k.low,o=Math.ceil(b*g),h=new Array(),n=200,l=$("<canvas class='tile'></canvas>");l.css({position:"absolute",top:0,left:(u-this.view.low)*g,"border-right":"1px solid #ddd"});l.get(0).width=o;l.get(0).height=n;var p=l.get(0).getContext("2d");var r=0;for(var s in this.values){feature=this.values[s];if(feature.start<=c&&feature.end>=u){f_start=Math.floor(Math.max(0,(feature.start-u)*g));f_end=Math.ceil(Math.min(o,(feature.end-u)*g));p.fillStyle="#000";p.fillRect(f_start,this.slots[feature.name]*10+5,f_end-f_start,1);if(this.showing_labels&&p.fillText){p.font="10px monospace";p.textAlign="right";p.fillText(feature.name,f_start,this.slots[feature.name]*10+8)}if(feature.exon_start&&feature.exon_end){var d=Math.floor(Math.max(0,(feature.exon_start-u)*g));var w=Math.ceil(Math.min(o,(feature.exon_end-u)*g))}for(var s in feature.blocks){block=feature.blocks[s];block_start=Math.floor(Mat
h.max(0,(block[0]-u)*g));block_end=Math.ceil(Math.min(o,(block[1]-u)*g));var a=3,v=4;if(d&&block_start>=d&&block_end<=w){a=5,v=3}p.fillRect(d,this.slots[feature.name]*10+v,block_end-block_start,a)}r++}}e.append(l);return l},});
\ No newline at end of file
diff -r 9118054983c3 -r afa7946a126c static/scripts/trackster.js
--- a/static/scripts/trackster.js Tue Sep 22 14:47:47 2009 -0400
+++ b/static/scripts/trackster.js Tue Sep 22 21:51:11 2009 -0400
@@ -1,26 +1,92 @@
+/* Trackster
+ 2009, James Taylor, Kanwei Li
+*/
+
var DENSITY = 1000;
-var BLOCK_SIZE = 1000;
+var DataCache = function( type, track ) {
+ this.type = type;
+ this.track = track;
+ this.cache = Object();
+};
+$.extend( DataCache.prototype, {
+ get: function( resolution, position ) {
+ var cache = this.cache;
+ if ( !( cache[resolution] && cache[resolution][position] ) ) {
+ if ( !cache[resolution] ) {
+ cache[resolution] = Object();
+ }
+ var low = position * DENSITY * resolution;
+ var high = ( position + 1 ) * DENSITY * resolution;
+ cache[resolution][position] = { state: "loading" };
+
+ $.getJSON( data_url, { track_type: this.track.track_type, chrom: this.track.view.chrom, low: low, high: high, dataset_id: this.track.dataset_id }, function ( data ) {
+ if( data == "pending" ) {
+ setTimeout( fetcher, 5000 );
+ } else {
+ cache[resolution][position] = { state: "loaded", values: data };
+ }
+ $(document).trigger( "redraw" );
+ });
+ }
+ return cache[resolution][position];
+ }
+});
-var log = function( x, b ) { return Math.log( x ) / Math.log( b ) }
-
-var View = function( chr, length, low, high ) {
- this.chr = chr;
- this.length = length;
- this.low = low;
- this.high = high;
+var View = function( chrom, max_length ) {
+ this.chrom = chrom;
+ this.tracks = [];
+ this.max_low = 0;
+ this.max_high = max_length;
+ this.low = this.max_low;
+ this.high = this.max_high;
+ this.length = this.max_high - this.max_low;
};
$.extend( View.prototype, {
+ add_track: function ( track ) {
+ track.view = this;
+ this.tracks.push( track );
+ if (track.init) { track.init(); }
+ },
+ redraw: function () {
+ // Overview
+ $("#overview-box").css( {
+ left: ( this.low / this.length ) * $("#overview-viewport").width(),
+ width: Math.max( 4, ( ( this.high - this.low ) / this.length ) * $("#overview-viewport").width() )
+ }).show();
+ $("#low").text( this.low );
+ $("#high").text( this.high );
+ for ( var i in this.tracks ) {
+ this.tracks[i].draw();
+ }
+ $("#bottom-spacer").remove();
+ $("#viewport").append('<div id="bottom-spacer" style="height: 200px;"></div>');
+ },
move: function ( new_low, new_high ) {
- this.low = Math.max( 0, Math.floor( new_low ) );
+ this.low = Math.max( this.max_low, Math.floor( new_low ) );
this.high = Math.min( this.length, Math.ceil( new_high ) );
},
- zoom_in: function ( factor ) {
- var center = ( this.low + this.high ) / 2;
+ zoom_in: function ( factor, point ) {
var range = this.high - this.low;
var diff = range / factor / 2;
+
+ if (point == undefined) {
+ var center = ( this.low + this.high ) / 2;
+ } else {
+ // console.log(100*point/$(document).width());
+ var center = this.low + range * point / $(document).width();
+ }
+ // console.log(center);
this.low = Math.floor( center - diff );
this.high = Math.ceil( center + diff );
+ if (this.low < this.max_low) {
+ this.low = this.max_low;
+ this.high = range / factor;
+ } else if (this.high > this.max_high) {
+ this.high = this.max_high;
+ this.low = this.max_high - range / factor;
+ // console.log(this.high, this.low);
+ }
if (this.high - this.low < 1 ) {
this.high = this.low + 1;
}
@@ -56,27 +122,21 @@
}
});
-var Track = function ( name, view, parent_element ) {
+var Track = function ( name, parent_element ) {
this.name = name;
- this.view = view;
this.parent_element = parent_element;
this.make_container();
};
$.extend( Track.prototype, {
- make_container : function () {
- this.header_div = $("<div class='track-header'>");
- this.header_div.text( this.name );
+ make_container: function () {
+ this.header_div = $("<div class='track-header'>").text( this.name );;
this.content_div = $("<div class='track-content'>");
- this.container_div = $("<div class='track'></div>");
- this.container_div.append( this.header_div );
- this.container_div.append( this.content_div );
+ this.container_div = $("<div class='track'></div>").append( this.header_div ).append( this.content_div );
this.parent_element.append( this.container_div );
}
});
-var TiledTrack = function( name, view, parent_element ) {
- Track.call( this, name, view, parent_element );
- // For caching
+var TiledTrack = function() {
this.last_resolution = null;
this.last_w_scale = null;
this.tile_cache = {};
@@ -87,23 +147,20 @@
high = this.view.high,
range = high - low;
- var resolution = Math.pow( BLOCK_SIZE, Math.floor( log( range, BLOCK_SIZE ) ) );
- // Math.pow( 10, Math.ceil( Math.log( range / DENSITY ) / Math.log( 10 ) ) );
-
- console//.log( "resolution:", resolution );
+ var resolution = Math.pow( 10, Math.ceil( Math.log( range / DENSITY ) / Math.log( 10 ) ) );
resolution = Math.max( resolution, 1 );
- resolution = Math.min( resolution, 1000000 );
+ resolution = Math.min( resolution, 100000 );
- var parent_element = $("<div style='position: relative;'></div>");
- this.content_div.children( ":first" ).remove();
- this.content_div.append( parent_element );
+ var parent_element = $("<div style='position: relative;'></div>");
+ this.content_div.children( ":first" ).remove();
+ this.content_div.append( parent_element );
var w = this.content_div.width(),
h = this.content_div.height(),
- w_scale = w / range,
- old_tiles = {},
+ w_scale = w / range,
+ old_tiles = {},
new_tiles = {};
-
+
// If resolution and scale are unchanged, try to reuse tiles
if ( this.last_resolution == resolution && this.last_w_scale == w_scale ) {
old_tiles = this.tile_cache;
@@ -125,10 +182,10 @@
// Our responsibility to move the element to the new parent
parent_element.append( tile_element );
} else {
- // console.log( "new tile" );
tile_element = this.draw_tile( resolution, tile_index, parent_element, w_scale, h );
}
if ( tile_element ) {
+ // console.log( typeof(tile_element) );
new_tiles[tile_index] = tile_element;
max_height = Math.max( max_height, tile_element.height() );
}
@@ -143,53 +200,37 @@
}
});
-var DataCache = function( type, track, view ) {
- this.type = type;
- this.track = track;
- this.view = view;
- this.cache = Object();
-};
-$.extend( DataCache.prototype, {
- get: function( resolution, position ) {
- var cache = this.cache;
- if ( ! ( cache[resolution] && cache[resolution][position] ) ) {
- if ( ! cache[resolution] ) {
- cache[resolution] = Object();
- }
- var low = position * DENSITY * resolution;
- var high = ( position + 1 ) * DENSITY * resolution;
- cache[resolution][position] = { state: "loading" };
- // use closure to preserve this and parameters for getJSON
- var fetcher = function (ref) {
- return function () {
- $.getJSON( TRACKSTER_DATA_URL, { track_type: ref.type, chrom: ref.view.chr, low: low, high: high, dataset_id: ref.track.dataset_id }, function ( data ) {
- if( data == "pending" ) {
- setTimeout( fetcher, 5000 );
- } else {
- cache[resolution][position] = { state: "loaded", values: data };
- }
- $(document).trigger( "redraw" );
- });
- };
- }(this);
- fetcher();
- }
- return cache[resolution][position];
- }
-});
-
-var LineTrack = function ( name, view, parent_element, dataset_id ) {
- Track.call( this, name, view, parent_element );
+var LineTrack = function ( name, dataset_id, height ) {
+ Track.call( this, name, $("#viewport") );
+
+ this.track_type = "line";
+ this.height_px = (height ? height : 100);
this.container_div.addClass( "line-track" );
this.dataset_id = dataset_id;
- this.cache = new DataCache( "line", this, view );
+ this.cache = new DataCache( "", this );
};
$.extend( LineTrack.prototype, TiledTrack.prototype, {
make_container: function () {
- Track.prototype.make_container.call( this );
- this.content_div.css( "height", 100 );
+ Track.prototype.make_container.call(this);
+ // console.log("height:", this.height_px);
+ this.content_div.css( "height", this.height_px );
+ },
+ init: function() {
+ track = this;
+ $.getJSON( data_url, { stats: true, track_type: track.track_type, chrom: this.view.chrom, low: null, high: null, dataset_id: this.dataset_id }, function ( data ) {
+ // console.log(data);
+ if (data) {
+ track.min_value = data['min'];
+ track.max_value = data['max'];
+ track.vertical_range = track.max_value - track.min_value;
+ track.view.redraw();
+ }
+ });
},
draw_tile: function( resolution, tile_index, parent_element, w_scale, h_scale ) {
+ if (!this.vertical_range) // We don't have the necessary information yet
+ return;
+
var tile_low = tile_index * DENSITY * resolution,
tile_high = ( tile_index + 1 ) * DENSITY * resolution,
tile_length = DENSITY * resolution;
@@ -204,71 +245,64 @@
position: "absolute",
top: 0,
left: ( tile_low - this.view.low ) * w_scale,
- width: Math.ceil( tile_length * w_scale ),
- height: 100
});
parent_element.append( element );
- // Chunk is still loading, do noting
+ // Chunk is still loading, do nothing
if ( chunk.state == "loading" ) {
in_path = false;
return null;
}
var canvas = element;
- canvas.get(0).width = canvas.width();
- canvas.get(0).height = canvas.height();
- var data = chunk.values;
- if ( data ) {
- var ctx = canvas.get(0).getContext("2d");
- var in_path = false;
- ctx.beginPath();
- // console.log( "Drawing tile" );
- for ( var i = 0; i < data.length - 1; i++ ) {
- var x1 = data[i][0] - tile_low;
- var y1 = data[i][1];
- var x2 = data[i+1][0] - tile_low;
- var y2 = data[i+1][1];
- // Missing data causes us to stop drawing
- if ( isNaN( y1 ) || isNaN( y2 ) ) {
- in_path = false;
- } else {
- // Translate
- x1 = x1 * w_scale;
- x2 = x2 * w_scale;
- y1 = h_scale - y1 * ( h_scale );
- y2 = h_scale - y2 * ( h_scale );
- if ( in_path ) {
- ctx.lineTo( x1, y1, x2, y2 );
- } else {
- ctx.moveTo( x1, y1, x2, y2 );
- in_path = true;
- }
- }
- }
- ctx.stroke();
- }
- return element;
+ canvas.get(0).width = Math.ceil( tile_length * w_scale );
+ canvas.get(0).height = this.height_px;
+ var ctx = canvas.get(0).getContext("2d");
+ var in_path = false;
+ ctx.beginPath();
+ var data = chunk.values;
+ if (!data) return;
+ for ( var i = 0; i < data.length - 1; i++ ) {
+ var x = data[i][0] - tile_low;
+ var y = data[i][1];
+ // Missing data causes us to stop drawing
+ if ( isNaN( y ) ) {
+ in_path = false;
+ } else {
+ // Translate
+ x = x * w_scale;
+ y_above_min = y - this.min_value;
+ y = y_above_min / this.vertical_range * this.height_px;
+ if ( in_path ) {
+ ctx.lineTo( x, y );
+ } else {
+ ctx.moveTo( x, y );
+ in_path = true;
+ }
+ }
+ }
+ ctx.stroke();
+ return element;
}
});
-var LabelTrack = function ( view, parent_element ) {
- Track.call( this, null, view, parent_element );
+var LabelTrack = function ( parent_element ) {
+ Track.call( this, null, parent_element );
this.container_div.addClass( "label-track" );
};
$.extend( LabelTrack.prototype, Track.prototype, {
draw: function() {
var view = this.view,
- range = view.high - view.low,
- tickDistance = Math.floor( Math.pow( 10, Math.floor( Math.log( range ) / Math.log( 10 ) ) ) ),
- position = Math.floor( view.low / tickDistance ) * tickDistance,
- width = this.content_div.width(),
- new_div = $("<div style='position: relative; height: 1.3em;'></div>");
+ range = view.high - view.low,
+ tickDistance = Math.floor( Math.pow( 10, Math.floor( Math.log( range ) / Math.log( 10 ) ) ) ),
+ position = Math.floor( view.low / tickDistance ) * tickDistance,
+ width = this.content_div.width(),
+ new_div = $("<div style='position: relative; height: 1.3em;'></div>");
while ( position < view.high ) {
var screenPosition = ( position - view.low ) / range * width;
new_div.append( $("<div class='label'>" + position + "</div>").css( {
position: "absolute",
// Reduce by one to account for border
left: screenPosition - 1
- }) );
+ }));
position += tickDistance;
}
this.content_div.children( ":first" ).remove();
@@ -281,96 +315,137 @@
thinHeight = 7,
thinOffset = 3;
-var FeatureTrack = function ( name, view, parent_element,dataset_id ) {
- Track.call( this, name, view, parent_element );
+var FeatureTrack = function ( name, dataset_id ) {
+ Track.call( this, name, $("#viewport") );
+ this.track_type = "feature";
this.container_div.addClass( "feature-track" );
this.dataset_id = dataset_id;
- this.cache = new DataCache( "", this, view );
+ this.zo_slots = new Object();
+ this.show_labels_scale = 0.01;
+ this.showing_labels = false;
};
$.extend( FeatureTrack.prototype, TiledTrack.prototype, {
- get_data_async: function() {
+
+ calc_slots: function( include_labels ) {
+ // console.log("num vals: " + this.values.length);
+ end_ary = new Array();
+ var scale = this.container_div.width() / (this.view.high - this.view.low);
+ // console.log(scale);
+ if (include_labels) this.zi_slots = new Object();
+ var dummy_canvas = $("<canvas></canvas>").get(0).getContext("2d");
+ for (var i in this.values) {
+
+ feature = this.values[i];
+ f_start = Math.floor( Math.max(this.view.max_low, (feature.start - this.view.max_low) * scale) );
+ if (include_labels) {
+ f_start -= dummy_canvas.measureText(feature.name).width;
+ }
+
+ f_end = Math.ceil( Math.min(this.view.max_high, (feature.end - this.view.max_low) * scale) );
+ // if (include_labels) { console.log(f_start, f_end); }
+ j = 0;
+ while (true) {
+ if (end_ary[j] == undefined || end_ary[j] < f_start) {
+ end_ary[j] = f_end;
+ if (include_labels) {
+ this.zi_slots[feature.name] = j;
+ } else {
+ this.zo_slots[feature.name] = j;
+ }
+ break;
+ }
+ j++;
+ }
+ }
+ },
+
+ init: function() {
var track = this;
- $.getJSON( "data", { chr: this.view.chr, dataset_id: this.dataset_id }, function ( data ) {
+ $.getJSON( "getfeature", { 'start': this.view.max_low, 'end': this.view.max_high, 'dataset_id': this.dataset_id, 'chrom': this.view.chrom }, function ( data ) {
track.values = data;
+ track.calc_slots();
+ track.slots = track.zo_slots;
+ // console.log(track.zo_slots);
track.draw();
});
},
+
draw_tile: function( resolution, tile_index, parent_element, w_scale, h_scale ) {
+ if (!this.values) // Still loading
+ return null;
+
+ if (w_scale > this.show_labels_scale && !this.showing_labels) {
+ this.showing_labels = true;
+ if (!this.zi_slots) this.calc_slots(true); // Once we zoom in enough, show name labels
+ this.slots = this.zi_slots;
+ } else if (w_scale <= this.show_labels_scale && this.showing_labels) {
+ this.showing_labels = false;
+ this.slots = this.zo_slots;
+ }
+ // console.log(this.slots);
+
var tile_low = tile_index * DENSITY * resolution,
tile_high = ( tile_index + 1 ) * DENSITY * resolution,
tile_length = DENSITY * resolution;
-
+ // console.log(tile_low, tile_high, tile_length, w_scale);
var view = this.view,
range = view.high - view.low,
- width = this.content_div.width(),
- slots = [],
- new_div = $("<div class='tile' style='position: relative;'></div>");
-
- var chunk = this.cache.get( resolution, tile_index );
- if ( chunk.state == "loading" ) {
- parent_element.addClass("loading");
- return null;
- } else {
- parent_element.removeClass("loading");
- }
- var values = chunk.values;
-
- for ( var index in values ) {
- var value = values[index];
- var start = value[1], end = value[2], strand = value[5];
- // Determine slot based on entire feature and label
- var screenStart = ( start - tile_low ) * w_scale;
- var screenEnd = ( end - tile_low ) * w_scale;
- var screenWidth = screenEnd - screenStart;
- var screenStartWithLabel = screenStart;
- // Determine slot
- var slot = slots.length;
- for ( i in slots ) {
- if ( slots[i] < screenStartWithLabel ) {
- slot = i;
- break;
- }
- }
- slots[slot] = Math.ceil( screenEnd );
- var feature_div = $("<div class='feature'></div>").css( {
- position: 'absolute',
- left: screenStart,
- top: (slot*(itemHeight+itemPad)),
- height: itemHeight,
- width: Math.max( screenWidth, 1 )
- });
- new_div.append( feature_div );
- }
- new_div.css( {
+ width = Math.ceil( tile_length * w_scale ),
+ slots = new Array(),
+ height = 200,
+ new_canvas = $("<canvas class='tile'></canvas>");
+
+ new_canvas.css({
position: "absolute",
top: 0,
left: ( tile_low - this.view.low ) * w_scale,
- width: Math.ceil( tile_length * w_scale ),
- height: slots.length * ( itemHeight + itemPad ) + itemPad
+ "border-right": "1px solid #ddd"
});
- parent_element.append( new_div );
- return new_div;
- }
+ new_canvas.get(0).width = width;
+ new_canvas.get(0).height = height;
+ // console.log(( tile_low - this.view.low ) * w_scale, tile_index, w_scale);
+ var ctx = new_canvas.get(0).getContext("2d");
+
+ var j = 0;
+ for (var i in this.values) {
+ feature = this.values[i];
+ if (feature.start <= tile_high && feature.end >= tile_low) {
+ f_start = Math.floor( Math.max(0, (feature.start - tile_low) * w_scale) );
+ f_end = Math.ceil( Math.min(width, (feature.end - tile_low) * w_scale) );
+ // console.log(feature.start, feature.end, f_start, f_end, j);
+ ctx.fillStyle = "#000";
+ ctx.fillRect(f_start, this.slots[feature.name] * 10 + 5, f_end - f_start, 1);
+
+ if (this.showing_labels && ctx.fillText) {
+ ctx.font = "10px monospace";
+ ctx.textAlign = "right";
+ ctx.fillText(feature.name, f_start, this.slots[feature.name] * 10 + 8);
+ }
+
+ if (feature.exon_start && feature.exon_end) {
+ var exon_start = Math.floor( Math.max(0, (feature.exon_start - tile_low) * w_scale) );
+ var exon_end = Math.ceil( Math.min(width, (feature.exon_end - tile_low) * w_scale) );
+ // ctx.fillRect(exon_start, j * 10 + 3, exon_end - exon_start, 5);
+ // ctx.fillRect(exon_start, this.slots[feature.name] * 10 + 3, exon_end - exon_start, 3);
+ }
+
+ for (var i in feature.blocks) {
+ block = feature.blocks[i];
+ block_start = Math.floor( Math.max(0, (block[0] - tile_low) * w_scale) );
+ block_end = Math.ceil( Math.min(width, (block[1] - tile_low) * w_scale) );
+ var thickness = 3, y_start = 4;
+ if (exon_start && block_start >= exon_start && block_end <= exon_end) {
+ thickness = 5, y_start = 3;
+ }
+ ctx.fillRect(exon_start, this.slots[feature.name] * 10 + y_start, block_end - block_start, thickness);
+ // console.log(block_start, block_end);
+ }
+
+ j++;
+ }
+ }
+
+ parent_element.append( new_canvas );
+ return new_canvas;
+ },
});
-
-var TrackLayout = function ( view ) {
- this.view = view;
- this.tracks = [];
-};
-$.extend( TrackLayout.prototype, {
- add: function ( track ) {
- this.tracks.push( track );
- },
- redraw : function () {
- for ( var index in this.tracks ) {
- this.tracks[index].draw();
- }
- // Overview
- $("#overview-box").css( {
- left: ( this.view.low / this.view.length ) * $("#overview-viewport").width(),
- width: Math.max( 1, ( ( this.view.high - this.view.low ) / this.view.length ) * $("#overview-viewport").width() )
- }).show();
- $("#low").text( this.view.low );
- $("#high").text( this.view.high );
- }
-});
\ No newline at end of file
diff -r 9118054983c3 -r afa7946a126c static/trackster.css
--- a/static/trackster.css Tue Sep 22 14:47:47 2009 -0400
+++ b/static/trackster.css Tue Sep 22 21:51:11 2009 -0400
@@ -3,7 +3,7 @@
padding: 0;
font-family: verdana;
font-size: 75%;
- overflow-y: scroll;
+ overflow-y: hidden;
}
#content {
@@ -15,21 +15,18 @@
}
#nav {
- padding: 1em;
position: fixed;
bottom: 0;
width: 100%;
- background: rgb( 64, 64, 64 );
+ background: #333;
color: white;
font-weight: bold;
text-align: center;
}
-#nav > div
-{
- margin: 0 0;
+#nav-controls {
+ padding: 15px 0;
}
-
#nav-controls a {
color: white;
padding: 0.1em 0.4em;
@@ -42,26 +39,30 @@
#overview {
width: 100%;
- padding: 1em 0;
- background: rgb( 64, 64, 64 );
+ padding: 10px 0 0 0;
+ margin: 0px;
+ background: #333;
color: white;
font-weight: bold;
}
#overview-viewport {
- position: relative;
height: 10px;
- border-top: solid gray 1px;
- border-bottom: solid gray 1px;
+ border-top: solid #666 1px;
+ border-bottom: solid #666 1px;
+ background: #888;
}
#overview-box {
position: absolute;
height: 10px;
- background: white;
+ background: #ddd;
}
#viewport {
- min-height: 100%;
+ overflow: hidden;
+ background-color: #fff;
+/* overflow: scroll;*/
+/* border-bottom: 2px solid black;*/
}
#viewport-canvas {
@@ -70,14 +71,12 @@
}
.track {
- border-top: solid gray 1px;
+/* border-top: solid gray 1px;*/
border-bottom: solid gray 1px;
- margin: 5px 0;
}
.track-header {
text-align: center;
- padding: 0.1 0 0.3em 0;
}
.track-content {
@@ -92,12 +91,12 @@
}
.label-track .label {
- border-left: solid grey 1px;
+ border-left: solid gray 1px;
padding-left: 2px;
}
.feature-track .feature {
- background: brown;
+
}
.feature-track .feature .forward {
diff -r 9118054983c3 -r afa7946a126c templates/tracks/browser.mako
--- a/templates/tracks/browser.mako Tue Sep 22 14:47:47 2009 -0400
+++ b/templates/tracks/browser.mako Tue Sep 22 21:51:11 2009 -0400
@@ -7,36 +7,81 @@
<%def name="javascripts()">
${parent.javascripts()}
-<script type="text/javascript" src="/static/scripts/jquery.event.drag.js"></script>
-<script type="text/javascript" src="/static/scripts/trackster.js"></script>
+${h.js( "jquery", "jquery.event.drag", "jquery.mousewheel", "trackster" )}
+
<script type="text/javascript">
- ## HACK
- TRACKSTER_DATA_URL = "${h.url_for( action='data' )}";
-
- var view = new View( "${chrom}", ${LEN}, 0, ${max(LEN,1)} );
- var tracks = new TrackLayout( view );
- var dbkey = "${dbkey}";
+ var data_url = "${h.url_for( action='data' )}";
+ var view = new View( "${chrom}", ${LEN} );
$(function() {
- tracks.add( new LabelTrack( view, $("#viewport" ) ) );
- %for track in tracks:
- tracks.add( new ${track["type"]}( "${track["name"]}", view, $("#viewport" ), ${track["id"]} ) );
- %endfor
+ view.add_track( new LabelTrack( $("#overview" ) ) );
+ view.add_track( new LabelTrack( $("#nav-labeltrack" ) ) );
+
+ %for track in tracks:
+ view.add_track( new ${track["type"]}( "${track['name']}", ${track['dataset_id']} ) );
+ %endfor
$(document).bind( "redraw", function( e ) {
- tracks.redraw();
- });
-
- $(window).resize( function( e ) {
- tracks.redraw();
+ view.redraw();
});
+ $(document).bind("mousewheel", function(e, delta) {
+ if (delta > 0) {
+ view.zoom_in(2, e.pageX);
+ view.redraw();
+ } else {
+ view.zoom_out(2);
+ view.redraw();
+ }
+ });
+
+ $(document).bind("dblclick", function(e) {
+ view.zoom_in(2, e.pageX);
+ view.redraw();
+ });
+
+ $("#overview-box").bind("dragstart", function(e) {
+ this.current_x = e.offsetX;
+ }).bind("drag", function(e) {
+ var delta = e.offsetX - this.current_x;
+ this.current_x = e.offsetX;
+
+ var delta_chrom = Math.round(delta / $(document).width() * (view.max_high - view.max_low));
+ var view_range = view.high - view.low;
+
+ var new_low = view.low += delta_chrom;
+ var new_high = view.high += delta_chrom;
+ if (new_low < view.max_low) {
+ new_low = 0;
+ new_high = view_range;
+ } else if (new_high > view.max_high) {
+ new_high = view.max_high;
+ new_low = view.max_high - view_range;
+ }
+ view.low = new_low;
+ view.high = new_high;
+ view.redraw();
+ });
+
+ $(window).resize( function( e ) {
+ $("#viewport").height( $(window).height() - 120 );
+ view.redraw();
+ });
+
$("#viewport").bind( "dragstart", function ( e ) {
this.original_low = view.low;
+ this.current_height = e.clientY;
}).bind( "drag", function( e ) {
var move_amount = ( e.offsetX - this.offsetLeft ) / this.offsetWidth;
+ var new_scroll = $(this).scrollTop() - (e.clientY - this.current_height);
+
+ if ( new_scroll < $(this).get(0).scrollHeight - $(this).height() - 200) {
+ $(this).scrollTop(new_scroll);
+
+ }
+ this.current_height = e.clientY;
var range = view.high - view.low;
var move_bases = Math.round( range * move_amount );
var new_low = this.original_low - move_bases;
@@ -50,83 +95,58 @@
}
view.low = new_low;
view.high = new_high;
- tracks.redraw();
+ view.redraw();
});
- tracks.redraw();
- load_chroms();
+ (function () {
+ $.getJSON( "${h.url_for( action='chroms' )}", { dbkey: "${dbkey}" }, function ( data ) {
+ var chrom_options = '<option value=""></option>';
+ for (i in data) {
+ chrom = data[i]['chrom']
+ if( chrom == view.chrom ) {
+ chrom_options += '<option value="' + chrom + '" selected="true">' + chrom + '</option>';
+ } else {
+ chrom_options += '<option value="' + chrom + '">' + chrom + '</option>';
+ }
+ }
+ $("#chrom").html(chrom_options);
+ $("#chrom").bind( "change", function () {
+ $("#chr").submit();
+ });
+ });
+ })();
+ view.redraw();
+ $(window).trigger("resize");
});
-
- var load_chroms = function () {
- var fetcher = function (ref) {
- return function () {
- $.getJSON( "${h.url_for( action='chroms' )}", { dbkey: dbkey }, function ( data ) {
- // Hacky - check length of "object"
- var chrom_length = 0;
- for (key in data) chrom_length++;
- if( chrom_length == 0 ) {
- setTimeout( fetcher, 5000 );
- } else {
- var chrom_options = '';
- for (key in data) {
- if( key == view.chr ) {
- chrom_options += '<option value="' + key + '" selected="true">' + key + '</option>';
- } else {
- chrom_options += '<option value="' + key + '">' + key + '</option>';
- }
- }
- $("#chrom").html(chrom_options);
- $("#chrom").bind( "change", function ( e ) {
- $("#chr").submit();
- });
- if( view.chr == "" ) {
- $("#chrom option:first").attr("selected", true);
- $("#chrom").trigger( "change" );
- }
- }
- });
- };
- }(this);
- fetcher();
- };
</script>
</%def>
+<div id="content">
+ <div id="overview">
+ <div id="overview-viewport">
+ <div id="overview-box"></div>
+ </div>
+ </div>
+ <div id="viewport"></div>
+</div>
+<div id="nav">
+ <div id="nav-labeltrack"></div>
+ <div id="nav-controls">
+ <form name="chr" id="chr" method="get">
+ <input type="hidden" name="dataset_ids" value="${dataset_ids}" />
+ <a href="#" onclick="javascript:view.left(5);view.redraw();"><<</a>
+ <a href="#" onclick="javascript:view.left(2);view.redraw();"><</a>
+ <select id="chrom" name="chrom">
+ <option value="">Loading</option>
+ </select>
+ <span id="low">0</span>—<span id="high">${LEN}</span>
+ <span style="display: inline-block; width: 10em;">
+ <a href="#" onclick="javascript:view.zoom_in(2);view.redraw();">+</a>
+ <a href="#" onclick="javascript:view.zoom_out(2);view.redraw();">-</a>
+ </span>
-<div id="content">
-
- <div id="overview">
- <div id="overview-viewport">
- <div id="overview-box"></div>
- </div>
+ <a href="#" onclick="javascript:view.right(2);view.redraw();">></a>
+ <a href="#" onclick="javascript:view.right(5);view.redraw();">>></a>
+ </form>
</div>
-
-
- <div id="viewport">
- </div>
-
</div>
- <div id="nav">
-
- <div id="nav-controls">
- <form name="chr" id="chr" method="GET">
- <input type="hidden" name="dataset_ids" value="${dataset_ids}" />
- <a href="#" onclick="javascript:view.left(5);tracks.redraw();"><<</a>
- <a href="#" onclick="javascript:view.left(2);tracks.redraw();"><</a>
- <span style="display: inline-block; width: 30em; text-align: center;">Viewing
- <select id="chrom" name="chrom">
- <option value="">loading</option>
- </select>
- <span id="low">0</span>-<span id="high">180857866</span></span>
- <span style="display: inline-block; width: 10em;">
- <a href="#" onclick="javascript:view.zoom_in(2);tracks.redraw();">+</a>
- <a href="#" onclick="javascript:view.zoom_out(2);tracks.redraw();">-</a>
- </span>
-
- <a href="#" onclick="javascript:view.right(2);tracks.redraw();">></a>
- <a href="#" onclick="javascript:view.right(5);tracks.redraw();">>></a>
- </form>
- </div>
-
- </div>
-
diff -r 9118054983c3 -r afa7946a126c templates/tracks/new_browser.mako
--- a/templates/tracks/new_browser.mako Tue Sep 22 14:47:47 2009 -0400
+++ b/templates/tracks/new_browser.mako Tue Sep 22 21:51:11 2009 -0400
@@ -12,39 +12,38 @@
</%def>
<div class="form">
- <div class="form-title">Select datasets to include in browser</div>
- <div id="dbkey" class="form-body">
- <form id="form" method="POST">
- <div class="form-row">
- <label for="dbkey">Reference genome build (dbkey): </label>
- <div class="form-row-input">
- <select name="dbkey" id="dbkey" refresh_on_change="true">
- %for tmp_dbkey in dbkey_set:
- <option value="${tmp_dbkey}"
- %if tmp_dbkey == dbkey:
- selected="true"
- %endif
- >${tmp_dbkey}</option>
- %endfor
- </select>
- </div>
- <div style="clear: both;"></div>
- </div>
- <div class="form-row">
- <label for="dataset_ids">Datasets to include: </label>
- %for key,value in datasets.items():
- <div>
- <input type="checkbox" name="dataset_ids" value="${key}" />
- ${value}
- </div>
- %endfor
-
- <div style="clear: both;"></div>
- </div>
- </div>
- <div class="form-row">
- <input type="submit" name="browse" value="Browse"/>
- </div>
+ <div class="form-title">Select datasets to include in browser</div>
+ <div id="dbkey" class="form-body">
+ <form id="form" method="POST">
+ <div class="form-row">
+ <label for="dbkey">Reference genome build (dbkey): </label>
+ <div class="form-row-input">
+ <select name="dbkey" id="dbkey" refresh_on_change="true">
+ %for tmp_dbkey in dbkey_set:
+ <option value="${tmp_dbkey}"
+ %if tmp_dbkey == dbkey:
+ selected="true"
+ %endif
+ >${tmp_dbkey}</option>
+ %endfor
+ </select>
+ </div>
+ <div style="clear: both;"></div>
+ </div>
+ <div class="form-row">
+ <label for="dataset_ids">Datasets to include: </label>
+ %for key,value in datasets.items():
+ <div>
+ <input type="checkbox" name="dataset_ids" value="${key}" />
+ ${value}
+ </div>
+ %endfor
+
+ <div style="clear: both;"></div>
+ </div>
+ </div>
+ <div class="form-row">
+ <input type="submit" name="browse" value="Browse"/>
+ </div>
</form>
- </div>
</div>
1
0
25 Sep '09
details: http://www.bx.psu.edu/hg/galaxy/rev/d42c5698798b
changeset: 2750:d42c5698798b
user: Greg Von Kuster <greg(a)bx.psu.edu>
date: Tue Sep 22 14:04:48 2009 -0400
description:
Eliminate the use of the genetrack controller, merge the template code for uploading library datasets, and several bug fixes:
- The genetrack controller is no longer used ( I'll delete it soon ), so the GeneTrack application is now loosely coupled
- Merge the 2 new_dataset.mako templates into one common code module name library_dataset_common.mako
- Rename all of the library upload form fields to have the same names as the history upload form fields
- Eliminate a 2nd runtool_btn from being rendered on the same form in tool_form.mako
- Fix bug and add functional tests to cover uploading a library dataset that does not include a template
16 file(s) affected in this change:
lib/galaxy/config.py
lib/galaxy/datatypes/tracks.py
lib/galaxy/util/__init__.py
lib/galaxy/web/controllers/library.py
lib/galaxy/web/controllers/library_admin.py
lib/galaxy/web/controllers/library_dataset.py
templates/admin/library/new_dataset.mako
templates/admin/library/upload.mako
templates/library/library_dataset_common.mako
templates/library/new_dataset.mako
templates/library/upload.mako
templates/tool_form.mako
test/base/twilltestcase.py
test/functional/test_security_and_libraries.py
tool-data/shared/genetrack/genetrack_sites.txt
universe_wsgi.ini.sample
diffs (1749 lines):
diff -r 822cae6071c1 -r d42c5698798b lib/galaxy/config.py
--- a/lib/galaxy/config.py Tue Sep 22 11:40:41 2009 -0400
+++ b/lib/galaxy/config.py Tue Sep 22 14:04:48 2009 -0400
@@ -74,7 +74,8 @@
self.log_memory_usage = string_as_bool( kwargs.get( 'log_memory_usage', 'False' ) )
self.log_events = string_as_bool( kwargs.get( 'log_events', 'False' ) )
self.ucsc_display_sites = kwargs.get( 'ucsc_display_sites', "main,test,archaea" ).lower().split(",")
- self.gbrowse_display_sites = kwargs.get( 'gbrowse_display_sites', "wormbase,flybase,elegans" ).lower().split(",")
+ self.gbrowse_display_sites = kwargs.get( 'gbrowse_display_sites', "main,test" ).lower().split(",")
+ self.genetrack_display_sites = kwargs.get( 'genetrack_display_sites', "main,test" ).lower().split(",")
self.brand = kwargs.get( 'brand', None )
self.wiki_url = kwargs.get( 'wiki_url', 'http://g2.trac.bx.psu.edu/' )
self.bugs_email = kwargs.get( 'bugs_email', None )
diff -r 822cae6071c1 -r d42c5698798b lib/galaxy/datatypes/tracks.py
--- a/lib/galaxy/datatypes/tracks.py Tue Sep 22 11:40:41 2009 -0400
+++ b/lib/galaxy/datatypes/tracks.py Tue Sep 22 14:04:48 2009 -0400
@@ -5,6 +5,7 @@
import data
import logging
import re
+import binascii
from cgi import escape
from galaxy.datatypes.metadata import MetadataElement
from galaxy.datatypes import metadata
@@ -12,6 +13,7 @@
from galaxy import util
from galaxy.web import url_for
from sniff import *
+from galaxy.util.hash_util import *
log = logging.getLogger(__name__)
@@ -23,8 +25,19 @@
MetadataElement( name="label", default="Custom", desc="Track Label", readonly=True, visible=True, no_value="Custom" )
def __init__(self, **kwargs):
- super(GeneTrack, self).__init__(**kwargs)
- self.add_display_app( 'genetrack', 'View in ', '', 'genetrack_link' )
-
- def genetrack_link( self, dataset, type, app, base_url ):
- return [('GeneTrack', url_for(controller='genetrack', action='index', dataset_id=dataset.id ))]
\ No newline at end of file
+ super( GeneTrack, self ).__init__( **kwargs )
+ self.add_display_app( 'genetrack', 'View in GeneTrack', '', 'genetrack_link' )
+ def genetrack_link( self, hda, type, app, base_url ):
+ ret_val = []
+ if hda.has_data:
+ # Get the disk file name
+ file_name = hda.dataset.get_file_name()
+ # Make it secure
+ a = hmac_new( app.config.tool_secret, file_name )
+ b = binascii.hexlify( file_name )
+ encoded_file_name = "%s:%s" % ( a, b )
+ for site_name, site_url in util.get_genetrack_sites():
+ if site_name in app.config.genetrack_display_sites:
+ link = "%s?filename=%s" % ( site_url, encoded_file_name )
+ ret_val.append( ( site_name, link ) )
+ return ret_val
diff -r 822cae6071c1 -r d42c5698798b lib/galaxy/util/__init__.py
--- a/lib/galaxy/util/__init__.py Tue Sep 22 11:40:41 2009 -0400
+++ b/lib/galaxy/util/__init__.py Tue Sep 22 14:04:48 2009 -0400
@@ -334,12 +334,16 @@
if build in site['builds']:
sites.append((site['name'],site['url']))
return sites
-
def get_gbrowse_sites_by_build(build):
sites = []
for site in gbrowse_build_sites:
if build in site['builds']:
sites.append((site['name'],site['url']))
+ return sites
+def get_genetrack_sites():
+ sites = []
+ for site in genetrack_sites:
+ sites.append( ( site['name'], site['url'] ) )
return sites
def read_dbnames(filename):
@@ -392,7 +396,7 @@
db_names = DBNames( [( db_names.default_value, db_names.default_name )] )
return db_names
-def read_build_sites(filename):
+def read_build_sites( filename, check_builds=True ):
""" read db names to ucsc mappings from file, this file should probably be merged with the one above """
build_sites = []
try:
@@ -402,8 +406,11 @@
fields = line.replace("\r","").replace("\n","").split("\t")
site_name = fields[0]
site = fields[1]
- site_builds = fields[2].split(",")
- site_dict = {'name':site_name, 'url':site, 'builds':site_builds}
+ if check_builds:
+ site_builds = fields[2].split(",")
+ site_dict = {'name':site_name, 'url':site, 'builds':site_builds}
+ else:
+ site_dict = {'name':site_name, 'url':site}
build_sites.append( site_dict )
except: continue
except:
@@ -475,9 +482,11 @@
raise IOError, (errno.EEXIST, "No usable temporary file name found")
galaxy_root_path = os.path.join(__path__[0], "..","..","..")
-dbnames = read_dbnames( os.path.join( galaxy_root_path, "tool-data", "shared", "ucsc", "builds.txt" ) ) #this list is used in edit attributes and the upload tool
-ucsc_build_sites = read_build_sites( os.path.join( galaxy_root_path, "tool-data", "shared", "ucsc", "ucsc_build_sites.txt" ) ) #this list is used in history.tmpl
-gbrowse_build_sites = read_build_sites( os.path.join( galaxy_root_path, "tool-data", "shared", "gbrowse", "gbrowse_build_sites.txt" ) ) #this list is used in history.tmpl
+# The dbnames list is used in edit attributes and the upload tool
+dbnames = read_dbnames( os.path.join( galaxy_root_path, "tool-data", "shared", "ucsc", "builds.txt" ) )
+ucsc_build_sites = read_build_sites( os.path.join( galaxy_root_path, "tool-data", "shared", "ucsc", "ucsc_build_sites.txt" ) )
+gbrowse_build_sites = read_build_sites( os.path.join( galaxy_root_path, "tool-data", "shared", "gbrowse", "gbrowse_build_sites.txt" ) )
+genetrack_sites = read_build_sites( os.path.join( galaxy_root_path, "tool-data", "shared", "genetrack", "genetrack_sites.txt" ), check_builds=False )
if __name__ == '__main__':
import doctest, sys
diff -r 822cae6071c1 -r d42c5698798b lib/galaxy/web/controllers/library.py
--- a/lib/galaxy/web/controllers/library.py Tue Sep 22 11:40:41 2009 -0400
+++ b/lib/galaxy/web/controllers/library.py Tue Sep 22 14:04:48 2009 -0400
@@ -434,7 +434,7 @@
if folder and last_used_build in [ 'None', None, '?' ]:
last_used_build = folder.genome_build
replace_id = params.get( 'replace_id', None )
- if replace_id:
+ if replace_id not in [ None, 'None' ]:
replace_dataset = trans.app.model.LibraryDataset.get( params.get( 'replace_id', None ) )
if not last_used_build:
last_used_build = replace_dataset.library_dataset_dataset_association.dbkey
@@ -716,14 +716,14 @@
messagetype=messagetype )
if trans.app.security_agent.can_add_library_item( user, roles, folder ) or \
( replace_dataset and trans.app.security_agent.can_modify_library_item( user, roles, replace_dataset ) ):
- if params.get( 'new_dataset_button', False ):
+ if params.get( 'runtool_btn', False ):
# See if we have any inherited templates, but do not inherit contents.
info_association, inherited = folder.get_info_association( inherited=True )
if info_association:
template_id = str( info_association.template.id )
widgets = folder.get_template_widgets( trans, get_contents=False )
else:
- template_id = None
+ template_id = 'None'
widgets = []
upload_option = params.get( 'upload_option', 'upload_file' )
created_ldda_ids = trans.webapp.controllers[ 'library_dataset' ].upload_dataset( trans,
@@ -789,11 +789,11 @@
# Send the current history to the form to enable importing datasets from history to library
history = trans.get_history()
history.refresh()
- return trans.fill_template( '/library/new_dataset.mako',
+ return trans.fill_template( '/library/upload.mako',
upload_option=upload_option,
library_id=library_id,
folder_id=folder_id,
- replace_id=replace_id,
+ replace_dataset=replace_dataset,
file_formats=file_formats,
dbkeys=dbkeys,
last_used_build=last_used_build,
@@ -801,8 +801,7 @@
history=history,
widgets=widgets,
msg=msg,
- messagetype=messagetype,
- replace_dataset=replace_dataset )
+ messagetype=messagetype )
@web.expose
def add_history_datasets_to_library( self, trans, library_id, folder_id, hda_ids='', **kwd ):
params = util.Params( kwd )
@@ -902,16 +901,17 @@
dbkeys = get_dbkey_options( last_used_build )
# Send list of roles to the form so the dataset can be associated with 1 or more of them.
roles = trans.app.model.Role.filter( trans.app.model.Role.table.c.deleted==False ).order_by( trans.app.model.Role.c.name ).all()
- return trans.fill_template( "/library/new_dataset.mako",
+ return trans.fill_template( "/library/upload.mako",
upload_option=upload_option,
library_id=library_id,
folder_id=folder_id,
- replace_id=replace_id,
+ replace_dataset=replace_dataset,
file_formats=file_formats,
dbkeys=dbkeys,
last_used_build=last_used_build,
roles=roles,
history=history,
+ widgets=[],
msg=msg,
messagetype=messagetype )
@web.expose
diff -r 822cae6071c1 -r d42c5698798b lib/galaxy/web/controllers/library_admin.py
--- a/lib/galaxy/web/controllers/library_admin.py Tue Sep 22 11:40:41 2009 -0400
+++ b/lib/galaxy/web/controllers/library_admin.py Tue Sep 22 14:04:48 2009 -0400
@@ -418,7 +418,7 @@
if folder and last_used_build in [ 'None', None, '?' ]:
last_used_build = folder.genome_build
replace_id = params.get( 'replace_id', None )
- if replace_id:
+ if replace_id not in [ None, 'None' ]:
replace_dataset = trans.app.model.LibraryDataset.get( int( replace_id ) )
if not last_used_build:
last_used_build = replace_dataset.library_dataset_dataset_association.dbkey
@@ -428,14 +428,14 @@
# The built-in 'id' is overwritten in lots of places as well
ldatatypes = [ dtype_name for dtype_name, dtype_value in trans.app.datatypes_registry.datatypes_by_extension.iteritems() if dtype_value.allow_datatype_change ]
ldatatypes.sort()
- if params.get( 'new_dataset_button', False ):
+ if params.get( 'runtool_btn', False ):
# See if we have any inherited templates, but do not inherit contents.
info_association, inherited = folder.get_info_association( inherited=True )
if info_association:
template_id = str( info_association.template.id )
widgets = folder.get_template_widgets( trans, get_contents=False )
else:
- template_id = None
+ template_id = 'None'
widgets = []
upload_option = params.get( 'upload_option', 'upload_file' )
created_ldda_ids = trans.webapp.controllers[ 'library_dataset' ].upload_dataset( trans,
@@ -484,11 +484,11 @@
# Send the current history to the form to enable importing datasets from history to library
history = trans.get_history()
history.refresh()
- return trans.fill_template( '/admin/library/new_dataset.mako',
+ return trans.fill_template( '/admin/library/upload.mako',
upload_option=upload_option,
library_id=library_id,
folder_id=folder_id,
- replace_id=replace_id,
+ replace_dataset=replace_dataset,
file_formats=file_formats,
dbkeys=dbkeys,
last_used_build=last_used_build,
@@ -496,8 +496,7 @@
history=history,
widgets=widgets,
msg=msg,
- messagetype=messagetype,
- replace_dataset=replace_dataset )
+ messagetype=messagetype )
else:
if params.get( 'permissions', False ):
action = 'permissions'
@@ -886,17 +885,17 @@
dbkeys = get_dbkey_options( last_used_build )
# Send list of roles to the form so the dataset can be associated with 1 or more of them.
roles = trans.app.model.Role.filter( trans.app.model.Role.table.c.deleted==False ).order_by( trans.app.model.Role.c.name ).all()
- return trans.fill_template( "/admin/library/new_dataset.mako",
+ return trans.fill_template( "/admin/library/upload.mako",
upload_option=upload_option,
library_id=library_id,
folder_id=folder_id,
- replace_id=replace_id,
+ replace_dataset=replace_dataset,
file_formats=file_formats,
dbkeys=dbkeys,
last_used_build=last_used_build,
roles=roles,
history=history,
- widgets=widgets,
+ widgets=[],
msg=msg,
messagetype=messagetype )
@web.expose
diff -r 822cae6071c1 -r d42c5698798b lib/galaxy/web/controllers/library_dataset.py
--- a/lib/galaxy/web/controllers/library_dataset.py Tue Sep 22 11:40:41 2009 -0400
+++ b/lib/galaxy/web/controllers/library_dataset.py Tue Sep 22 14:04:48 2009 -0400
@@ -12,7 +12,7 @@
os.unlink( filename )
except:
log.exception( 'failure removing temporary file: %s' % filename )
- def add_file( self, trans, folder, file_obj, name, file_format, dbkey, roles,
+ def add_file( self, trans, folder, file_obj, name, file_type, dbkey, roles,
info='no info', space_to_tab=False, replace_dataset=None,
template=None, template_field_contents=[], message=None ):
data_type = None
@@ -58,15 +58,15 @@
raise BadFileException( "you attempted to upload an inappropriate file." )
elif is_zipped and is_valid:
# Currently, we force specific tools to handle this case. We also require the user
- # to manually set the incoming file_format
- if ( test_ext == 'ab1' or test_ext == 'scf' ) and file_format != 'binseq.zip':
+ # to manually set the incoming file_type
+ if ( test_ext == 'ab1' or test_ext == 'scf' ) and file_type != 'binseq.zip':
raise BadFileException( "Invalid 'File Format' for archive consisting of binary files - use 'Binseq.zip'." )
- elif test_ext == 'txt' and file_format != 'txtseq.zip':
+ elif test_ext == 'txt' and file_type != 'txtseq.zip':
raise BadFileException( "Invalid 'File Format' for archive consisting of text files - use 'Txtseq.zip'." )
- if not ( file_format == 'binseq.zip' or file_format == 'txtseq.zip' ):
+ if not ( file_type == 'binseq.zip' or file_type == 'txtseq.zip' ):
raise BadFileException( "you must manually set the 'File Format' to either 'Binseq.zip' or 'Txtseq.zip' when uploading zip files." )
data_type = 'zip'
- ext = file_format
+ ext = file_type
if not data_type:
if self.check_binary( temp_name ):
try:
@@ -78,13 +78,13 @@
except:
is_pdf = False #file failed to open or contents are smaller than pdf header
if is_pdf:
- file_format = 'pdf' #allow the upload of PDFs to library via the admin interface.
+ file_type = 'pdf' #allow the upload of PDFs to library via the admin interface.
else:
if not( ext == 'ab1' or ext == 'scf' ):
raise BadFileException( "you attempted to upload an inappropriate file." )
- if ext == 'ab1' and file_format != 'ab1':
+ if ext == 'ab1' and file_type != 'ab1':
raise BadFileException( "you must manually set the 'File Format' to 'Ab1' when uploading ab1 files." )
- elif ext == 'scf' and file_format != 'scf':
+ elif ext == 'scf' and file_type != 'scf':
raise BadFileException( "you must manually set the 'File Format' to 'Scf' when uploading scf files." )
data_type = 'binary'
if not data_type:
@@ -101,17 +101,17 @@
line_count = sniff.convert_newlines( temp_name )
else:
line_count = None
- if file_format == 'auto':
+ if file_type == 'auto':
ext = sniff.guess_ext( temp_name, sniff_order=trans.app.datatypes_registry.sniff_order )
else:
- ext = file_format
+ ext = file_type
data_type = ext
if info is None:
info = 'uploaded %s file' % data_type
- if file_format == 'auto':
+ if file_type == 'auto':
data_type = sniff.guess_ext( temp_name, sniff_order=trans.app.datatypes_registry.sniff_order )
else:
- data_type = file_format
+ data_type = file_type
if replace_dataset:
# The replace_dataset param ( when not None ) refers to a LibraryDataset that is being replaced with a new version.
library_dataset = replace_dataset
@@ -190,11 +190,11 @@
msg = util.restore_text( params.get( 'msg', '' ) )
messagetype = params.get( 'messagetype', 'done' )
dbkey = params.get( 'dbkey', '?' )
- file_format = params.get( 'file_format', 'auto' )
- data_file = params.get( 'file_data', '' )
- url_paste = params.get( 'url_paste', '' )
+ file_type = params.get( 'file_type', 'auto' )
+ data_file = params.get( 'files_0|file_data', '' )
+ url_paste = params.get( 'files_0|url_paste', '' )
server_dir = util.restore_text( params.get( 'server_dir', '' ) )
- if replace_dataset is not None:
+ if replace_dataset not in [ None, 'None' ]:
replace_id = replace_dataset.id
else:
replace_id = None
@@ -208,7 +208,7 @@
# We are inheriting the folder's info_association, so we did not
# receive any inherited contents, but we may have redirected here
# after the user entered template contents ( due to errors ).
- if template_id:
+ if template_id not in [ None, 'None' ]:
template = trans.app.model.FormDefinition.get( template_id )
for field_index in range( len( template.fields ) ):
field_name = 'field_%i' % field_index
@@ -243,7 +243,7 @@
upload_option=upload_option,
msg=util.sanitize_text( msg ),
messagetype='error' ) )
- space_to_tab = params.get( 'space_to_tab', False )
+ space_to_tab = params.get( 'files_0|space_to_tab', False )
if space_to_tab and space_to_tab not in [ "None", None ]:
space_to_tab = True
roles = []
@@ -260,7 +260,7 @@
folder,
data_file.file,
file_name,
- file_format,
+ file_type,
dbkey,
roles,
info="uploaded file",
@@ -288,7 +288,7 @@
folder,
urllib.urlopen( line ),
line,
- file_format,
+ file_type,
dbkey,
roles,
info="uploaded url",
@@ -314,7 +314,7 @@
folder,
StringIO.StringIO( url_paste ),
'Pasted Entry',
- file_format,
+ file_type,
dbkey,
roles,
info="pasted entry",
@@ -365,7 +365,7 @@
folder,
open( full_file, 'rb' ),
file,
- file_format,
+ file_type,
dbkey,
roles,
info="imported file",
@@ -402,7 +402,7 @@
zip_file = zipfile.ZipFile( temp_name, "r" )
# Make sure the archive consists of valid files. The current rules are:
# 1. Archives can only include .ab1, .scf or .txt files
- # 2. All file file_formats within an archive must be the same
+ # 2. All file file_types within an archive must be the same
name = zip_file.namelist()[0]
test_ext = name.split( "." )[1].strip().lower()
if not ( test_ext == 'scf' or test_ext == 'ab1' or test_ext == 'txt' ):
diff -r 822cae6071c1 -r d42c5698798b templates/admin/library/new_dataset.mako
--- a/templates/admin/library/new_dataset.mako Tue Sep 22 11:40:41 2009 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,213 +0,0 @@
-<%inherit file="/base.mako"/>
-<%namespace file="/message.mako" import="render_msg" />
-<%namespace file="/admin/library/common.mako" import="render_template_info" />
-
-<% import os, os.path %>
-
-<b>Create new data library datasets</b>
-<a id="upload-librarydataset--popup" class="popup-arrow" style="display: none;">▼</a>
-<div popupmenu="upload-librarydataset--popup">
- <a class="action-button" href="${h.url_for( controller='library_admin', action='library_dataset_dataset_association', library_id=library_id, folder_id=folder_id, replace_id=replace_id, upload_option='upload_file' )}">Upload files</a>
- %if trans.app.config.library_import_dir and os.path.exists( trans.app.config.library_import_dir ):
- <a class="action-button" href="${h.url_for( controller='library_admin', action='library_dataset_dataset_association', library_id=library_id, folder_id=folder_id, replace_id=replace_id, upload_option='upload_directory' )}">Upload directory of files</a>
- %endif
- <a class="action-button" href="${h.url_for( controller='library_admin', action='library_dataset_dataset_association', library_id=library_id, folder_id=folder_id, replace_id=replace_id, upload_option='import_from_history' )}">Import datasets from your current history</a>
-</div>
-<br/><br/>
-<ul class="manage-table-actions">
- <li>
- <a class="action-button" href="${h.url_for( controller='library_admin', action='browse_library', id=library_id )}"><span>Browse this data library</span></a>
- </li>
-</ul>
-
-%if msg:
- ${render_msg( msg, messagetype )}
-%endif
-
-%if upload_option in [ 'upload_file', 'upload_directory' ]:
- <div class="toolForm" id="new_dataset">
- %if upload_option == 'upload_file':
- <div class="toolFormTitle">Upload files</div>
- %else:
- <div class="toolFormTitle">Upload a directory of files</div>
- %endif
- <div class="toolFormBody">
- <form name="tool_form" action="${h.url_for( controller='library_admin', action='library_dataset_dataset_association', library_id=library_id )}" enctype="multipart/form-data" method="post">
- <input type="hidden" name="folder_id" value="${folder_id}"/>
- <input type="hidden" name="upload_option" value="${upload_option}"/>
- %if replace_dataset:
- <input type="hidden" name="replace_id" value="${replace_dataset.id}"/>
- <div class="form-row">
- You are currently selecting a new file to replace '<a href="${h.url_for( controller='library_admin', action='library_dataset_dataset_association', library_id=library_id, folder_id=folder_id, id=replace_dataset.library_dataset_dataset_association.id )}">${replace_dataset.name}</a>'.
- <div style="clear: both"></div>
- </div>
- %endif
- %if upload_option == 'upload_file':
- <div class="form-row">
- <label>File:</label>
- <div style="float: left; width: 250px; margin-right: 10px;">
- <input type="file" name="file_data"/>
- </div>
- <div style="clear: both"></div>
- </div>
- <div class="form-row">
- <label>URL/Text:</label>
- <div style="float: left; width: 250px; margin-right: 10px;">
- <textarea name="url_paste" rows="5" cols="35"></textarea>
- </div>
- <div class="toolParamHelp" style="clear: both;">
- Specify a list of URLs (one per line) or paste the contents of a file.
- </div>
- <div style="clear: both"></div>
- </div>
- %elif upload_option == 'upload_directory':
- <div class="form-row">
- <%
- # See if we have any contained sub-directories, if not the only option
- # in the server_dir select list will be library_import_dir
- contains_directories = False
- for entry in os.listdir( trans.app.config.library_import_dir ):
- if os.path.isdir( os.path.join( trans.app.config.library_import_dir, entry ) ):
- contains_directories = True
- break
- %>
- <label>Server Directory</label>
- <div style="float: left; width: 250px; margin-right: 10px;">
- <select name="server_dir">
- %if contains_directories:
- <option>None</option>
- %for entry in os.listdir( trans.app.config.library_import_dir ):
- ## Do not include entries that are not directories
- %if os.path.isdir( os.path.join( trans.app.config.library_import_dir, entry ) ):
- <option>${entry}</option>
- %endif
- %endfor
- %else:
- <option>${trans.app.config.library_import_dir}</option>
- %endif
- </select>
- </div>
- <div class="toolParamHelp" style="clear: both;">
- %if contains_directories:
- Upload all files in a sub-directory of <strong>${trans.app.config.library_import_dir}</strong> on the Galaxy server.
- %else:
- Upload all files in <strong>${trans.app.config.library_import_dir}</strong> on the Galaxy server.
- %endif
- </div>
- <div style="clear: both"></div>
- </div>
- %endif
- <div class="form-row">
- <label>Convert spaces to tabs:</label>
- <div style="float: left; width: 250px; margin-right: 10px;">
- <div>
- <input type="checkbox" name="space_to_tab" value="Yes"/>Yes
- </div>
- </div>
- <div class="toolParamHelp" style="clear: both;">
- Use this option if you are manually entering intervals.
- </div>
- <div style="clear: both"></div>
- </div>
- <div class="form-row">
- <label>File Format:</label>
- <div style="float: left; width: 250px; margin-right: 10px;">
- <select name="file_format">
- <option value="auto" selected>Auto-detect</option>
- %for file_format in file_formats:
- <option value="${file_format}">${file_format}</option>
- %endfor
- </select>
- </div>
- <div style="clear: both"></div>
- </div>
- <div class="form-row">
- <label>Genome:</label>
- <div style="float: left; width: 250px; margin-right: 10px;">
- <select name="dbkey">
- %for dbkey in dbkeys:
- %if dbkey[1] == last_used_build:
- <option value="${dbkey[1]}" selected>${dbkey[0]}</option>
- %else:
- <option value="${dbkey[1]}">${dbkey[0]}</option>
- %endif
- %endfor
- </select>
- </div>
- <div style="clear: both"></div>
- </div>
- <div class="form-row">
- <label>Message:</label>
- <div style="float: left; width: 250px; margin-right: 10px;">
- <textarea name="message" rows="3" cols="35"></textarea>
- </div>
- <div class="toolParamHelp" style="clear: both;">
- This information will be displayed in the "Information" column for this dataset in the data library browser
- </div>
- <div style="clear: both"></div>
- </div>
- <div class="form-row">
- <div style="float: left; width: 250px; margin-right: 10px;">
- <label>Restrict dataset access to specific roles:</label>
- <select name="roles" multiple="true" size="5">
- %for role in roles:
- <option value="${role.id}">${role.name}</option>
- %endfor
- </select>
- </div>
- <div class="toolParamHelp" style="clear: both;">
- Multi-select list - hold the appropriate key while clicking to select multiple roles. More restrictions can be applied after the upload is complete. Selecting no roles makes a dataset public.
- </div>
- </div>
- <div style="clear: both"></div>
- %if widgets:
- <p/>
- %for i, field in enumerate( widgets ):
- <div class="form-row">
- <label>${field[ 'label' ]}</label>
- ${field[ 'widget' ].get_html()}
- <div class="toolParamHelp" style="clear: both;">
- ${field[ 'helptext' ]}
- </div>
- <div style="clear: both"></div>
- </div>
- %endfor
- %endif
- <div class="form-row">
- <input type="submit" class="primary-button" name="new_dataset_button" value="Upload to library"/>
- </div>
- </form>
- </div>
- </div>
-%elif upload_option == 'import_from_history':
- <div class="toolForm">
- <div class="toolFormTitle">Active datasets in your current history (${history.name})</div>
- <div class="toolFormBody">
- %if history and history.active_datasets:
- <form name="add_history_datasets_to_library" action="${h.url_for( controller='library_admin', action='add_history_datasets_to_library', library_id=library_id )}" enctype="multipart/form-data" method="post">
- <input type="hidden" name="folder_id" value="${folder_id}"/>
- <input type="hidden" name="upload_option" value="${upload_option}"/>
- %if replace_dataset:
- <input type="hidden" name="replace_id" value="${replace_dataset.id}"/>
- <div class="form-row">
- You are currently selecting a new file to replace '<a href="${h.url_for( controller='library_admin', action='library_dataset_dataset_association', library_id=library_id, folder_id=folder_id, id=replace_dataset.library_dataset_dataset_association.id )}">${replace_dataset.name}</a>'.
- <div style="clear: both"></div>
- </div>
- %endif
- %for hda in history.active_datasets:
- <div class="form-row">
- <input name="hda_ids" value="${hda.id}" type="checkbox"/>${hda.hid}: ${hda.name}
- </div>
- %endfor
- <div class="form-row">
- <input type="submit" name="add_history_datasets_to_library_button" value="Import to library"/>
- </div>
- </form>
- %else:
- <p/>
- Your current history is empty
- <p/>
- %endif
- </div>
- </div>
-%endif
diff -r 822cae6071c1 -r d42c5698798b templates/admin/library/upload.mako
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/admin/library/upload.mako Tue Sep 22 14:04:48 2009 -0400
@@ -0,0 +1,35 @@
+<%inherit file="/base.mako"/>
+<%namespace file="/message.mako" import="render_msg" />
+<%namespace file="/admin/library/common.mako" import="render_template_info" />
+<%namespace file="/library/library_dataset_common.mako" import="render_upload_form" />
+
+<% import os, os.path %>
+
+<%
+ if replace_dataset not in [ None, 'None' ]:
+ replace_id = replace_dataset.id
+ else:
+ replace_id = 'None'
+%>
+
+<b>Create new data library datasets</b>
+<a id="upload-librarydataset--popup" class="popup-arrow" style="display: none;">▼</a>
+<div popupmenu="upload-librarydataset--popup">
+ <a class="action-button" href="${h.url_for( controller='library_admin', action='library_dataset_dataset_association', library_id=library_id, folder_id=folder_id, replace_id=replace_id, upload_option='upload_file' )}">Upload files</a>
+ %if trans.app.config.library_import_dir and os.path.exists( trans.app.config.library_import_dir ):
+ <a class="action-button" href="${h.url_for( controller='library_admin', action='library_dataset_dataset_association', library_id=library_id, folder_id=folder_id, replace_id=replace_id, upload_option='upload_directory' )}">Upload directory of files</a>
+ %endif
+ <a class="action-button" href="${h.url_for( controller='library_admin', action='library_dataset_dataset_association', library_id=library_id, folder_id=folder_id, replace_id=replace_id, upload_option='import_from_history' )}">Import datasets from your current history</a>
+</div>
+<br/><br/>
+<ul class="manage-table-actions">
+ <li>
+ <a class="action-button" href="${h.url_for( controller='library_admin', action='browse_library', id=library_id )}"><span>Browse this data library</span></a>
+ </li>
+</ul>
+
+%if msg:
+ ${render_msg( msg, messagetype )}
+%endif
+
+${render_upload_form( 'library_admin', upload_option, library_id, folder_id, replace_dataset, file_formats, dbkeys, roles, history, )}
diff -r 822cae6071c1 -r d42c5698798b templates/library/library_dataset_common.mako
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/library/library_dataset_common.mako Tue Sep 22 14:04:48 2009 -0400
@@ -0,0 +1,212 @@
+<%def name="render_upload_form( controller, upload_option, library_id, folder_id, replace_dataset, file_formats, dbkeys, roles, history )">
+ <% import os, os.path %>
+ %if upload_option in [ 'upload_file', 'upload_directory' ]:
+ <div class="toolForm" id="upload_library_dataset">
+ %if upload_option == 'upload_file':
+ <div class="toolFormTitle">Upload files</div>
+ %else:
+ <div class="toolFormTitle">Upload a directory of files</div>
+ %endif
+ <div class="toolFormBody">
+ <form name="upload_library_dataset" action="${h.url_for( controller=controller, action='library_dataset_dataset_association', library_id=library_id )}" enctype="multipart/form-data" method="post">
+ <input type="hidden" name="tool_id" value="upload_library_dataset"/>
+ <input type="hidden" name="tool_state" value="None"/>
+ <input type="hidden" name="folder_id" value="${folder_id}"/>
+ <input type="hidden" name="upload_option" value="${upload_option}"/>
+ %if replace_dataset not in [ None, 'None' ]:
+ <input type="hidden" name="replace_id" value="${replace_dataset.id}"/>
+ <div class="form-row">
+ You are currently selecting a new file to replace '<a href="${h.url_for( controller=controller, action='library_dataset_dataset_association', library_id=library_id, folder_id=folder_id, id=replace_dataset.library_dataset_dataset_association.id )}">${replace_dataset.name}</a>'.
+ <div style="clear: both"></div>
+ </div>
+ %endif
+ <div class="form-row">
+ <label>File Format:</label>
+ <div class="form-row-input">
+ <select name="file_type">
+ <option value="auto" selected>Auto-detect</option>
+ %for file_format in file_formats:
+ <option value="${file_format}">${file_format}</option>
+ %endfor
+ </select>
+ </div>
+ <div style="clear: both"></div>
+ </div>
+ %if upload_option == 'upload_file':
+ <div class="form-row">
+ <input type="hidden" name="async_datasets" value="None"/>
+ <div style="clear: both"></div>
+ </div>
+ <div class="form-row">
+ <label>File:</label>
+ <div class="form-row-input">
+ <input type="file" name="files_0|file_data" galaxy-ajax-upload="true"/>
+ </div>
+ <div style="clear: both"></div>
+ </div>
+ <div class="form-row">
+ <label>URL/Text:</label>
+ <div class="form-row-input">
+ <textarea name="files_0|url_paste" rows="5" cols="35"></textarea>
+ </div>
+ <div class="toolParamHelp" style="clear: both;">
+ Specify a list of URLs (one per line) or paste the contents of a file.
+ </div>
+ <div style="clear: both"></div>
+ </div>
+ %elif upload_option == 'upload_directory':
+ <%
+ if controller == 'library_admin':
+ import_dir = trans.app.config.library_import_dir
+ else:
+ # Directories of files from the Data Libraries view are restricted to a
+ # sub-directory named the same as the current user's email address
+ # contained within the configured setting for user_library_import_dir
+ import_dir = os.path.join( trans.app.config.user_library_import_dir, trans.user.email )
+ %>
+ <div class="form-row">
+ <%
+ # See if we have any contained sub-directories, if not the only option
+ # in the server_dir select list will be library_import_dir
+ contains_directories = False
+ for entry in os.listdir( import_dir ):
+ if os.path.isdir( os.path.join( import_dir, entry ) ):
+ contains_directories = True
+ break
+ %>
+ <label>Server Directory</label>
+ <div class="form-row-input">
+ <select name="server_dir">
+ %if contains_directories:
+ <option>None</option>
+ %for entry in os.listdir( import_dir ):
+ ## Do not include entries that are not directories
+ %if os.path.isdir( os.path.join( import_dir, entry ) ):
+ <option>${entry}</option>
+ %endif
+ %endfor
+ %else:
+ %if controller == 'library_admin':
+ <option>${import_dir}</option>
+ %else:
+ <option>${trans.user.email}</option>
+ %endif
+ %endif
+ </select>
+ </div>
+ <div class="toolParamHelp" style="clear: both;">
+ %if contains_directories:
+ Upload all files in a sub-directory of <strong>${import_dir}</strong> on the Galaxy server.
+ %else:
+ Upload all files in <strong>${import_dir}</strong> on the Galaxy server.
+ %endif
+ </div>
+ <div style="clear: both"></div>
+ </div>
+ %endif
+ <div class="form-row">
+ <label>
+ Convert spaces to tabs:
+ </label>
+ <div class="form-row-input">
+ <input type="checkbox" name="files_0|space_to_tab" value="Yes"/>Yes
+ </div>
+ </div>
+ <div class="toolParamHelp" style="clear: both;">
+ Use this option if you are entering intervals by hand.
+ </div>
+ <div style="clear: both"></div>
+ <div class="form-row">
+ <label>Genome:</label>
+ <div class="form-row-input">
+ <select name="dbkey" last_selected_value="?">
+ %for dbkey in dbkeys:
+ %if dbkey[1] == last_used_build:
+ <option value="${dbkey[1]}" selected>${dbkey[0]}</option>
+ %else:
+ <option value="${dbkey[1]}">${dbkey[0]}</option>
+ %endif
+ %endfor
+ </select>
+ </div>
+ <div style="clear: both"></div>
+ </div>
+ <div class="form-row">
+ <label>Message:</label>
+ <div class="form-row-input">
+ <textarea name="message" rows="3" cols="35"></textarea>
+ </div>
+ <div class="toolParamHelp" style="clear: both;">
+ This information will be displayed in the "Information" column for this dataset in the data library browser
+ </div>
+ <div style="clear: both"></div>
+ </div>
+ %if roles:
+ <div class="form-row">
+ <label>Restrict dataset access to specific roles:</label>
+ <div class="form-row-input">
+ <select name="roles" multiple="true" size="5">
+ %for role in roles:
+ <option value="${role.id}">${role.name}</option>
+ %endfor
+ </select>
+ </div>
+ <div class="toolParamHelp" style="clear: both;">
+ Multi-select list - hold the appropriate key while clicking to select multiple roles. More restrictions can be applied after the upload is complete. Selecting no roles makes a dataset public.
+ </div>
+ </div>
+ <div style="clear: both"></div>
+ %endif
+ %if widgets:
+ %for i, field in enumerate( widgets ):
+ <div class="form-row">
+ <label>${field[ 'label' ]}</label>
+ <div class="form-row-input">
+ ${field[ 'widget' ].get_html()}
+ </div>
+ <div class="toolParamHelp" style="clear: both;">
+ ${field[ 'helptext' ]}
+ </div>
+ <div style="clear: both"></div>
+ </div>
+ %endfor
+ %endif
+ <div class="form-row">
+ <input type="submit" class="primary-button" name="runtool_btn" value="Upload to library"/>
+ </div>
+ </form>
+ </div>
+ </div>
+ %elif upload_option == 'import_from_history':
+ <div class="toolForm">
+ <div class="toolFormTitle">Active datasets in your current history (${history.name})</div>
+ <div class="toolFormBody">
+ %if history and history.active_datasets:
+ <form name="add_history_datasets_to_library" action="${h.url_for( controller=controller, action='add_history_datasets_to_library', library_id=library_id )}" enctype="multipart/form-data" method="post">
+ <input type="hidden" name="folder_id" value="${folder_id}"/>
+ <input type="hidden" name="upload_option" value="${upload_option}"/>
+ %if replace_dataset not in [ None, 'None' ]:
+ <input type="hidden" name="replace_id" value="${replace_dataset.id}"/>
+ <div class="form-row">
+ You are currently selecting a new file to replace '<a href="${h.url_for( controller=controller, action='library_dataset_dataset_association', library_id=library_id, folder_id=folder_id, id=replace_dataset.library_dataset_dataset_association.id )}">${replace_dataset.name}</a>'.
+ <div style="clear: both"></div>
+ </div>
+ %endif
+ %for hda in history.active_datasets:
+ <div class="form-row">
+ <input name="hda_ids" value="${hda.id}" type="checkbox"/>${hda.hid}: ${hda.name}
+ </div>
+ %endfor
+ <div class="form-row">
+ <input type="submit" name="add_history_datasets_to_library_button" value="Import to library"/>
+ </div>
+ </form>
+ %else:
+ <p/>
+ Your current history is empty
+ <p/>
+ %endif
+ </div>
+ </div>
+ %endif
+</%def>
diff -r 822cae6071c1 -r d42c5698798b templates/library/new_dataset.mako
--- a/templates/library/new_dataset.mako Tue Sep 22 11:40:41 2009 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,222 +0,0 @@
-<%inherit file="/base.mako"/>
-<%namespace file="/message.mako" import="render_msg" />
-<%namespace file="/admin/library/common.mako" import="render_template_info" />
-
-<% import os, os.path %>
-
-<b>Create new library datasets</b>
-<a id="upload-librarydataset--popup" class="popup-arrow" style="display: none;">▼</a>
-<div popupmenu="upload-librarydataset--popup">
- <a class="action-button" href="${h.url_for( controller='library', action='library_dataset_dataset_association', library_id=library_id, folder_id=folder_id, replace_id=replace_id, upload_option='upload_file' )}">Upload files</a>
- %if trans.app.config.user_library_import_dir and os.path.exists( os.path.join( trans.app.config.user_library_import_dir, trans.user.email ) ):
- <a class="action-button" href="${h.url_for( controller='library', action='library_dataset_dataset_association', library_id=library_id, folder_id=folder_id, replace_id=replace_id, upload_option='upload_directory' )}">Upload directory of files</a>
- %endif
- <a class="action-button" href="${h.url_for( controller='library', action='library_dataset_dataset_association', library_id=library_id, folder_id=folder_id, replace_id=replace_id, upload_option='import_from_history' )}">Import datasets from your current history</a>
-</div>
-<br/><br/>
-<ul class="manage-table-actions">
- <li>
- <a class="action-button" href="${h.url_for( controller='library', action='browse_library', id=library_id )}"><span>Browse this data library</span></a>
- </li>
-</ul>
-
-%if msg:
- ${render_msg( msg, messagetype )}
-%endif
-
-<%
- roles = trans.app.model.Role.filter( trans.app.model.Role.table.c.deleted==False ).order_by( trans.app.model.Role.table.c.name ).all()
- history = trans.get_history()
-%>
-
-%if upload_option in [ 'upload_file', 'upload_directory' ]:
- <div class="toolForm" id="new_dataset">
- %if upload_option == 'upload_file':
- <div class="toolFormTitle">Upload files</div>
- %else:
- <div class="toolFormTitle">Upload a directory of files</div>
- %endif
- <div class="toolFormBody">
- <form name="tool_form" action="${h.url_for( controller='library', action='library_dataset_dataset_association', library_id=library_id )}" enctype="multipart/form-data" method="post">
- <input type="hidden" name="folder_id" value="${folder_id}"/>
- <input type="hidden" name="upload_option" value="${upload_option}"/>
- %if replace_dataset:
- <input type="hidden" name="replace_id" value="${replace_dataset.id}"/>
- <div class="form-row">
- You are currently selecting a new file to replace '<a href="${h.url_for( controller='library', action='library_dataset', id=replace_dataset.id )}">${replace_dataset.name}</a>'.
- <div style="clear: both"></div>
- </div>
- %endif
- %if upload_option == 'upload_file':
- <div class="form-row">
- <label>File:</label>
- <div style="float: left; width: 250px; margin-right: 10px;">
- <input type="file" name="file_data"/>
- </div>
- <div style="clear: both"></div>
- </div>
- <div class="form-row">
- <label>URL/Text:</label>
- <div style="float: left; width: 250px; margin-right: 10px;">
- <textarea name="url_paste" rows="5" cols="35"></textarea>
- </div>
- <div class="toolParamHelp" style="clear: both;">
- Specify a list of URLs (one per line) or paste the contents of a file.
- </div>
- <div style="clear: both"></div>
- </div>
- %elif upload_option == 'upload_directory':
- <div class="form-row">
- <%
- # Directories of files from the Data Libraries view are restricted to a
- # sub-directory named the same as the current user's email address
- # contained within the configured setting for user_library_import_dir
- user_library_import_dir = os.path.join( trans.app.config.user_library_import_dir, trans.user.email )
- # See if we have any contained sub-directories, if not the only option
- # in the server_dir select list will be user_library_import_dir
- contains_directories = False
- for entry in os.listdir( user_library_import_dir ):
- if os.path.isdir( os.path.join( user_library_import_dir, entry ) ):
- contains_directories = True
- break
- %>
- <label>Server Directory</label>
- <div style="float: left; width: 250px; margin-right: 10px;">
- <select name="server_dir">
- %if contains_directories:
- <option>None</option>
- %for entry in os.listdir( user_library_import_dir ):
- ## Do not include entries that are not directories
- %if os.path.isdir( os.path.join( user_library_import_dir, entry ) ):
- <option>${entry}</option>
- %endif
- %endfor
- %else:
- <option>${trans.user.email}</option>
- %endif
- </select>
- </div>
- <div class="toolParamHelp" style="clear: both;">
- %if contains_directories:
- Upload all files in a subdirectory of <strong>${user_library_import_dir}}</strong> on the Galaxy server.
- %else:
- Upload all files in <strong>${user_library_import_dir}}</strong> on the Galaxy server.
- %endif
- </div>
- <div style="clear: both"></div>
- </div>
- %endif
- <div class="form-row">
- <label>Convert spaces to tabs:</label>
- <div style="float: left; width: 250px; margin-right: 10px;">
- <div>
- <input type="checkbox" name="space_to_tab" value="Yes"/>Yes
- </div>
- </div>
- <div class="toolParamHelp" style="clear: both;">
- Use this option if you are manually entering intervals.
- </div>
- <div style="clear: both"></div>
- </div>
- <div class="form-row">
- <label>File Format:</label>
- <div style="float: left; width: 250px; margin-right: 10px;">
- <select name="file_format">
- <option value="auto" selected>Auto-detect</option>
- %for file_format in file_formats:
- <option value="${file_format}">${file_format}</option>
- %endfor
- </select>
- </div>
- <div style="clear: both"></div>
- </div>
- <div class="form-row">
- <label>Genome:</label>
- <div style="float: left; width: 250px; margin-right: 10px;">
- <select name="dbkey">
- %for dbkey in dbkeys:
- %if dbkey[1] == last_used_build:
- <option value="${dbkey[1]}" selected>${dbkey[0]}</option>
- %else:
- <option value="${dbkey[1]}">${dbkey[0]}</option>
- %endif
- %endfor
- </select>
- </div>
- <div style="clear: both"></div>
- </div>
- <div class="form-row">
- <label>Message:</label>
- <div style="float: left; width: 250px; margin-right: 10px;">
- <textarea name="message" rows="3" cols="35"></textarea>
- </div>
- <div class="toolParamHelp" style="clear: both;">
- This information will be displayed in the "Information" column for this dataset in the library browser
- </div>
- <div style="clear: both"></div>
- </div>
- <div class="form-row">
- <div style="float: left; width: 250px; margin-right: 10px;">
- <label>Restrict dataset access to specific roles:</label>
- <select name="roles" multiple="true" size="5">
- %for role in roles:
- <option value="${role.id}">${role.name}</option>
- %endfor
- </select>
- </div>
- <div class="toolParamHelp" style="clear: both;">
- Multi-select list - hold the appropriate key while clicking to select multiple roles. More restrictions can be applied after the upload is complete. Selecting no roles makes a dataset public.
- </div>
- </div>
- <div style="clear: both"></div>
- %if widgets:
- <p/>
- %for i, field in enumerate( widgets ):
- <div class="form-row">
- <label>${field[ 'label' ]}</label>
- ${field[ 'widget' ].get_html()}
- <div class="toolParamHelp" style="clear: both;">
- ${field[ 'helptext' ]}
- </div>
- <div style="clear: both"></div>
- </div>
- %endfor
- %endif
- <div class="form-row">
- <input type="submit" class="primary-button" name="new_dataset_button" value="Upload to library"/>
- </div>
- </form>
- </div>
- </div>
-%elif upload_option == 'import_from_history':
- <div class="toolForm">
- <div class="toolFormTitle">Active datasets in your current history (${history.name})</div>
- <div class="toolFormBody">
- %if history and history.active_datasets:
- <form name="add_history_datasets_to_library" action="${h.url_for( controller='library', action='add_history_datasets_to_library', library_id=library_id )}" enctype="multipart/form-data" method="post">
- <input type="hidden" name="folder_id" value="${folder_id}"/>
- <input type="hidden" name="upload_option" value="${upload_option}"/>
- %if replace_dataset:
- <input type="hidden" name="replace_id" value="${replace_dataset.id}"/>
- <div class="form-row">
- You are currently selecting a new file to replace '<a href="${h.url_for( controller='library', action='library_dataset_dataset_association', library_id=library_id, folder_id=folder_id, id=replace_dataset.library_dataset_dataset_association.id )}">${replace_dataset.name}</a>'.
- <div style="clear: both"></div>
- </div>
- %endif
- %for hda in history.active_datasets:
- <div class="form-row">
- <input name="hda_ids" value="${hda.id}" type="checkbox"/>${hda.hid}: ${hda.name}
- </div>
- %endfor
- <div class="form-row">
- <input type="submit" name="add_history_datasets_to_library_button" value="Import to library"/>
- </div>
- </form>
- %else:
- <p/>
- Your current history is empty
- <p/>
- %endif
- </div>
- </div>
-%endif
diff -r 822cae6071c1 -r d42c5698798b templates/library/upload.mako
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/library/upload.mako Tue Sep 22 14:04:48 2009 -0400
@@ -0,0 +1,35 @@
+<%inherit file="/base.mako"/>
+<%namespace file="/message.mako" import="render_msg" />
+<%namespace file="/admin/library/common.mako" import="render_template_info" />
+<%namespace file="/library/library_dataset_common.mako" import="render_upload_form" />
+
+<% import os, os.path %>
+
+<%
+ if replace_dataset not in [ None, 'None' ]:
+ replace_id = replace_dataset.id
+ else:
+ replace_id = 'None'
+%>
+
+<b>Create new data library datasets</b>
+<a id="upload-librarydataset--popup" class="popup-arrow" style="display: none;">▼</a>
+<div popupmenu="upload-librarydataset--popup">
+ <a class="action-button" href="${h.url_for( controller='library', action='library_dataset_dataset_association', library_id=library_id, folder_id=folder_id, replace_id=replace_id, upload_option='upload_file' )}">Upload files</a>
+ %if trans.app.config.user_library_import_dir and os.path.exists( os.path.join( trans.app.config.user_library_import_dir, trans.user.email ) ):
+ <a class="action-button" href="${h.url_for( controller='library', action='library_dataset_dataset_association', library_id=library_id, folder_id=folder_id, replace_id=replace_id, upload_option='upload_directory' )}">Upload directory of files</a>
+ %endif
+ <a class="action-button" href="${h.url_for( controller='library', action='library_dataset_dataset_association', library_id=library_id, folder_id=folder_id, replace_id=replace_id, upload_option='import_from_history' )}">Import datasets from your current history</a>
+</div>
+<br/><br/>
+<ul class="manage-table-actions">
+ <li>
+ <a class="action-button" href="${h.url_for( controller='library', action='browse_library', id=library_id )}"><span>Browse this data library</span></a>
+ </li>
+</ul>
+
+%if msg:
+ ${render_msg( msg, messagetype )}
+%endif
+
+${render_upload_form( 'library', upload_option, library_id, folder_id, replace_dataset, file_formats, dbkeys, roles, history, )}
diff -r 822cae6071c1 -r d42c5698798b templates/tool_form.mako
--- a/templates/tool_form.mako Tue Sep 22 11:40:41 2009 -0400
+++ b/templates/tool_form.mako Tue Sep 22 14:04:48 2009 -0400
@@ -71,179 +71,164 @@
</head>
<body>
-
-<%def name="do_inputs( inputs, tool_state, errors, prefix, other_values=None )">
- <% other_values = ExpressionContext( tool_state, other_values ) %>
- %for input_index, input in enumerate( inputs.itervalues() ):
- %if input.type == "repeat":
- <div class="repeat-group">
- <div class="form-title-row"><b>${input.title_plural}</b></div>
- <% repeat_state = tool_state[input.name] %>
- %for i in range( len( repeat_state ) ):
- <div class="repeat-group-item">
+ <%def name="do_inputs( inputs, tool_state, errors, prefix, other_values=None )">
+ <% other_values = ExpressionContext( tool_state, other_values ) %>
+ %for input_index, input in enumerate( inputs.itervalues() ):
+ %if input.type == "repeat":
+ <div class="repeat-group">
+ <div class="form-title-row"><b>${input.title_plural}</b></div>
+ <% repeat_state = tool_state[input.name] %>
+ %for i in range( len( repeat_state ) ):
+ <div class="repeat-group-item">
+ <%
+ if input.name in errors:
+ rep_errors = errors[input.name][i]
+ else:
+ rep_errors = dict()
+ index = repeat_state[i]['__index__']
+ %>
+ <div class="form-title-row"><b>${input.title} ${i + 1}</b></div>
+ ${do_inputs( input.inputs, repeat_state[i], rep_errors, prefix + input.name + "_" + str(index) + "|", other_values )}
+ <div class="form-row"><input type="submit" name="${prefix}${input.name}_${index}_remove" value="Remove ${input.title} ${i+1}"></div>
+ </div>
+ %endfor
+ <div class="form-row"><input type="submit" name="${prefix}${input.name}_add" value="Add new ${input.title}"></div>
+ </div>
+ %elif input.type == "conditional":
<%
- if input.name in errors:
- rep_errors = errors[input.name][i]
- else:
- rep_errors = dict()
- index = repeat_state[i]['__index__']
+ group_state = tool_state[input.name]
+ group_errors = errors.get( input.name, {} )
+ current_case = group_state['__current_case__']
+ group_prefix = prefix + input.name + "|"
%>
- <div class="form-title-row"><b>${input.title} ${i + 1}</b></div>
- ${do_inputs( input.inputs, repeat_state[i], rep_errors, prefix + input.name + "_" + str(index) + "|", other_values )}
- <div class="form-row"><input type="submit" name="${prefix}${input.name}_${index}_remove" value="Remove ${input.title} ${i+1}"></div>
- </div>
- %endfor
- <div class="form-row"><input type="submit" name="${prefix}${input.name}_add" value="Add new ${input.title}"></div>
- </div>
- %elif input.type == "conditional":
+ %if input.value_ref_in_group:
+ ${row_for_param( group_prefix, input.test_param, group_state, group_errors, other_values )}
+ %endif
+ ${do_inputs( input.cases[current_case].inputs, group_state, group_errors, group_prefix, other_values )}
+ %elif input.type == "upload_dataset":
+ %if input.get_datatype( trans, other_values ).composite_type is None: #have non-composite upload appear as before
+ <%
+ if input.name in errors:
+ rep_errors = errors[input.name][0]
+ else:
+ rep_errors = dict()
+ %>
+ ${do_inputs( input.inputs, tool_state[input.name][0], rep_errors, prefix + input.name + "_" + str( 0 ) + "|", other_values )}
+ %else:
+ <div class="repeat-group">
+ <div class="form-title-row"><b>${input.group_title( other_values )}</b></div>
+ <%
+ repeat_state = tool_state[input.name]
+ %>
+ %for i in range( len( repeat_state ) ):
+ <div class="repeat-group-item">
+ <%
+ if input.name in errors:
+ rep_errors = errors[input.name][i]
+ else:
+ rep_errors = dict()
+ index = repeat_state[i]['__index__']
+ %>
+ <div class="form-title-row"><b>File Contents for ${input.title_by_index( trans, i, other_values )}</b></div>
+ ${do_inputs( input.inputs, repeat_state[i], rep_errors, prefix + input.name + "_" + str(index) + "|", other_values )}
+ ##<div class="form-row"><input type="submit" name="${prefix}${input.name}_${index}_remove" value="Remove ${input.title} ${i+1}"></div>
+ </div>
+ %endfor
+ ##<div class="form-row"><input type="submit" name="${prefix}${input.name}_add" value="Add new ${input.title}"></div>
+ </div>
+ %endif
+ %else:
+ ${row_for_param( prefix, input, tool_state, errors, other_values )}
+ %endif
+ %endfor
+ </%def>
+
+ <%def name="row_for_param( prefix, param, parent_state, parent_errors, other_values )">
+ <%
+ if parent_errors.has_key( param.name ):
+ cls = "form-row form-row-error"
+ else:
+ cls = "form-row"
+ %>
+ <div class="${cls}">
+ <% label = param.get_label() %>
+ %if label:
+ <label>
+ ${label}:
+ </label>
+ %endif
<%
- group_state = tool_state[input.name]
- group_errors = errors.get( input.name, {} )
- current_case = group_state['__current_case__']
- group_prefix = prefix + input.name + "|"
+ field = param.get_html_field( trans, parent_state[ param.name ], other_values )
+ field.refresh_on_change = param.refresh_on_change
%>
- %if input.value_ref_in_group:
- ${row_for_param( group_prefix, input.test_param, group_state, group_errors, other_values )}
+ <div class="form-row-input">${field.get_html( prefix )}</div>
+ %if parent_errors.has_key( param.name ):
+ <div class="form-row-error-message">
+ <div><img style="vertical-align: middle;" src="${h.url_for('/static/style/error_small.png')}"> <span style="vertical-align: middle;">${parent_errors[param.name]}</span></div>
+ </div>
%endif
- ${do_inputs( input.cases[current_case].inputs, group_state, group_errors, group_prefix, other_values )}
- %elif input.type == "upload_dataset":
- %if input.get_datatype( trans, other_values ).composite_type is None: #have non-composite upload appear as before
- <%
- if input.name in errors:
- rep_errors = errors[input.name][0]
- else:
- rep_errors = dict()
- %>
- ${do_inputs( input.inputs, tool_state[input.name][0], rep_errors, prefix + input.name + "_" + str( 0 ) + "|", other_values )}
- %else:
- <div class="repeat-group">
- <div class="form-title-row"><b>${input.group_title( other_values )}</b></div>
- <%
- repeat_state = tool_state[input.name]
- %>
- %for i in range( len( repeat_state ) ):
- <div class="repeat-group-item">
- <%
- if input.name in errors:
- rep_errors = errors[input.name][i]
- else:
- rep_errors = dict()
- index = repeat_state[i]['__index__']
- %>
- <div class="form-title-row"><b>File Contents for ${input.title_by_index( trans, i, other_values )}</b></div>
- ${do_inputs( input.inputs, repeat_state[i], rep_errors, prefix + input.name + "_" + str(index) + "|", other_values )}
- ##<div class="form-row"><input type="submit" name="${prefix}${input.name}_${index}_remove" value="Remove ${input.title} ${i+1}"></div>
- </div>
- %endfor
- ##<div class="form-row"><input type="submit" name="${prefix}${input.name}_add" value="Add new ${input.title}"></div>
- </div>
+
+ %if param.help:
+ <div class="toolParamHelp" style="clear: both;">
+ ${param.help}
+ </div>
%endif
+
+ <div style="clear: both"></div>
+
+ </div>
+ </%def>
+
+ %if add_frame.from_noframe:
+ <div class="warningmessage">
+ <strong>Welcome to Galaxy</strong>
+ <hr/>
+ It appears that you found this tool from a link outside of Galaxy.
+ If you're not familiar with Galaxy, please consider visiting the
+ <a href="${h.url_for( controller='root' )}" target="_top">welcome page</a>.
+ To learn more about what Galaxy is and what it can do for you, please visit
+ the <a href="$add_frame.wiki_url" target="_top">Galaxy wiki</a>.
+ </div>
+ <br/>
+ %endif
+
+ <div class="toolForm" id="${tool.id}">
+ %if tool.has_multiple_pages:
+ <div class="toolFormTitle">${tool.name} (step ${tool_state.page+1} of ${tool.npages})</div>
%else:
- ${row_for_param( prefix, input, tool_state, errors, other_values )}
+ <div class="toolFormTitle">${tool.name}</div>
%endif
- %endfor
-</%def>
-
-<%def name="row_for_param( prefix, param, parent_state, parent_errors, other_values )">
- <%
- if parent_errors.has_key( param.name ):
- cls = "form-row form-row-error"
- else:
- cls = "form-row"
- %>
- <div class="${cls}">
- <% label = param.get_label() %>
- %if label:
- <label>
- ${label}:
- </label>
- %endif
- <%
- field = param.get_html_field( trans, parent_state[ param.name ], other_values )
- field.refresh_on_change = param.refresh_on_change
- %>
- <div class="form-row-input">${field.get_html( prefix )}</div>
- %if parent_errors.has_key( param.name ):
- <div class="form-row-error-message">
- <div><img style="vertical-align: middle;" src="${h.url_for('/static/style/error_small.png')}"> <span style="vertical-align: middle;">${parent_errors[param.name]}</span></div>
+ <div class="toolFormBody">
+ <form id="tool_form" name="tool_form" action="${h.url_for( tool.action )}" enctype="${tool.enctype}" target="${tool.target}" method="${tool.method}">
+ <input type="hidden" name="tool_id" value="${tool.id}">
+ <input type="hidden" name="tool_state" value="${util.object_to_string( tool_state.encode( tool, app ) )}">
+ %if tool.display_by_page[tool_state.page]:
+ ${trans.fill_template_string( tool.display_by_page[tool_state.page], context=tool.get_param_html_map( trans, tool_state.page, tool_state.inputs ) )}
+ <input type="submit" class="primary-button" name="runtool_btn" value="Execute">
+ %else:
+ ${do_inputs( tool.inputs_by_page[ tool_state.page ], tool_state.inputs, errors, "" )}
+ <div class="form-row">
+ %if tool_state.page == tool.last_page:
+ <input type="submit" class="primary-button" name="runtool_btn" value="Execute">
+ %else:
+ <input type="submit" class="primary-button" name="runtool_btn" value="Next step">
+ %endif
+ </div>
+ %endif
+ </form>
</div>
- %endif
-
- %if param.help:
- <div class="toolParamHelp" style="clear: both;">
- ${param.help}
+ </div>
+ %if tool.help:
+ <div class="toolHelp">
+ <div class="toolHelpBody">
+ %if tool.has_multiple_pages:
+ ${tool.help_by_page[tool_state.page]}
+ %else:
+ ${tool.help}
+ %endif
+ </div>
</div>
- %endif
-
- <div style="clear: both"></div>
-
- </div>
-</%def>
-
-%if add_frame.from_noframe:
- <div class="warningmessage">
- <strong>Welcome to Galaxy</strong>
- <hr/>
- It appears that you found this tool from a link outside of Galaxy.
- If you're not familiar with Galaxy, please consider visiting the
- <a href="${h.url_for( controller='root' )}" target="_top">welcome page</a>.
- To learn more about what Galaxy is and what it can do for you, please visit
- the <a href="$add_frame.wiki_url" target="_top">Galaxy wiki</a>.
- </div>
- <br/>
-%endif
-
-<div class="toolForm" id="${tool.id}">
- %if tool.has_multiple_pages:
- <div class="toolFormTitle">${tool.name} (step ${tool_state.page+1} of ${tool.npages})</div>
- %else:
- <div class="toolFormTitle">${tool.name}</div>
- %endif
- <div class="toolFormBody">
- <form id="tool_form" name="tool_form" action="${h.url_for( tool.action )}" enctype="${tool.enctype}" target="${tool.target}" method="${tool.method}">
- <input type="hidden" name="tool_id" value="${tool.id}">
- <input type="hidden" name="tool_state" value="${util.object_to_string( tool_state.encode( tool, app ) )}">
-
- %if tool.display_by_page[tool_state.page]:
- ${trans.fill_template_string( tool.display_by_page[tool_state.page], context=tool.get_param_html_map( trans, tool_state.page, tool_state.inputs ) )}
- <input type="submit" class="primary-button" name="runtool_btn" value="Execute">
-
- %else:
-
- <div style="display: none;">
- %if tool_state.page == tool.last_page:
- <input type="submit" class="primary-button" name="runtool_btn" value="Execute">
- %else:
- <input type="submit" class="primary-button" name="runtool_btn" value="Next step">
- %endif
- </div>
- ${do_inputs( tool.inputs_by_page[ tool_state.page ], tool_state.inputs, errors, "" )}
- <div class="form-row">
- %if tool_state.page == tool.last_page:
- <input type="submit" class="primary-button" name="runtool_btn" value="Execute">
- %else:
- <input type="submit" class="primary-button" name="runtool_btn" value="Next step">
- %endif
- </div>
-
- %endif
-
- </form>
- </div>
-</div>
-
-%if tool.help:
-<div class="toolHelp">
- <div class="toolHelpBody">
- %if tool.has_multiple_pages:
- ${tool.help_by_page[tool_state.page]}
- %else:
- ${tool.help}
- %endif
- </div>
-</div>
-%endif
-
+ %endif
</body>
<script type="text/javascript">
diff -r 822cae6071c1 -r d42c5698798b test/base/twilltestcase.py
--- a/test/base/twilltestcase.py Tue Sep 22 11:40:41 2009 -0400
+++ b/test/base/twilltestcase.py Tue Sep 22 14:04:48 2009 -0400
@@ -1250,7 +1250,7 @@
check_str = "Folder '%s' has been renamed to '%s'" % ( old_name, name )
self.check_page_for_string( check_str )
self.home()
- def add_library_dataset( self, filename, library_id, folder_id, folder_name, file_format='auto',
+ def add_library_dataset( self, filename, library_id, folder_id, folder_name, file_type='auto',
dbkey='hg18', roles=[], message='', root=False, template_field_name1='', template_field_contents1='' ):
"""Add a dataset to a folder"""
filename = self.get_filename( filename )
@@ -1259,8 +1259,8 @@
( self.url, library_id, folder_id, message ) )
self.check_page_for_string( 'Upload files' )
tc.fv( "1", "folder_id", folder_id )
- tc.formfile( "1", "file_data", filename )
- tc.fv( "1", "file_format", file_format )
+ tc.formfile( "1", "files_0|file_data", filename )
+ tc.fv( "1", "file_type", file_type )
tc.fv( "1", "dbkey", dbkey )
tc.fv( "1", "message", message.replace( '+', ' ' ) )
for role_id in roles:
@@ -1268,7 +1268,7 @@
# Add template field contents, if any...
if template_field_name1:
tc.fv( "1", template_field_name1, template_field_contents1 )
- tc.submit( "new_dataset_button" )
+ tc.submit( "runtool_btn" )
if root:
check_str = "Added 1 datasets to the library '%s' ( each is selected )." % folder_name
else:
@@ -1339,7 +1339,7 @@
check_str = 'Edit attributes of %s' % new_ldda_name
self.check_page_for_string( check_str )
self.home()
- def upload_new_dataset_version( self, filename, library_id, folder_id, folder_name, library_dataset_id, ldda_name, file_format='auto',
+ def upload_new_dataset_version( self, filename, library_id, folder_id, folder_name, library_dataset_id, ldda_name, file_type='auto',
dbkey='hg18', message='', template_field_name1='', template_field_contents1='' ):
"""Upload new version(s) of a dataset"""
self.home()
@@ -1349,18 +1349,18 @@
self.check_page_for_string( 'Upload files' )
self.check_page_for_string( 'You are currently selecting a new file to replace' )
self.check_page_for_string( ldda_name )
- tc.formfile( "1", "file_data", filename )
- tc.fv( "1", "file_format", file_format )
+ tc.formfile( "1", "files_0|file_data", filename )
+ tc.fv( "1", "file_type", file_type )
tc.fv( "1", "dbkey", dbkey )
tc.fv( "1", "message", message.replace( '+', ' ' ) )
# Add template field contents, if any...
if template_field_name1:
tc.fv( "1", template_field_name1, template_field_contents1 )
- tc.submit( "new_dataset_button" )
+ tc.submit( "runtool_btn" )
check_str = "Added 1 dataset versions to the library dataset '%s' in the folder '%s'." % ( ldda_name, folder_name )
self.check_page_for_string( check_str )
self.home()
- def upload_new_dataset_versions( self, library_id, folder_id, folder_name, library_dataset_id, ldda_name, file_format='auto',
+ def upload_new_dataset_versions( self, library_id, folder_id, folder_name, library_dataset_id, ldda_name, file_type='auto',
dbkey='hg18', message='', template_field_name1='', template_field_contents1='' ):
"""Upload new version(s) of a dataset using a directory of files"""
self.home()
@@ -1368,14 +1368,14 @@
% ( self.url, library_id, folder_id, library_dataset_id ) )
self.check_page_for_string( 'Upload a directory of files' )
self.check_page_for_string( 'You are currently selecting a new file to replace' )
- tc.fv( "1", "file_format", file_format )
+ tc.fv( "1", "file_type", file_type )
tc.fv( "1", "dbkey", dbkey )
tc.fv( "1", "message", message.replace( '+', ' ' ) )
tc.fv( "1", "server_dir", "library" )
# Add template field contents, if any...
if template_field_name1:
tc.fv( "1", template_field_name1, template_field_contents1 )
- tc.submit( "new_dataset_button" )
+ tc.submit( "runtool_btn" )
check_str = "Added 3 dataset versions to the library dataset '%s' in the folder '%s'." % ( ldda_name, folder_name )
self.check_page_for_string( check_str )
self.home()
@@ -1390,7 +1390,7 @@
check_str = "Added 1 datasets to the folder '%s' ( each is selected )." % folder_name
self.check_page_for_string( check_str )
self.home()
- def add_dir_of_files_from_admin_view( self, library_id, folder_id, file_format='auto', dbkey='hg18', roles_tuple=[],
+ def add_dir_of_files_from_admin_view( self, library_id, folder_id, file_type='auto', dbkey='hg18', roles_tuple=[],
message='', check_str_after_submit='', template_field_name1='', template_field_contents1='' ):
"""Add a directory of datasets to a folder"""
# roles is a list of tuples: [ ( role_id, role_description ) ]
@@ -1398,7 +1398,7 @@
self.visit_url( "%s/library_admin/library_dataset_dataset_association?upload_option=upload_directory&library_id=%s&folder_id=%s" % ( self.url, library_id, folder_id ) )
self.check_page_for_string( 'Upload a directory of files' )
tc.fv( "1", "folder_id", folder_id )
- tc.fv( "1", "file_format", file_format )
+ tc.fv( "1", "file_type", file_type )
tc.fv( "1", "dbkey", dbkey )
tc.fv( "1", "message", message.replace( '+', ' ' ) )
tc.fv( "1", "server_dir", "library" )
@@ -1407,19 +1407,20 @@
# Add template field contents, if any...
if template_field_name1:
tc.fv( "1", template_field_name1, template_field_contents1 )
- tc.submit( "new_dataset_button" )
+ tc.submit( "runtool_btn" )
if check_str_after_submit:
self.check_page_for_string( check_str_after_submit )
self.home()
- def add_dir_of_files_from_libraries_view( self, library_id, folder_id, selected_dir, file_format='auto', dbkey='hg18', roles_tuple=[],
+ def add_dir_of_files_from_libraries_view( self, library_id, folder_id, selected_dir, file_type='auto', dbkey='hg18', roles_tuple=[],
message='', check_str_after_submit='', template_field_name1='', template_field_contents1='' ):
"""Add a directory of datasets to a folder"""
# roles is a list of tuples: [ ( role_id, role_description ) ]
self.home()
- self.visit_url( "%s/library/library_dataset_dataset_association?upload_option=upload_directory&library_id=%s&folder_id=%s" % ( self.url, library_id, folder_id ) )
+ self.visit_url( "%s/library/library_dataset_dataset_association?upload_option=upload_directory&library_id=%s&folder_id=%s" % \
+ ( self.url, library_id, folder_id ) )
self.check_page_for_string( 'Upload a directory of files' )
tc.fv( "1", "folder_id", folder_id )
- tc.fv( "1", "file_format", file_format )
+ tc.fv( "1", "file_type", file_type )
tc.fv( "1", "dbkey", dbkey )
tc.fv( "1", "message", message.replace( '+', ' ' ) )
tc.fv( "1", "server_dir", selected_dir )
@@ -1428,7 +1429,7 @@
# Add template field contents, if any...
if template_field_name1:
tc.fv( "1", template_field_name1, template_field_contents1 )
- tc.submit( "new_dataset_button" )
+ tc.submit( "runtool_btn" )
if check_str_after_submit:
self.check_page_for_string( check_str_after_submit )
self.home()
diff -r 822cae6071c1 -r d42c5698798b test/functional/test_security_and_libraries.py
--- a/test/functional/test_security_and_libraries.py Tue Sep 22 11:40:41 2009 -0400
+++ b/test/functional/test_security_and_libraries.py Tue Sep 22 14:04:48 2009 -0400
@@ -543,7 +543,7 @@
str( library_one.id ),
str( library_one.root_folder.id ),
library_one.root_folder.name,
- file_format='bed',
+ file_type='bed',
dbkey='hg18',
message=message.replace( ' ', '+' ),
root=True,
@@ -690,7 +690,7 @@
str( library_one.id ),
str( folder_two.id ),
folder_two.name,
- file_format='bed',
+ file_type='bed',
dbkey='hg18',
message=message.replace( ' ', '+' ),
root=False,
@@ -721,7 +721,7 @@
str( library_one.id ),
str( folder_two.id ),
folder_two.name,
- file_format='bed',
+ file_type='bed',
dbkey='hg18',
message=message.replace( ' ', '+' ),
root=False,
@@ -763,7 +763,7 @@
str( library_one.id ),
str( folder_one.id ),
folder_one.name,
- file_format='bed',
+ file_type='bed',
dbkey='hg18',
roles=[ str( regular_user1_private_role.id ) ],
message=message.replace( ' ', '+' ),
@@ -870,7 +870,7 @@
str( library_one.id ),
str( folder_one.id ),
folder_one.name,
- file_format='bed',
+ file_type='bed',
dbkey='hg17',
roles=[ str( role_two.id ) ],
message=message.replace( ' ', '+' ),
@@ -1029,7 +1029,7 @@
str( subfolder_one.name ),
str( ldda_six.library_dataset.id ),
ldda_six.name,
- file_format='auto',
+ file_type='auto',
dbkey='hg18',
message=message.replace( ' ', '+' ),
template_field_name1=form_one_field_name,
@@ -1093,7 +1093,7 @@
str( subfolder_one.name ),
str( ldda_six_version_two.library_dataset.id ),
ldda_six_version_two.name,
- file_format='auto',
+ file_type='auto',
dbkey='hg18',
message=message.replace( ' ', '+' ),
template_field_name1=form_one_field_name,
@@ -1549,7 +1549,43 @@
raise AssertionError( 'The library_dataset id %s named "%s" has not been marked as deleted.' % \
( str( library_dataset.id ), library_dataset.name ) )
check_folder( library_one.root_folder )
- def test_260_reset_data_for_later_test_runs( self ):
+ def test_260_no_library_template( self ):
+ """Test library features when library has no template"""
+ name = "Library Two"
+ description = "This is Library Two"
+ # Create a library, adding no template
+ self.create_library( name=name, description=description )
+ self.visit_page( 'library_admin/browse_libraries' )
+ self.check_page_for_string( name )
+ self.check_page_for_string( description )
+ library_two = galaxy.model.Library.filter( and_( galaxy.model.Library.table.c.name==name,
+ galaxy.model.Library.table.c.description==description,
+ galaxy.model.Library.table.c.deleted==False ) ).first()
+ assert library_two is not None, 'Problem retrieving library named "%s" from the database' % name
+ # Add a dataset to the library
+ self.add_library_dataset( '7.bed',
+ str( library_two.id ),
+ str( library_two.root_folder.id ),
+ library_two.root_folder.name,
+ file_type='bed',
+ dbkey='hg18',
+ message='',
+ root=True )
+ ldda_seven = galaxy.model.LibraryDatasetDatasetAssociation.query() \
+ .order_by( desc( galaxy.model.LibraryDatasetDatasetAssociation.table.c.create_time ) ).first()
+ assert ldda_seven is not None, 'Problem retrieving LibraryDatasetDatasetAssociation ldda_seven from the database'
+ self.home()
+ self.visit_url( '%s/library_admin/browse_library?id=%s' % ( self.url, str( library_two.id ) ) )
+ self.check_page_for_string( "7.bed" )
+ self.check_page_for_string( admin_user.email )
+ # TODO: add a functional test to cover adding a library dataset via url_paste here...
+ # TODO: Add a functional test to cover checking the space_to_tab checkbox here...
+ # Delete and purge the library
+ self.home()
+ self.delete_library_item( str( library_two.id ), str( library_two.id ), library_two.name, library_item_type='library' )
+ self.purge_library( str( library_two.id ), library_two.name )
+ self.home()
+ def test_265_reset_data_for_later_test_runs( self ):
"""Reseting data to enable later test runs to pass"""
##################
# Eliminate all non-private roles
diff -r 822cae6071c1 -r d42c5698798b tool-data/shared/genetrack/genetrack_sites.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tool-data/shared/genetrack/genetrack_sites.txt Tue Sep 22 14:04:48 2009 -0400
@@ -0,0 +1,3 @@
+# GeneTrack sites
+main http://www.genetrack.org/
+test http://www.test.genetrack.org/
diff -r 822cae6071c1 -r d42c5698798b universe_wsgi.ini.sample
--- a/universe_wsgi.ini.sample Tue Sep 22 11:40:41 2009 -0400
+++ b/universe_wsgi.ini.sample Tue Sep 22 14:04:48 2009 -0400
@@ -81,9 +81,10 @@
# Use the new iframe / javascript based layout
use_new_layout = true
-# Comma separated list of UCSC / gbrowse browsers to use for viewing
+# Comma separated list of UCSC / gbrowse / GeneTrack browsers to use for viewing
ucsc_display_sites = main,test,archaea
gbrowse_display_sites = main,test
+genetrack_display_sites = main,test
# Serving static files (needed if running standalone)
static_enabled = True
1
0
25 Sep '09
details: http://www.bx.psu.edu/hg/galaxy/rev/9e8901230940
changeset: 2748:9e8901230940
user: Dan Blankenberg <dan(a)bx.psu.edu>
date: Tue Sep 22 11:37:41 2009 -0400
description:
More friendly error reporting for mutate SNP codon tool.
1 file(s) affected in this change:
tools/evolution/mutate_snp_codon.py
diffs (89 lines):
diff -r 4d32e2d934d0 -r 9e8901230940 tools/evolution/mutate_snp_codon.py
--- a/tools/evolution/mutate_snp_codon.py Tue Sep 22 10:55:50 2009 -0400
+++ b/tools/evolution/mutate_snp_codon.py Tue Sep 22 11:37:41 2009 -0400
@@ -34,32 +34,66 @@
DNA_COMP = string.maketrans( "ACGTacgt", "TGCAtgca" )
skipped_lines = 0
- for line in open( input_file ):
+ errors = {}
+ for name, message in [ ('max_field_index','not enough fields'), ( 'codon_len', 'codon length must be 3' ), ( 'codon_seq', 'codon sequence must have length 3' ), ( 'snp_len', 'SNP length must be 3' ), ( 'snp_observed', 'SNP observed values must have length 3' ), ( 'empty_comment', 'empty or comment'), ( 'no_overlap', 'codon and SNP do not overlap' ) ]:
+ errors[ name ] = { 'count':0, 'message':message }
+ line_count = 0
+ for line_count, line in enumerate( open( input_file ) ):
line = line.rstrip( '\n\r' )
if line and not line.startswith( '#' ):
fields = line.split( '\t' )
if max_field_index >= len( fields ):
skipped_lines += 1
+ errors[ 'max_field_index' ]['count'] += 1
continue
+
+ #read codon info
codon_chrom = fields[codon_chrom_col]
codon_start = int( fields[codon_start_col] )
codon_end = int( fields[codon_end_col] )
+ if codon_end - codon_start != 3:
+ #codons must be length 3
+ skipped_lines += 1
+ errors[ 'codon_len' ]['count'] += 1
+ continue
codon_strand = strandify( fields, codon_strand_col )
codon_seq = fields[codon_seq_col].upper()
+ if len( codon_seq ) != 3:
+ #codon sequence must have length 3
+ skipped_lines += 1
+ errors[ 'codon_seq' ]['count'] += 1
+ continue
+ #read snp info
snp_chrom = fields[snp_chrom_col]
snp_start = int( fields[snp_start_col] )
snp_end = int( fields[snp_end_col] )
+ if snp_end - snp_start != 1:
+ #snps must be length 1
+ skipped_lines += 1
+ errors[ 'snp_len' ]['count'] += 1
+ continue
snp_strand = strandify( fields, snp_strand_col )
snp_observed = fields[snp_observed_col].split( '/' )
+ snp_observed = [ observed for observed in snp_observed if len( observed ) == 1 ]
+ if not snp_observed:
+ #sequence replacements must be length 1
+ skipped_lines += 1
+ errors[ 'snp_observed' ]['count'] += 1
+ continue
+
+ #Determine index of replacement for observed values into codon
+ offset = snp_start - codon_start
+ #Extract DNA on neg strand codons will have positions reversed relative to interval positions; i.e. position 0 == position 2
+ if codon_strand == '-':
+ offset = 2 - offset
+ if offset < 0 and offset > 2: #assert offset >= 0 and offset <= 2, ValueError( 'Impossible offset determined: %s' % offset )
+ #codon and snp do not overlap
+ skipped_lines += 1
+ errors[ 'no_overlap' ]['count'] += 1
+ continue
for observed in snp_observed:
- #Extract DNA on neg strand codons will have positions reversed relative to interval positions; i.e. position 0 == position 2
- offset = snp_start - codon_start
- if codon_strand == '-':
- offset = 2 - offset
- assert offset >= 0 and offset <= 2, ValueError( 'Impossible offset determined: %s' % offset )
-
if codon_strand != snp_strand:
#if our SNP is on a different strand than our codon, take complement of provided observed SNP base
observed = observed.translate( DNA_COMP )
@@ -69,5 +103,10 @@
if codon_seq != snp_codon: #only output when we actually have a different codon
out.write( "%s\t%s\n" % ( line, snp_codon ) )
-
+ else:
+ skipped_lines += 1
+ errors[ 'empty_comment' ]['count'] += 1
+ if skipped_lines:
+ print "Skipped %i (%4.2f%%) of %i lines; reasons: %s" % ( skipped_lines, ( float( skipped_lines )/float( line_count ) ) * 100, line_count, ', '.join( [ "%s (%i)" % ( error['message'], error['count'] ) for error in errors.itervalues() if error['count'] ] ) )
+
if __name__ == "__main__": main()
1
0
25 Sep '09
details: http://www.bx.psu.edu/hg/galaxy/rev/822cae6071c1
changeset: 2749:822cae6071c1
user: Dan Blankenberg <dan(a)bx.psu.edu>
date: Tue Sep 22 11:40:41 2009 -0400
description:
Changing an 'and' to 'or' in SNP mutate codon tool error checking.
1 file(s) affected in this change:
tools/evolution/mutate_snp_codon.py
diffs (12 lines):
diff -r 9e8901230940 -r 822cae6071c1 tools/evolution/mutate_snp_codon.py
--- a/tools/evolution/mutate_snp_codon.py Tue Sep 22 11:37:41 2009 -0400
+++ b/tools/evolution/mutate_snp_codon.py Tue Sep 22 11:40:41 2009 -0400
@@ -87,7 +87,7 @@
#Extract DNA on neg strand codons will have positions reversed relative to interval positions; i.e. position 0 == position 2
if codon_strand == '-':
offset = 2 - offset
- if offset < 0 and offset > 2: #assert offset >= 0 and offset <= 2, ValueError( 'Impossible offset determined: %s' % offset )
+ if offset < 0 or offset > 2: #assert offset >= 0 and offset <= 2, ValueError( 'Impossible offset determined: %s' % offset )
#codon and snp do not overlap
skipped_lines += 1
errors[ 'no_overlap' ]['count'] += 1
1
0
25 Sep '09
details: http://www.bx.psu.edu/hg/galaxy/rev/4d32e2d934d0
changeset: 2747:4d32e2d934d0
user: Nate Coraor <nate(a)bx.psu.edu>
date: Tue Sep 22 10:55:50 2009 -0400
description:
Missing string formatting operator as reported by bitbucket user kuntzagk
1 file(s) affected in this change:
lib/galaxy/jobs/runners/sge.py
diffs (12 lines):
diff -r 1cf9480dd090 -r 4d32e2d934d0 lib/galaxy/jobs/runners/sge.py
--- a/lib/galaxy/jobs/runners/sge.py Tue Sep 22 10:09:23 2009 -0400
+++ b/lib/galaxy/jobs/runners/sge.py Tue Sep 22 10:55:50 2009 -0400
@@ -297,7 +297,7 @@
self.ds.control( job.job_runner_external_id, DRMAA.Session.TERMINATE )
log.debug( "(%s/%s) Removed from SGE queue at user's request" % ( job.id, job.job_runner_external_id ) )
except DRMAA.InvalidJobError:
- log.debug( "(%s/%s) User killed running job, but it was already dead" ( job.id, job.job_runner_external_id ) )
+ log.debug( "(%s/%s) User killed running job, but it was already dead" % ( job.id, job.job_runner_external_id ) )
def recover( self, job, job_wrapper ):
"""Recovers jobs stuck in the queued/running state when Galaxy started"""
1
0
25 Sep '09
details: http://www.bx.psu.edu/hg/galaxy/rev/1cf9480dd090
changeset: 2746:1cf9480dd090
user: Kelly Vincent <kpvincent(a)bx.psu.edu>
date: Tue Sep 22 10:09:23 2009 -0400
description:
Modified Concatenate queries tool to have two base files to concatenate and the option to add a third or more. Also removed to unnecessary sort1 test files.
5 file(s) affected in this change:
test-data/cat_wrapper_out1.bed
test-data/sort1_alpha.bed
test-data/sort1_num.bed
tools/filters/catWrapper.py
tools/filters/catWrapper.xml
diffs (226 lines):
diff -r e9104d403af7 -r 1cf9480dd090 test-data/cat_wrapper_out1.bed
--- a/test-data/cat_wrapper_out1.bed Tue Sep 22 08:59:36 2009 -0400
+++ b/test-data/cat_wrapper_out1.bed Tue Sep 22 10:09:23 2009 -0400
@@ -131,3 +131,28 @@
chrX 152648964 152649196 NM_000425_cds_0_0_chrX_152648965_r 0 -
chrX 152691446 152691471 AF101728_cds_0_0_chrX_152691447_f 0 +
chrX 152694029 152694263 BC052303_cds_0_0_chrX_152694030_r 0 -
+chr1 147962006 147975713 NM_005997 0 - 147962192 147975670 0 6 574,145,177,115,153,160, 0,1543,7859,9048,9340,13547,
+chr1 147984101 148035079 BC007833 0 + 147984545 148033414 0 14 529,32,81,131,118,153,300,206,84,49,85,130,46,1668, 0,25695,28767,33118,33695,33998,35644,38005,39629,40577,41402,43885,48367,49310,
+chr1 148077485 148111797 NM_002651 0 - 148078400 148111728 0 12 1097,121,133,266,124,105,110,228,228,45,937,77, 0,2081,2472,6871,9907,10257,11604,14199,15637,18274,23636,34235,
+chr1 148185113 148187485 NM_002796 0 + 148185136 148187378 0 7 163,207,147,82,117,89,120, 0,416,877,1199,1674,1977,2252,
+chr2 118288484 118306183 NM_006773 0 + 118288583 118304530 0 14 184,285,144,136,101,200,115,140,162,153,114,57,178,1796, 0,2765,4970,6482,6971,7183,7468,9890,10261,10768,11590,14270,14610,15903,
+chr2 118389378 118390700 BC005078 0 - 118390395 118390500 0 1 1322, 0,
+chr2 220108603 220116964 NM_001927 0 + 220108689 220116217 0 9 664,61,96,162,126,221,44,83,789, 0,1718,1874,2118,2451,2963,5400,7286,7572,
+chr2 220229182 220233943 NM_024536 0 - 220229609 220233765 0 4 1687,180,574,492, 0,1990,2660,4269,
+chr5 131170738 131357870 AF099740 0 - 131311206 131357817 0 31 112,124,120,81,65,40,120,129,61,88,94,79,72,102,144,117,89,73,96,135,135,78,74,52,33,179,100,102,65,115,248, 0,11593,44117,47607,104668,109739,114675,126366,135488,137518,138009,140437,152389,153373,155388,159269,160793,162981,164403,165577,166119,167611,169501,178260,179675,180901,181658,182260,182953,183706,186884,
+chr5 131424245 131426795 NM_000588 0 + 131424298 131426383 0 5 215,42,90,42,535, 0,313,1658,1872,2015,
+chr5 131556201 131590458 NM_004199 0 - 131556601 131582218 0 15 471,97,69,66,54,100,71,177,194,240,138,152,97,100,170, 0,2316,2802,5596,6269,11138,11472,15098,16528,17674,21306,24587,25142,25935,34087,
+chr5 131621285 131637046 NM_003687 0 + 131621326 131635821 0 7 134,152,82,179,164,118,1430, 0,4915,8770,13221,13609,14097,14331,
+chr6 108298214 108386086 NM_007214 0 - 108299600 108385906 0 21 1530,105,99,102,159,174,60,83,148,155,93,133,95,109,51,59,62,113,115,100,304, 0,2490,6246,10831,12670,23164,23520,27331,31052,32526,34311,36130,36365,38609,41028,42398,43048,51479,54500,59097,87568,
+chr6 108593954 108616704 NM_003269 0 + 108594662 108615360 0 9 733,146,88,236,147,97,150,106,1507, 0,5400,8778,10445,12037,14265,14749,15488,21243,
+chr6 108639410 108689143 NM_152827 0 - 108640045 108688818 0 3 741,125,487, 0,2984,49246,
+chr6 108722790 108950942 NM_145315 0 + 108722976 108950321 0 13 325,224,52,102,131,100,59,83,71,101,141,114,750, 0,28931,52094,60760,61796,71339,107102,152319,181970,182297,215317,224802,227402,
+chr7 113320332 113924911 AK131266 0 + 113862563 113893433 0 20 285,91,178,90,58,75,138,51,201,178,214,105,88,84,77,102,122,70,164,1124, 0,201692,340175,448290,451999,484480,542213,543265,543478,545201,556083,558358,565876,567599,573029,573245,575738,577123,577946,603455,
+chr7 116511232 116557294 NM_003391 0 - 116512159 116556994 0 5 1157,265,278,227,383, 0,20384,37843,43339,45679,
+chr7 116713967 116902666 NM_000492 0 + 116714099 116901113 0 27 185,111,109,216,90,164,126,247,93,183,192,95,87,724,129,38,251,80,151,228,101,249,156,90,173,106,1754, 0,24290,29071,50936,54313,55285,56585,60137,62053,68678,79501,107776,110390,111971,114967,122863,123569,126711,130556,131618,134650,147559,162475,172879,184725,185496,186945,
+chr7 116944658 117107512 AF377960 0 - 116945541 116979926 0 23 1129,102,133,64,186,206,179,188,153,100,87,80,96,276,118,255,151,100,204,1654,225,108,173, 0,7364,8850,10413,13893,14398,17435,24259,24615,35177,35359,45901,47221,49781,56405,66857,69787,72208,73597,80474,100111,150555,162681,
+chr8 118880786 119193239 NM_000127 0 - 118881131 119192466 0 11 531,172,161,90,96,119,133,120,108,94,1735, 0,5355,7850,13505,19068,20309,23098,30863,36077,37741,310718,
+chr9 128763240 128783870 NM_174933 0 + 128764156 128783586 0 12 261,118,74,159,76,48,56,63,129,117,127,370, 0,522,875,5630,12374,12603,15040,15175,18961,19191,20037,20260,
+chr9 128787362 128789566 NM_014908 0 - 128787519 128789136 0 1 2204, 0,
+chr9 128789530 128848928 NM_015354 0 + 128789552 128848511 0 44 54,55,74,85,81,45,93,120,212,115,201,90,66,120,127,153,127,88,77,115,121,67,129,140,107,207,170,70,68,196,78,86,146,182,201,93,159,138,75,228,132,74,130,594, 0,1491,5075,8652,9254,10312,11104,11317,20808,21702,23060,25462,31564,32908,33566,34851,35204,35595,35776,37202,38860,39111,39891,40349,42422,45499,45827,46675,47158,47621,50453,50840,51474,51926,53831,54186,55119,55619,57449,57605,57947,58352,58541,58804,
+chr9 128849867 128870133 NM_020145 0 - 128850516 128869987 0 11 757,241,101,90,24,63,93,134,129,142,209, 0,1071,1736,2085,2635,4201,6376,6736,13056,14247,20057,
diff -r e9104d403af7 -r 1cf9480dd090 test-data/sort1_alpha.bed
--- a/test-data/sort1_alpha.bed Tue Sep 22 08:59:36 2009 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-chr1 147962006 147975713 NM_005997 0 - 147962192 147975670 0 6 574,145,177,115,153,160, 0,1543,7859,9048,9340,13547,
-chr1 147984101 148035079 BC007833 0 + 147984545 148033414 0 14 529,32,81,131,118,153,300,206,84,49,85,130,46,1668, 0,25695,28767,33118,33695,33998,35644,38005,39629,40577,41402,43885,48367,49310,
-chr1 148077485 148111797 NM_002651 0 - 148078400 148111728 0 12 1097,121,133,266,124,105,110,228,228,45,937,77, 0,2081,2472,6871,9907,10257,11604,14199,15637,18274,23636,34235,
-chr1 148185113 148187485 NM_002796 0 + 148185136 148187378 0 7 163,207,147,82,117,89,120, 0,416,877,1199,1674,1977,2252,
-chr2 118288484 118306183 NM_006773 0 + 118288583 118304530 0 14 184,285,144,136,101,200,115,140,162,153,114,57,178,1796, 0,2765,4970,6482,6971,7183,7468,9890,10261,10768,11590,14270,14610,15903,
-chr2 118389378 118390700 BC005078 0 - 118390395 118390500 0 1 1322, 0,
-chr2 220108603 220116964 NM_001927 0 + 220108689 220116217 0 9 664,61,96,162,126,221,44,83,789, 0,1718,1874,2118,2451,2963,5400,7286,7572,
-chr2 220229182 220233943 NM_024536 0 - 220229609 220233765 0 4 1687,180,574,492, 0,1990,2660,4269,
-chr5 131170738 131357870 AF099740 0 - 131311206 131357817 0 31 112,124,120,81,65,40,120,129,61,88,94,79,72,102,144,117,89,73,96,135,135,78,74,52,33,179,100,102,65,115,248, 0,11593,44117,47607,104668,109739,114675,126366,135488,137518,138009,140437,152389,153373,155388,159269,160793,162981,164403,165577,166119,167611,169501,178260,179675,180901,181658,182260,182953,183706,186884,
-chr5 131424245 131426795 NM_000588 0 + 131424298 131426383 0 5 215,42,90,42,535, 0,313,1658,1872,2015,
-chr5 131556201 131590458 NM_004199 0 - 131556601 131582218 0 15 471,97,69,66,54,100,71,177,194,240,138,152,97,100,170, 0,2316,2802,5596,6269,11138,11472,15098,16528,17674,21306,24587,25142,25935,34087,
-chr5 131621285 131637046 NM_003687 0 + 131621326 131635821 0 7 134,152,82,179,164,118,1430, 0,4915,8770,13221,13609,14097,14331,
-chr6 108298214 108386086 NM_007214 0 - 108299600 108385906 0 21 1530,105,99,102,159,174,60,83,148,155,93,133,95,109,51,59,62,113,115,100,304, 0,2490,6246,10831,12670,23164,23520,27331,31052,32526,34311,36130,36365,38609,41028,42398,43048,51479,54500,59097,87568,
-chr6 108593954 108616704 NM_003269 0 + 108594662 108615360 0 9 733,146,88,236,147,97,150,106,1507, 0,5400,8778,10445,12037,14265,14749,15488,21243,
-chr6 108639410 108689143 NM_152827 0 - 108640045 108688818 0 3 741,125,487, 0,2984,49246,
-chr6 108722790 108950942 NM_145315 0 + 108722976 108950321 0 13 325,224,52,102,131,100,59,83,71,101,141,114,750, 0,28931,52094,60760,61796,71339,107102,152319,181970,182297,215317,224802,227402,
-chr7 113320332 113924911 AK131266 0 + 113862563 113893433 0 20 285,91,178,90,58,75,138,51,201,178,214,105,88,84,77,102,122,70,164,1124, 0,201692,340175,448290,451999,484480,542213,543265,543478,545201,556083,558358,565876,567599,573029,573245,575738,577123,577946,603455,
-chr7 116511232 116557294 NM_003391 0 - 116512159 116556994 0 5 1157,265,278,227,383, 0,20384,37843,43339,45679,
-chr7 116713967 116902666 NM_000492 0 + 116714099 116901113 0 27 185,111,109,216,90,164,126,247,93,183,192,95,87,724,129,38,251,80,151,228,101,249,156,90,173,106,1754, 0,24290,29071,50936,54313,55285,56585,60137,62053,68678,79501,107776,110390,111971,114967,122863,123569,126711,130556,131618,134650,147559,162475,172879,184725,185496,186945,
-chr7 116944658 117107512 AF377960 0 - 116945541 116979926 0 23 1129,102,133,64,186,206,179,188,153,100,87,80,96,276,118,255,151,100,204,1654,225,108,173, 0,7364,8850,10413,13893,14398,17435,24259,24615,35177,35359,45901,47221,49781,56405,66857,69787,72208,73597,80474,100111,150555,162681,
-chr8 118880786 119193239 NM_000127 0 - 118881131 119192466 0 11 531,172,161,90,96,119,133,120,108,94,1735, 0,5355,7850,13505,19068,20309,23098,30863,36077,37741,310718,
-chr9 128763240 128783870 NM_174933 0 + 128764156 128783586 0 12 261,118,74,159,76,48,56,63,129,117,127,370, 0,522,875,5630,12374,12603,15040,15175,18961,19191,20037,20260,
-chr9 128787362 128789566 NM_014908 0 - 128787519 128789136 0 1 2204, 0,
-chr9 128789530 128848928 NM_015354 0 + 128789552 128848511 0 44 54,55,74,85,81,45,93,120,212,115,201,90,66,120,127,153,127,88,77,115,121,67,129,140,107,207,170,70,68,196,78,86,146,182,201,93,159,138,75,228,132,74,130,594, 0,1491,5075,8652,9254,10312,11104,11317,20808,21702,23060,25462,31564,32908,33566,34851,35204,35595,35776,37202,38860,39111,39891,40349,42422,45499,45827,46675,47158,47621,50453,50840,51474,51926,53831,54186,55119,55619,57449,57605,57947,58352,58541,58804,
-chr9 128849867 128870133 NM_020145 0 - 128850516 128869987 0 11 757,241,101,90,24,63,93,134,129,142,209, 0,1071,1736,2085,2635,4201,6376,6736,13056,14247,20057,
-chrX 122719582 122773357 NM_001167 0 + 122745047 122766566 0 7 96,909,100,79,43,201,6985, 0,25433,28421,31040,32533,40295,46790,
-chrX 152648233 152662158 NM_000425 0 - 152648964 152662138 0 28 963,12,73,135,156,120,174,123,202,116,223,71,198,111,125,157,167,112,144,132,185,112,171,123,203,106,11,100, 0,1436,1545,1951,2390,2653,2889,3156,3367,3772,4717,5122,5424,5868,6066,6370,6629,6909,7588,7871,8124,8456,8858,9125,10220,10660,11296,13825,
-chrX 152691216 152693487 NM_000054 0 + 152691446 152693029 0 3 255,885,664, 0,616,1607,
-chrX 152693677 152712545 NM_001666 0 - 152694029 152712503 0 22 586,100,93,184,74,234,106,135,78,61,103,28,85,192,102,222,129,183,63,163,205,109, 0,1693,2066,2364,2635,2794,3129,3323,3545,3752,5323,5647,5841,6032,6401,11455,11778,13249,13719,13987,14227,18759,
diff -r e9104d403af7 -r 1cf9480dd090 test-data/sort1_num.bed
--- a/test-data/sort1_num.bed Tue Sep 22 08:59:36 2009 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-chr1 147962192 147962580 CCDS989.1_cds_0_0_chr1_147962193_r 0 -
-chr1 147984545 147984630 CCDS990.1_cds_0_0_chr1_147984546_f 0 +
-chr1 148078400 148078582 CCDS993.1_cds_0_0_chr1_148078401_r 0 -
-chr1 148185136 148185276 CCDS996.1_cds_0_0_chr1_148185137_f 0 +
-chr10 55251623 55253124 CCDS7248.1_cds_0_0_chr10_55251624_r 0 -
-chr11 116124407 116124501 CCDS8374.1_cds_0_0_chr11_116124408_r 0 -
-chr11 116206508 116206563 CCDS8377.1_cds_0_0_chr11_116206509_f 0 +
-chr11 116211733 116212337 CCDS8378.1_cds_0_0_chr11_116211734_r 0 -
-chr11 1812377 1812407 CCDS7726.1_cds_0_0_chr11_1812378_f 0 +
-chr12 38440094 38440321 CCDS8736.1_cds_0_0_chr12_38440095_r 0 -
-chr13 112381694 112381953 CCDS9526.1_cds_0_0_chr13_112381695_f 0 +
-chr14 98710240 98712285 CCDS9949.1_cds_0_0_chr14_98710241_r 0 -
-chr15 41486872 41487060 CCDS10096.1_cds_0_0_chr15_41486873_r 0 -
-chr15 41673708 41673857 CCDS10097.1_cds_0_0_chr15_41673709_f 0 +
-chr15 41679161 41679250 CCDS10098.1_cds_0_0_chr15_41679162_r 0 -
-chr15 41826029 41826196 CCDS10101.1_cds_0_0_chr15_41826030_f 0 +
-chr16 142908 143003 CCDS10397.1_cds_0_0_chr16_142909_f 0 +
-chr16 179963 180135 CCDS10401.1_cds_0_0_chr16_179964_r 0 -
-chr16 244413 244681 CCDS10402.1_cds_0_0_chr16_244414_f 0 +
-chr16 259268 259383 CCDS10403.1_cds_0_0_chr16_259269_r 0 -
-chr18 23786114 23786321 CCDS11891.1_cds_0_0_chr18_23786115_r 0 -
-chr18 59406881 59407046 CCDS11985.1_cds_0_0_chr18_59406882_f 0 +
-chr18 59455932 59456337 CCDS11986.1_cds_0_0_chr18_59455933_r 0 -
-chr18 59600586 59600754 CCDS11988.1_cds_0_0_chr18_59600587_f 0 +
-chr19 59068595 59069564 CCDS12866.1_cds_0_0_chr19_59068596_f 0 +
-chr19 59236026 59236146 CCDS12872.1_cds_0_0_chr19_59236027_r 0 -
-chr19 59297998 59298008 CCDS12877.1_cds_0_0_chr19_59297999_f 0 +
-chr19 59302168 59302288 CCDS12878.1_cds_0_0_chr19_59302169_r 0 -
-chr2 118288583 118288668 CCDS2120.1_cds_0_0_chr2_118288584_f 0 +
-chr2 118394148 118394202 CCDS2121.1_cds_0_0_chr2_118394149_r 0 -
-chr2 220190202 220190242 CCDS2441.1_cds_0_0_chr2_220190203_f 0 +
-chr2 220229609 220230869 CCDS2443.1_cds_0_0_chr2_220229610_r 0 -
-chr20 33330413 33330423 CCDS13249.1_cds_0_0_chr20_33330414_r 0 -
-chr20 33513606 33513792 CCDS13255.1_cds_0_0_chr20_33513607_f 0 +
-chr20 33579500 33579527 CCDS13256.1_cds_0_0_chr20_33579501_r 0 -
-chr20 33593260 33593348 CCDS13257.1_cds_0_0_chr20_33593261_f 0 +
-chr21 32707032 32707192 CCDS13614.1_cds_0_0_chr21_32707033_f 0 +
-chr21 32869641 32870022 CCDS13615.1_cds_0_0_chr21_32869642_r 0 -
-chr21 33321040 33322012 CCDS13620.1_cds_0_0_chr21_33321041_f 0 +
-chr21 33744994 33745040 CCDS13625.1_cds_0_0_chr21_33744995_r 0 -
-chr22 30120223 30120265 CCDS13897.1_cds_0_0_chr22_30120224_f 0 +
-chr22 30160419 30160661 CCDS13898.1_cds_0_0_chr22_30160420_r 0 -
-chr22 30665273 30665360 CCDS13901.1_cds_0_0_chr22_30665274_f 0 +
-chr22 30939054 30939266 CCDS13903.1_cds_0_0_chr22_30939055_r 0 -
-chr5 131424298 131424460 CCDS4149.1_cds_0_0_chr5_131424299_f 0 +
-chr5 131556601 131556672 CCDS4151.1_cds_0_0_chr5_131556602_r 0 -
-chr5 131621326 131621419 CCDS4152.1_cds_0_0_chr5_131621327_f 0 +
-chr5 131847541 131847666 CCDS4155.1_cds_0_0_chr5_131847542_r 0 -
-chr6 108299600 108299744 CCDS5061.1_cds_0_0_chr6_108299601_r 0 -
-chr6 108594662 108594687 CCDS5063.1_cds_0_0_chr6_108594663_f 0 +
-chr6 108640045 108640151 CCDS5064.1_cds_0_0_chr6_108640046_r 0 -
-chr6 108722976 108723115 CCDS5067.1_cds_0_0_chr6_108722977_f 0 +
-chr7 113660517 113660685 CCDS5760.1_cds_0_0_chr7_113660518_f 0 +
-chr7 116512159 116512389 CCDS5771.1_cds_0_0_chr7_116512160_r 0 -
-chr7 116714099 116714152 CCDS5773.1_cds_0_0_chr7_116714100_f 0 +
-chr7 116945541 116945787 CCDS5774.1_cds_0_0_chr7_116945542_r 0 -
-chr8 118881131 118881317 CCDS6324.1_cds_0_0_chr8_118881132_r 0 -
-chr9 128764156 128764189 CCDS6914.1_cds_0_0_chr9_128764157_f 0 +
-chr9 128787519 128789136 CCDS6915.1_cds_0_0_chr9_128787520_r 0 -
-chr9 128882427 128882523 CCDS6917.1_cds_0_0_chr9_128882428_f 0 +
-chr9 128937229 128937445 CCDS6919.1_cds_0_0_chr9_128937230_r 0 -
-chrX 122745047 122745924 CCDS14606.1_cds_0_0_chrX_122745048_f 0 +
-chrX 152648964 152649196 CCDS14733.1_cds_0_0_chrX_152648965_r 0 -
-chrX 152691446 152691471 CCDS14735.1_cds_0_0_chrX_152691447_f 0 +
-chrX 152694029 152694263 CCDS14736.1_cds_0_0_chrX_152694030_r 0 -
diff -r e9104d403af7 -r 1cf9480dd090 tools/filters/catWrapper.py
--- a/tools/filters/catWrapper.py Tue Sep 22 08:59:36 2009 -0400
+++ b/tools/filters/catWrapper.py Tue Sep 22 10:09:23 2009 -0400
@@ -11,29 +11,19 @@
def main():
outfile = sys.argv[1]
infile = sys.argv[2]
-
+ catfiles = sys.argv[3:]
try:
fout = open(sys.argv[1],'w')
- except:
- stop_err("Output file cannot be opened for writing.")
-
+ except Exxception, ex:
+ stop_err("Output file cannot be opened for writing\n" + str(ex))
try:
fin = open(sys.argv[2],'r')
- except:
- stop_err("Input file cannot be opened for reading.")
-
- if len(sys.argv) < 4:
- os.system("cp %s %s" %(infile,outfile))
- sys.exit()
-
- cmdline = "cat %s " %(infile)
- for inp in sys.argv[3:]:
- cmdline = cmdline + inp + " "
- cmdline = cmdline + ">" + outfile
+ except Exception, ex:
+ stop_err("Input file cannot be opened for reading\n" + str(ex))
+ cmdline = "cat %s %s > %s" % (infile, ' '.join(catfiles), outfile)
try:
os.system(cmdline)
- except:
- stop_err("Error encountered with cat.")
+ except Exception, ex:
+ stop_err("Error encountered with cat\n" + str(ex))
-if __name__ == "__main__":
- main()
\ No newline at end of file
+if __name__ == "__main__": main()
\ No newline at end of file
diff -r e9104d403af7 -r 1cf9480dd090 tools/filters/catWrapper.xml
--- a/tools/filters/catWrapper.xml Tue Sep 22 08:59:36 2009 -0400
+++ b/tools/filters/catWrapper.xml Tue Sep 22 10:09:23 2009 -0400
@@ -1,17 +1,19 @@
-<tool id="cat1" name="Concatenate queries">
+<tool id="cat1" name="Concatenate queries" version="1.0.1">
<description>tail-to-head</description>
<command interpreter="python">
catWrapper.py
$out_file1
- $input1
+ $input1
+ $input2
#for $q in $queries
- ${q.input2}
+ ${q.input3}
#end for
</command>
<inputs>
- <param name="input1" type="data" label="Concatenate Query"/>
- <repeat name="queries" title="Query">
- <param name="input2" type="data" label="Select" />
+ <param name="input1" type="data" label="First query to concatenate:"/>
+ <param name="input2" type="data" label="Second query to concatenate:"/>
+ <repeat name="queries" title="Additional query">
+ <param name="input3" type="data" label="Select" />
</repeat>
</inputs>
<outputs>
@@ -21,14 +23,16 @@
<test>
<param name="input1" value="1.bed"/>
<param name="input2" value="2.bed"/>
+ <param name="input3" value="3.bed"/>
<output name="out_file1" file="cat_wrapper_out1.bed"/>
</test>
<!--TODO: if possible, enhance the underlying test code to handle this test
- the problem is multiple params with the same name "input2"
+ the problem is multiple params with the same name "input3"
<test>
<param name="input1" value="1.bed"/>
<param name="input2" value="2.bed"/>
- <param name="input2" value="3.bed"/>
+ <param name="input3" value="3.bed"/>
+ <param name="input3" value="4.bed"/>
<output name="out_file1" file="cat_wrapper_out2.bed"/>
</test>
-->
1
0