galaxy-commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
July 2013
- 1 participants
- 83 discussions
commit/galaxy-central: carlfeberhard: API Documentation: histories, history_contents
by commits-noreply@bitbucket.org 31 Jul '13
by commits-noreply@bitbucket.org 31 Jul '13
31 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/fe5867b89ec0/
Changeset: fe5867b89ec0
User: carlfeberhard
Date: 2013-07-31 22:55:50
Summary: API Documentation: histories, history_contents
Affected #: 2 files
diff -r edef166c163f30175e98ddb0b98f7993d7d4d5eb -r fe5867b89ec01bfde18591df8809526d85fb821e lib/galaxy/webapps/galaxy/api/histories.py
--- a/lib/galaxy/webapps/galaxy/api/histories.py
+++ b/lib/galaxy/webapps/galaxy/api/histories.py
@@ -1,5 +1,7 @@
"""
API operations on a history.
+
+.. seealso:: :class:`galaxy.model.History`
"""
import pkg_resources
@@ -21,17 +23,30 @@
@web.expose_api_anonymous
def index( self, trans, deleted='False', **kwd ):
"""
- GET /api/histories
- GET /api/histories/deleted
- Displays a collection (list) of histories.
+ index( trans, deleted='False' )
+ * GET /api/histories:
+ return undeleted histories for the current user
+ * GET /api/histories/deleted:
+ return deleted histories for the current user
+
+ If the user is logged-in, a full list of all histories is shown.
+ If not logged in, only the curernt history (if any) is shown.
+
+ :type deleted: boolean
+ :param deleted: if True, show only deleted histories, if False, non-deleted
+
+ :rtype: list
+ :returns: list of dictionaries containing summary history information
"""
#TODO: query (by name, date, etc.)
rval = []
deleted = string_as_bool( deleted )
try:
if trans.user:
- query = trans.sa_session.query(trans.app.model.History ).filter_by( user=trans.user, deleted=deleted ).order_by(
- desc(trans.app.model.History.table.c.update_time)).all()
+ query = ( trans.sa_session.query( trans.app.model.History )
+ .filter_by( user=trans.user, deleted=deleted )
+ .order_by( desc( trans.app.model.History.table.c.update_time ) )
+ .all() )
for history in query:
item = history.get_api_value(value_mapper={'id':trans.security.encode_id})
item['url'] = url_for( 'history', id=trans.security.encode_id( history.id ) )
@@ -52,11 +67,24 @@
@web.expose_api_anonymous
def show( self, trans, id, deleted='False', **kwd ):
+ # oh, sphinx - you bastard
"""
- GET /api/histories/{encoded_history_id}
- GET /api/histories/deleted/{encoded_history_id}
- GET /api/histories/most_recently_used
- Displays information about a history.
+ show( trans, id, deleted='False' )
+ * GET /api/histories/{id}:
+ return the history with ``id``
+ * GET /api/histories/deleted/{id}:
+ return the deleted history with ``id``
+ * GET /api/histories/most_recently_used:
+ return the most recently used history
+
+ :type id: an encoded id string
+ :param id: the encoded id of the history to query or the string 'most_recently_used'
+ :type deleted: boolean
+ :param deleted: if True, allow information on a deleted history to be shown.
+
+ :rtype: dictionary
+ :returns: detailed history information from
+ :func:`galaxy.web.base.controller.UsesHistoryDatasetAssociationMixin.get_history_dict`
"""
#TODO: GET /api/histories/{encoded_history_id}?as_archive=True
#TODO: GET /api/histories/s/{username}/{slug}
@@ -94,8 +122,16 @@
@web.expose_api
def create( self, trans, payload, **kwd ):
"""
- POST /api/histories
- Creates a new history.
+ create( trans, payload )
+ * POST /api/histories:
+ create a new history
+
+ :type payload: dict
+ :param payload: (optional) dictionary structure containing::
+ 'name': the new history's name
+
+ :rtype: dict
+ :returns: element view of new history
"""
hist_name = None
if payload.get( 'name', None ):
@@ -115,8 +151,24 @@
@web.expose_api
def delete( self, trans, id, **kwd ):
"""
- DELETE /api/histories/{encoded_history_id}
- Deletes a history
+ delete( self, trans, id, **kwd )
+ * DELETE /api/histories/{id}
+ delete the history with the given ``id``
+ .. note:: Currently does not stop any active jobs in the history.
+
+ :type id: str
+ :param id: the encoded id of the history to delete
+ :type kwd: dict
+ :param kwd: (optional) dictionary structure containing::
+ 'payload': a dictionary itself containing::
+ 'purge': if True, purge the history and all of it's HDAs
+
+ :rtype: dict
+ :returns: an error object if an error occurred or a dictionary containing::
+
+ id: the encoded id of the history,
+ deleted: if the history was marked as deleted,
+ purged: if the history was purged
"""
history_id = id
# a request body is optional here
@@ -175,8 +227,15 @@
@web.expose_api
def undelete( self, trans, id, **kwd ):
"""
- POST /api/histories/deleted/{encoded_history_id}/undelete
- Undeletes a history
+ undelete( self, trans, id, **kwd )
+ * POST /api/histories/deleted/{id}/undelete:
+ undelete history (that hasn't been purged) with the given ``id``
+
+ :type id: str
+ :param id: the encoded id of the history to undelete
+
+ :rtype: str
+ :returns: 'OK' if the history was undeleted
"""
history_id = id
history = self.get_history( trans, history_id, check_ownership=True, check_accessible=False, deleted=True )
@@ -188,8 +247,21 @@
@web.expose_api
def update( self, trans, id, payload, **kwd ):
"""
- PUT /api/histories/{encoded_history_id}
- Changes an existing history.
+ update( self, trans, id, payload, **kwd )
+ * PUT /api/histories/{id}
+ updates the values for the history with the given ``id``
+
+ :type id: str
+ :param id: the encoded id of the history to undelete
+ :type payload: dict
+ :param payload: a dictionary containing any or all the
+ fields in :func:`galaxy.model.History.get_api_value` and/or the following::
+
+ 'annotation': an annotation for the history
+
+ :rtype: dict
+ :returns: an error object if an error occurred or a dictionary containing
+ any values that were different from the original and, therefore, updated
"""
#TODO: PUT /api/histories/{encoded_history_id} payload = { rating: rating } (w/ no security checks)
try:
@@ -255,6 +327,7 @@
raise ValueError( 'annotation must be a string or unicode: %s' %( str( type( val ) ) ) )
validated_payload[ 'annotation' ] = sanitize_html( val, 'utf-8' )
elif key not in valid_but_uneditable_keys:
- raise AttributeError( 'unknown key: %s' %( str( key ) ) )
+ pass
+ #log.warn( 'unknown key: %s', str( key ) )
return validated_payload
diff -r edef166c163f30175e98ddb0b98f7993d7d4d5eb -r fe5867b89ec01bfde18591df8809526d85fb821e lib/galaxy/webapps/galaxy/api/history_contents.py
--- a/lib/galaxy/webapps/galaxy/api/history_contents.py
+++ b/lib/galaxy/webapps/galaxy/api/history_contents.py
@@ -15,21 +15,31 @@
@web.expose_api_anonymous
def index( self, trans, history_id, ids=None, **kwd ):
"""
- GET /api/histories/{encoded_history_id}/contents
- Displays a collection (list) of history contents (HDAs)
+ index( self, trans, history_id, ids=None, **kwd )
+ * GET /api/histories/{history_id}/contents
+ return a list of HDA data for the history with the given ``id``
- :param history_id: an encoded id string of the `History` to search
- :param ids: (optional) a comma separated list of encoded `HDA` ids
+ :type history_id: str
+ :param history_id: encoded id string of the HDA's History
+ :type ids: str
+ :param ids: (optional) a comma separated list of encoded `HDA` ids
- If Ids is not given, index returns a list of *summary* json objects for
- every `HDA` associated with the given `history_id`.
- See _summary_hda_dict.
+ If Ids is not given, index returns a list of *summary* objects for
+ every HDA associated with the given `history_id`.
+
+ .. seealso::
+ :func:`_summary_hda_dict`
If ids is given, index returns a *more complete* json object for each
HDA in the ids list.
- Note: Anonymous users are allowed to get their current history contents
- (generally useful for browser UI access of the api)
+ .. seealso::
+ :func:`galaxy.web.base.controller.UsesHistoryDatasetAssociationMixin.get_hda_dict`
+
+ .. note:: Anonymous users are allowed to get their current history contents
+
+ :rtype: list
+ :returns: dictionaries containing summary or detailed HDA information
"""
rval = []
try:
@@ -78,13 +88,13 @@
#TODO: move to model or Mixin
def _summary_hda_dict( self, trans, history_id, hda ):
"""
- Returns a dictionary based on the HDA in .. _summary form::
- {
- 'id' : < the encoded dataset id >,
- 'name' : < currently only returns 'file' >,
- 'type' : < name of the dataset >,
- 'url' : < api url to retrieve this datasets full data >,
- }
+ Returns a dictionary based on the HDA in summary form::
+ {
+ 'id' : < the encoded dataset id >,
+ 'name' : < currently only returns 'file' >,
+ 'type' : < name of the dataset >,
+ 'url' : < api url to retrieve this datasets full data >,
+ }
"""
api_type = "file"
encoded_id = trans.security.encode_id( hda.id )
@@ -98,8 +108,21 @@
@web.expose_api_anonymous
def show( self, trans, id, history_id, **kwd ):
"""
- GET /api/histories/{encoded_history_id}/contents/{encoded_content_id}
- Displays information about a history content (dataset).
+ show( self, trans, id, history_id, **kwd )
+ * GET /api/histories/{history_id}/contents/{id}
+ return detailed information about an HDA within a history
+
+ :type id: str
+ :param ids: the encoded id of the HDA to return
+ :type history_id: str
+ :param history_id: encoded id string of the HDA's History
+
+ .. seealso:: :func:`galaxy.web.base.controller.UsesHistoryDatasetAssociationMixin.get_hda_dict`
+
+ .. note:: Anonymous users are allowed to get their current history contents
+
+ :rtype: dict
+ :returns: dictionary containing detailed HDA information
"""
hda_dict = {}
try:
@@ -135,8 +158,18 @@
@web.expose_api
def create( self, trans, history_id, payload, **kwd ):
"""
- POST /api/histories/{encoded_history_id}/contents
- Creates a new history content item (file, aka HistoryDatasetAssociation).
+ create( self, trans, history_id, payload, **kwd )
+ * POST /api/histories/{history_id}/contents
+ create a new HDA by copying an accessible LibraryDataset
+
+ :type history_id: str
+ :param history_id: encoded id string of the new HDA's History
+ :type payload: dict
+ :param payload: dictionary structure containing::
+ 'from_ld_id': the encoded id of the LibraryDataset to copy
+
+ :rtype: dict
+ :returns: dictionary containing detailed information for the new HDA
"""
#TODO: copy existing, accessible hda - dataset controller, copy_datasets
#TODO: convert existing, accessible hda - model.DatasetInstance(or hda.datatype).get_converter_types
@@ -173,8 +206,24 @@
@web.expose_api
def update( self, trans, history_id, id, payload, **kwd ):
"""
- PUT /api/histories/{encoded_history_id}/contents/{encoded_content_id}
- Changes an existing history dataset.
+ update( self, trans, history_id, id, payload, **kwd )
+ * PUT /api/histories/{history_id}/contents/{id}
+ updates the values for the HDA with the given ``id``
+
+ :type history_id: str
+ :param history_id: encoded id string of the HDA's History
+ :type id: str
+ :param id: the encoded id of the history to undelete
+ :type payload: dict
+ :param payload: a dictionary containing any or all the
+ fields in :func:`galaxy.model.HistoryDatasetAssociation.get_api_value`
+ and/or the following::
+
+ 'annotation': an annotation for the history
+
+ :rtype: dict
+ :returns: an error object if an error occurred or a dictionary containing
+ any values that were different from the original and, therefore, updated
"""
#TODO: PUT /api/histories/{encoded_history_id} payload = { rating: rating } (w/ no security checks)
changed = {}
@@ -251,6 +300,7 @@
raise ValueError( 'misc_info must be a string or unicode: %s' %( str( type( val ) ) ) )
validated_payload[ 'info' ] = util.sanitize_html.sanitize_html( val, 'utf-8' )
elif key not in valid_but_uneditable_keys:
- raise AttributeError( 'unknown key: %s' %( str( key ) ) )
+ pass
+ #log.warn( 'unknown key: %s', str( key ) )
return validated_payload
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: carlfeberhard: Unit tests: add base dataprovider unit tests
by commits-noreply@bitbucket.org 31 Jul '13
by commits-noreply@bitbucket.org 31 Jul '13
31 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/edef166c163f/
Changeset: edef166c163f
User: carlfeberhard
Date: 2013-07-31 20:07:01
Summary: Unit tests: add base dataprovider unit tests
Affected #: 6 files
diff -r 4b5f8a81adf16369d828aa82fe82f8141772c1d3 -r edef166c163f30175e98ddb0b98f7993d7d4d5eb .hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -85,6 +85,7 @@
.coverage
htmlcov
run_unit_tests.html
+test/unit/**.log
# Project files
*.kpf
diff -r 4b5f8a81adf16369d828aa82fe82f8141772c1d3 -r edef166c163f30175e98ddb0b98f7993d7d4d5eb test/unit/datatypes/dataproviders/tempfilecache.py
--- /dev/null
+++ b/test/unit/datatypes/dataproviders/tempfilecache.py
@@ -0,0 +1,47 @@
+
+import os
+import tempfile
+
+import logging
+logging.getLogger( __name__ )
+log = logging
+
+class TempFileCache( object ):
+ """
+ Creates and caches tempfiles with/based-on the given contents.
+ """
+ def __init__( self, logger=None ):
+ if logger:
+ global log
+ log = logger
+ super( TempFileCache, self ).__init__()
+ self.clear()
+
+ def clear( self ):
+ self.delete_tmpfiles()
+ self._content_dict = {}
+
+ def create_tmpfile( self, contents ):
+ if not hasattr( self, '_content_dict' ):
+ self.set_up_tmpfiles()
+
+ if contents not in self._content_dict:
+ # create a named tmp and write contents to it, return filename
+ tmpfile = tempfile.NamedTemporaryFile( delete=False )
+ tmpfile.write( contents )
+ tmpfile.close()
+ log.debug( 'created tmpfile.name: %s', tmpfile.name )
+ self._content_dict[ contents ] = tmpfile.name
+
+ else:
+ log.debug( '(cached): %s', self._content_dict[ contents ] )
+ return self._content_dict[ contents ]
+
+ def delete_tmpfiles( self ):
+ if not hasattr( self, '_content_dict' ) or not self._content_dict:
+ return
+ for tmpfile_contents in self._content_dict:
+ tmpfile = self._content_dict[ tmpfile_contents ]
+ if os.path.exists( tmpfile ):
+ log.debug( 'unlinking tmpfile: %s', tmpfile )
+ os.unlink( tmpfile )
diff -r 4b5f8a81adf16369d828aa82fe82f8141772c1d3 -r edef166c163f30175e98ddb0b98f7993d7d4d5eb test/unit/datatypes/dataproviders/test_base_dataproviders.py
--- /dev/null
+++ b/test/unit/datatypes/dataproviders/test_base_dataproviders.py
@@ -0,0 +1,370 @@
+"""
+Unit tests for base DataProviders.
+.. seealso:: galaxy.datatypes.dataproviders.base
+"""
+# currently because of dataproviders.dataset importing galaxy.model this doesn't work
+#TODO: fix imports there after dist and retry
+
+#TODO: fix off by ones in FilteredDataProvider counters
+
+import unittest
+import StringIO
+
+import tempfilecache
+import utility
+
+log = utility.set_up_filelogger( __name__ + '.log' )
+
+utility.add_galaxy_lib_to_path( '/test/unit/datatypes/dataproviders' )
+from galaxy.datatypes import dataproviders
+
+
+class BaseTestCase( unittest.TestCase ):
+ default_file_contents = """
+ One
+ Two
+ Three
+ """
+
+ @classmethod
+ def setUpClass( cls ):
+ log.debug( 'CLASS %s %s', ( '_' * 40 ), cls.__name__ )
+
+ @classmethod
+ def tearDownClass( cls ):
+ log.debug( 'CLASS %s %s\n\n', ( '_' * 40 ), cls.__name__ )
+
+ def __init__( self, *args ):
+ unittest.TestCase.__init__( self, *args )
+ self.tmpfiles = tempfilecache.TempFileCache( log )
+
+ def setUp( self ):
+ log.debug( 'BEGIN %s %s', ( '.' * 40 ), self._testMethodName )
+ if self._testMethodDoc:
+ log.debug( ' """%s"""', self._testMethodDoc.strip() )
+
+ def tearDown( self ):
+ self.tmpfiles.clear()
+ log.debug( 'END\n' )
+
+ def format_tmpfile_contents( self, contents=None ):
+ contents = contents or self.default_file_contents
+ contents = utility.clean_multiline_string( contents )
+ log.debug( 'file contents:\n%s', contents )
+ return contents
+
+
+class Test_BaseDataProvider( BaseTestCase ):
+ provider_class = dataproviders.base.DataProvider
+
+ def contents_provider_and_data( self,
+ filename=None, contents=None, source=None, *provider_args, **provider_kwargs ):
+ # to remove boiler plate
+ # returns file content string, provider used, and data list
+ if not filename:
+ contents = self.format_tmpfile_contents( contents )
+ filename = self.tmpfiles.create_tmpfile( contents )
+ #TODO: if filename, contents == None
+ if not source:
+ source = open( filename )
+ provider = self.provider_class( source, *provider_args, **provider_kwargs )
+ log.debug( 'provider: %s', provider )
+ data = list( provider )
+ log.debug( 'data: %s', str( data ) )
+ return ( contents, provider, data )
+
+ def test_iterators( self ):
+ source = ( x for x in xrange( 1, 10 ) )
+ provider = self.provider_class( source )
+ data = list( provider )
+ log.debug( 'data: %s', str( data ) )
+ self.assertEqual( data, [ x for x in xrange( 1, 10 ) ] )
+
+ source = [ x for x in xrange( 1, 10 ) ]
+ provider = self.provider_class( source )
+ data = list( provider )
+ log.debug( 'data: %s', str( data ) )
+ self.assertEqual( data, [ x for x in xrange( 1, 10 ) ] )
+
+ source = ( x for x in xrange( 1, 10 ) )
+ provider = self.provider_class( source )
+ data = list( provider )
+ log.debug( 'data: %s', str( data ) )
+ self.assertEqual( data, [ x for x in xrange( 1, 10 ) ] )
+
+ def test_validate_source( self ):
+ """validate_source should throw an error if the source doesn't have attr '__iter__'
+ """
+ def non_iterator_dprov( source ):
+ return self.provider_class( source )
+ self.assertRaises( dataproviders.exceptions.InvalidDataProviderSource,
+ non_iterator_dprov, 'one two three' )
+ self.assertRaises( dataproviders.exceptions.InvalidDataProviderSource,
+ non_iterator_dprov, 40 )
+
+ def test_writemethods( self ):
+ """should throw an error if any write methods are called
+ """
+ source = ( x for x in xrange( 1, 10 ) )
+ provider = self.provider_class( source )
+ # should throw error
+ def call_method( provider, method_name, *args ):
+ method = getattr( provider, method_name )
+ return method( *args )
+ self.assertRaises( NotImplementedError, call_method, provider, 'truncate', 20 )
+ self.assertRaises( NotImplementedError, call_method, provider, 'write', 'bler' )
+ self.assertRaises( NotImplementedError, call_method, provider, 'writelines', [ 'one', 'two' ] )
+
+ def test_readlines( self ):
+ """readlines should return all the data in list form
+ """
+ source = ( x for x in xrange( 1, 10 ) )
+ provider = self.provider_class( source )
+ data = provider.readlines()
+ log.debug( 'data: %s', str( data ) )
+ self.assertEqual( data, [ x for x in xrange( 1, 10 ) ] )
+
+ def test_stringio( self ):
+ """should work with StringIO
+ """
+ contents = utility.clean_multiline_string( """
+ One
+ Two
+ Three
+ """ )
+ source = StringIO.StringIO( contents )
+ provider = self.provider_class( source )
+ data = list( provider )
+ log.debug( 'data: %s', str( data ) )
+ # provider should call close on file
+ self.assertEqual( ''.join( data ), contents )
+ self.assertTrue( source.closed )
+
+ def test_file( self ):
+ """should work with files
+ """
+ ( contents, provider, data ) = self.contents_provider_and_data()
+ self.assertEqual( ''.join( data ), contents )
+ # provider should call close on file
+ self.assertTrue( isinstance( provider.source, file ) )
+ self.assertTrue( provider.source.closed )
+
+
+class Test_FilteredDataProvider( Test_BaseDataProvider ):
+ provider_class = dataproviders.base.FilteredDataProvider
+
+ def assertCounters( self, provider, read, valid, returned ):
+ self.assertEqual( provider.num_data_read, read )
+ self.assertEqual( provider.num_valid_data_read, valid )
+ self.assertEqual( provider.num_data_returned, returned )
+
+ def test_counters( self ):
+ """should count: lines read, lines that passed the filter, lines returned
+ """
+ ( contents, provider, data ) = self.contents_provider_and_data()
+ self.assertCounters( provider, 3, 3, 3 )
+
+ def test_filter_fn( self ):
+ """should filter out lines using filter_fn and set counters properly
+ based on filter
+ """
+ def filter_ts( string ):
+ if string.lower().startswith( 't' ):
+ return None
+ return string
+ ( contents, provider, data ) = self.contents_provider_and_data( filter_fn=filter_ts )
+ self.assertCounters( provider, 3, 1, 1 )
+
+
+class Test_LimitedOffsetDataProvider( Test_FilteredDataProvider ):
+ provider_class = dataproviders.base.LimitedOffsetDataProvider
+
+ def test_offset_1( self ):
+ """when offset is 1, should skip first
+ """
+ ( contents, provider, data ) = self.contents_provider_and_data( offset=1 )
+ self.assertEqual( data, [ 'Two\n', 'Three\n' ] )
+ self.assertCounters( provider, 3, 3, 2 )
+
+ def test_offset_all( self ):
+ """when offset >= num lines, should return empty list
+ """
+ ( contents, provider, data ) = self.contents_provider_and_data( offset=4 )
+ self.assertEqual( data, [] )
+ self.assertCounters( provider, 3, 3, 0 )
+
+ def test_offset_none( self ):
+ """when offset is 0, should return all
+ """
+ ( contents, provider, data ) = self.contents_provider_and_data( offset=0 )
+ self.assertEqual( ''.join( data ), contents )
+ self.assertCounters( provider, 3, 3, 3 )
+
+ def test_offset_negative( self ):
+ """when offset is negative, should return all
+ """
+ ( contents, provider, data ) = self.contents_provider_and_data( offset=-1 )
+ self.assertEqual( ''.join( data ), contents )
+ self.assertCounters( provider, 3, 3, 3 )
+
+ def test_limit_1( self ):
+ """when limit is one, should return first
+ """
+ ( contents, provider, data ) = self.contents_provider_and_data( limit=1 )
+ self.assertEqual( data, [ 'One\n' ] )
+ #TODO: currently reads 2 in all counters before ending
+ #self.assertCounters( provider, 1, 1, 1 )
+
+ def test_limit_all( self ):
+ """when limit >= num lines, should return all
+ """
+ ( contents, provider, data ) = self.contents_provider_and_data( limit=4 )
+ self.assertEqual( ''.join( data ), contents )
+ self.assertCounters( provider, 3, 3, 3 )
+
+ def test_limit_zero( self ):
+ """when limit >= num lines, should return empty list
+ """
+ ( contents, provider, data ) = self.contents_provider_and_data( limit=0 )
+ self.assertEqual( data, [] )
+ #TODO: currently reads 1 before ending
+ self.assertCounters( provider, 3, 0, 0 )
+
+ def test_limit_zero( self ):
+ """when limit is None, should return all
+ """
+ ( contents, provider, data ) = self.contents_provider_and_data( limit=None )
+ self.assertEqual( ''.join( data ), contents )
+ self.assertCounters( provider, 3, 3, 3 )
+
+ #TODO: somehow re-use tmpfile here
+ def test_limit_with_offset( self ):
+ def limit_offset_combo( limit, offset, data_should_be, read, valid, returned ):
+ ( contents, provider, data ) = self.contents_provider_and_data( limit=limit, offset=offset )
+ self.assertEqual( data, data_should_be )
+ #self.assertCounters( provider, read, valid, returned )
+ test_data = [
+ ( 0, 0, [], 0, 0, 0 ),
+ ( 1, 0, [ 'One\n' ], 1, 1, 1 ),
+ ( 2, 0, [ 'One\n', 'Two\n' ], 2, 2, 2 ),
+ ( 3, 0, [ 'One\n', 'Two\n', 'Three\n' ], 3, 3, 3 ),
+ ( 1, 1, [ 'Two\n' ], 1, 1, 1 ),
+ ( 2, 1, [ 'Two\n', 'Three\n' ], 2, 2, 2 ),
+ ( 3, 1, [ 'Two\n', 'Three\n' ], 2, 2, 2 ),
+ ( 1, 2, [ 'Three\n' ], 1, 1, 1 ),
+ ( 2, 2, [ 'Three\n' ], 1, 1, 1 ),
+ ( 3, 2, [ 'Three\n' ], 1, 1, 1 ),
+ ]
+ for test in test_data:
+ log.debug( 'limit_offset_combo: %s', ', '.join([ str( e ) for e in test ]) )
+ limit_offset_combo( *test )
+
+ def test_limit_with_offset_and_filter( self ):
+ def limit_offset_combo( limit, offset, data_should_be, read, valid, returned ):
+ def only_ts( string ):
+ if not string.lower().startswith( 't' ):
+ return None
+ return string
+ ( contents, provider, data ) = self.contents_provider_and_data(
+ limit=limit, offset=offset, filter_fn=only_ts )
+ self.assertEqual( data, data_should_be )
+ #self.assertCounters( provider, read, valid, returned )
+ test_data = [
+ ( 0, 0, [], 0, 0, 0 ),
+ ( 1, 0, [ 'Two\n' ], 1, 1, 1 ),
+ ( 2, 0, [ 'Two\n', 'Three\n' ], 2, 2, 2 ),
+ ( 3, 0, [ 'Two\n', 'Three\n' ], 2, 2, 2 ),
+ ( 1, 1, [ 'Three\n' ], 1, 1, 1 ),
+ ( 2, 1, [ 'Three\n' ], 1, 1, 1 ),
+ ( 1, 2, [], 0, 0, 0 ),
+ ]
+ for test in test_data:
+ log.debug( 'limit_offset_combo: %s', ', '.join([ str( e ) for e in test ]) )
+ limit_offset_combo( *test )
+
+
+class Test_MultiSourceDataProvider( BaseTestCase ):
+ provider_class = dataproviders.base.MultiSourceDataProvider
+
+ def contents_and_tmpfile( self, contents=None ):
+ #TODO: hmmmm...
+ contents = contents or self.default_file_contents
+ contents = utility.clean_multiline_string( contents )
+ return ( contents, self.tmpfiles.create_tmpfile( contents ) )
+
+ def test_multiple_sources( self ):
+ # clean the following contents, write them to tmpfiles, open them,
+ # and pass as a list to the provider
+ contents = [
+ """
+ One
+ Two
+ Three
+ Four
+ Five
+ """,
+ """
+ Six
+ Seven
+ Eight
+ Nine
+ Ten
+ """,
+ """
+ Eleven
+ Twelve! (<-- http://youtu.be/JZshZp-cxKg)
+ """
+ ]
+ contents = [ utility.clean_multiline_string( c ) for c in contents ]
+ source_list = [ open( self.tmpfiles.create_tmpfile( c ) ) for c in contents ]
+
+ provider = self.provider_class( source_list )
+ log.debug( 'provider: %s', provider )
+ data = list( provider )
+ log.debug( 'data: %s', str( data ) )
+ self.assertEqual( ''.join( data ), ''.join( contents) )
+
+ def test_multiple_compound_sources( self ):
+ # clean the following contents, write them to tmpfiles, open them,
+ # and pass as a list to the provider
+ contents = [
+ """
+ One
+ Two
+ Three
+ Four
+ Five
+ """,
+ """
+ Six
+ Seven
+ Eight
+ Nine
+ Ten
+ """,
+ """
+ Eleven
+ Twelve! (<-- http://youtu.be/JZshZp-cxKg)
+ """
+ ]
+ contents = [ utility.clean_multiline_string( c ) for c in contents ]
+ source_list = [ open( self.tmpfiles.create_tmpfile( c ) ) for c in contents ]
+
+ def no_Fs( string ):
+ return None if string.startswith( 'F' ) else string
+ def no_youtube( string ):
+ return None if ( 'youtu.be' in string ) else string
+ source_list = [
+ dataproviders.base.LimitedOffsetDataProvider( source_list[0], filter_fn=no_Fs, limit=2, offset=1 ),
+ dataproviders.base.LimitedOffsetDataProvider( source_list[1], limit=1, offset=3 ),
+ dataproviders.base.FilteredDataProvider( source_list[2], filter_fn=no_youtube ),
+ ]
+ provider = self.provider_class( source_list )
+ log.debug( 'provider: %s', provider )
+ data = list( provider )
+ log.debug( 'data: %s', str( data ) )
+ self.assertEqual( ''.join( data ), 'Two\nThree\nNine\nEleven\n' )
+
+
+if __name__ == '__main__':
+ unittest.main()
diff -r 4b5f8a81adf16369d828aa82fe82f8141772c1d3 -r edef166c163f30175e98ddb0b98f7993d7d4d5eb test/unit/datatypes/dataproviders/utility.py
--- /dev/null
+++ b/test/unit/datatypes/dataproviders/utility.py
@@ -0,0 +1,45 @@
+"""
+Unit test utilities.
+"""
+
+import os
+import sys
+import logging
+import textwrap
+
+def set_up_filelogger( logname, level=logging.DEBUG ):
+ """
+ Sets up logging to a file named `logname`
+ (removing it first if it already exists).
+
+ Usable with 'nosetests' to get logging msgs from failed tests
+ (no logfile created).
+ Usable with 'nosetests --nologcapture' to get logging msgs for all tests
+ (in logfile).
+ """
+ if os.path.exists( logname ): os.unlink( logname )
+ logging.basicConfig( filename=logname, level=logging.DEBUG )
+ return logging
+
+def add_galaxy_lib_to_path( this_dir_relative_to_root ):
+ """
+ Adds `<galaxy>/lib` to `sys.path` given the scripts directory relative
+ to `<galaxy>`.
+ .. example::
+ utility.add_galaxy_lib_to_path( '/test/unit/datatypes/dataproviders' )
+ """
+ glx_lib = os.path.join( os.getcwd().replace( this_dir_relative_to_root, '' ), 'lib' )
+ sys.path.append( glx_lib )
+
+def clean_multiline_string( multiline_string, sep='\n' ):
+ """
+ Dedent, split, remove first and last empty lines, rejoin.
+ """
+ multiline_string = textwrap.dedent( multiline_string )
+ string_list = multiline_string.split( sep )
+ if not string_list[0]:
+ string_list = string_list[1:]
+ if not string_list[-1]:
+ string_list = string_list[:-1]
+ #return '\n'.join( docstrings )
+ return ''.join([ ( s + '\n' ) for s in string_list ])
diff -r 4b5f8a81adf16369d828aa82fe82f8141772c1d3 -r edef166c163f30175e98ddb0b98f7993d7d4d5eb test/unit/test_dataproviders.pyc
Binary file test/unit/test_dataproviders.pyc has changed
diff -r 4b5f8a81adf16369d828aa82fe82f8141772c1d3 -r edef166c163f30175e98ddb0b98f7993d7d4d5eb test/unit/test_tool_loader.pyc
Binary file test/unit/test_tool_loader.pyc has changed
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: jgoecks: Automated merge of next-stable
by commits-noreply@bitbucket.org 31 Jul '13
by commits-noreply@bitbucket.org 31 Jul '13
31 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/4b5f8a81adf1/
Changeset: 4b5f8a81adf1
User: jgoecks
Date: 2013-07-31 19:00:52
Summary: Automated merge of next-stable
Affected #: 3 files
diff -r f2e03734f86bc6bec204cee0c9b53aac8b20ba4a -r 4b5f8a81adf16369d828aa82fe82f8141772c1d3 static/scripts/galaxy.pages.js
--- a/static/scripts/galaxy.pages.js
+++ b/static/scripts/galaxy.pages.js
@@ -164,18 +164,19 @@
{
"Make link": function() {
// Get URL, name/title.
- var sUrl = $(wym._options.hrefSelector).val(),
- sName = $(".wym_title").val();
+ var sUrl = $(wym._options.hrefSelector).val() || '',
+ sId = $(".wym_id").val() || '',
+ sName = $(wym._options.titleSelector).val() || '';
- if (sUrl && sName) {
+ if (sUrl || sId) {
// Create link.
wym._exec(WYMeditor.CREATE_LINK, sStamp);
// Set link attributes.
var link = $("a[href=" + sStamp + "]", wym._doc.body);
link.attr(WYMeditor.HREF, sUrl)
- .attr(WYMeditor.TITLE, $(wym._options.titleSelector).val())
- .attr("id", sName);
+ .attr(WYMeditor.TITLE, sName)
+ .attr("id", sId);
// If link's text is default (wym-...), change it to the title.
if (link.text().indexOf('wym-') === 0) {
diff -r f2e03734f86bc6bec204cee0c9b53aac8b20ba4a -r 4b5f8a81adf16369d828aa82fe82f8141772c1d3 static/scripts/packed/galaxy.pages.js
--- a/static/scripts/packed/galaxy.pages.js
+++ b/static/scripts/packed/galaxy.pages.js
@@ -1,1 +1,1 @@
-var Galaxy={ITEM_HISTORY:"item_history",ITEM_DATASET:"item_dataset",ITEM_WORKFLOW:"item_workflow",ITEM_PAGE:"item_page",ITEM_VISUALIZATION:"item_visualization",DIALOG_HISTORY_LINK:"link_history",DIALOG_DATASET_LINK:"link_dataset",DIALOG_WORKFLOW_LINK:"link_workflow",DIALOG_PAGE_LINK:"link_page",DIALOG_VISUALIZATION_LINK:"link_visualization",DIALOG_EMBED_HISTORY:"embed_history",DIALOG_EMBED_DATASET:"embed_dataset",DIALOG_EMBED_WORKFLOW:"embed_workflow",DIALOG_EMBED_PAGE:"embed_page",DIALOG_EMBED_VISUALIZATION:"embed_visualization",DIALOG_HISTORY_ANNOTATE:"history_annotate",};function init_galaxy_elts(a){$(".annotation",a._doc.body).each(function(){$(this).click(function(){var b=a._doc.createRange();b.selectNodeContents(this);var d=window.getSelection();d.removeAllRanges();d.addRange(b);var c=""})})}function get_item_info(d){var f,c,b;switch(d){case (Galaxy.ITEM_HISTORY):f="History";c="Histories";b="history";item_class="History";break;case (Galaxy.ITEM_DATASET):f="Dataset";c="Datasets";b="dataset";item_class="HistoryDatasetAssociation";break;case (Galaxy.ITEM_WORKFLOW):f="Workflow";c="Workflows";b="workflow";item_class="StoredWorkflow";break;case (Galaxy.ITEM_PAGE):f="Page";c="Pages";b="page";item_class="Page";break;case (Galaxy.ITEM_VISUALIZATION):f="Visualization";c="Visualizations";b="visualization";item_class="Visualization";break}var e="list_"+c.toLowerCase()+"_for_selection";var a=list_objects_url.replace("LIST_ACTION",e);return{singular:f,plural:c,controller:b,iclass:item_class,list_ajax_url:a}}function make_item_importable(a,c,b){ajax_url=set_accessible_url.replace("ITEM_CONTROLLER",a);$.ajax({type:"POST",url:ajax_url,data:{id:c,accessible:"True"},error:function(){alert("Making "+b+" accessible failed")}})}WYMeditor.editor.prototype.dialog=function(i,e,g){var a=this;var b=a.uniqueStamp();var f=a.selected();function h(){$("#set_link_id").click(function(){$("#link_attribute_label").text("ID/Name");var k=$(".wym_href");k.addClass("wym_id").removeClass("wym_href");if(f){k.val($(f).attr("id"))}$(this).remove()})}if(i==WYMeditor.DIALOG_LINK){if(f){$(a._options.hrefSelector).val($(f).attr(WYMeditor.HREF));$(a._options.srcSelector).val($(f).attr(WYMeditor.SRC));$(a._options.titleSelector).val($(f).attr(WYMeditor.TITLE));$(a._options.altSelector).val($(f).attr(WYMeditor.ALT))}var c,d;if(f){c=$(f).attr("href");if(c==undefined){c=""}d=$(f).attr("title");if(d==undefined){d=""}}show_modal("Create Link","<div><div><label id='link_attribute_label'>URL <span style='float: right; font-size: 90%'><a href='#' id='set_link_id'>Create in-page anchor</a></span></label><br><input type='text' class='wym_href' value='"+c+"' size='40' /></div><div><label>Title</label><br><input type='text' class='wym_title' value='"+d+"' size='40' /></div><div>",{"Make link":function(){var l=$(a._options.hrefSelector).val(),m=$(".wym_title").val();if(l&&m){a._exec(WYMeditor.CREATE_LINK,b);var k=$("a[href="+b+"]",a._doc.body);k.attr(WYMeditor.HREF,l).attr(WYMeditor.TITLE,$(a._options.titleSelector).val()).attr("id",m);if(k.text().indexOf("wym-")===0){k.text(m)}}hide_modal()},Cancel:function(){hide_modal()}},{},h)}if(i==WYMeditor.DIALOG_IMAGE){if(a._selected_image){$(a._options.dialogImageSelector+" "+a._options.srcSelector).val($(a._selected_image).attr(WYMeditor.SRC));$(a._options.dialogImageSelector+" "+a._options.titleSelector).val($(a._selected_image).attr(WYMeditor.TITLE));$(a._options.dialogImageSelector+" "+a._options.altSelector).val($(a._selected_image).attr(WYMeditor.ALT))}show_modal("Image","<div class='row'><label>URL</label><br><input type='text' class='wym_src' value='' size='40' /></div><div class='row'><label>Alt text</label><br><input type='text' class='wym_alt' value='' size='40' /></div><div class='row'><label>Title</label><br><input type='text' class='wym_title' value='' size='40' /></div>",{Insert:function(){var k=$(a._options.srcSelector).val();if(k.length>0){a._exec(WYMeditor.INSERT_IMAGE,b);$("img[src$="+b+"]",a._doc.body).attr(WYMeditor.SRC,k).attr(WYMeditor.TITLE,$(a._options.titleSelector).val()).attr(WYMeditor.ALT,$(a._options.altSelector).val())}hide_modal()},Cancel:function(){hide_modal()}});return}if(i==WYMeditor.DIALOG_TABLE){show_modal("Table","<div class='row'><label>Caption</label><br><input type='text' class='wym_caption' value='' size='40' /></div><div class='row'><label>Summary</label><br><input type='text' class='wym_summary' value='' size='40' /></div><div class='row'><label>Number Of Rows<br></label><input type='text' class='wym_rows' value='3' size='3' /></div><div class='row'><label>Number Of Cols<br></label><input type='text' class='wym_cols' value='2' size='3' /></div>",{Insert:function(){var o=$(a._options.rowsSelector).val();var r=$(a._options.colsSelector).val();if(o>0&&r>0){var n=a._doc.createElement(WYMeditor.TABLE);var l=null;var q=null;var k=$(a._options.captionSelector).val();var p=n.createCaption();p.innerHTML=k;for(x=0;x<o;x++){l=n.insertRow(x);for(y=0;y<r;y++){l.insertCell(y)}}$(n).attr("summary",$(a._options.summarySelector).val());var m=$(a.findUp(a.container(),WYMeditor.MAIN_CONTAINERS)).get(0);if(!m||!m.parentNode){$(a._doc.body).append(n)}else{$(m).after(n)}}hide_modal()},Cancel:function(){hide_modal()}})}if(i==Galaxy.DIALOG_HISTORY_LINK||i==Galaxy.DIALOG_DATASET_LINK||i==Galaxy.DIALOG_WORKFLOW_LINK||i==Galaxy.DIALOG_PAGE_LINK||i==Galaxy.DIALOG_VISUALIZATION_LINK){var j;switch(i){case (Galaxy.DIALOG_HISTORY_LINK):j=get_item_info(Galaxy.ITEM_HISTORY);break;case (Galaxy.DIALOG_DATASET_LINK):j=get_item_info(Galaxy.ITEM_DATASET);break;case (Galaxy.DIALOG_WORKFLOW_LINK):j=get_item_info(Galaxy.ITEM_WORKFLOW);break;case (Galaxy.DIALOG_PAGE_LINK):j=get_item_info(Galaxy.ITEM_PAGE);break;case (Galaxy.DIALOG_VISUALIZATION_LINK):j=get_item_info(Galaxy.ITEM_VISUALIZATION);break}$.ajax({url:j.list_ajax_url,data:{},error:function(){alert("Failed to list "+j.plural.toLowerCase()+" for selection")},success:function(k){show_modal("Insert Link to "+j.singular,k+"<div><input id='make-importable' type='checkbox' checked/>Make the selected "+j.plural.toLowerCase()+" accessible so that they can viewed by everyone.</div>",{Insert:function(){var m=false;if($("#make-importable:checked").val()!==null){m=true}var l=new Array();$("input[name=id]:checked").each(function(){var n=$(this).val();if(m){make_item_importable(j.controller,n,j.singular)}url_template=get_name_and_link_url+n;ajax_url=url_template.replace("ITEM_CONTROLLER",j.controller);$.getJSON(ajax_url,function(p){a._exec(WYMeditor.CREATE_LINK,b);var o=$("a[href="+b+"]",a._doc.body).text();if(o==""||o==b){a.insert("<a href='"+p.link+"'>"+j.singular+" '"+p.name+"'</a>")}else{$("a[href="+b+"]",a._doc.body).attr(WYMeditor.HREF,p.link).attr(WYMeditor.TITLE,j.singular+n)}})});hide_modal()},Cancel:function(){hide_modal()}})}})}if(i==Galaxy.DIALOG_EMBED_HISTORY||i==Galaxy.DIALOG_EMBED_DATASET||i==Galaxy.DIALOG_EMBED_WORKFLOW||i==Galaxy.DIALOG_EMBED_PAGE||i==Galaxy.DIALOG_EMBED_VISUALIZATION){var j;switch(i){case (Galaxy.DIALOG_EMBED_HISTORY):j=get_item_info(Galaxy.ITEM_HISTORY);break;case (Galaxy.DIALOG_EMBED_DATASET):j=get_item_info(Galaxy.ITEM_DATASET);break;case (Galaxy.DIALOG_EMBED_WORKFLOW):j=get_item_info(Galaxy.ITEM_WORKFLOW);break;case (Galaxy.DIALOG_EMBED_PAGE):j=get_item_info(Galaxy.ITEM_PAGE);break;case (Galaxy.DIALOG_EMBED_VISUALIZATION):j=get_item_info(Galaxy.ITEM_VISUALIZATION);break}$.ajax({url:j.list_ajax_url,data:{},error:function(){alert("Failed to list "+j.plural.toLowerCase()+" for selection")},success:function(k){if(i==Galaxy.DIALOG_EMBED_HISTORY||i==Galaxy.DIALOG_EMBED_WORKFLOW||i==Galaxy.DIALOG_EMBED_VISUALIZATION){k=k+"<div><input id='make-importable' type='checkbox' checked/>Make the selected "+j.plural.toLowerCase()+" accessible so that they can viewed by everyone.</div>"}show_modal("Embed "+j.plural,k,{Embed:function(){var l=false;if($("#make-importable:checked").val()!=null){l=true}$("input[name=id]:checked").each(function(){var m=$(this).val();var p=$("label[for='"+m+"']:first").text();if(l){make_item_importable(j.controller,m,j.singular)}var n=j.iclass+"-"+m;var o="<p><div id='"+n+"' class='embedded-item "+j.singular.toLowerCase()+" placeholder'><p class='title'>Embedded Galaxy "+j.singular+" '"+p+"'</p><p class='content'> [Do not edit this block; Galaxy will fill it in with the annotated "+j.singular.toLowerCase()+" when it is displayed.] </p></div></p>";a.insert(" ");a.insert(o);$("#"+n,a._doc.body).each(function(){var q=true;while(q){var r=$(this).prev();if(r.length!=0&&jQuery.trim(r.text())==""){r.remove()}else{q=false}}})});hide_modal()},Cancel:function(){hide_modal()}})}})}if(i==Galaxy.DIALOG_ANNOTATE_HISTORY){$.ajax({url:list_histories_for_selection_url,data:{},error:function(){alert("Grid refresh failed")},success:function(k){show_modal("Insert Link to History",k,{Annotate:function(){var l=new Array();$("input[name=id]:checked").each(function(){var m=$(this).val();$.ajax({url:get_history_annotation_table_url,data:{id:m},error:function(){alert("Grid refresh failed")},success:function(n){a.insert(n);init_galaxy_elts(a)}})});hide_modal()},Cancel:function(){hide_modal()}})}})}};$(function(){$(document).ajaxError(function(i,g){var h=g.responseText||g.statusText||"Could not connect to server";show_modal("Server error",h,{"Ignore error":hide_modal});return false});$("[name=page_content]").wymeditor({skin:"galaxy",basePath:editor_base_path,iframeBasePath:iframe_base_path,boxHtml:"<table class='wym_box' width='100%' height='100%'><tr><td><div class='wym_area_top'>"+WYMeditor.TOOLS+"</div></td></tr><tr height='100%'><td><div class='wym_area_main' style='height: 100%;'>"+WYMeditor.IFRAME+WYMeditor.STATUS+"</div></div></td></tr></table>",toolsItems:[{name:"Bold",title:"Strong",css:"wym_tools_strong"},{name:"Italic",title:"Emphasis",css:"wym_tools_emphasis"},{name:"Superscript",title:"Superscript",css:"wym_tools_superscript"},{name:"Subscript",title:"Subscript",css:"wym_tools_subscript"},{name:"InsertOrderedList",title:"Ordered_List",css:"wym_tools_ordered_list"},{name:"InsertUnorderedList",title:"Unordered_List",css:"wym_tools_unordered_list"},{name:"Indent",title:"Indent",css:"wym_tools_indent"},{name:"Outdent",title:"Outdent",css:"wym_tools_outdent"},{name:"Undo",title:"Undo",css:"wym_tools_undo"},{name:"Redo",title:"Redo",css:"wym_tools_redo"},{name:"CreateLink",title:"Link",css:"wym_tools_link"},{name:"Unlink",title:"Unlink",css:"wym_tools_unlink"},{name:"InsertImage",title:"Image",css:"wym_tools_image"},{name:"InsertTable",title:"Table",css:"wym_tools_table"},]});var d=$.wymeditors(0);var f=function(g){show_modal("Saving page","progress");$.ajax({url:save_url,type:"POST",data:{id:page_id,content:d.xhtml(),annotations:JSON.stringify(new Object()),_:"true"},success:function(){g()}})};$("#save-button").click(function(){f(function(){hide_modal()})});$("#close-button").click(function(){var h=false;if(h){var g=function(){window.onbeforeunload=undefined;window.document.location=page_list_url};show_modal("Close editor","There are unsaved changes to your page which will be lost.",{Cancel:hide_modal,"Save Changes":function(){f(g)}},{"Don't Save":g})}else{window.document.location=page_list_url}});var a=$("<div class='galaxy-page-editor-button'><a id='insert-galaxy-link' class='action-button popup' href='#'>Paragraph type</a></div>");$(".wym_area_top").append(a);var b={};$.each(d._options.containersItems,function(h,g){var i=g.name;b[g.title.replace("_"," ")]=function(){d.container(i)}});make_popupmenu(a,b);var c=$("<div><a id='insert-galaxy-link' class='action-button popup' href='#'>Insert Link to Galaxy Object</a></div>").addClass("galaxy-page-editor-button");$(".wym_area_top").append(c);make_popupmenu(c,{"Insert History Link":function(){d.dialog(Galaxy.DIALOG_HISTORY_LINK)},"Insert Dataset Link":function(){d.dialog(Galaxy.DIALOG_DATASET_LINK)},"Insert Workflow Link":function(){d.dialog(Galaxy.DIALOG_WORKFLOW_LINK)},"Insert Page Link":function(){d.dialog(Galaxy.DIALOG_PAGE_LINK)},"Insert Visualization Link":function(){d.dialog(Galaxy.DIALOG_VISUALIZATION_LINK)},});var e=$("<div><a id='embed-galaxy-object' class='action-button popup' href='#'>Embed Galaxy Object</a></div>").addClass("galaxy-page-editor-button");$(".wym_area_top").append(e);make_popupmenu(e,{"Embed History":function(){d.dialog(Galaxy.DIALOG_EMBED_HISTORY)},"Embed Dataset":function(){d.dialog(Galaxy.DIALOG_EMBED_DATASET)},"Embed Workflow":function(){d.dialog(Galaxy.DIALOG_EMBED_WORKFLOW)},"Embed Visualization":function(){d.dialog(Galaxy.DIALOG_EMBED_VISUALIZATION)},})});
\ No newline at end of file
+var Galaxy={ITEM_HISTORY:"item_history",ITEM_DATASET:"item_dataset",ITEM_WORKFLOW:"item_workflow",ITEM_PAGE:"item_page",ITEM_VISUALIZATION:"item_visualization",DIALOG_HISTORY_LINK:"link_history",DIALOG_DATASET_LINK:"link_dataset",DIALOG_WORKFLOW_LINK:"link_workflow",DIALOG_PAGE_LINK:"link_page",DIALOG_VISUALIZATION_LINK:"link_visualization",DIALOG_EMBED_HISTORY:"embed_history",DIALOG_EMBED_DATASET:"embed_dataset",DIALOG_EMBED_WORKFLOW:"embed_workflow",DIALOG_EMBED_PAGE:"embed_page",DIALOG_EMBED_VISUALIZATION:"embed_visualization",DIALOG_HISTORY_ANNOTATE:"history_annotate",};function init_galaxy_elts(a){$(".annotation",a._doc.body).each(function(){$(this).click(function(){var b=a._doc.createRange();b.selectNodeContents(this);var d=window.getSelection();d.removeAllRanges();d.addRange(b);var c=""})})}function get_item_info(d){var f,c,b;switch(d){case (Galaxy.ITEM_HISTORY):f="History";c="Histories";b="history";item_class="History";break;case (Galaxy.ITEM_DATASET):f="Dataset";c="Datasets";b="dataset";item_class="HistoryDatasetAssociation";break;case (Galaxy.ITEM_WORKFLOW):f="Workflow";c="Workflows";b="workflow";item_class="StoredWorkflow";break;case (Galaxy.ITEM_PAGE):f="Page";c="Pages";b="page";item_class="Page";break;case (Galaxy.ITEM_VISUALIZATION):f="Visualization";c="Visualizations";b="visualization";item_class="Visualization";break}var e="list_"+c.toLowerCase()+"_for_selection";var a=list_objects_url.replace("LIST_ACTION",e);return{singular:f,plural:c,controller:b,iclass:item_class,list_ajax_url:a}}function make_item_importable(a,c,b){ajax_url=set_accessible_url.replace("ITEM_CONTROLLER",a);$.ajax({type:"POST",url:ajax_url,data:{id:c,accessible:"True"},error:function(){alert("Making "+b+" accessible failed")}})}WYMeditor.editor.prototype.dialog=function(i,e,g){var a=this;var b=a.uniqueStamp();var f=a.selected();function h(){$("#set_link_id").click(function(){$("#link_attribute_label").text("ID/Name");var k=$(".wym_href");k.addClass("wym_id").removeClass("wym_href");if(f){k.val($(f).attr("id"))}$(this).remove()})}if(i==WYMeditor.DIALOG_LINK){if(f){$(a._options.hrefSelector).val($(f).attr(WYMeditor.HREF));$(a._options.srcSelector).val($(f).attr(WYMeditor.SRC));$(a._options.titleSelector).val($(f).attr(WYMeditor.TITLE));$(a._options.altSelector).val($(f).attr(WYMeditor.ALT))}var c,d;if(f){c=$(f).attr("href");if(c==undefined){c=""}d=$(f).attr("title");if(d==undefined){d=""}}show_modal("Create Link","<div><div><label id='link_attribute_label'>URL <span style='float: right; font-size: 90%'><a href='#' id='set_link_id'>Create in-page anchor</a></span></label><br><input type='text' class='wym_href' value='"+c+"' size='40' /></div><div><label>Title</label><br><input type='text' class='wym_title' value='"+d+"' size='40' /></div><div>",{"Make link":function(){var m=$(a._options.hrefSelector).val()||"",k=$(".wym_id").val()||"",n=$(a._options.titleSelector).val()||"";if(m||k){a._exec(WYMeditor.CREATE_LINK,b);var l=$("a[href="+b+"]",a._doc.body);l.attr(WYMeditor.HREF,m).attr(WYMeditor.TITLE,n).attr("id",k);if(l.text().indexOf("wym-")===0){l.text(n)}}hide_modal()},Cancel:function(){hide_modal()}},{},h)}if(i==WYMeditor.DIALOG_IMAGE){if(a._selected_image){$(a._options.dialogImageSelector+" "+a._options.srcSelector).val($(a._selected_image).attr(WYMeditor.SRC));$(a._options.dialogImageSelector+" "+a._options.titleSelector).val($(a._selected_image).attr(WYMeditor.TITLE));$(a._options.dialogImageSelector+" "+a._options.altSelector).val($(a._selected_image).attr(WYMeditor.ALT))}show_modal("Image","<div class='row'><label>URL</label><br><input type='text' class='wym_src' value='' size='40' /></div><div class='row'><label>Alt text</label><br><input type='text' class='wym_alt' value='' size='40' /></div><div class='row'><label>Title</label><br><input type='text' class='wym_title' value='' size='40' /></div>",{Insert:function(){var k=$(a._options.srcSelector).val();if(k.length>0){a._exec(WYMeditor.INSERT_IMAGE,b);$("img[src$="+b+"]",a._doc.body).attr(WYMeditor.SRC,k).attr(WYMeditor.TITLE,$(a._options.titleSelector).val()).attr(WYMeditor.ALT,$(a._options.altSelector).val())}hide_modal()},Cancel:function(){hide_modal()}});return}if(i==WYMeditor.DIALOG_TABLE){show_modal("Table","<div class='row'><label>Caption</label><br><input type='text' class='wym_caption' value='' size='40' /></div><div class='row'><label>Summary</label><br><input type='text' class='wym_summary' value='' size='40' /></div><div class='row'><label>Number Of Rows<br></label><input type='text' class='wym_rows' value='3' size='3' /></div><div class='row'><label>Number Of Cols<br></label><input type='text' class='wym_cols' value='2' size='3' /></div>",{Insert:function(){var o=$(a._options.rowsSelector).val();var r=$(a._options.colsSelector).val();if(o>0&&r>0){var n=a._doc.createElement(WYMeditor.TABLE);var l=null;var q=null;var k=$(a._options.captionSelector).val();var p=n.createCaption();p.innerHTML=k;for(x=0;x<o;x++){l=n.insertRow(x);for(y=0;y<r;y++){l.insertCell(y)}}$(n).attr("summary",$(a._options.summarySelector).val());var m=$(a.findUp(a.container(),WYMeditor.MAIN_CONTAINERS)).get(0);if(!m||!m.parentNode){$(a._doc.body).append(n)}else{$(m).after(n)}}hide_modal()},Cancel:function(){hide_modal()}})}if(i==Galaxy.DIALOG_HISTORY_LINK||i==Galaxy.DIALOG_DATASET_LINK||i==Galaxy.DIALOG_WORKFLOW_LINK||i==Galaxy.DIALOG_PAGE_LINK||i==Galaxy.DIALOG_VISUALIZATION_LINK){var j;switch(i){case (Galaxy.DIALOG_HISTORY_LINK):j=get_item_info(Galaxy.ITEM_HISTORY);break;case (Galaxy.DIALOG_DATASET_LINK):j=get_item_info(Galaxy.ITEM_DATASET);break;case (Galaxy.DIALOG_WORKFLOW_LINK):j=get_item_info(Galaxy.ITEM_WORKFLOW);break;case (Galaxy.DIALOG_PAGE_LINK):j=get_item_info(Galaxy.ITEM_PAGE);break;case (Galaxy.DIALOG_VISUALIZATION_LINK):j=get_item_info(Galaxy.ITEM_VISUALIZATION);break}$.ajax({url:j.list_ajax_url,data:{},error:function(){alert("Failed to list "+j.plural.toLowerCase()+" for selection")},success:function(k){show_modal("Insert Link to "+j.singular,k+"<div><input id='make-importable' type='checkbox' checked/>Make the selected "+j.plural.toLowerCase()+" accessible so that they can viewed by everyone.</div>",{Insert:function(){var m=false;if($("#make-importable:checked").val()!==null){m=true}var l=new Array();$("input[name=id]:checked").each(function(){var n=$(this).val();if(m){make_item_importable(j.controller,n,j.singular)}url_template=get_name_and_link_url+n;ajax_url=url_template.replace("ITEM_CONTROLLER",j.controller);$.getJSON(ajax_url,function(p){a._exec(WYMeditor.CREATE_LINK,b);var o=$("a[href="+b+"]",a._doc.body).text();if(o==""||o==b){a.insert("<a href='"+p.link+"'>"+j.singular+" '"+p.name+"'</a>")}else{$("a[href="+b+"]",a._doc.body).attr(WYMeditor.HREF,p.link).attr(WYMeditor.TITLE,j.singular+n)}})});hide_modal()},Cancel:function(){hide_modal()}})}})}if(i==Galaxy.DIALOG_EMBED_HISTORY||i==Galaxy.DIALOG_EMBED_DATASET||i==Galaxy.DIALOG_EMBED_WORKFLOW||i==Galaxy.DIALOG_EMBED_PAGE||i==Galaxy.DIALOG_EMBED_VISUALIZATION){var j;switch(i){case (Galaxy.DIALOG_EMBED_HISTORY):j=get_item_info(Galaxy.ITEM_HISTORY);break;case (Galaxy.DIALOG_EMBED_DATASET):j=get_item_info(Galaxy.ITEM_DATASET);break;case (Galaxy.DIALOG_EMBED_WORKFLOW):j=get_item_info(Galaxy.ITEM_WORKFLOW);break;case (Galaxy.DIALOG_EMBED_PAGE):j=get_item_info(Galaxy.ITEM_PAGE);break;case (Galaxy.DIALOG_EMBED_VISUALIZATION):j=get_item_info(Galaxy.ITEM_VISUALIZATION);break}$.ajax({url:j.list_ajax_url,data:{},error:function(){alert("Failed to list "+j.plural.toLowerCase()+" for selection")},success:function(k){if(i==Galaxy.DIALOG_EMBED_HISTORY||i==Galaxy.DIALOG_EMBED_WORKFLOW||i==Galaxy.DIALOG_EMBED_VISUALIZATION){k=k+"<div><input id='make-importable' type='checkbox' checked/>Make the selected "+j.plural.toLowerCase()+" accessible so that they can viewed by everyone.</div>"}show_modal("Embed "+j.plural,k,{Embed:function(){var l=false;if($("#make-importable:checked").val()!=null){l=true}$("input[name=id]:checked").each(function(){var m=$(this).val();var p=$("label[for='"+m+"']:first").text();if(l){make_item_importable(j.controller,m,j.singular)}var n=j.iclass+"-"+m;var o="<p><div id='"+n+"' class='embedded-item "+j.singular.toLowerCase()+" placeholder'><p class='title'>Embedded Galaxy "+j.singular+" '"+p+"'</p><p class='content'> [Do not edit this block; Galaxy will fill it in with the annotated "+j.singular.toLowerCase()+" when it is displayed.] </p></div></p>";a.insert(" ");a.insert(o);$("#"+n,a._doc.body).each(function(){var q=true;while(q){var r=$(this).prev();if(r.length!=0&&jQuery.trim(r.text())==""){r.remove()}else{q=false}}})});hide_modal()},Cancel:function(){hide_modal()}})}})}if(i==Galaxy.DIALOG_ANNOTATE_HISTORY){$.ajax({url:list_histories_for_selection_url,data:{},error:function(){alert("Grid refresh failed")},success:function(k){show_modal("Insert Link to History",k,{Annotate:function(){var l=new Array();$("input[name=id]:checked").each(function(){var m=$(this).val();$.ajax({url:get_history_annotation_table_url,data:{id:m},error:function(){alert("Grid refresh failed")},success:function(n){a.insert(n);init_galaxy_elts(a)}})});hide_modal()},Cancel:function(){hide_modal()}})}})}};$(function(){$(document).ajaxError(function(i,g){var h=g.responseText||g.statusText||"Could not connect to server";show_modal("Server error",h,{"Ignore error":hide_modal});return false});$("[name=page_content]").wymeditor({skin:"galaxy",basePath:editor_base_path,iframeBasePath:iframe_base_path,boxHtml:"<table class='wym_box' width='100%' height='100%'><tr><td><div class='wym_area_top'>"+WYMeditor.TOOLS+"</div></td></tr><tr height='100%'><td><div class='wym_area_main' style='height: 100%;'>"+WYMeditor.IFRAME+WYMeditor.STATUS+"</div></div></td></tr></table>",toolsItems:[{name:"Bold",title:"Strong",css:"wym_tools_strong"},{name:"Italic",title:"Emphasis",css:"wym_tools_emphasis"},{name:"Superscript",title:"Superscript",css:"wym_tools_superscript"},{name:"Subscript",title:"Subscript",css:"wym_tools_subscript"},{name:"InsertOrderedList",title:"Ordered_List",css:"wym_tools_ordered_list"},{name:"InsertUnorderedList",title:"Unordered_List",css:"wym_tools_unordered_list"},{name:"Indent",title:"Indent",css:"wym_tools_indent"},{name:"Outdent",title:"Outdent",css:"wym_tools_outdent"},{name:"Undo",title:"Undo",css:"wym_tools_undo"},{name:"Redo",title:"Redo",css:"wym_tools_redo"},{name:"CreateLink",title:"Link",css:"wym_tools_link"},{name:"Unlink",title:"Unlink",css:"wym_tools_unlink"},{name:"InsertImage",title:"Image",css:"wym_tools_image"},{name:"InsertTable",title:"Table",css:"wym_tools_table"},]});var d=$.wymeditors(0);var f=function(g){show_modal("Saving page","progress");$.ajax({url:save_url,type:"POST",data:{id:page_id,content:d.xhtml(),annotations:JSON.stringify(new Object()),_:"true"},success:function(){g()}})};$("#save-button").click(function(){f(function(){hide_modal()})});$("#close-button").click(function(){var h=false;if(h){var g=function(){window.onbeforeunload=undefined;window.document.location=page_list_url};show_modal("Close editor","There are unsaved changes to your page which will be lost.",{Cancel:hide_modal,"Save Changes":function(){f(g)}},{"Don't Save":g})}else{window.document.location=page_list_url}});var a=$("<div class='galaxy-page-editor-button'><a id='insert-galaxy-link' class='action-button popup' href='#'>Paragraph type</a></div>");$(".wym_area_top").append(a);var b={};$.each(d._options.containersItems,function(h,g){var i=g.name;b[g.title.replace("_"," ")]=function(){d.container(i)}});make_popupmenu(a,b);var c=$("<div><a id='insert-galaxy-link' class='action-button popup' href='#'>Insert Link to Galaxy Object</a></div>").addClass("galaxy-page-editor-button");$(".wym_area_top").append(c);make_popupmenu(c,{"Insert History Link":function(){d.dialog(Galaxy.DIALOG_HISTORY_LINK)},"Insert Dataset Link":function(){d.dialog(Galaxy.DIALOG_DATASET_LINK)},"Insert Workflow Link":function(){d.dialog(Galaxy.DIALOG_WORKFLOW_LINK)},"Insert Page Link":function(){d.dialog(Galaxy.DIALOG_PAGE_LINK)},"Insert Visualization Link":function(){d.dialog(Galaxy.DIALOG_VISUALIZATION_LINK)},});var e=$("<div><a id='embed-galaxy-object' class='action-button popup' href='#'>Embed Galaxy Object</a></div>").addClass("galaxy-page-editor-button");$(".wym_area_top").append(e);make_popupmenu(e,{"Embed History":function(){d.dialog(Galaxy.DIALOG_EMBED_HISTORY)},"Embed Dataset":function(){d.dialog(Galaxy.DIALOG_EMBED_DATASET)},"Embed Workflow":function(){d.dialog(Galaxy.DIALOG_EMBED_WORKFLOW)},"Embed Visualization":function(){d.dialog(Galaxy.DIALOG_EMBED_VISUALIZATION)},})});
\ No newline at end of file
diff -r f2e03734f86bc6bec204cee0c9b53aac8b20ba4a -r 4b5f8a81adf16369d828aa82fe82f8141772c1d3 static/scripts/packed/mvc/tools.js
--- a/static/scripts/packed/mvc/tools.js
+++ b/static/scripts/packed/mvc/tools.js
@@ -1,1 +1,1 @@
-define(["libs/underscore","viz/trackster/util","mvc/data","libs/backbone/backbone-relational"],function(q,a,r){var f=Backbone.RelationalModel.extend({defaults:{name:null,hidden:false},show:function(){this.set("hidden",false)},hide:function(){this.set("hidden",true)},is_visible:function(){return !this.attributes.hidden}});var k=Backbone.RelationalModel.extend({defaults:{name:null,label:null,type:null,value:null,num_samples:5},initialize:function(){this.attributes.html=unescape(this.attributes.html)},copy:function(){return new k(this.toJSON())},get_samples:function(){var u=this.get("type"),t=null;if(u==="number"){t=d3.scale.linear().domain([this.get("min"),this.get("max")]).ticks(this.get("num_samples"))}else{if(u==="select"){t=q.map(this.get("options"),function(v){return v[0]})}}return t}});var e=f.extend({defaults:{description:null,target:null,inputs:[]},relations:[{type:Backbone.HasMany,key:"inputs",relatedModel:k,reverseRelation:{key:"tool",includeInJSON:false}}],urlRoot:galaxy_paths.get("tool_url"),copy:function(u){var v=new e(this.toJSON());if(u){var t=new Backbone.Collection();v.get("inputs").each(function(w){if(w.get_samples()){t.push(w)}});v.set("inputs",t)}return v},apply_search_results:function(t){(q.indexOf(t,this.attributes.id)!==-1?this.show():this.hide());return this.is_visible()},set_input_value:function(t,u){this.get("inputs").find(function(v){return v.get("name")===t}).set("value",u)},set_input_values:function(u){var t=this;q.each(q.keys(u),function(v){t.set_input_value(v,u[v])})},run:function(){return this._run()},rerun:function(u,t){return this._run({action:"rerun",target_dataset_id:u.id,regions:t})},get_inputs_dict:function(){var t={};this.get("inputs").each(function(u){t[u.get("name")]=u.get("value")});return t},_run:function(v){var w=q.extend({tool_id:this.id,inputs:this.get_inputs_dict()},v);var u=$.Deferred(),t=new a.ServerStateDeferred({ajax_settings:{url:this.urlRoot,data:JSON.stringify(w),dataType:"json",contentType:"application/json",type:"POST"},interval:2000,success_fn:function(x){return x!=="pending"}});$.when(t.go()).then(function(x){u.resolve(new r.DatasetCollection().reset(x))});return u}});var i=Backbone.Collection.extend({model:e});var m=f.extend({});var p=f.extend({defaults:{elems:[],open:false},clear_search_results:function(){q.each(this.attributes.elems,function(t){t.show()});this.show();this.set("open",false)},apply_search_results:function(u){var v=true,t;q.each(this.attributes.elems,function(w){if(w instanceof m){t=w;t.hide()}else{if(w instanceof e){if(w.apply_search_results(u)){v=false;if(t){t.show()}}}}});if(v){this.hide()}else{this.show();this.set("open",true)}}});var b=f.extend({defaults:{search_hint_string:"search tools",min_chars_for_search:3,spinner_url:"",clear_btn_url:"",search_url:"",visible:true,query:"",results:null,clear_key:27},initialize:function(){this.on("change:query",this.do_search)},do_search:function(){var v=this.attributes.query;if(v.length<this.attributes.min_chars_for_search){this.set("results",null);return}var u=v+"*";if(this.timer){clearTimeout(this.timer)}$("#search-clear-btn").hide();$("#search-spinner").show();var t=this;this.timer=setTimeout(function(){$.get(t.attributes.search_url,{query:u},function(w){t.set("results",w);$("#search-spinner").hide();$("#search-clear-btn").show()},"json")},200)},clear_search:function(){this.set("query","");this.set("results",null)}});var j=Backbone.Collection.extend({url:"/tools",tools:new i(),parse:function(t){var u=function(x){var w=x.type;if(w==="tool"){return new e(x)}else{if(w==="section"){var v=q.map(x.elems,u);x.elems=v;return new p(x)}else{if(w==="label"){return new m(x)}}}};return q.map(t,u)},initialize:function(t){this.tool_search=t.tool_search;this.tool_search.on("change:results",this.apply_search_results,this);this.on("reset",this.populate_tools,this)},populate_tools:function(){var t=this;t.tools=new i();this.each(function(u){if(u instanceof p){q.each(u.attributes.elems,function(v){if(v instanceof e){t.tools.push(v)}})}else{if(u instanceof e){t.tools.push(u)}}})},clear_search_results:function(){this.each(function(t){if(t instanceof p){t.clear_search_results()}else{t.show()}})},apply_search_results:function(){var u=this.tool_search.attributes.results;if(u===null){this.clear_search_results();return}var t=null;this.each(function(v){if(v instanceof m){t=v;t.hide()}else{if(v instanceof e){if(v.apply_search_results(u)){if(t){t.show()}}}else{t=null;v.apply_search_results(u)}}})}});var n=Backbone.View.extend({initialize:function(){this.model.on("change:hidden",this.update_visible,this);this.update_visible()},update_visible:function(){(this.model.attributes.hidden?this.$el.hide():this.$el.show())}});var h=n.extend({tagName:"div",template:Handlebars.templates.tool_link,render:function(){this.$el.append(this.template(this.model.toJSON()));return this}});var c=n.extend({tagName:"div",className:"toolPanelLabel",render:function(){this.$el.append($("<span/>").text(this.model.attributes.name));return this}});var g=n.extend({tagName:"div",className:"toolSectionWrapper",template:Handlebars.templates.panel_section,initialize:function(){n.prototype.initialize.call(this);this.model.on("change:open",this.update_open,this)},render:function(){this.$el.append(this.template(this.model.toJSON()));var t=this.$el.find(".toolSectionBody");q.each(this.model.attributes.elems,function(u){if(u instanceof e){var v=new h({model:u,className:"toolTitle"});v.render();t.append(v.$el)}else{if(u instanceof m){var w=new c({model:u});w.render();t.append(w.$el)}else{}}});return this},events:{"click .toolSectionTitle > a":"toggle"},toggle:function(){this.model.set("open",!this.model.attributes.open)},update_open:function(){(this.model.attributes.open?this.$el.children(".toolSectionBody").slideDown("fast"):this.$el.children(".toolSectionBody").slideUp("fast"))}});var l=Backbone.View.extend({tagName:"div",id:"tool-search",className:"bar",template:Handlebars.templates.tool_search,events:{click:"focus_and_select","keyup :input":"query_changed","click #search-clear-btn":"clear"},render:function(){this.$el.append(this.template(this.model.toJSON()));if(!this.model.is_visible()){this.$el.hide()}this.$el.find(".tooltip").tooltip();return this},focus_and_select:function(){this.$el.find(":input").focus().select()},clear:function(){this.model.clear_search();this.$el.find(":input").val(this.model.attributes.search_hint_string);this.focus_and_select();return false},query_changed:function(t){if((this.model.attributes.clear_key)&&(this.model.attributes.clear_key===t.which)){this.clear();return false}this.model.set("query",this.$el.find(":input").val())}});var s=Backbone.View.extend({tagName:"div",className:"toolMenu",initialize:function(){this.collection.tool_search.on("change:results",this.handle_search_results,this)},render:function(){var t=this;var u=new l({model:this.collection.tool_search});u.render();t.$el.append(u.$el);this.collection.each(function(w){if(w instanceof p){var v=new g({model:w});v.render();t.$el.append(v.$el)}else{if(w instanceof e){var x=new h({model:w,className:"toolTitleNoSection"});x.render();t.$el.append(x.$el)}else{if(w instanceof m){var y=new c({model:w});y.render();t.$el.append(y.$el)}}}});t.$el.find("a.tool-link").click(function(x){var w=$(this).attr("class").split(/\s+/)[0],v=t.collection.tools.get(w);t.trigger("tool_link_click",x,v)});return this},handle_search_results:function(){var t=this.collection.tool_search.attributes.results;if(t&&t.length===0){$("#search-no-results").show()}else{$("#search-no-results").hide()}}});var o=Backbone.View.extend({className:"toolForm",template:Handlebars.templates.tool_form,render:function(){this.$el.children().remove();this.$el.append(this.template(this.model.toJSON()))}});var d=Backbone.View.extend({className:"toolMenuAndView",initialize:function(){this.tool_panel_view=new s({collection:this.collection});this.tool_form_view=new o()},render:function(){this.tool_panel_view.render();this.tool_panel_view.$el.css("float","left");this.$el.append(this.tool_panel_view.$el);this.tool_form_view.$el.hide();this.$el.append(this.tool_form_view.$el);var t=this;this.tool_panel_view.on("tool_link_click",function(v,u){v.preventDefault();t.show_tool(u)})},show_tool:function(u){var t=this;u.fetch().done(function(){t.tool_form_view.model=u;t.tool_form_view.render();t.tool_form_view.$el.show();$("#left").width("650px")})}});return{Tool:e,ToolSearch:b,ToolPanel:j,ToolPanelView:s,ToolFormView:o}});
\ No newline at end of file
+define(["libs/underscore","viz/trackster/util","mvc/data","libs/backbone/backbone-relational"],function(q,a,r){var g=Backbone.RelationalModel.extend({defaults:{name:null,hidden:false},show:function(){this.set("hidden",false)},hide:function(){this.set("hidden",true)},is_visible:function(){return !this.attributes.hidden}});var c=Backbone.RelationalModel.extend({defaults:{name:null,label:null,type:null,value:null,num_samples:5},initialize:function(){this.attributes.html=unescape(this.attributes.html)},copy:function(){return new c(this.toJSON())},get_samples:function(){var u=this.get("type"),t=null;if(u==="number"){t=d3.scale.linear().domain([this.get("min"),this.get("max")]).ticks(this.get("num_samples"))}else{if(u==="select"){t=q.map(this.get("options"),function(v){return v[0]})}}return t}});var f=g.extend({defaults:{description:null,target:null,inputs:[]},relations:[{type:Backbone.HasMany,key:"inputs",relatedModel:c,reverseRelation:{key:"tool",includeInJSON:false}}],urlRoot:galaxy_paths.get("tool_url"),copy:function(u){var v=new f(this.toJSON());if(u){var t=new Backbone.Collection();v.get("inputs").each(function(w){if(w.get_samples()){t.push(w)}});v.set("inputs",t)}return v},apply_search_results:function(t){(q.indexOf(t,this.attributes.id)!==-1?this.show():this.hide());return this.is_visible()},set_input_value:function(t,u){this.get("inputs").find(function(v){return v.get("name")===t}).set("value",u)},set_input_values:function(u){var t=this;q.each(q.keys(u),function(v){t.set_input_value(v,u[v])})},run:function(){return this._run()},rerun:function(u,t){return this._run({action:"rerun",target_dataset_id:u.id,regions:t})},get_inputs_dict:function(){var t={};this.get("inputs").each(function(u){t[u.get("name")]=u.get("value")});return t},_run:function(v){var w=q.extend({tool_id:this.id,inputs:this.get_inputs_dict()},v);var u=$.Deferred(),t=new a.ServerStateDeferred({ajax_settings:{url:this.urlRoot,data:JSON.stringify(w),dataType:"json",contentType:"application/json",type:"POST"},interval:2000,success_fn:function(x){return x!=="pending"}});$.when(t.go()).then(function(x){u.resolve(new r.DatasetCollection().reset(x))});return u}});var j=Backbone.Collection.extend({model:f});var m=g.extend({});var p=g.extend({defaults:{elems:[],open:false},clear_search_results:function(){q.each(this.attributes.elems,function(t){t.show()});this.show();this.set("open",false)},apply_search_results:function(u){var v=true,t;q.each(this.attributes.elems,function(w){if(w instanceof m){t=w;t.hide()}else{if(w instanceof f){if(w.apply_search_results(u)){v=false;if(t){t.show()}}}}});if(v){this.hide()}else{this.show();this.set("open",true)}}});var b=g.extend({defaults:{search_hint_string:"search tools",min_chars_for_search:3,spinner_url:"",clear_btn_url:"",search_url:"",visible:true,query:"",results:null,clear_key:27},initialize:function(){this.on("change:query",this.do_search)},do_search:function(){var v=this.attributes.query;if(v.length<this.attributes.min_chars_for_search){this.set("results",null);return}var u=v+"*";if(this.timer){clearTimeout(this.timer)}$("#search-clear-btn").hide();$("#search-spinner").show();var t=this;this.timer=setTimeout(function(){$.get(t.attributes.search_url,{query:u},function(w){t.set("results",w);$("#search-spinner").hide();$("#search-clear-btn").show()},"json")},200)},clear_search:function(){this.set("query","");this.set("results",null)}});var k=Backbone.Collection.extend({url:"/tools",tools:new j(),parse:function(t){var u=function(x){var w=x.type;if(w==="tool"){return new f(x)}else{if(w==="section"){var v=q.map(x.elems,u);x.elems=v;return new p(x)}else{if(w==="label"){return new m(x)}}}};return q.map(t,u)},initialize:function(t){this.tool_search=t.tool_search;this.tool_search.on("change:results",this.apply_search_results,this);this.on("reset",this.populate_tools,this)},populate_tools:function(){var t=this;t.tools=new j();this.each(function(u){if(u instanceof p){q.each(u.attributes.elems,function(v){if(v instanceof f){t.tools.push(v)}})}else{if(u instanceof f){t.tools.push(u)}}})},clear_search_results:function(){this.each(function(t){if(t instanceof p){t.clear_search_results()}else{t.show()}})},apply_search_results:function(){var u=this.tool_search.attributes.results;if(u===null){this.clear_search_results();return}var t=null;this.each(function(v){if(v instanceof m){t=v;t.hide()}else{if(v instanceof f){if(v.apply_search_results(u)){if(t){t.show()}}}else{t=null;v.apply_search_results(u)}}})}});var n=Backbone.View.extend({initialize:function(){this.model.on("change:hidden",this.update_visible,this);this.update_visible()},update_visible:function(){(this.model.attributes.hidden?this.$el.hide():this.$el.show())}});var i=n.extend({tagName:"div",template:Handlebars.templates.tool_link,render:function(){this.$el.append(this.template(this.model.toJSON()));return this}});var d=n.extend({tagName:"div",className:"toolPanelLabel",render:function(){this.$el.append($("<span/>").text(this.model.attributes.name));return this}});var h=n.extend({tagName:"div",className:"toolSectionWrapper",template:Handlebars.templates.panel_section,initialize:function(){n.prototype.initialize.call(this);this.model.on("change:open",this.update_open,this)},render:function(){this.$el.append(this.template(this.model.toJSON()));var t=this.$el.find(".toolSectionBody");q.each(this.model.attributes.elems,function(u){if(u instanceof f){var v=new i({model:u,className:"toolTitle"});v.render();t.append(v.$el)}else{if(u instanceof m){var w=new d({model:u});w.render();t.append(w.$el)}else{}}});return this},events:{"click .toolSectionTitle > a":"toggle"},toggle:function(){this.model.set("open",!this.model.attributes.open)},update_open:function(){(this.model.attributes.open?this.$el.children(".toolSectionBody").slideDown("fast"):this.$el.children(".toolSectionBody").slideUp("fast"))}});var l=Backbone.View.extend({tagName:"div",id:"tool-search",className:"bar",template:Handlebars.templates.tool_search,events:{click:"focus_and_select","keyup :input":"query_changed","click #search-clear-btn":"clear"},render:function(){this.$el.append(this.template(this.model.toJSON()));if(!this.model.is_visible()){this.$el.hide()}this.$el.find(".tooltip").tooltip();return this},focus_and_select:function(){this.$el.find(":input").focus().select()},clear:function(){this.model.clear_search();this.$el.find(":input").val(this.model.attributes.search_hint_string);this.focus_and_select();return false},query_changed:function(t){if((this.model.attributes.clear_key)&&(this.model.attributes.clear_key===t.which)){this.clear();return false}this.model.set("query",this.$el.find(":input").val())}});var s=Backbone.View.extend({tagName:"div",className:"toolMenu",initialize:function(){this.collection.tool_search.on("change:results",this.handle_search_results,this)},render:function(){var t=this;var u=new l({model:this.collection.tool_search});u.render();t.$el.append(u.$el);this.collection.each(function(w){if(w instanceof p){var v=new h({model:w});v.render();t.$el.append(v.$el)}else{if(w instanceof f){var x=new i({model:w,className:"toolTitleNoSection"});x.render();t.$el.append(x.$el)}else{if(w instanceof m){var y=new d({model:w});y.render();t.$el.append(y.$el)}}}});t.$el.find("a.tool-link").click(function(x){var w=$(this).attr("class").split(/\s+/)[0],v=t.collection.tools.get(w);t.trigger("tool_link_click",x,v)});return this},handle_search_results:function(){var t=this.collection.tool_search.attributes.results;if(t&&t.length===0){$("#search-no-results").show()}else{$("#search-no-results").hide()}}});var o=Backbone.View.extend({className:"toolForm",template:Handlebars.templates.tool_form,render:function(){this.$el.children().remove();this.$el.append(this.template(this.model.toJSON()))}});var e=Backbone.View.extend({className:"toolMenuAndView",initialize:function(){this.tool_panel_view=new s({collection:this.collection});this.tool_form_view=new o()},render:function(){this.tool_panel_view.render();this.tool_panel_view.$el.css("float","left");this.$el.append(this.tool_panel_view.$el);this.tool_form_view.$el.hide();this.$el.append(this.tool_form_view.$el);var t=this;this.tool_panel_view.on("tool_link_click",function(v,u){v.preventDefault();t.show_tool(u)})},show_tool:function(u){var t=this;u.fetch().done(function(){t.tool_form_view.model=u;t.tool_form_view.render();t.tool_form_view.$el.show();$("#left").width("650px")})}});return{Tool:f,ToolSearch:b,ToolPanel:k,ToolPanelView:s,ToolFormView:o}});
\ No newline at end of file
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: jgoecks: Fix bug in Pages' link creation and pack scripts.
by commits-noreply@bitbucket.org 31 Jul '13
by commits-noreply@bitbucket.org 31 Jul '13
31 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/208f93f6cdc0/
Changeset: 208f93f6cdc0
Branch: next-stable
User: jgoecks
Date: 2013-07-31 19:00:23
Summary: Fix bug in Pages' link creation and pack scripts.
Affected #: 3 files
diff -r 82c3a4ab2b0191507cd720c96ada1a66b0b142db -r 208f93f6cdc00c6d866b8029b0f53990ce0bfadc static/scripts/galaxy.pages.js
--- a/static/scripts/galaxy.pages.js
+++ b/static/scripts/galaxy.pages.js
@@ -164,18 +164,19 @@
{
"Make link": function() {
// Get URL, name/title.
- var sUrl = $(wym._options.hrefSelector).val(),
- sName = $(".wym_title").val();
+ var sUrl = $(wym._options.hrefSelector).val() || '',
+ sId = $(".wym_id").val() || '',
+ sName = $(wym._options.titleSelector).val() || '';
- if (sUrl && sName) {
+ if (sUrl || sId) {
// Create link.
wym._exec(WYMeditor.CREATE_LINK, sStamp);
// Set link attributes.
var link = $("a[href=" + sStamp + "]", wym._doc.body);
link.attr(WYMeditor.HREF, sUrl)
- .attr(WYMeditor.TITLE, $(wym._options.titleSelector).val())
- .attr("id", sName);
+ .attr(WYMeditor.TITLE, sName)
+ .attr("id", sId);
// If link's text is default (wym-...), change it to the title.
if (link.text().indexOf('wym-') === 0) {
diff -r 82c3a4ab2b0191507cd720c96ada1a66b0b142db -r 208f93f6cdc00c6d866b8029b0f53990ce0bfadc static/scripts/packed/galaxy.pages.js
--- a/static/scripts/packed/galaxy.pages.js
+++ b/static/scripts/packed/galaxy.pages.js
@@ -1,1 +1,1 @@
-var Galaxy={ITEM_HISTORY:"item_history",ITEM_DATASET:"item_dataset",ITEM_WORKFLOW:"item_workflow",ITEM_PAGE:"item_page",ITEM_VISUALIZATION:"item_visualization",DIALOG_HISTORY_LINK:"link_history",DIALOG_DATASET_LINK:"link_dataset",DIALOG_WORKFLOW_LINK:"link_workflow",DIALOG_PAGE_LINK:"link_page",DIALOG_VISUALIZATION_LINK:"link_visualization",DIALOG_EMBED_HISTORY:"embed_history",DIALOG_EMBED_DATASET:"embed_dataset",DIALOG_EMBED_WORKFLOW:"embed_workflow",DIALOG_EMBED_PAGE:"embed_page",DIALOG_EMBED_VISUALIZATION:"embed_visualization",DIALOG_HISTORY_ANNOTATE:"history_annotate",};function init_galaxy_elts(a){$(".annotation",a._doc.body).each(function(){$(this).click(function(){var b=a._doc.createRange();b.selectNodeContents(this);var d=window.getSelection();d.removeAllRanges();d.addRange(b);var c=""})})}function get_item_info(d){var f,c,b;switch(d){case (Galaxy.ITEM_HISTORY):f="History";c="Histories";b="history";item_class="History";break;case (Galaxy.ITEM_DATASET):f="Dataset";c="Datasets";b="dataset";item_class="HistoryDatasetAssociation";break;case (Galaxy.ITEM_WORKFLOW):f="Workflow";c="Workflows";b="workflow";item_class="StoredWorkflow";break;case (Galaxy.ITEM_PAGE):f="Page";c="Pages";b="page";item_class="Page";break;case (Galaxy.ITEM_VISUALIZATION):f="Visualization";c="Visualizations";b="visualization";item_class="Visualization";break}var e="list_"+c.toLowerCase()+"_for_selection";var a=list_objects_url.replace("LIST_ACTION",e);return{singular:f,plural:c,controller:b,iclass:item_class,list_ajax_url:a}}function make_item_importable(a,c,b){ajax_url=set_accessible_url.replace("ITEM_CONTROLLER",a);$.ajax({type:"POST",url:ajax_url,data:{id:c,accessible:"True"},error:function(){alert("Making "+b+" accessible failed")}})}WYMeditor.editor.prototype.dialog=function(i,e,g){var a=this;var b=a.uniqueStamp();var f=a.selected();function h(){$("#set_link_id").click(function(){$("#link_attribute_label").text("ID/Name");var k=$(".wym_href");k.addClass("wym_id").removeClass("wym_href");if(f){k.val($(f).attr("id"))}$(this).remove()})}if(i==WYMeditor.DIALOG_LINK){if(f){$(a._options.hrefSelector).val($(f).attr(WYMeditor.HREF));$(a._options.srcSelector).val($(f).attr(WYMeditor.SRC));$(a._options.titleSelector).val($(f).attr(WYMeditor.TITLE));$(a._options.altSelector).val($(f).attr(WYMeditor.ALT))}var c,d;if(f){c=$(f).attr("href");if(c==undefined){c=""}d=$(f).attr("title");if(d==undefined){d=""}}show_modal("Create Link","<div><div><label id='link_attribute_label'>URL <span style='float: right; font-size: 90%'><a href='#' id='set_link_id'>Create in-page anchor</a></span></label><br><input type='text' class='wym_href' value='"+c+"' size='40' /></div><div><label>Title</label><br><input type='text' class='wym_title' value='"+d+"' size='40' /></div><div>",{"Make link":function(){var l=$(a._options.hrefSelector).val(),m=$(".wym_title").val();if(l&&m){a._exec(WYMeditor.CREATE_LINK,b);var k=$("a[href="+b+"]",a._doc.body);k.attr(WYMeditor.HREF,l).attr(WYMeditor.TITLE,$(a._options.titleSelector).val()).attr("id",m);if(k.text().indexOf("wym-")===0){k.text(m)}}hide_modal()},Cancel:function(){hide_modal()}},{},h)}if(i==WYMeditor.DIALOG_IMAGE){if(a._selected_image){$(a._options.dialogImageSelector+" "+a._options.srcSelector).val($(a._selected_image).attr(WYMeditor.SRC));$(a._options.dialogImageSelector+" "+a._options.titleSelector).val($(a._selected_image).attr(WYMeditor.TITLE));$(a._options.dialogImageSelector+" "+a._options.altSelector).val($(a._selected_image).attr(WYMeditor.ALT))}show_modal("Image","<div class='row'><label>URL</label><br><input type='text' class='wym_src' value='' size='40' /></div><div class='row'><label>Alt text</label><br><input type='text' class='wym_alt' value='' size='40' /></div><div class='row'><label>Title</label><br><input type='text' class='wym_title' value='' size='40' /></div>",{Insert:function(){var k=$(a._options.srcSelector).val();if(k.length>0){a._exec(WYMeditor.INSERT_IMAGE,b);$("img[src$="+b+"]",a._doc.body).attr(WYMeditor.SRC,k).attr(WYMeditor.TITLE,$(a._options.titleSelector).val()).attr(WYMeditor.ALT,$(a._options.altSelector).val())}hide_modal()},Cancel:function(){hide_modal()}});return}if(i==WYMeditor.DIALOG_TABLE){show_modal("Table","<div class='row'><label>Caption</label><br><input type='text' class='wym_caption' value='' size='40' /></div><div class='row'><label>Summary</label><br><input type='text' class='wym_summary' value='' size='40' /></div><div class='row'><label>Number Of Rows<br></label><input type='text' class='wym_rows' value='3' size='3' /></div><div class='row'><label>Number Of Cols<br></label><input type='text' class='wym_cols' value='2' size='3' /></div>",{Insert:function(){var o=$(a._options.rowsSelector).val();var r=$(a._options.colsSelector).val();if(o>0&&r>0){var n=a._doc.createElement(WYMeditor.TABLE);var l=null;var q=null;var k=$(a._options.captionSelector).val();var p=n.createCaption();p.innerHTML=k;for(x=0;x<o;x++){l=n.insertRow(x);for(y=0;y<r;y++){l.insertCell(y)}}$(n).attr("summary",$(a._options.summarySelector).val());var m=$(a.findUp(a.container(),WYMeditor.MAIN_CONTAINERS)).get(0);if(!m||!m.parentNode){$(a._doc.body).append(n)}else{$(m).after(n)}}hide_modal()},Cancel:function(){hide_modal()}})}if(i==Galaxy.DIALOG_HISTORY_LINK||i==Galaxy.DIALOG_DATASET_LINK||i==Galaxy.DIALOG_WORKFLOW_LINK||i==Galaxy.DIALOG_PAGE_LINK||i==Galaxy.DIALOG_VISUALIZATION_LINK){var j;switch(i){case (Galaxy.DIALOG_HISTORY_LINK):j=get_item_info(Galaxy.ITEM_HISTORY);break;case (Galaxy.DIALOG_DATASET_LINK):j=get_item_info(Galaxy.ITEM_DATASET);break;case (Galaxy.DIALOG_WORKFLOW_LINK):j=get_item_info(Galaxy.ITEM_WORKFLOW);break;case (Galaxy.DIALOG_PAGE_LINK):j=get_item_info(Galaxy.ITEM_PAGE);break;case (Galaxy.DIALOG_VISUALIZATION_LINK):j=get_item_info(Galaxy.ITEM_VISUALIZATION);break}$.ajax({url:j.list_ajax_url,data:{},error:function(){alert("Failed to list "+j.plural.toLowerCase()+" for selection")},success:function(k){show_modal("Insert Link to "+j.singular,k+"<div><input id='make-importable' type='checkbox' checked/>Make the selected "+j.plural.toLowerCase()+" accessible so that they can viewed by everyone.</div>",{Insert:function(){var m=false;if($("#make-importable:checked").val()!==null){m=true}var l=new Array();$("input[name=id]:checked").each(function(){var n=$(this).val();if(m){make_item_importable(j.controller,n,j.singular)}url_template=get_name_and_link_url+n;ajax_url=url_template.replace("ITEM_CONTROLLER",j.controller);$.getJSON(ajax_url,function(p){a._exec(WYMeditor.CREATE_LINK,b);var o=$("a[href="+b+"]",a._doc.body).text();if(o==""||o==b){a.insert("<a href='"+p.link+"'>"+j.singular+" '"+p.name+"'</a>")}else{$("a[href="+b+"]",a._doc.body).attr(WYMeditor.HREF,p.link).attr(WYMeditor.TITLE,j.singular+n)}})});hide_modal()},Cancel:function(){hide_modal()}})}})}if(i==Galaxy.DIALOG_EMBED_HISTORY||i==Galaxy.DIALOG_EMBED_DATASET||i==Galaxy.DIALOG_EMBED_WORKFLOW||i==Galaxy.DIALOG_EMBED_PAGE||i==Galaxy.DIALOG_EMBED_VISUALIZATION){var j;switch(i){case (Galaxy.DIALOG_EMBED_HISTORY):j=get_item_info(Galaxy.ITEM_HISTORY);break;case (Galaxy.DIALOG_EMBED_DATASET):j=get_item_info(Galaxy.ITEM_DATASET);break;case (Galaxy.DIALOG_EMBED_WORKFLOW):j=get_item_info(Galaxy.ITEM_WORKFLOW);break;case (Galaxy.DIALOG_EMBED_PAGE):j=get_item_info(Galaxy.ITEM_PAGE);break;case (Galaxy.DIALOG_EMBED_VISUALIZATION):j=get_item_info(Galaxy.ITEM_VISUALIZATION);break}$.ajax({url:j.list_ajax_url,data:{},error:function(){alert("Failed to list "+j.plural.toLowerCase()+" for selection")},success:function(k){if(i==Galaxy.DIALOG_EMBED_HISTORY||i==Galaxy.DIALOG_EMBED_WORKFLOW||i==Galaxy.DIALOG_EMBED_VISUALIZATION){k=k+"<div><input id='make-importable' type='checkbox' checked/>Make the selected "+j.plural.toLowerCase()+" accessible so that they can viewed by everyone.</div>"}show_modal("Embed "+j.plural,k,{Embed:function(){var l=false;if($("#make-importable:checked").val()!=null){l=true}$("input[name=id]:checked").each(function(){var m=$(this).val();var p=$("label[for='"+m+"']:first").text();if(l){make_item_importable(j.controller,m,j.singular)}var n=j.iclass+"-"+m;var o="<p><div id='"+n+"' class='embedded-item "+j.singular.toLowerCase()+" placeholder'><p class='title'>Embedded Galaxy "+j.singular+" '"+p+"'</p><p class='content'> [Do not edit this block; Galaxy will fill it in with the annotated "+j.singular.toLowerCase()+" when it is displayed.] </p></div></p>";a.insert(" ");a.insert(o);$("#"+n,a._doc.body).each(function(){var q=true;while(q){var r=$(this).prev();if(r.length!=0&&jQuery.trim(r.text())==""){r.remove()}else{q=false}}})});hide_modal()},Cancel:function(){hide_modal()}})}})}if(i==Galaxy.DIALOG_ANNOTATE_HISTORY){$.ajax({url:list_histories_for_selection_url,data:{},error:function(){alert("Grid refresh failed")},success:function(k){show_modal("Insert Link to History",k,{Annotate:function(){var l=new Array();$("input[name=id]:checked").each(function(){var m=$(this).val();$.ajax({url:get_history_annotation_table_url,data:{id:m},error:function(){alert("Grid refresh failed")},success:function(n){a.insert(n);init_galaxy_elts(a)}})});hide_modal()},Cancel:function(){hide_modal()}})}})}};$(function(){$(document).ajaxError(function(i,g){var h=g.responseText||g.statusText||"Could not connect to server";show_modal("Server error",h,{"Ignore error":hide_modal});return false});$("[name=page_content]").wymeditor({skin:"galaxy",basePath:editor_base_path,iframeBasePath:iframe_base_path,boxHtml:"<table class='wym_box' width='100%' height='100%'><tr><td><div class='wym_area_top'>"+WYMeditor.TOOLS+"</div></td></tr><tr height='100%'><td><div class='wym_area_main' style='height: 100%;'>"+WYMeditor.IFRAME+WYMeditor.STATUS+"</div></div></td></tr></table>",toolsItems:[{name:"Bold",title:"Strong",css:"wym_tools_strong"},{name:"Italic",title:"Emphasis",css:"wym_tools_emphasis"},{name:"Superscript",title:"Superscript",css:"wym_tools_superscript"},{name:"Subscript",title:"Subscript",css:"wym_tools_subscript"},{name:"InsertOrderedList",title:"Ordered_List",css:"wym_tools_ordered_list"},{name:"InsertUnorderedList",title:"Unordered_List",css:"wym_tools_unordered_list"},{name:"Indent",title:"Indent",css:"wym_tools_indent"},{name:"Outdent",title:"Outdent",css:"wym_tools_outdent"},{name:"Undo",title:"Undo",css:"wym_tools_undo"},{name:"Redo",title:"Redo",css:"wym_tools_redo"},{name:"CreateLink",title:"Link",css:"wym_tools_link"},{name:"Unlink",title:"Unlink",css:"wym_tools_unlink"},{name:"InsertImage",title:"Image",css:"wym_tools_image"},{name:"InsertTable",title:"Table",css:"wym_tools_table"},]});var d=$.wymeditors(0);var f=function(g){show_modal("Saving page","progress");$.ajax({url:save_url,type:"POST",data:{id:page_id,content:d.xhtml(),annotations:JSON.stringify(new Object()),_:"true"},success:function(){g()}})};$("#save-button").click(function(){f(function(){hide_modal()})});$("#close-button").click(function(){var h=false;if(h){var g=function(){window.onbeforeunload=undefined;window.document.location=page_list_url};show_modal("Close editor","There are unsaved changes to your page which will be lost.",{Cancel:hide_modal,"Save Changes":function(){f(g)}},{"Don't Save":g})}else{window.document.location=page_list_url}});var a=$("<div class='galaxy-page-editor-button'><a id='insert-galaxy-link' class='action-button popup' href='#'>Paragraph type</a></div>");$(".wym_area_top").append(a);var b={};$.each(d._options.containersItems,function(h,g){var i=g.name;b[g.title.replace("_"," ")]=function(){d.container(i)}});make_popupmenu(a,b);var c=$("<div><a id='insert-galaxy-link' class='action-button popup' href='#'>Insert Link to Galaxy Object</a></div>").addClass("galaxy-page-editor-button");$(".wym_area_top").append(c);make_popupmenu(c,{"Insert History Link":function(){d.dialog(Galaxy.DIALOG_HISTORY_LINK)},"Insert Dataset Link":function(){d.dialog(Galaxy.DIALOG_DATASET_LINK)},"Insert Workflow Link":function(){d.dialog(Galaxy.DIALOG_WORKFLOW_LINK)},"Insert Page Link":function(){d.dialog(Galaxy.DIALOG_PAGE_LINK)},"Insert Visualization Link":function(){d.dialog(Galaxy.DIALOG_VISUALIZATION_LINK)},});var e=$("<div><a id='embed-galaxy-object' class='action-button popup' href='#'>Embed Galaxy Object</a></div>").addClass("galaxy-page-editor-button");$(".wym_area_top").append(e);make_popupmenu(e,{"Embed History":function(){d.dialog(Galaxy.DIALOG_EMBED_HISTORY)},"Embed Dataset":function(){d.dialog(Galaxy.DIALOG_EMBED_DATASET)},"Embed Workflow":function(){d.dialog(Galaxy.DIALOG_EMBED_WORKFLOW)},"Embed Visualization":function(){d.dialog(Galaxy.DIALOG_EMBED_VISUALIZATION)},})});
\ No newline at end of file
+var Galaxy={ITEM_HISTORY:"item_history",ITEM_DATASET:"item_dataset",ITEM_WORKFLOW:"item_workflow",ITEM_PAGE:"item_page",ITEM_VISUALIZATION:"item_visualization",DIALOG_HISTORY_LINK:"link_history",DIALOG_DATASET_LINK:"link_dataset",DIALOG_WORKFLOW_LINK:"link_workflow",DIALOG_PAGE_LINK:"link_page",DIALOG_VISUALIZATION_LINK:"link_visualization",DIALOG_EMBED_HISTORY:"embed_history",DIALOG_EMBED_DATASET:"embed_dataset",DIALOG_EMBED_WORKFLOW:"embed_workflow",DIALOG_EMBED_PAGE:"embed_page",DIALOG_EMBED_VISUALIZATION:"embed_visualization",DIALOG_HISTORY_ANNOTATE:"history_annotate",};function init_galaxy_elts(a){$(".annotation",a._doc.body).each(function(){$(this).click(function(){var b=a._doc.createRange();b.selectNodeContents(this);var d=window.getSelection();d.removeAllRanges();d.addRange(b);var c=""})})}function get_item_info(d){var f,c,b;switch(d){case (Galaxy.ITEM_HISTORY):f="History";c="Histories";b="history";item_class="History";break;case (Galaxy.ITEM_DATASET):f="Dataset";c="Datasets";b="dataset";item_class="HistoryDatasetAssociation";break;case (Galaxy.ITEM_WORKFLOW):f="Workflow";c="Workflows";b="workflow";item_class="StoredWorkflow";break;case (Galaxy.ITEM_PAGE):f="Page";c="Pages";b="page";item_class="Page";break;case (Galaxy.ITEM_VISUALIZATION):f="Visualization";c="Visualizations";b="visualization";item_class="Visualization";break}var e="list_"+c.toLowerCase()+"_for_selection";var a=list_objects_url.replace("LIST_ACTION",e);return{singular:f,plural:c,controller:b,iclass:item_class,list_ajax_url:a}}function make_item_importable(a,c,b){ajax_url=set_accessible_url.replace("ITEM_CONTROLLER",a);$.ajax({type:"POST",url:ajax_url,data:{id:c,accessible:"True"},error:function(){alert("Making "+b+" accessible failed")}})}WYMeditor.editor.prototype.dialog=function(i,e,g){var a=this;var b=a.uniqueStamp();var f=a.selected();function h(){$("#set_link_id").click(function(){$("#link_attribute_label").text("ID/Name");var k=$(".wym_href");k.addClass("wym_id").removeClass("wym_href");if(f){k.val($(f).attr("id"))}$(this).remove()})}if(i==WYMeditor.DIALOG_LINK){if(f){$(a._options.hrefSelector).val($(f).attr(WYMeditor.HREF));$(a._options.srcSelector).val($(f).attr(WYMeditor.SRC));$(a._options.titleSelector).val($(f).attr(WYMeditor.TITLE));$(a._options.altSelector).val($(f).attr(WYMeditor.ALT))}var c,d;if(f){c=$(f).attr("href");if(c==undefined){c=""}d=$(f).attr("title");if(d==undefined){d=""}}show_modal("Create Link","<div><div><label id='link_attribute_label'>URL <span style='float: right; font-size: 90%'><a href='#' id='set_link_id'>Create in-page anchor</a></span></label><br><input type='text' class='wym_href' value='"+c+"' size='40' /></div><div><label>Title</label><br><input type='text' class='wym_title' value='"+d+"' size='40' /></div><div>",{"Make link":function(){var m=$(a._options.hrefSelector).val()||"",k=$(".wym_id").val()||"",n=$(a._options.titleSelector).val()||"";if(m||k){a._exec(WYMeditor.CREATE_LINK,b);var l=$("a[href="+b+"]",a._doc.body);l.attr(WYMeditor.HREF,m).attr(WYMeditor.TITLE,n).attr("id",k);if(l.text().indexOf("wym-")===0){l.text(n)}}hide_modal()},Cancel:function(){hide_modal()}},{},h)}if(i==WYMeditor.DIALOG_IMAGE){if(a._selected_image){$(a._options.dialogImageSelector+" "+a._options.srcSelector).val($(a._selected_image).attr(WYMeditor.SRC));$(a._options.dialogImageSelector+" "+a._options.titleSelector).val($(a._selected_image).attr(WYMeditor.TITLE));$(a._options.dialogImageSelector+" "+a._options.altSelector).val($(a._selected_image).attr(WYMeditor.ALT))}show_modal("Image","<div class='row'><label>URL</label><br><input type='text' class='wym_src' value='' size='40' /></div><div class='row'><label>Alt text</label><br><input type='text' class='wym_alt' value='' size='40' /></div><div class='row'><label>Title</label><br><input type='text' class='wym_title' value='' size='40' /></div>",{Insert:function(){var k=$(a._options.srcSelector).val();if(k.length>0){a._exec(WYMeditor.INSERT_IMAGE,b);$("img[src$="+b+"]",a._doc.body).attr(WYMeditor.SRC,k).attr(WYMeditor.TITLE,$(a._options.titleSelector).val()).attr(WYMeditor.ALT,$(a._options.altSelector).val())}hide_modal()},Cancel:function(){hide_modal()}});return}if(i==WYMeditor.DIALOG_TABLE){show_modal("Table","<div class='row'><label>Caption</label><br><input type='text' class='wym_caption' value='' size='40' /></div><div class='row'><label>Summary</label><br><input type='text' class='wym_summary' value='' size='40' /></div><div class='row'><label>Number Of Rows<br></label><input type='text' class='wym_rows' value='3' size='3' /></div><div class='row'><label>Number Of Cols<br></label><input type='text' class='wym_cols' value='2' size='3' /></div>",{Insert:function(){var o=$(a._options.rowsSelector).val();var r=$(a._options.colsSelector).val();if(o>0&&r>0){var n=a._doc.createElement(WYMeditor.TABLE);var l=null;var q=null;var k=$(a._options.captionSelector).val();var p=n.createCaption();p.innerHTML=k;for(x=0;x<o;x++){l=n.insertRow(x);for(y=0;y<r;y++){l.insertCell(y)}}$(n).attr("summary",$(a._options.summarySelector).val());var m=$(a.findUp(a.container(),WYMeditor.MAIN_CONTAINERS)).get(0);if(!m||!m.parentNode){$(a._doc.body).append(n)}else{$(m).after(n)}}hide_modal()},Cancel:function(){hide_modal()}})}if(i==Galaxy.DIALOG_HISTORY_LINK||i==Galaxy.DIALOG_DATASET_LINK||i==Galaxy.DIALOG_WORKFLOW_LINK||i==Galaxy.DIALOG_PAGE_LINK||i==Galaxy.DIALOG_VISUALIZATION_LINK){var j;switch(i){case (Galaxy.DIALOG_HISTORY_LINK):j=get_item_info(Galaxy.ITEM_HISTORY);break;case (Galaxy.DIALOG_DATASET_LINK):j=get_item_info(Galaxy.ITEM_DATASET);break;case (Galaxy.DIALOG_WORKFLOW_LINK):j=get_item_info(Galaxy.ITEM_WORKFLOW);break;case (Galaxy.DIALOG_PAGE_LINK):j=get_item_info(Galaxy.ITEM_PAGE);break;case (Galaxy.DIALOG_VISUALIZATION_LINK):j=get_item_info(Galaxy.ITEM_VISUALIZATION);break}$.ajax({url:j.list_ajax_url,data:{},error:function(){alert("Failed to list "+j.plural.toLowerCase()+" for selection")},success:function(k){show_modal("Insert Link to "+j.singular,k+"<div><input id='make-importable' type='checkbox' checked/>Make the selected "+j.plural.toLowerCase()+" accessible so that they can viewed by everyone.</div>",{Insert:function(){var m=false;if($("#make-importable:checked").val()!==null){m=true}var l=new Array();$("input[name=id]:checked").each(function(){var n=$(this).val();if(m){make_item_importable(j.controller,n,j.singular)}url_template=get_name_and_link_url+n;ajax_url=url_template.replace("ITEM_CONTROLLER",j.controller);$.getJSON(ajax_url,function(p){a._exec(WYMeditor.CREATE_LINK,b);var o=$("a[href="+b+"]",a._doc.body).text();if(o==""||o==b){a.insert("<a href='"+p.link+"'>"+j.singular+" '"+p.name+"'</a>")}else{$("a[href="+b+"]",a._doc.body).attr(WYMeditor.HREF,p.link).attr(WYMeditor.TITLE,j.singular+n)}})});hide_modal()},Cancel:function(){hide_modal()}})}})}if(i==Galaxy.DIALOG_EMBED_HISTORY||i==Galaxy.DIALOG_EMBED_DATASET||i==Galaxy.DIALOG_EMBED_WORKFLOW||i==Galaxy.DIALOG_EMBED_PAGE||i==Galaxy.DIALOG_EMBED_VISUALIZATION){var j;switch(i){case (Galaxy.DIALOG_EMBED_HISTORY):j=get_item_info(Galaxy.ITEM_HISTORY);break;case (Galaxy.DIALOG_EMBED_DATASET):j=get_item_info(Galaxy.ITEM_DATASET);break;case (Galaxy.DIALOG_EMBED_WORKFLOW):j=get_item_info(Galaxy.ITEM_WORKFLOW);break;case (Galaxy.DIALOG_EMBED_PAGE):j=get_item_info(Galaxy.ITEM_PAGE);break;case (Galaxy.DIALOG_EMBED_VISUALIZATION):j=get_item_info(Galaxy.ITEM_VISUALIZATION);break}$.ajax({url:j.list_ajax_url,data:{},error:function(){alert("Failed to list "+j.plural.toLowerCase()+" for selection")},success:function(k){if(i==Galaxy.DIALOG_EMBED_HISTORY||i==Galaxy.DIALOG_EMBED_WORKFLOW||i==Galaxy.DIALOG_EMBED_VISUALIZATION){k=k+"<div><input id='make-importable' type='checkbox' checked/>Make the selected "+j.plural.toLowerCase()+" accessible so that they can viewed by everyone.</div>"}show_modal("Embed "+j.plural,k,{Embed:function(){var l=false;if($("#make-importable:checked").val()!=null){l=true}$("input[name=id]:checked").each(function(){var m=$(this).val();var p=$("label[for='"+m+"']:first").text();if(l){make_item_importable(j.controller,m,j.singular)}var n=j.iclass+"-"+m;var o="<p><div id='"+n+"' class='embedded-item "+j.singular.toLowerCase()+" placeholder'><p class='title'>Embedded Galaxy "+j.singular+" '"+p+"'</p><p class='content'> [Do not edit this block; Galaxy will fill it in with the annotated "+j.singular.toLowerCase()+" when it is displayed.] </p></div></p>";a.insert(" ");a.insert(o);$("#"+n,a._doc.body).each(function(){var q=true;while(q){var r=$(this).prev();if(r.length!=0&&jQuery.trim(r.text())==""){r.remove()}else{q=false}}})});hide_modal()},Cancel:function(){hide_modal()}})}})}if(i==Galaxy.DIALOG_ANNOTATE_HISTORY){$.ajax({url:list_histories_for_selection_url,data:{},error:function(){alert("Grid refresh failed")},success:function(k){show_modal("Insert Link to History",k,{Annotate:function(){var l=new Array();$("input[name=id]:checked").each(function(){var m=$(this).val();$.ajax({url:get_history_annotation_table_url,data:{id:m},error:function(){alert("Grid refresh failed")},success:function(n){a.insert(n);init_galaxy_elts(a)}})});hide_modal()},Cancel:function(){hide_modal()}})}})}};$(function(){$(document).ajaxError(function(i,g){var h=g.responseText||g.statusText||"Could not connect to server";show_modal("Server error",h,{"Ignore error":hide_modal});return false});$("[name=page_content]").wymeditor({skin:"galaxy",basePath:editor_base_path,iframeBasePath:iframe_base_path,boxHtml:"<table class='wym_box' width='100%' height='100%'><tr><td><div class='wym_area_top'>"+WYMeditor.TOOLS+"</div></td></tr><tr height='100%'><td><div class='wym_area_main' style='height: 100%;'>"+WYMeditor.IFRAME+WYMeditor.STATUS+"</div></div></td></tr></table>",toolsItems:[{name:"Bold",title:"Strong",css:"wym_tools_strong"},{name:"Italic",title:"Emphasis",css:"wym_tools_emphasis"},{name:"Superscript",title:"Superscript",css:"wym_tools_superscript"},{name:"Subscript",title:"Subscript",css:"wym_tools_subscript"},{name:"InsertOrderedList",title:"Ordered_List",css:"wym_tools_ordered_list"},{name:"InsertUnorderedList",title:"Unordered_List",css:"wym_tools_unordered_list"},{name:"Indent",title:"Indent",css:"wym_tools_indent"},{name:"Outdent",title:"Outdent",css:"wym_tools_outdent"},{name:"Undo",title:"Undo",css:"wym_tools_undo"},{name:"Redo",title:"Redo",css:"wym_tools_redo"},{name:"CreateLink",title:"Link",css:"wym_tools_link"},{name:"Unlink",title:"Unlink",css:"wym_tools_unlink"},{name:"InsertImage",title:"Image",css:"wym_tools_image"},{name:"InsertTable",title:"Table",css:"wym_tools_table"},]});var d=$.wymeditors(0);var f=function(g){show_modal("Saving page","progress");$.ajax({url:save_url,type:"POST",data:{id:page_id,content:d.xhtml(),annotations:JSON.stringify(new Object()),_:"true"},success:function(){g()}})};$("#save-button").click(function(){f(function(){hide_modal()})});$("#close-button").click(function(){var h=false;if(h){var g=function(){window.onbeforeunload=undefined;window.document.location=page_list_url};show_modal("Close editor","There are unsaved changes to your page which will be lost.",{Cancel:hide_modal,"Save Changes":function(){f(g)}},{"Don't Save":g})}else{window.document.location=page_list_url}});var a=$("<div class='galaxy-page-editor-button'><a id='insert-galaxy-link' class='action-button popup' href='#'>Paragraph type</a></div>");$(".wym_area_top").append(a);var b={};$.each(d._options.containersItems,function(h,g){var i=g.name;b[g.title.replace("_"," ")]=function(){d.container(i)}});make_popupmenu(a,b);var c=$("<div><a id='insert-galaxy-link' class='action-button popup' href='#'>Insert Link to Galaxy Object</a></div>").addClass("galaxy-page-editor-button");$(".wym_area_top").append(c);make_popupmenu(c,{"Insert History Link":function(){d.dialog(Galaxy.DIALOG_HISTORY_LINK)},"Insert Dataset Link":function(){d.dialog(Galaxy.DIALOG_DATASET_LINK)},"Insert Workflow Link":function(){d.dialog(Galaxy.DIALOG_WORKFLOW_LINK)},"Insert Page Link":function(){d.dialog(Galaxy.DIALOG_PAGE_LINK)},"Insert Visualization Link":function(){d.dialog(Galaxy.DIALOG_VISUALIZATION_LINK)},});var e=$("<div><a id='embed-galaxy-object' class='action-button popup' href='#'>Embed Galaxy Object</a></div>").addClass("galaxy-page-editor-button");$(".wym_area_top").append(e);make_popupmenu(e,{"Embed History":function(){d.dialog(Galaxy.DIALOG_EMBED_HISTORY)},"Embed Dataset":function(){d.dialog(Galaxy.DIALOG_EMBED_DATASET)},"Embed Workflow":function(){d.dialog(Galaxy.DIALOG_EMBED_WORKFLOW)},"Embed Visualization":function(){d.dialog(Galaxy.DIALOG_EMBED_VISUALIZATION)},})});
\ No newline at end of file
diff -r 82c3a4ab2b0191507cd720c96ada1a66b0b142db -r 208f93f6cdc00c6d866b8029b0f53990ce0bfadc static/scripts/packed/mvc/tools.js
--- a/static/scripts/packed/mvc/tools.js
+++ b/static/scripts/packed/mvc/tools.js
@@ -1,1 +1,1 @@
-define(["libs/underscore","viz/trackster/util","mvc/data","libs/backbone/backbone-relational"],function(q,a,r){var f=Backbone.RelationalModel.extend({defaults:{name:null,hidden:false},show:function(){this.set("hidden",false)},hide:function(){this.set("hidden",true)},is_visible:function(){return !this.attributes.hidden}});var k=Backbone.RelationalModel.extend({defaults:{name:null,label:null,type:null,value:null,num_samples:5},initialize:function(){this.attributes.html=unescape(this.attributes.html)},copy:function(){return new k(this.toJSON())},get_samples:function(){var u=this.get("type"),t=null;if(u==="number"){t=d3.scale.linear().domain([this.get("min"),this.get("max")]).ticks(this.get("num_samples"))}else{if(u==="select"){t=q.map(this.get("options"),function(v){return v[0]})}}return t}});var e=f.extend({defaults:{description:null,target:null,inputs:[]},relations:[{type:Backbone.HasMany,key:"inputs",relatedModel:k,reverseRelation:{key:"tool",includeInJSON:false}}],urlRoot:galaxy_paths.get("tool_url"),copy:function(u){var v=new e(this.toJSON());if(u){var t=new Backbone.Collection();v.get("inputs").each(function(w){if(w.get_samples()){t.push(w)}});v.set("inputs",t)}return v},apply_search_results:function(t){(q.indexOf(t,this.attributes.id)!==-1?this.show():this.hide());return this.is_visible()},set_input_value:function(t,u){this.get("inputs").find(function(v){return v.get("name")===t}).set("value",u)},set_input_values:function(u){var t=this;q.each(q.keys(u),function(v){t.set_input_value(v,u[v])})},run:function(){return this._run()},rerun:function(u,t){return this._run({action:"rerun",target_dataset_id:u.id,regions:t})},get_inputs_dict:function(){var t={};this.get("inputs").each(function(u){t[u.get("name")]=u.get("value")});return t},_run:function(v){var w=q.extend({tool_id:this.id,inputs:this.get_inputs_dict()},v);var u=$.Deferred(),t=new a.ServerStateDeferred({ajax_settings:{url:this.urlRoot,data:JSON.stringify(w),dataType:"json",contentType:"application/json",type:"POST"},interval:2000,success_fn:function(x){return x!=="pending"}});$.when(t.go()).then(function(x){u.resolve(new r.DatasetCollection().reset(x))});return u}});var i=Backbone.Collection.extend({model:e});var m=f.extend({});var p=f.extend({defaults:{elems:[],open:false},clear_search_results:function(){q.each(this.attributes.elems,function(t){t.show()});this.show();this.set("open",false)},apply_search_results:function(u){var v=true,t;q.each(this.attributes.elems,function(w){if(w instanceof m){t=w;t.hide()}else{if(w instanceof e){if(w.apply_search_results(u)){v=false;if(t){t.show()}}}}});if(v){this.hide()}else{this.show();this.set("open",true)}}});var b=f.extend({defaults:{search_hint_string:"search tools",min_chars_for_search:3,spinner_url:"",clear_btn_url:"",search_url:"",visible:true,query:"",results:null,clear_key:27},initialize:function(){this.on("change:query",this.do_search)},do_search:function(){var v=this.attributes.query;if(v.length<this.attributes.min_chars_for_search){this.set("results",null);return}var u=v+"*";if(this.timer){clearTimeout(this.timer)}$("#search-clear-btn").hide();$("#search-spinner").show();var t=this;this.timer=setTimeout(function(){$.get(t.attributes.search_url,{query:u},function(w){t.set("results",w);$("#search-spinner").hide();$("#search-clear-btn").show()},"json")},200)},clear_search:function(){this.set("query","");this.set("results",null)}});var j=Backbone.Collection.extend({url:"/tools",tools:new i(),parse:function(t){var u=function(x){var w=x.type;if(w==="tool"){return new e(x)}else{if(w==="section"){var v=q.map(x.elems,u);x.elems=v;return new p(x)}else{if(w==="label"){return new m(x)}}}};return q.map(t,u)},initialize:function(t){this.tool_search=t.tool_search;this.tool_search.on("change:results",this.apply_search_results,this);this.on("reset",this.populate_tools,this)},populate_tools:function(){var t=this;t.tools=new i();this.each(function(u){if(u instanceof p){q.each(u.attributes.elems,function(v){if(v instanceof e){t.tools.push(v)}})}else{if(u instanceof e){t.tools.push(u)}}})},clear_search_results:function(){this.each(function(t){if(t instanceof p){t.clear_search_results()}else{t.show()}})},apply_search_results:function(){var u=this.tool_search.attributes.results;if(u===null){this.clear_search_results();return}var t=null;this.each(function(v){if(v instanceof m){t=v;t.hide()}else{if(v instanceof e){if(v.apply_search_results(u)){if(t){t.show()}}}else{t=null;v.apply_search_results(u)}}})}});var n=Backbone.View.extend({initialize:function(){this.model.on("change:hidden",this.update_visible,this);this.update_visible()},update_visible:function(){(this.model.attributes.hidden?this.$el.hide():this.$el.show())}});var h=n.extend({tagName:"div",template:Handlebars.templates.tool_link,render:function(){this.$el.append(this.template(this.model.toJSON()));return this}});var c=n.extend({tagName:"div",className:"toolPanelLabel",render:function(){this.$el.append($("<span/>").text(this.model.attributes.name));return this}});var g=n.extend({tagName:"div",className:"toolSectionWrapper",template:Handlebars.templates.panel_section,initialize:function(){n.prototype.initialize.call(this);this.model.on("change:open",this.update_open,this)},render:function(){this.$el.append(this.template(this.model.toJSON()));var t=this.$el.find(".toolSectionBody");q.each(this.model.attributes.elems,function(u){if(u instanceof e){var v=new h({model:u,className:"toolTitle"});v.render();t.append(v.$el)}else{if(u instanceof m){var w=new c({model:u});w.render();t.append(w.$el)}else{}}});return this},events:{"click .toolSectionTitle > a":"toggle"},toggle:function(){this.model.set("open",!this.model.attributes.open)},update_open:function(){(this.model.attributes.open?this.$el.children(".toolSectionBody").slideDown("fast"):this.$el.children(".toolSectionBody").slideUp("fast"))}});var l=Backbone.View.extend({tagName:"div",id:"tool-search",className:"bar",template:Handlebars.templates.tool_search,events:{click:"focus_and_select","keyup :input":"query_changed","click #search-clear-btn":"clear"},render:function(){this.$el.append(this.template(this.model.toJSON()));if(!this.model.is_visible()){this.$el.hide()}this.$el.find(".tooltip").tooltip();return this},focus_and_select:function(){this.$el.find(":input").focus().select()},clear:function(){this.model.clear_search();this.$el.find(":input").val(this.model.attributes.search_hint_string);this.focus_and_select();return false},query_changed:function(t){if((this.model.attributes.clear_key)&&(this.model.attributes.clear_key===t.which)){this.clear();return false}this.model.set("query",this.$el.find(":input").val())}});var s=Backbone.View.extend({tagName:"div",className:"toolMenu",initialize:function(){this.collection.tool_search.on("change:results",this.handle_search_results,this)},render:function(){var t=this;var u=new l({model:this.collection.tool_search});u.render();t.$el.append(u.$el);this.collection.each(function(w){if(w instanceof p){var v=new g({model:w});v.render();t.$el.append(v.$el)}else{if(w instanceof e){var x=new h({model:w,className:"toolTitleNoSection"});x.render();t.$el.append(x.$el)}else{if(w instanceof m){var y=new c({model:w});y.render();t.$el.append(y.$el)}}}});t.$el.find("a.tool-link").click(function(x){var w=$(this).attr("class").split(/\s+/)[0],v=t.collection.tools.get(w);t.trigger("tool_link_click",x,v)});return this},handle_search_results:function(){var t=this.collection.tool_search.attributes.results;if(t&&t.length===0){$("#search-no-results").show()}else{$("#search-no-results").hide()}}});var o=Backbone.View.extend({className:"toolForm",template:Handlebars.templates.tool_form,render:function(){this.$el.children().remove();this.$el.append(this.template(this.model.toJSON()))}});var d=Backbone.View.extend({className:"toolMenuAndView",initialize:function(){this.tool_panel_view=new s({collection:this.collection});this.tool_form_view=new o()},render:function(){this.tool_panel_view.render();this.tool_panel_view.$el.css("float","left");this.$el.append(this.tool_panel_view.$el);this.tool_form_view.$el.hide();this.$el.append(this.tool_form_view.$el);var t=this;this.tool_panel_view.on("tool_link_click",function(v,u){v.preventDefault();t.show_tool(u)})},show_tool:function(u){var t=this;u.fetch().done(function(){t.tool_form_view.model=u;t.tool_form_view.render();t.tool_form_view.$el.show();$("#left").width("650px")})}});return{Tool:e,ToolSearch:b,ToolPanel:j,ToolPanelView:s,ToolFormView:o}});
\ No newline at end of file
+define(["libs/underscore","viz/trackster/util","mvc/data","libs/backbone/backbone-relational"],function(q,a,r){var g=Backbone.RelationalModel.extend({defaults:{name:null,hidden:false},show:function(){this.set("hidden",false)},hide:function(){this.set("hidden",true)},is_visible:function(){return !this.attributes.hidden}});var c=Backbone.RelationalModel.extend({defaults:{name:null,label:null,type:null,value:null,num_samples:5},initialize:function(){this.attributes.html=unescape(this.attributes.html)},copy:function(){return new c(this.toJSON())},get_samples:function(){var u=this.get("type"),t=null;if(u==="number"){t=d3.scale.linear().domain([this.get("min"),this.get("max")]).ticks(this.get("num_samples"))}else{if(u==="select"){t=q.map(this.get("options"),function(v){return v[0]})}}return t}});var f=g.extend({defaults:{description:null,target:null,inputs:[]},relations:[{type:Backbone.HasMany,key:"inputs",relatedModel:c,reverseRelation:{key:"tool",includeInJSON:false}}],urlRoot:galaxy_paths.get("tool_url"),copy:function(u){var v=new f(this.toJSON());if(u){var t=new Backbone.Collection();v.get("inputs").each(function(w){if(w.get_samples()){t.push(w)}});v.set("inputs",t)}return v},apply_search_results:function(t){(q.indexOf(t,this.attributes.id)!==-1?this.show():this.hide());return this.is_visible()},set_input_value:function(t,u){this.get("inputs").find(function(v){return v.get("name")===t}).set("value",u)},set_input_values:function(u){var t=this;q.each(q.keys(u),function(v){t.set_input_value(v,u[v])})},run:function(){return this._run()},rerun:function(u,t){return this._run({action:"rerun",target_dataset_id:u.id,regions:t})},get_inputs_dict:function(){var t={};this.get("inputs").each(function(u){t[u.get("name")]=u.get("value")});return t},_run:function(v){var w=q.extend({tool_id:this.id,inputs:this.get_inputs_dict()},v);var u=$.Deferred(),t=new a.ServerStateDeferred({ajax_settings:{url:this.urlRoot,data:JSON.stringify(w),dataType:"json",contentType:"application/json",type:"POST"},interval:2000,success_fn:function(x){return x!=="pending"}});$.when(t.go()).then(function(x){u.resolve(new r.DatasetCollection().reset(x))});return u}});var j=Backbone.Collection.extend({model:f});var m=g.extend({});var p=g.extend({defaults:{elems:[],open:false},clear_search_results:function(){q.each(this.attributes.elems,function(t){t.show()});this.show();this.set("open",false)},apply_search_results:function(u){var v=true,t;q.each(this.attributes.elems,function(w){if(w instanceof m){t=w;t.hide()}else{if(w instanceof f){if(w.apply_search_results(u)){v=false;if(t){t.show()}}}}});if(v){this.hide()}else{this.show();this.set("open",true)}}});var b=g.extend({defaults:{search_hint_string:"search tools",min_chars_for_search:3,spinner_url:"",clear_btn_url:"",search_url:"",visible:true,query:"",results:null,clear_key:27},initialize:function(){this.on("change:query",this.do_search)},do_search:function(){var v=this.attributes.query;if(v.length<this.attributes.min_chars_for_search){this.set("results",null);return}var u=v+"*";if(this.timer){clearTimeout(this.timer)}$("#search-clear-btn").hide();$("#search-spinner").show();var t=this;this.timer=setTimeout(function(){$.get(t.attributes.search_url,{query:u},function(w){t.set("results",w);$("#search-spinner").hide();$("#search-clear-btn").show()},"json")},200)},clear_search:function(){this.set("query","");this.set("results",null)}});var k=Backbone.Collection.extend({url:"/tools",tools:new j(),parse:function(t){var u=function(x){var w=x.type;if(w==="tool"){return new f(x)}else{if(w==="section"){var v=q.map(x.elems,u);x.elems=v;return new p(x)}else{if(w==="label"){return new m(x)}}}};return q.map(t,u)},initialize:function(t){this.tool_search=t.tool_search;this.tool_search.on("change:results",this.apply_search_results,this);this.on("reset",this.populate_tools,this)},populate_tools:function(){var t=this;t.tools=new j();this.each(function(u){if(u instanceof p){q.each(u.attributes.elems,function(v){if(v instanceof f){t.tools.push(v)}})}else{if(u instanceof f){t.tools.push(u)}}})},clear_search_results:function(){this.each(function(t){if(t instanceof p){t.clear_search_results()}else{t.show()}})},apply_search_results:function(){var u=this.tool_search.attributes.results;if(u===null){this.clear_search_results();return}var t=null;this.each(function(v){if(v instanceof m){t=v;t.hide()}else{if(v instanceof f){if(v.apply_search_results(u)){if(t){t.show()}}}else{t=null;v.apply_search_results(u)}}})}});var n=Backbone.View.extend({initialize:function(){this.model.on("change:hidden",this.update_visible,this);this.update_visible()},update_visible:function(){(this.model.attributes.hidden?this.$el.hide():this.$el.show())}});var i=n.extend({tagName:"div",template:Handlebars.templates.tool_link,render:function(){this.$el.append(this.template(this.model.toJSON()));return this}});var d=n.extend({tagName:"div",className:"toolPanelLabel",render:function(){this.$el.append($("<span/>").text(this.model.attributes.name));return this}});var h=n.extend({tagName:"div",className:"toolSectionWrapper",template:Handlebars.templates.panel_section,initialize:function(){n.prototype.initialize.call(this);this.model.on("change:open",this.update_open,this)},render:function(){this.$el.append(this.template(this.model.toJSON()));var t=this.$el.find(".toolSectionBody");q.each(this.model.attributes.elems,function(u){if(u instanceof f){var v=new i({model:u,className:"toolTitle"});v.render();t.append(v.$el)}else{if(u instanceof m){var w=new d({model:u});w.render();t.append(w.$el)}else{}}});return this},events:{"click .toolSectionTitle > a":"toggle"},toggle:function(){this.model.set("open",!this.model.attributes.open)},update_open:function(){(this.model.attributes.open?this.$el.children(".toolSectionBody").slideDown("fast"):this.$el.children(".toolSectionBody").slideUp("fast"))}});var l=Backbone.View.extend({tagName:"div",id:"tool-search",className:"bar",template:Handlebars.templates.tool_search,events:{click:"focus_and_select","keyup :input":"query_changed","click #search-clear-btn":"clear"},render:function(){this.$el.append(this.template(this.model.toJSON()));if(!this.model.is_visible()){this.$el.hide()}this.$el.find(".tooltip").tooltip();return this},focus_and_select:function(){this.$el.find(":input").focus().select()},clear:function(){this.model.clear_search();this.$el.find(":input").val(this.model.attributes.search_hint_string);this.focus_and_select();return false},query_changed:function(t){if((this.model.attributes.clear_key)&&(this.model.attributes.clear_key===t.which)){this.clear();return false}this.model.set("query",this.$el.find(":input").val())}});var s=Backbone.View.extend({tagName:"div",className:"toolMenu",initialize:function(){this.collection.tool_search.on("change:results",this.handle_search_results,this)},render:function(){var t=this;var u=new l({model:this.collection.tool_search});u.render();t.$el.append(u.$el);this.collection.each(function(w){if(w instanceof p){var v=new h({model:w});v.render();t.$el.append(v.$el)}else{if(w instanceof f){var x=new i({model:w,className:"toolTitleNoSection"});x.render();t.$el.append(x.$el)}else{if(w instanceof m){var y=new d({model:w});y.render();t.$el.append(y.$el)}}}});t.$el.find("a.tool-link").click(function(x){var w=$(this).attr("class").split(/\s+/)[0],v=t.collection.tools.get(w);t.trigger("tool_link_click",x,v)});return this},handle_search_results:function(){var t=this.collection.tool_search.attributes.results;if(t&&t.length===0){$("#search-no-results").show()}else{$("#search-no-results").hide()}}});var o=Backbone.View.extend({className:"toolForm",template:Handlebars.templates.tool_form,render:function(){this.$el.children().remove();this.$el.append(this.template(this.model.toJSON()))}});var e=Backbone.View.extend({className:"toolMenuAndView",initialize:function(){this.tool_panel_view=new s({collection:this.collection});this.tool_form_view=new o()},render:function(){this.tool_panel_view.render();this.tool_panel_view.$el.css("float","left");this.$el.append(this.tool_panel_view.$el);this.tool_form_view.$el.hide();this.$el.append(this.tool_form_view.$el);var t=this;this.tool_panel_view.on("tool_link_click",function(v,u){v.preventDefault();t.show_tool(u)})},show_tool:function(u){var t=this;u.fetch().done(function(){t.tool_form_view.model=u;t.tool_form_view.render();t.tool_form_view.$el.show();$("#left").width("650px")})}});return{Tool:f,ToolSearch:b,ToolPanel:k,ToolPanelView:s,ToolFormView:o}});
\ No newline at end of file
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/82c3a4ab2b01/
Changeset: 82c3a4ab2b01
Branch: next-stable
User: Dave Bouvier
Date: 2013-07-31 16:38:40
Summary: Fix server error when displaying a tool with conditionals in the tool shed.
Affected #: 2 files
diff -r 866d8b29854f4079250efae62a6fddf0204e51c4 -r 82c3a4ab2b0191507cd720c96ada1a66b0b142db lib/galaxy/tools/parameters/basic.py
--- a/lib/galaxy/tools/parameters/basic.py
+++ b/lib/galaxy/tools/parameters/basic.py
@@ -1514,8 +1514,8 @@
NOTE: This is wasteful since dynamic options and dataset collection
happens twice (here and when generating HTML).
"""
- # Can't look at history in workflow mode
- if trans is None or trans.workflow_building_mode:
+ # Can't look at history in workflow mode. Tool shed has no histories.
+ if trans is None or trans.workflow_building_mode or trans.webapp.name == 'tool_shed':
return DummyDataset()
assert trans is not None, "DataToolParameter requires a trans"
history = trans.get_history()
diff -r 866d8b29854f4079250efae62a6fddf0204e51c4 -r 82c3a4ab2b0191507cd720c96ada1a66b0b142db templates/webapps/tool_shed/repository/tool_form.mako
--- a/templates/webapps/tool_shed/repository/tool_form.mako
+++ b/templates/webapps/tool_shed/repository/tool_form.mako
@@ -70,6 +70,8 @@
<%def name="row_for_param( prefix, param, parent_state, other_values )"><%
+ # Disable refresh_on_change for select lists displayed in the tool shed.
+ param.refresh_on_change = False
label = param.get_label()
if isinstance( param, DataToolParameter ) or isinstance( param, ColumnListParameter ) or isinstance( param, GenomeBuildParameter ):
field = SelectField( param.name )
https://bitbucket.org/galaxy/galaxy-central/commits/f2e03734f86b/
Changeset: f2e03734f86b
User: Dave Bouvier
Date: 2013-07-31 16:40:15
Summary: Merge in bugfix from next-stable.
Affected #: 2 files
diff -r 6a32d26aefc758cf576e0b753c2626ac56005c18 -r f2e03734f86bc6bec204cee0c9b53aac8b20ba4a lib/galaxy/tools/parameters/basic.py
--- a/lib/galaxy/tools/parameters/basic.py
+++ b/lib/galaxy/tools/parameters/basic.py
@@ -1514,8 +1514,8 @@
NOTE: This is wasteful since dynamic options and dataset collection
happens twice (here and when generating HTML).
"""
- # Can't look at history in workflow mode
- if trans is None or trans.workflow_building_mode:
+ # Can't look at history in workflow mode. Tool shed has no histories.
+ if trans is None or trans.workflow_building_mode or trans.webapp.name == 'tool_shed':
return DummyDataset()
assert trans is not None, "DataToolParameter requires a trans"
history = trans.get_history()
diff -r 6a32d26aefc758cf576e0b753c2626ac56005c18 -r f2e03734f86bc6bec204cee0c9b53aac8b20ba4a templates/webapps/tool_shed/repository/tool_form.mako
--- a/templates/webapps/tool_shed/repository/tool_form.mako
+++ b/templates/webapps/tool_shed/repository/tool_form.mako
@@ -70,6 +70,8 @@
<%def name="row_for_param( prefix, param, parent_state, other_values )"><%
+ # Disable refresh_on_change for select lists displayed in the tool shed.
+ param.refresh_on_change = False
label = param.get_label()
if isinstance( param, DataToolParameter ) or isinstance( param, ColumnListParameter ) or isinstance( param, GenomeBuildParameter ):
field = SelectField( param.name )
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: jgoecks: New version of Cuffdiff wrapper: (a) remove obsolete wrapper script; (b) rework steps to specify conditions and replicates; and (c) remove deprecated options.
by commits-noreply@bitbucket.org 31 Jul '13
by commits-noreply@bitbucket.org 31 Jul '13
31 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/6a32d26aefc7/
Changeset: 6a32d26aefc7
User: jgoecks
Date: 2013-07-31 15:50:00
Summary: New version of Cuffdiff wrapper: (a) remove obsolete wrapper script; (b) rework steps to specify conditions and replicates; and (c) remove deprecated options.
Affected #: 2 files
diff -r 951e853b0bcd2c62cedee0b95d46c9e36ab6c605 -r 6a32d26aefc758cf576e0b753c2626ac56005c18 tools/ngs_rna/cuffdiff_wrapper.py
--- a/tools/ngs_rna/cuffdiff_wrapper.py
+++ /dev/null
@@ -1,241 +0,0 @@
-#!/usr/bin/env python
-
-# Wrapper supports Cuffdiff versions v1.3.0-v2.0
-
-import optparse, os, shutil, subprocess, sys, tempfile
-
-def group_callback( option, op_str, value, parser ):
- groups = []
- flist = []
- for arg in parser.rargs:
- arg = arg.strip()
- if arg[0] is "-":
- break
- elif arg[0] is ",":
- groups.append(flist)
- flist = []
- else:
- flist.append(arg)
- groups.append(flist)
-
- setattr(parser.values, option.dest, groups)
-
-def label_callback( option, op_str, value, parser ):
- labels = []
- for arg in parser.rargs:
- arg = arg.strip()
- if arg[0] is "-":
- break
- else:
- labels.append(arg)
-
- setattr(parser.values, option.dest, labels)
-
-def stop_err( msg ):
- sys.stderr.write( "%s\n" % msg )
- sys.exit()
-
-# Copied from sam_to_bam.py:
-def check_seq_file( dbkey, cached_seqs_pointer_file ):
- seq_path = ''
- for line in open( cached_seqs_pointer_file ):
- line = line.rstrip( '\r\n' )
- if line and not line.startswith( '#' ) and line.startswith( 'index' ):
- fields = line.split( '\t' )
- if len( fields ) < 3:
- continue
- if fields[1] == dbkey:
- seq_path = fields[2].strip()
- break
- return seq_path
-
-def __main__():
- #Parse Command Line
- parser = optparse.OptionParser()
-
- # Cuffdiff options.
- parser.add_option( '-s', '--inner-dist-std-dev', dest='inner_dist_std_dev', help='The standard deviation for the distribution on inner distances between mate pairs. The default is 20bp.' )
- parser.add_option( '-p', '--num-threads', dest='num_threads', help='Use this many threads to align reads. The default is 1.' )
- parser.add_option( '-m', '--inner-mean-dist', dest='inner_mean_dist', help='This is the expected (mean) inner distance between mate pairs. \
- For, example, for paired end runs with fragments selected at 300bp, \
- where each end is 50bp, you should set -r to be 200. The default is 45bp.')
- parser.add_option( '-c', '--min-alignment-count', dest='min_alignment_count', help='The minimum number of alignments in a locus for needed to conduct significance testing on changes in that locus observed between samples. If no testing is performed, changes in the locus are deemed not signficant, and the locus\' observed changes don\'t contribute to correction for multiple testing. The default is 1,000 fragment alignments (up to 2,000 paired reads).' )
- parser.add_option( '--FDR', dest='FDR', help='The allowed false discovery rate. The default is 0.05.' )
- parser.add_option( '-u', '--multi-read-correct', dest='multi_read_correct', action="store_true", help='Tells Cufflinks to do an initial estimation procedure to more accurately weight reads mapping to multiple locations in the genome')
- parser.add_option( '--library-norm-method', dest='library_norm_method' )
- parser.add_option( '--dispersion-method', dest='dispersion_method' )
-
- # Advanced Options:
- parser.add_option( '--num-importance-samples', dest='num_importance_samples', help='Sets the number of importance samples generated for each locus during abundance estimation. Default: 1000' )
- parser.add_option( '--max-mle-iterations', dest='max_mle_iterations', help='Sets the number of iterations allowed during maximum likelihood estimation of abundances. Default: 5000' )
-
- # Wrapper / Galaxy options.
- parser.add_option( '-f', '--files', dest='groups', action="callback", callback=group_callback, help="Groups to be processed, groups are separated by spaces, replicates in a group comma separated. group1_rep1,group1_rep2 group2_rep1,group2_rep2, ..., groupN_rep1, groupN_rep2" )
- parser.add_option( '-A', '--inputA', dest='inputA', help='A transcript GTF file produced by cufflinks, cuffcompare, or other source.')
- parser.add_option( '-1', '--input1', dest='input1', help='File of RNA-Seq read alignments in the SAM format. SAM is a standard short read alignment, that allows aligners to attach custom tags to individual alignments, and Cufflinks requires that the alignments you supply have some of these tags. Please see Input formats for more details.' )
- parser.add_option( '-2', '--input2', dest='input2', help='File of RNA-Seq read alignments in the SAM format. SAM is a standard short read alignment, that allows aligners to attach custom tags to individual alignments, and Cufflinks requires that the alignments you supply have some of these tags. Please see Input formats for more details.' )
-
- # Label options
- parser.add_option('-L', '--labels', dest='labels', action="callback", callback=label_callback, help="Labels for the groups the replicates are in.")
-
- # Normalization options.
- parser.add_option( "-N", "--quartile-normalization", dest="do_normalization", action="store_true" )
-
- # Bias correction options.
- parser.add_option( '-b', dest='do_bias_correction', action="store_true", help='Providing Cufflinks with a multifasta file via this option instructs it to run our new bias detection and correction algorithm which can significantly improve accuracy of transcript abundance estimates.')
- parser.add_option( '', '--dbkey', dest='dbkey', help='The build of the reference dataset' )
- parser.add_option( '', '--index_dir', dest='index_dir', help='GALAXY_DATA_INDEX_DIR' )
- parser.add_option( '', '--ref_file', dest='ref_file', help='The reference dataset from the history' )
-
- # Outputs.
- parser.add_option( "--isoforms_fpkm_tracking_output", dest="isoforms_fpkm_tracking_output" )
- parser.add_option( "--genes_fpkm_tracking_output", dest="genes_fpkm_tracking_output" )
- parser.add_option( "--cds_fpkm_tracking_output", dest="cds_fpkm_tracking_output" )
- parser.add_option( "--tss_groups_fpkm_tracking_output", dest="tss_groups_fpkm_tracking_output" )
- parser.add_option( "--isoforms_exp_output", dest="isoforms_exp_output" )
- parser.add_option( "--genes_exp_output", dest="genes_exp_output" )
- parser.add_option( "--tss_groups_exp_output", dest="tss_groups_exp_output" )
- parser.add_option( "--cds_exp_fpkm_tracking_output", dest="cds_exp_fpkm_tracking_output" )
- parser.add_option( "--splicing_diff_output", dest="splicing_diff_output" )
- parser.add_option( "--cds_diff_output", dest="cds_diff_output" )
- parser.add_option( "--promoters_diff_output", dest="promoters_diff_output" )
-
- (options, args) = parser.parse_args()
-
- # output version # of tool
- try:
- tmp = tempfile.NamedTemporaryFile().name
- tmp_stdout = open( tmp, 'wb' )
- proc = subprocess.Popen( args='cuffdiff --no-update-check 2>&1', shell=True, stdout=tmp_stdout )
- tmp_stdout.close()
- returncode = proc.wait()
- stdout = None
- for line in open( tmp_stdout.name, 'rb' ):
- if line.lower().find( 'cuffdiff v' ) >= 0:
- stdout = line.strip()
- break
- if stdout:
- sys.stdout.write( '%s\n' % stdout )
- else:
- raise Exception
- except:
- sys.stdout.write( 'Could not determine Cuffdiff version\n' )
-
- # If doing bias correction, set/link to sequence file.
- if options.do_bias_correction:
- if options.ref_file != 'None':
- # Sequence data from history.
- # Create symbolic link to ref_file so that index will be created in working directory.
- seq_path = "ref.fa"
- os.symlink( options.ref_file, seq_path )
- else:
- # Sequence data from loc file.
- cached_seqs_pointer_file = os.path.join( options.index_dir, 'sam_fa_indices.loc' )
- if not os.path.exists( cached_seqs_pointer_file ):
- stop_err( 'The required file (%s) does not exist.' % cached_seqs_pointer_file )
- # If found for the dbkey, seq_path will look something like /galaxy/data/equCab2/sam_index/equCab2.fa,
- # and the equCab2.fa file will contain fasta sequences.
- seq_path = check_seq_file( options.dbkey, cached_seqs_pointer_file )
- if seq_path == '':
- stop_err( 'No sequence data found for dbkey %s, so bias correction cannot be used.' % options.dbkey )
-
- # Build command.
-
- # Base; always use quiet mode to avoid problems with storing log output.
- cmd = "cuffdiff --no-update-check -q"
-
- # Add options.
- if options.library_norm_method:
- cmd += ( " --library-norm-method %s" % options.library_norm_method )
- if options.dispersion_method:
- cmd += ( " --dispersion-method %s" % options.dispersion_method )
- if options.inner_dist_std_dev:
- cmd += ( " -s %i" % int ( options.inner_dist_std_dev ) )
- if options.num_threads:
- cmd += ( " -p %i" % int ( options.num_threads ) )
- if options.inner_mean_dist:
- cmd += ( " -m %i" % int ( options.inner_mean_dist ) )
- if options.min_alignment_count:
- cmd += ( " -c %i" % int ( options.min_alignment_count ) )
- if options.FDR:
- cmd += ( " --FDR %f" % float( options.FDR ) )
- if options.multi_read_correct:
- cmd += ( " -u" )
- if options.num_importance_samples:
- cmd += ( " --num-importance-samples %i" % int ( options.num_importance_samples ) )
- if options.max_mle_iterations:
- cmd += ( " --max-mle-iterations %i" % int ( options.max_mle_iterations ) )
- if options.do_normalization:
- cmd += ( " -N" )
- if options.do_bias_correction:
- cmd += ( " -b %s" % seq_path )
-
- # Add inputs.
- # For replicate analysis: group1_rep1,group1_rep2 groupN_rep1,groupN_rep2
- if options.groups:
- cmd += " --labels "
- for label in options.labels:
- cmd += '"%s",' % label
- cmd = cmd[:-1]
-
- cmd += " " + options.inputA + " "
-
- for group in options.groups:
- for filename in group:
- cmd += filename + ","
- cmd = cmd[:-1] + " "
- else:
- cmd += " " + options.inputA + " " + options.input1 + " " + options.input2
-
- # Debugging.
- print cmd
-
- # Run command.
- try:
- tmp_name = tempfile.NamedTemporaryFile().name
- tmp_stderr = open( tmp_name, 'wb' )
- proc = subprocess.Popen( args=cmd, shell=True, stderr=tmp_stderr.fileno() )
- returncode = proc.wait()
- tmp_stderr.close()
-
- # Get stderr, allowing for case where it's very large.
- tmp_stderr = open( tmp_name, 'rb' )
- stderr = ''
- buffsize = 1048576
- try:
- while True:
- stderr += tmp_stderr.read( buffsize )
- if not stderr or len( stderr ) % buffsize != 0:
- break
- except OverflowError:
- pass
- tmp_stderr.close()
-
- # Error checking.
- if returncode != 0:
- raise Exception, stderr
-
- # check that there are results in the output file
- if len( open( "isoforms.fpkm_tracking", 'rb' ).read().strip() ) == 0:
- raise Exception, 'The main output file is empty, there may be an error with your input file or settings.'
- except Exception, e:
- stop_err( 'Error running cuffdiff. ' + str( e ) )
-
-
- # Copy output files to specified files.
- try:
- shutil.copyfile( "isoforms.fpkm_tracking", options.isoforms_fpkm_tracking_output )
- shutil.copyfile( "genes.fpkm_tracking", options.genes_fpkm_tracking_output )
- shutil.copyfile( "cds.fpkm_tracking", options.cds_fpkm_tracking_output )
- shutil.copyfile( "tss_groups.fpkm_tracking", options.tss_groups_fpkm_tracking_output )
- shutil.copyfile( "isoform_exp.diff", options.isoforms_exp_output )
- shutil.copyfile( "gene_exp.diff", options.genes_exp_output )
- shutil.copyfile( "tss_group_exp.diff", options.tss_groups_exp_output )
- shutil.copyfile( "splicing.diff", options.splicing_diff_output )
- shutil.copyfile( "cds.diff", options.cds_diff_output )
- shutil.copyfile( "cds_exp.diff", options.cds_exp_fpkm_tracking_output )
- shutil.copyfile( "promoters.diff", options.promoters_diff_output )
- except Exception, e:
- stop_err( 'Error in cuffdiff:\n' + str( e ) )
-
-if __name__=="__main__": __main__()
diff -r 951e853b0bcd2c62cedee0b95d46c9e36ab6c605 -r 6a32d26aefc758cf576e0b753c2626ac56005c18 tools/ngs_rna/cuffdiff_wrapper.xml
--- a/tools/ngs_rna/cuffdiff_wrapper.xml
+++ b/tools/ngs_rna/cuffdiff_wrapper.xml
@@ -1,40 +1,23 @@
-<tool id="cuffdiff" name="Cuffdiff" version="0.0.5">
+<tool id="cuffdiff" name="Cuffdiff" version="0.0.6"><!-- Wrapper supports Cuffdiff versions 2.1.0-2.1.1 --><description>find significant changes in transcript expression, splicing, and promoter use</description><requirements><requirement type="package">cufflinks</requirement></requirements>
- <command interpreter="python">
- cuffdiff_wrapper.py
+ <command>
+ cuffdiff
--FDR=$fdr
--num-threads="4"
--min-alignment-count=$min_alignment_count
--library-norm-method=$library_norm_method
--dispersion-method=$dispersion_method
- --isoforms_fpkm_tracking_output=$isoforms_fpkm_tracking
- --genes_fpkm_tracking_output=$genes_fpkm_tracking
- --cds_fpkm_tracking_output=$cds_fpkm_tracking
- --tss_groups_fpkm_tracking_output=$tss_groups_fpkm_tracking
- --isoforms_exp_output=$isoforms_exp
- --genes_exp_output=$genes_exp
- --tss_groups_exp_output=$tss_groups_exp
- --cds_exp_fpkm_tracking_output=$cds_exp_fpkm_tracking
- --splicing_diff_output=$splicing_diff
- --cds_diff_output=$cds_diff
- --promoters_diff_output=$promoters_diff
-
## Set advanced data parameters?
#if $additional.sAdditional == "Yes":
-m $additional.frag_mean_len
-s $additional.frag_len_std_dev
#end if
- ## Normalization?
- #if str($do_normalization) == "Yes":
- -N
- #end if
-
## Multi-read correct?
#if str($multiread_correct) == "Yes":
-u
@@ -51,50 +34,26 @@
--dbkey=${gtf_input.metadata.dbkey}
--index_dir=${GALAXY_DATA_INDEX_DIR}
#end if
-
+
+ #set labels = ','.join( [ str( $condition.name ) for $condition in $conditions ] )
+ --labels $labels
+
## Inputs.
- --inputA=$gtf_input
- #if $group_analysis.do_groups == "No":
- --input1=$aligned_reads1
- --input2=$aligned_reads2
- #else:
- ## Replicates.
- --labels
- #for $group in $group_analysis.groups
- ## Cuffdiff uses commas as delimiters, so replace them with underscores to avoid
- ## parsing problems.
- "${group.group.replace(',', '_')}"
- #end for
- --files
- #for $group in $group_analysis.groups
- #for $file in $group.files:
- ${file.file}
- #end for
- ,
- #end for
- #end if
-
+ $gtf_input
+ #for $condition in $conditions:
+ #set samples = ','.join( [ str( $sample.sample ) for $sample in $condition.samples ] )
+ $samples
+ #end for
</command><inputs><param format="gtf,gff3" name="gtf_input" type="data" label="Transcripts" help="A transcript GFF3 or GTF file produced by cufflinks, cuffcompare, or other source."/>
- <conditional name="group_analysis">
- <param name="do_groups" type="select" label="Perform replicate analysis" help="Perform cuffdiff with replicates in each group.">
- <option value="No">No</option>
- <option value="Yes">Yes</option>
- </param>
- <when value="Yes">
- <repeat name="groups" title="Group">
- <param name="group" title="Group name" type="text" label="Group name"/>
- <repeat name="files" title="Replicate">
- <param name="file" label="Add file" type="data" format="sam,bam"/>
- </repeat>
- </repeat>
- </when>
- <when value="No">
- <param format="sam,bam" name="aligned_reads1" type="data" label="SAM or BAM file of aligned RNA-Seq reads" help=""/>
- <param format="sam,bam" name="aligned_reads2" type="data" label="SAM or BAM file of aligned RNA-Seq reads" help=""/>
- </when>
- </conditional>
+
+ <repeat name="conditions" title="Condition" min="2">
+ <param name="name" title="Condition name" type="text" label="Name"/>
+ <repeat name="samples" title="Replicate" min="1">
+ <param name="sample" label="Add replicate" type="data" format="sam,bam"/>
+ </repeat>
+ </repeat><param name="library_norm_method" type="select" label="Library normalization method"><option value="geometric" selected="True">geometric</option>
@@ -112,11 +71,6 @@
<param name="min_alignment_count" type="integer" value="10" label="Min Alignment Count" help="The minimum number of alignments in a locus for needed to conduct significance testing on changes in that locus observed between samples."/>
- <param name="do_normalization" type="select" label="Perform quartile normalization" help="Removes top 25% of genes from FPKM denominator to improve accuracy of differential expression calls for low abundance transcripts.">
- <option value="No">No</option>
- <option value="Yes">Yes</option>
- </param>
-
<param name="multiread_correct" type="select" label="Use multi-read correct" help="Tells Cufflinks to do an initial estimation procedure to more accurately weight reads mapping to multiple locations in the genome."><option value="No" selected="true">No</option><option value="Yes">Yes</option>
@@ -155,18 +109,22 @@
</conditional></inputs>
+ <stdio>
+ <regex match=".*" source="both" level="log" description="tool progress"/>
+ </stdio>
+
<outputs>
- <data format="tabular" name="splicing_diff" label="${tool.name} on ${on_string}: splicing differential expression testing"/>
- <data format="tabular" name="promoters_diff" label="${tool.name} on ${on_string}: promoters differential expression testing"/>
- <data format="tabular" name="cds_diff" label="${tool.name} on ${on_string}: CDS overloading diffential expression testing"/>
- <data format="tabular" name="cds_exp_fpkm_tracking" label="${tool.name} on ${on_string}: CDS FPKM differential expression testing"/>
- <data format="tabular" name="cds_fpkm_tracking" label="${tool.name} on ${on_string}: CDS FPKM tracking"/>
- <data format="tabular" name="tss_groups_exp" label="${tool.name} on ${on_string}: TSS groups differential expression testing"/>
- <data format="tabular" name="tss_groups_fpkm_tracking" label="${tool.name} on ${on_string}: TSS groups FPKM tracking" />
- <data format="tabular" name="genes_exp" label="${tool.name} on ${on_string}: gene differential expression testing"/>
- <data format="tabular" name="genes_fpkm_tracking" label="${tool.name} on ${on_string}: gene FPKM tracking"/>
- <data format="tabular" name="isoforms_exp" label="${tool.name} on ${on_string}: transcript differential expression testing"/>
- <data format="tabular" name="isoforms_fpkm_tracking" label="${tool.name} on ${on_string}: transcript FPKM tracking"/>
+ <data format="tabular" name="splicing_diff" label="${tool.name} on ${on_string}: splicing differential expression testing" from_work_dir="splicing.diff" />
+ <data format="tabular" name="promoters_diff" label="${tool.name} on ${on_string}: promoters differential expression testing" from_work_dir="promoters.diff" />
+ <data format="tabular" name="cds_diff" label="${tool.name} on ${on_string}: CDS overloading diffential expression testing" from_work_dir="cds.diff" />
+ <data format="tabular" name="cds_exp_fpkm_tracking" label="${tool.name} on ${on_string}: CDS FPKM differential expression testing" from_work_dir="cds_exp.diff" />
+ <data format="tabular" name="cds_fpkm_tracking" label="${tool.name} on ${on_string}: CDS FPKM tracking" from_work_dir="cds.fpkm_tracking" />
+ <data format="tabular" name="tss_groups_exp" label="${tool.name} on ${on_string}: TSS groups differential expression testing" from_work_dir="tss_group_exp.diff" />
+ <data format="tabular" name="tss_groups_fpkm_tracking" label="${tool.name} on ${on_string}: TSS groups FPKM tracking" from_work_dir="tss_groups.fpkm_tracking" />
+ <data format="tabular" name="genes_exp" label="${tool.name} on ${on_string}: gene differential expression testing" from_work_dir="gene_exp.diff" />
+ <data format="tabular" name="genes_fpkm_tracking" label="${tool.name} on ${on_string}: gene FPKM tracking" from_work_dir="genes.fpkm_tracking" />
+ <data format="tabular" name="isoforms_exp" label="${tool.name} on ${on_string}: transcript differential expression testing" from_work_dir="isoform_exp.diff" />
+ <data format="tabular" name="isoforms_fpkm_tracking" label="${tool.name} on ${on_string}: transcript FPKM tracking" from_work_dir="isoforms.fpkm_tracking" /></outputs><tests>
@@ -174,21 +132,19 @@
<!--
cuffdiff cuffcompare_out5.gtf cuffdiff_in1.sam cuffdiff_in2.sam
-->
+ <!--
+ NOTE: as of version 0.0.6 of the wrapper, tests cannot be run because multiple inputs to a repeat
+ element are not supported.
<param name="gtf_input" value="cuffcompare_out5.gtf" ftype="gtf" /><param name="do_groups" value="No" /><param name="aligned_reads1" value="cuffdiff_in1.sam" ftype="sam" /><param name="aligned_reads2" value="cuffdiff_in2.sam" ftype="sam" />
- <!-- Defaults. --><param name="fdr" value="0.05" /><param name="min_alignment_count" value="0" /><param name="do_bias_correction" value="No" /><param name="do_normalization" value="No" /><param name="multiread_correct" value="No"/><param name="sAdditional" value="No"/>
- <!--
- Line diffs are needed because cuffdiff does not produce deterministic output.
- TODO: can we find datasets that lead to deterministic behavior?
- --><output name="splicing_diff" file="cuffdiff_out9.txt"/><output name="promoters_diff" file="cuffdiff_out10.txt"/><output name="cds_diff" file="cuffdiff_out11.txt"/>
@@ -200,6 +156,7 @@
<output name="genes_fpkm_tracking" file="cuffdiff_out6.txt" lines_diff="200"/><output name="isoforms_exp" file="cuffdiff_out1.txt" lines_diff="200"/><output name="isoforms_fpkm_tracking" file="cuffdiff_out5.txt" lines_diff="200"/>
+ --></test></tests>
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
6 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/47681422a0ca/
Changeset: 47681422a0ca
Branch: mepcotterell/allow-pip-to-run-when-venv_directory-con-1373715782557
User: natefoo
Date: 2013-07-30 18:31:59
Summary: Close branch.
Affected #: 0 files
https://bitbucket.org/galaxy/galaxy-central/commits/c51f98990299/
Changeset: c51f98990299
User: natefoo
Date: 2013-07-30 18:32:17
Summary: Merge closed branch.
Affected #: 0 files
https://bitbucket.org/galaxy/galaxy-central/commits/73d7a93e2f8d/
Changeset: 73d7a93e2f8d
User: natefoo
Date: 2013-07-30 18:44:05
Summary: Backout af20b15f7eda, these changes will be reapplied after tools using the sam_fa_indices data table have been migrated to the Tool Shed in their original state and updated to use the new table format.
Affected #: 2 files
diff -r c51f98990299f40ac6ce13bf9ea7cee47158c615 -r 73d7a93e2f8d0bafbcb0b4dd9bf562d1fa6a88e0 tool-data/sam_fa_new_indices.loc.sample
--- a/tool-data/sam_fa_new_indices.loc.sample
+++ /dev/null
@@ -1,30 +0,0 @@
-#This is a sample file distributed with Galaxy that enables tools
-#to use a directory of Samtools indexed sequences data files. You will need
-#to create these data files and then create a sam_fa_new_indices.loc file
-#similar to this one (store it in this directory) that points to
-#the directories in which those files are stored. The sam_fa_new_indices.loc
-#file has this format (white space characters are TAB characters):
-#
-# <unique_build_id><dbkey><display_name><file_base_path>
-#
-#So, for example, if you had hg19 Canonical indexed stored in
-#
-# /depot/data2/galaxy/hg19/sam/,
-#
-#then the sam_fa_new_indices.loc entry would look like this:
-#
-#hg19canon hg19 Human (Homo sapiens): hg19 Canonical /depot/data2/galaxy/hg19/sam/hg19canon.fa
-#
-#and your /depot/data2/galaxy/hg19/sam/ directory
-#would contain hg19canon.fa and hg19canon.fa.fai files.
-#
-#Your sam_fa_new_indices.loc file should include an entry per line for
-#each index set you have stored. The file in the path does actually
-#exist, but it should never be directly used. Instead, the name serves
-#as a prefix for the index file. For example:
-#
-#hg18canon hg18 Human (Homo sapiens): hg18 Canonical /depot/data2/galaxy/hg18/sam/hg18canon.fa
-#hg18full hg18 Human (Homo sapiens): hg18 Full /depot/data2/galaxy/hg18/sam/hg18full.fa
-#hg19canon hg19 Human (Homo sapiens): hg19 Canonical /depot/data2/galaxy/hg19/sam/hg19canon.fa
-#hg19full hg19 Human (Homo sapiens): hg19 Full /depot/data2/galaxy/hg19/sam/hg19full.fa
-
diff -r c51f98990299f40ac6ce13bf9ea7cee47158c615 -r 73d7a93e2f8d0bafbcb0b4dd9bf562d1fa6a88e0 tool_data_table_conf.xml.sample
--- a/tool_data_table_conf.xml.sample
+++ b/tool_data_table_conf.xml.sample
@@ -55,26 +55,10 @@
<columns>value, name, path</columns><file path="tool-data/perm_color_index.loc" /></table>
- <!-- Location of SAMTools indexes and other files (new version)
- Warning: until Galaxy release_2013.06.03 the format of this
- table was:
-
+ <!-- Location of SAMTools indexes and other files -->
+ <table name="sam_fa_indexes" comment_char="#"><columns>line_type, value, path</columns><file path="tool-data/sam_fa_indices.loc" />
-
- If you are updating your tool_data_table_conf.xml to the current
- version you should first migrate your
- tool-data/sam_fa_indices.loc file to a new
- tool-data/sam_fa_new_indices.loc file with the format specified
- below, which is explained in the relative sample file
- tool-data/sam_fa_new_indices.loc.sample .
- By using the new format it is possible to let the user choose
- among multiple indexed genome variants having the same dbkey,
- e.g. hg19canon vs. hg19full variants for hg19 dbkey.
- -->
- <table name="sam_fa_indexes" comment_char="#">
- <columns>value, dbkey, name, path</columns>
- <file path="tool-data/sam_fa_new_indices.loc" /></table><!-- Location of Picard dict file and other files --><table name="picard_indexes" comment_char="#">
https://bitbucket.org/galaxy/galaxy-central/commits/c386fc668d0e/
Changeset: c386fc668d0e
User: natefoo
Date: 2013-07-30 18:50:29
Summary: See previous commit message. Note that cufflinks reverts to 0.0.6, not 0.0.7, due to a version increase that came after the changes that are being rolled back.
Affected #: 8 files
diff -r 73d7a93e2f8d0bafbcb0b4dd9bf562d1fa6a88e0 -r c386fc668d0ef5d829fcbd3ee314bcd35ac0e882 tools/ngs_rna/cuffcompare_wrapper.py
--- a/tools/ngs_rna/cuffcompare_wrapper.py
+++ b/tools/ngs_rna/cuffcompare_wrapper.py
@@ -8,6 +8,20 @@
sys.stderr.write( '%s\n' % msg )
sys.exit()
+# Copied from sam_to_bam.py:
+def check_seq_file( dbkey, cached_seqs_pointer_file ):
+ seq_path = ''
+ for line in open( cached_seqs_pointer_file ):
+ line = line.rstrip( '\r\n' )
+ if line and not line.startswith( '#' ) and line.startswith( 'index' ):
+ fields = line.split( '\t' )
+ if len( fields ) < 3:
+ continue
+ if fields[1] == dbkey:
+ seq_path = fields[2].strip()
+ break
+ return seq_path
+
def __main__():
#Parse Command Line
parser = optparse.OptionParser()
@@ -16,7 +30,8 @@
parser.add_option( '-s', dest='use_seq_data', action="store_true", help='Causes cuffcompare to look into for fasta files with the underlying genomic sequences (one file per contig) against which your reads were aligned for some optional classification functions. For example, Cufflinks transcripts consisting mostly of lower-case bases are classified as repeats. Note that <seq_dir> must contain one fasta file per reference chromosome, and each file must be named after the chromosome, and have a .fa or .fasta extension.')
# Wrapper / Galaxy options.
- parser.add_option( '', '--index', dest='index', help='The path of the reference genome' )
+ parser.add_option( '', '--dbkey', dest='dbkey', help='The build of the reference dataset' )
+ parser.add_option( '', '--index_dir', dest='index_dir', help='GALAXY_DATA_INDEX_DIR' )
parser.add_option( '', '--ref_file', dest='ref_file', help='The reference dataset from the history' )
# Outputs.
@@ -45,16 +60,21 @@
# Set/link to sequence file.
if options.use_seq_data:
- if options.ref_file:
+ if options.ref_file != 'None':
# Sequence data from history.
# Create symbolic link to ref_file so that index will be created in working directory.
seq_path = "ref.fa"
os.symlink( options.ref_file, seq_path )
else:
# Sequence data from loc file.
- if not os.path.exists( options.index ):
- stop_err( 'Reference genome %s not present, request it by reporting this error.' % options.index )
- seq_path = options.index
+ cached_seqs_pointer_file = os.path.join( options.index_dir, 'sam_fa_indices.loc' )
+ if not os.path.exists( cached_seqs_pointer_file ):
+ stop_err( 'The required file (%s) does not exist.' % cached_seqs_pointer_file )
+ # If found for the dbkey, seq_path will look something like /galaxy/data/equCab2/sam_index/equCab2.fa,
+ # and the equCab2.fa file will contain fasta sequences.
+ seq_path = check_seq_file( options.dbkey, cached_seqs_pointer_file )
+ if seq_path == '':
+ stop_err( 'No sequence data found for dbkey %s, so sequence data cannot be used.' % options.dbkey )
# Build command.
diff -r 73d7a93e2f8d0bafbcb0b4dd9bf562d1fa6a88e0 -r c386fc668d0ef5d829fcbd3ee314bcd35ac0e882 tools/ngs_rna/cuffcompare_wrapper.xml
--- a/tools/ngs_rna/cuffcompare_wrapper.xml
+++ b/tools/ngs_rna/cuffcompare_wrapper.xml
@@ -1,4 +1,4 @@
-<tool id="cuffcompare" name="Cuffcompare" version="0.0.6">
+<tool id="cuffcompare" name="Cuffcompare" version="0.0.5"><!-- Wrapper supports Cuffcompare versions v1.3.0 and newer --><description>compare assembled transcripts to a reference annotation and track Cufflinks transcripts across multiple experiments</description><requirements>
@@ -17,12 +17,14 @@
## Use sequence data?
#if $seq_data.use_seq_data == "Yes":
- -s
+ -s
#if $seq_data.seq_source.index_source == "history":
--ref_file=$seq_data.seq_source.ref_file
#else:
- --index=${seq_data.seq_source.index.fields.path}
+ --ref_file="None"
#end if
+ --dbkey=${first_input.metadata.dbkey}
+ --index_dir=${GALAXY_DATA_INDEX_DIR}
#end if
## Outputs.
@@ -64,14 +66,7 @@
<option value="cached">Locally cached</option><option value="history">History</option></param>
- <when value="cached">
- <param name="index" type="select" label="Using reference genome">
- <options from_data_table="sam_fa_indexes">
- <filter type="data_meta" ref="first_input" key="dbkey" column="1" />
- <validator type="no_options" message="No reference genome is available for the build associated with the selected input dataset" />
- </options>
- </param>
- </when>
+ <when value="cached"></when><when value="history"><param name="ref_file" type="data" format="fasta" label="Using reference file" /></when>
diff -r 73d7a93e2f8d0bafbcb0b4dd9bf562d1fa6a88e0 -r c386fc668d0ef5d829fcbd3ee314bcd35ac0e882 tools/ngs_rna/cuffdiff_wrapper.py
--- a/tools/ngs_rna/cuffdiff_wrapper.py
+++ b/tools/ngs_rna/cuffdiff_wrapper.py
@@ -35,6 +35,20 @@
sys.stderr.write( "%s\n" % msg )
sys.exit()
+# Copied from sam_to_bam.py:
+def check_seq_file( dbkey, cached_seqs_pointer_file ):
+ seq_path = ''
+ for line in open( cached_seqs_pointer_file ):
+ line = line.rstrip( '\r\n' )
+ if line and not line.startswith( '#' ) and line.startswith( 'index' ):
+ fields = line.split( '\t' )
+ if len( fields ) < 3:
+ continue
+ if fields[1] == dbkey:
+ seq_path = fields[2].strip()
+ break
+ return seq_path
+
def __main__():
#Parse Command Line
parser = optparse.OptionParser()
@@ -69,7 +83,8 @@
# Bias correction options.
parser.add_option( '-b', dest='do_bias_correction', action="store_true", help='Providing Cufflinks with a multifasta file via this option instructs it to run our new bias detection and correction algorithm which can significantly improve accuracy of transcript abundance estimates.')
- parser.add_option( '', '--index', dest='index', help='The path of the reference genome' )
+ parser.add_option( '', '--dbkey', dest='dbkey', help='The build of the reference dataset' )
+ parser.add_option( '', '--index_dir', dest='index_dir', help='GALAXY_DATA_INDEX_DIR' )
parser.add_option( '', '--ref_file', dest='ref_file', help='The reference dataset from the history' )
# Outputs.
@@ -108,16 +123,21 @@
# If doing bias correction, set/link to sequence file.
if options.do_bias_correction:
- if options.ref_file:
+ if options.ref_file != 'None':
# Sequence data from history.
# Create symbolic link to ref_file so that index will be created in working directory.
seq_path = "ref.fa"
os.symlink( options.ref_file, seq_path )
else:
# Sequence data from loc file.
- if not os.path.exists( options.index ):
- stop_err( 'Reference genome %s not present, request it by reporting this error.' % options.index )
- seq_path = options.index
+ cached_seqs_pointer_file = os.path.join( options.index_dir, 'sam_fa_indices.loc' )
+ if not os.path.exists( cached_seqs_pointer_file ):
+ stop_err( 'The required file (%s) does not exist.' % cached_seqs_pointer_file )
+ # If found for the dbkey, seq_path will look something like /galaxy/data/equCab2/sam_index/equCab2.fa,
+ # and the equCab2.fa file will contain fasta sequences.
+ seq_path = check_seq_file( options.dbkey, cached_seqs_pointer_file )
+ if seq_path == '':
+ stop_err( 'No sequence data found for dbkey %s, so bias correction cannot be used.' % options.dbkey )
# Build command.
diff -r 73d7a93e2f8d0bafbcb0b4dd9bf562d1fa6a88e0 -r c386fc668d0ef5d829fcbd3ee314bcd35ac0e882 tools/ngs_rna/cuffdiff_wrapper.xml
--- a/tools/ngs_rna/cuffdiff_wrapper.xml
+++ b/tools/ngs_rna/cuffdiff_wrapper.xml
@@ -1,4 +1,4 @@
-<tool id="cuffdiff" name="Cuffdiff" version="0.0.6">
+<tool id="cuffdiff" name="Cuffdiff" version="0.0.5"><!-- Wrapper supports Cuffdiff versions 2.1.0-2.1.1 --><description>find significant changes in transcript expression, splicing, and promoter use</description><requirements>
@@ -42,12 +42,14 @@
## Bias correction?
#if $bias_correction.do_bias_correction == "Yes":
- -b
+ -b
#if $bias_correction.seq_source.index_source == "history":
--ref_file=$bias_correction.seq_source.ref_file
#else:
- --index=${bias_correction.seq_source.index.fields.path}
+ --ref_file="None"
#end if
+ --dbkey=${gtf_input.metadata.dbkey}
+ --index_dir=${GALAXY_DATA_INDEX_DIR}
#end if
## Inputs.
@@ -131,14 +133,7 @@
<option value="cached">Locally cached</option><option value="history">History</option></param>
- <when value="cached">
- <param name="index" type="select" label="Using reference genome">
- <options from_data_table="sam_fa_indexes">
- <filter type="data_meta" ref="gtf_input" key="dbkey" column="1" />
- <validator type="no_options" message="No reference genome is available for the build associated with the selected input dataset" />
- </options>
- </param>
- </when>
+ <when value="cached"></when><when value="history"><param name="ref_file" type="data" format="fasta" label="Using reference file" /></when>
diff -r 73d7a93e2f8d0bafbcb0b4dd9bf562d1fa6a88e0 -r c386fc668d0ef5d829fcbd3ee314bcd35ac0e882 tools/ngs_rna/cufflinks_wrapper.py
--- a/tools/ngs_rna/cufflinks_wrapper.py
+++ b/tools/ngs_rna/cufflinks_wrapper.py
@@ -10,6 +10,20 @@
sys.stderr.write( "%s\n" % msg )
sys.exit()
+# Copied from sam_to_bam.py:
+def check_seq_file( dbkey, cached_seqs_pointer_file ):
+ seq_path = ''
+ for line in open( cached_seqs_pointer_file ):
+ line = line.rstrip( '\r\n' )
+ if line and not line.startswith( '#' ) and line.startswith( 'index' ):
+ fields = line.split( '\t' )
+ if len( fields ) < 3:
+ continue
+ if fields[1] == dbkey:
+ seq_path = fields[2].strip()
+ break
+ return seq_path
+
def __main__():
#Parse Command Line
parser = optparse.OptionParser()
@@ -39,7 +53,8 @@
# Bias correction options.
parser.add_option( '-b', dest='do_bias_correction', action="store_true", help='Providing Cufflinks with a multifasta file via this option instructs it to run our new bias detection and correction algorithm which can significantly improve accuracy of transcript abundance estimates.')
- parser.add_option( '', '--index', dest='index', help='The path of the reference genome' )
+ parser.add_option( '', '--dbkey', dest='dbkey', help='The build of the reference dataset' )
+ parser.add_option( '', '--index_dir', dest='index_dir', help='GALAXY_DATA_INDEX_DIR' )
parser.add_option( '', '--ref_file', dest='ref_file', help='The reference dataset from the history' )
# Global model.
@@ -68,16 +83,21 @@
# If doing bias correction, set/link to sequence file.
if options.do_bias_correction:
- if options.ref_file:
+ if options.ref_file != 'None':
# Sequence data from history.
# Create symbolic link to ref_file so that index will be created in working directory.
seq_path = "ref.fa"
os.symlink( options.ref_file, seq_path )
else:
# Sequence data from loc file.
- if not os.path.exists( options.index ):
- stop_err( 'Reference genome %s not present, request it by reporting this error.' % options.index )
- seq_path = options.index
+ cached_seqs_pointer_file = os.path.join( options.index_dir, 'sam_fa_indices.loc' )
+ if not os.path.exists( cached_seqs_pointer_file ):
+ stop_err( 'The required file (%s) does not exist.' % cached_seqs_pointer_file )
+ # If found for the dbkey, seq_path will look something like /galaxy/data/equCab2/sam_index/equCab2.fa,
+ # and the equCab2.fa file will contain fasta sequences.
+ seq_path = check_seq_file( options.dbkey, cached_seqs_pointer_file )
+ if seq_path == '':
+ stop_err( 'No sequence data found for dbkey %s, so bias correction cannot be used.' % options.dbkey )
# Build command.
diff -r 73d7a93e2f8d0bafbcb0b4dd9bf562d1fa6a88e0 -r c386fc668d0ef5d829fcbd3ee314bcd35ac0e882 tools/ngs_rna/cufflinks_wrapper.xml
--- a/tools/ngs_rna/cufflinks_wrapper.xml
+++ b/tools/ngs_rna/cufflinks_wrapper.xml
@@ -1,4 +1,4 @@
-<tool id="cufflinks" name="Cufflinks" version="0.0.7">
+<tool id="cufflinks" name="Cufflinks" version="0.0.6"><!-- Wrapper supports Cufflinks versions v1.3.0 and newer --><description>transcript assembly and FPKM (RPKM) estimates for RNA-Seq data</description><requirements>
@@ -29,12 +29,14 @@
## Bias correction?
#if $bias_correction.do_bias_correction == "Yes":
- -b
+ -b
#if $bias_correction.seq_source.index_source == "history":
--ref_file=$bias_correction.seq_source.ref_file
#else:
- --index=${bias_correction.seq_source.index.fields.path}
+ --ref_file="None"
#end if
+ --dbkey=${input.metadata.dbkey}
+ --index_dir=${GALAXY_DATA_INDEX_DIR}
#end if
## Multi-read correct?
@@ -65,15 +67,15 @@
<when value="No"></when><when value="Use reference annotation"><param format="gff3,gtf" name="reference_annotation_file" type="data" label="Reference Annotation" help="Gene annotation dataset in GTF or GFF3 format."/>
- </when>
- <when value="Use reference annotation guide">
+ </when>
+ <when value="Use reference annotation guide"><param format="gff3,gtf" name="reference_annotation_guide_file" type="data" label="Reference Annotation" help="Gene annotation dataset in GTF or GFF3 format."/>
- </when>
+ </when></conditional><conditional name="bias_correction"><param name="do_bias_correction" type="select" label="Perform Bias Correction" help="Bias detection and correction can significantly improve accuracy of transcript abundance estimates."><option value="No" selected="true">No</option>
- <option value="Yes">Yes</option>
+ <option value="Yes">Yes</option></param><when value="Yes"><conditional name="seq_source">
@@ -81,14 +83,7 @@
<option value="cached" selected="true">Locally cached</option><option value="history">History</option></param>
- <when value="cached">
- <param name="index" type="select" label="Using reference genome">
- <options from_data_table="sam_fa_indexes">
- <filter type="data_meta" ref="input" key="dbkey" column="1" />
- <validator type="no_options" message="No reference genome is available for the build associated with the selected input dataset" />
- </options>
- </param>
- </when>
+ <when value="cached"></when><when value="history"><param name="ref_file" type="data" format="fasta" label="Using reference file" /></when>
diff -r 73d7a93e2f8d0bafbcb0b4dd9bf562d1fa6a88e0 -r c386fc668d0ef5d829fcbd3ee314bcd35ac0e882 tools/ngs_rna/cuffmerge_wrapper.py
--- a/tools/ngs_rna/cuffmerge_wrapper.py
+++ b/tools/ngs_rna/cuffmerge_wrapper.py
@@ -8,6 +8,20 @@
sys.stderr.write( '%s\n' % msg )
sys.exit()
+# Copied from sam_to_bam.py:
+def check_seq_file( dbkey, cached_seqs_pointer_file ):
+ seq_path = ''
+ for line in open( cached_seqs_pointer_file ):
+ line = line.rstrip( '\r\n' )
+ if line and not line.startswith( '#' ) and line.startswith( 'index' ):
+ fields = line.split( '\t' )
+ if len( fields ) < 3:
+ continue
+ if fields[1] == dbkey:
+ seq_path = fields[2].strip()
+ break
+ return seq_path
+
def __main__():
#Parse Command Line
parser = optparse.OptionParser()
@@ -17,7 +31,8 @@
# Wrapper / Galaxy options.
- parser.add_option( '', '--index', dest='index', help='The path of the reference genome' )
+ parser.add_option( '', '--dbkey', dest='dbkey', help='The build of the reference dataset' )
+ parser.add_option( '', '--index_dir', dest='index_dir', help='GALAXY_DATA_INDEX_DIR' )
parser.add_option( '', '--ref_file', dest='ref_file', help='The reference dataset from the history' )
# Outputs.
@@ -46,16 +61,21 @@
# Set/link to sequence file.
if options.use_seq_data:
- if options.ref_file:
+ if options.ref_file != 'None':
# Sequence data from history.
# Create symbolic link to ref_file so that index will be created in working directory.
seq_path = "ref.fa"
os.symlink( options.ref_file, seq_path )
else:
# Sequence data from loc file.
- if not os.path.exists( options.index ):
- stop_err( 'Reference genome %s not present, request it by reporting this error.' % options.index )
- seq_path = options.index
+ cached_seqs_pointer_file = os.path.join( options.index_dir, 'sam_fa_indices.loc' )
+ if not os.path.exists( cached_seqs_pointer_file ):
+ stop_err( 'The required file (%s) does not exist.' % cached_seqs_pointer_file )
+ # If found for the dbkey, seq_path will look something like /galaxy/data/equCab2/sam_index/equCab2.fa,
+ # and the equCab2.fa file will contain fasta sequences.
+ seq_path = check_seq_file( options.dbkey, cached_seqs_pointer_file )
+ if seq_path == '':
+ stop_err( 'No sequence data found for dbkey %s, so sequence data cannot be used.' % options.dbkey )
# Build command.
diff -r 73d7a93e2f8d0bafbcb0b4dd9bf562d1fa6a88e0 -r c386fc668d0ef5d829fcbd3ee314bcd35ac0e882 tools/ngs_rna/cuffmerge_wrapper.xml
--- a/tools/ngs_rna/cuffmerge_wrapper.xml
+++ b/tools/ngs_rna/cuffmerge_wrapper.xml
@@ -1,4 +1,4 @@
-<tool id="cuffmerge" name="Cuffmerge" version="0.0.6">
+<tool id="cuffmerge" name="Cuffmerge" version="0.0.5"><!-- Wrapper supports Cuffmerge versions 1.3 and newer --><description>merge together several Cufflinks assemblies</description><requirements>
@@ -16,12 +16,14 @@
## Use sequence data?
#if $seq_data.use_seq_data == "Yes":
- -s
+ -s
#if $seq_data.seq_source.index_source == "history":
--ref_file=$seq_data.seq_source.ref_file
#else:
- --index=${seq_data.seq_source.index.fields.path}
+ --ref_file="None"
#end if
+ --dbkey=${first_input.metadata.dbkey}
+ --index_dir=${GALAXY_DATA_INDEX_DIR}
#end if
## Outputs.
@@ -62,14 +64,7 @@
<option value="cached">Locally cached</option><option value="history">History</option></param>
- <when value="cached">
- <param name="index" type="select" label="Using reference genome">
- <options from_data_table="sam_fa_indexes">
- <filter type="data_meta" ref="first_input" key="dbkey" column="1" />
- <validator type="no_options" message="No reference genome is available for the build associated with the selected input dataset" />
- </options>
- </param>
- </when>
+ <when value="cached"></when><when value="history"><param name="ref_file" type="data" format="fasta" label="Using reference file" /></when>
https://bitbucket.org/galaxy/galaxy-central/commits/951e853b0bcd/
Changeset: 951e853b0bcd
User: natefoo
Date: 2013-07-30 18:54:02
Summary: See previous commit message.
Affected #: 5 files
diff -r c386fc668d0ef5d829fcbd3ee314bcd35ac0e882 -r 951e853b0bcd2c62cedee0b95d46c9e36ab6c605 tools/samtools/sam_pileup.py
--- a/tools/samtools/sam_pileup.py
+++ b/tools/samtools/sam_pileup.py
@@ -8,7 +8,8 @@
-o, --output1=o: Output pileup
-R, --ref=R: Reference file type
-n, --ownFile=n: User-supplied fasta reference file
- -g, --index=g: Path of the indexed reference genome
+ -d, --dbkey=d: dbkey of user-supplied file
+ -x, --indexDir=x: Index directory
-b, --bamIndex=b: BAM index file
-s, --lastCol=s: Print the mapping quality as the last column
-i, --indels=i: Only output lines containing indels
@@ -30,9 +31,24 @@
sys.stderr.write( '%s\n' % msg )
sys.exit()
+def check_seq_file( dbkey, GALAXY_DATA_INDEX_DIR ):
+ seqFile = '%s/sam_fa_indices.loc' % GALAXY_DATA_INDEX_DIR
+ seqPath = ''
+ for line in open( seqFile ):
+ line = line.rstrip( '\r\n' )
+ if line and not line.startswith( '#' ) and line.startswith( 'index' ):
+ fields = line.split( '\t' )
+ if len( fields ) < 3:
+ continue
+ if fields[1] == dbkey:
+ seqPath = fields[2].strip()
+ break
+ return seqPath
+
def __main__():
#Parse Command Line
options, args = doc_optparse.parse( __doc__ )
+ seqPath = check_seq_file( options.dbkey, options.indexDir )
# output version # of tool
try:
tmp = tempfile.NamedTemporaryFile().name
@@ -61,6 +77,7 @@
tmpf1 = tempfile.NamedTemporaryFile( dir=tmpDir )
tmpf1_name = tmpf1.name
tmpf1.close()
+ tmpf1fai_name = '%s.fai' % tmpf1_name
#link bam and bam index to working directory (can't move because need to leave original)
os.symlink( options.input1, tmpf0bam_name )
os.symlink( options.bamIndex, tmpf0bambai_name )
@@ -83,9 +100,9 @@
try:
#index reference if necessary and prepare pileup command
if options.ref == 'indexed':
- if not os.path.exists( "%s.fai" % options.index ):
- raise Exception, "Indexed genome %s not present, request it by reporting this error." % options.index
- cmd = cmd % ( opts, options.index, tmpf0bam_name, options.output1 )
+ if not os.path.exists( "%s.fai" % seqPath ):
+ raise Exception, "No sequences are available for '%s', request them by reporting this error." % options.dbkey
+ cmd = cmd % ( opts, seqPath, tmpf0bam_name, options.output1 )
elif options.ref == 'history':
os.symlink( options.ownFile, tmpf1_name )
cmdIndex = 'samtools faidx %s' % ( tmpf1_name )
diff -r c386fc668d0ef5d829fcbd3ee314bcd35ac0e882 -r 951e853b0bcd2c62cedee0b95d46c9e36ab6c605 tools/samtools/sam_pileup.xml
--- a/tools/samtools/sam_pileup.xml
+++ b/tools/samtools/sam_pileup.xml
@@ -1,4 +1,4 @@
-<tool id="sam_pileup" name="Generate pileup" version="1.1.2">
+<tool id="sam_pileup" name="Generate pileup" version="1.1.1"><description>from BAM dataset</description><requirements><requirement type="package" version="0.1.16">samtools</requirement>
@@ -11,8 +11,10 @@
#if $refOrHistory.reference == "history":
--ownFile=$refOrHistory.ownFile
#else:
- --index=${refOrHistory.index.fields.path}
+ --ownFile="None"
#end if
+ --dbkey=${input1.metadata.dbkey}
+ --indexDir=${GALAXY_DATA_INDEX_DIR}
--bamIndex=${input1.metadata.bam_index}
--lastCol=$lastCol
--indels=$indels
@@ -39,13 +41,7 @@
<when value="indexed"><param name="input1" type="data" format="bam" label="Select the BAM file to generate the pileup file for"><validator type="unspecified_build" />
- <validator type="dataset_metadata_in_data_table" table_name="sam_fa_indexes" metadata_name="dbkey" metadata_column="1" message="Sequences are not currently available for the specified build." />
- </param>
- <param name="index" type="select" label="Using reference genome">
- <options from_data_table="sam_fa_indexes">
- <filter type="data_meta" ref="input1" key="dbkey" column="1" />
- <validator type="no_options" message="No reference genome is available for the build associated with the selected input dataset" />
- </options>
+ <validator type="dataset_metadata_in_file" filename="sam_fa_indices.loc" metadata_name="dbkey" metadata_column="1" message="Sequences are not currently available for the specified build." line_startswith="index" /></param></when><when value="history">
@@ -104,7 +100,6 @@
--><param name="reference" value="indexed" /><param name="input1" value="sam_pileup_in1.bam" ftype="bam" dbkey="equCab2" />
- <param name="index" value="chr_m" /><param name="lastCol" value="no" /><param name="indels" value="no" /><param name="mapCap" value="60" />
diff -r c386fc668d0ef5d829fcbd3ee314bcd35ac0e882 -r 951e853b0bcd2c62cedee0b95d46c9e36ab6c605 tools/samtools/sam_to_bam.py
--- a/tools/samtools/sam_to_bam.py
+++ b/tools/samtools/sam_to_bam.py
@@ -3,24 +3,43 @@
Converts SAM data to sorted BAM data.
usage: sam_to_bam.py [options]
--input1: SAM file to be converted
- --index: path of the indexed reference genome
+ --dbkey: dbkey value
--ref_file: Reference file if choosing from history
--output1: output dataset in bam format
+ --index_dir: GALAXY_DATA_INDEX_DIR
"""
-import optparse, os, sys, subprocess, tempfile, shutil
+import optparse, os, sys, subprocess, tempfile, shutil, gzip
+from galaxy import eggs
+import pkg_resources; pkg_resources.require( "bx-python" )
+from bx.cookbook import doc_optparse
+from galaxy import util
def stop_err( msg ):
sys.stderr.write( '%s\n' % msg )
sys.exit()
+def check_seq_file( dbkey, cached_seqs_pointer_file ):
+ seq_path = ''
+ for line in open( cached_seqs_pointer_file ):
+ line = line.rstrip( '\r\n' )
+ if line and not line.startswith( '#' ) and line.startswith( 'index' ):
+ fields = line.split( '\t' )
+ if len( fields ) < 3:
+ continue
+ if fields[1] == dbkey:
+ seq_path = fields[2].strip()
+ break
+ return seq_path
+
def __main__():
#Parse Command Line
parser = optparse.OptionParser()
parser.add_option( '', '--input1', dest='input1', help='The input SAM dataset' )
- parser.add_option( '', '--index', dest='index', help='The path of the indexed reference genome' )
+ parser.add_option( '', '--dbkey', dest='dbkey', help='The build of the reference dataset' )
parser.add_option( '', '--ref_file', dest='ref_file', help='The reference dataset from the history' )
parser.add_option( '', '--output1', dest='output1', help='The output BAM dataset' )
+ parser.add_option( '', '--index_dir', dest='index_dir', help='GALAXY_DATA_INDEX_DIR' )
( options, args ) = parser.parse_args()
# output version # of tool
@@ -42,17 +61,24 @@
except:
sys.stdout.write( 'Could not determine Samtools version\n' )
+ cached_seqs_pointer_file = '%s/sam_fa_indices.loc' % options.index_dir
+ if not os.path.exists( cached_seqs_pointer_file ):
+ stop_err( 'The required file (%s) does not exist.' % cached_seqs_pointer_file )
+ # If found for the dbkey, seq_path will look something like /galaxy/data/equCab2/sam_index/equCab2.fa,
+ # and the equCab2.fa file will contain fasta sequences.
+ seq_path = check_seq_file( options.dbkey, cached_seqs_pointer_file )
tmp_dir = tempfile.mkdtemp( dir='.' )
if not options.ref_file or options.ref_file == 'None':
# We're using locally cached reference sequences( e.g., /galaxy/data/equCab2/sam_index/equCab2.fa ).
# The indexes for /galaxy/data/equCab2/sam_index/equCab2.fa will be contained in
# a file named /galaxy/data/equCab2/sam_index/equCab2.fa.fai
- fai_index_file_path = '%s.fai' % options.index
+ fai_index_file_base = seq_path
+ fai_index_file_path = '%s.fai' % seq_path
if not os.path.exists( fai_index_file_path ):
#clean up temp files
if os.path.exists( tmp_dir ):
shutil.rmtree( tmp_dir )
- stop_err( 'Indexed genome %s not present, request it by reporting this error.' % options.index )
+ stop_err( 'No sequences are available for build (%s), request them by reporting this error.' % options.dbkey )
else:
try:
# Create indexes for history reference ( e.g., ~/database/files/000/dataset_1.dat ) using samtools faidx, which will:
diff -r c386fc668d0ef5d829fcbd3ee314bcd35ac0e882 -r 951e853b0bcd2c62cedee0b95d46c9e36ab6c605 tools/samtools/sam_to_bam.xml
--- a/tools/samtools/sam_to_bam.xml
+++ b/tools/samtools/sam_to_bam.xml
@@ -1,4 +1,4 @@
-<tool id="sam_to_bam" name="SAM-to-BAM" version="1.1.3">
+<tool id="sam_to_bam" name="SAM-to-BAM" version="1.1.2"><description>converts SAM format to BAM format</description><requirements><requirement type="package">samtools</requirement>
@@ -7,11 +7,13 @@
sam_to_bam.py
--input1=$source.input1
#if $source.index_source == "history":
+ --dbkey=${ref_file.metadata.dbkey}
--ref_file=$source.ref_file
#else
- --index=${source.index.fields.path}
+ --dbkey=${input1.metadata.dbkey}
#end if
--output1=$output1
+ --index_dir=${GALAXY_DATA_INDEX_DIR}
</command><inputs><conditional name="source">
@@ -20,19 +22,13 @@
<option value="history">History</option></param><when value="cached">
- <param name="input1" type="data" format="sam" metadata_name="dbkey" label="SAM file to convert">
- <validator type="unspecified_build" />
- <validator type="dataset_metadata_in_data_table" table_name="sam_fa_indexes" metadata_name="dbkey" metadata_column="1" message="Sequences are not currently available for the specified build." />
- </param>
- <param name="index" type="select" label="Using reference genome">
- <options from_data_table="sam_fa_indexes">
- <filter type="data_meta" ref="input1" key="dbkey" column="1" />
- <validator type="no_options" message="No reference genome is available for the build associated with the selected input dataset" />
- </options>
+ <param name="input1" type="data" format="sam" metadata_name="dbkey" label="SAM File to Convert">
+ <validator type="unspecified_build" />
+ <validator type="dataset_metadata_in_file" filename="sam_fa_indices.loc" metadata_name="dbkey" metadata_column="1" message="Sequences are not currently available for the specified build." line_startswith="index" /></param></when><when value="history">
- <param name="input1" type="data" format="sam" label="SAM file to convert" />
+ <param name="input1" type="data" format="sam" label="Convert SAM file" /><param name="ref_file" type="data" format="fasta" metadata_name="dbkey" label="Using reference file" /></when></conditional>
@@ -80,7 +76,6 @@
--><param name="index_source" value="cached" /><param name="input1" value="sam_to_bam_in1.sam" ftype="sam" dbkey="chrM" />
- <param name="index" value="chr_m" /><output name="output1" file="sam_to_bam_out2.bam" ftype="bam" /></test></tests>
diff -r c386fc668d0ef5d829fcbd3ee314bcd35ac0e882 -r 951e853b0bcd2c62cedee0b95d46c9e36ab6c605 tools/samtools/samtools_mpileup.xml
--- a/tools/samtools/samtools_mpileup.xml
+++ b/tools/samtools/samtools_mpileup.xml
@@ -1,4 +1,4 @@
-<tool id="samtools_mpileup" name="MPileup" version="0.0.2">
+<tool id="samtools_mpileup" name="MPileup" version="0.0.1"><description>SNP and indel caller</description><requirements><requirement type="package">samtools</requirement>
@@ -59,22 +59,22 @@
</param><when value="cached"><repeat name="input_bams" title="BAM file" min="1">
- <param name="input_bam" type="data" format="bam" label="BAM file">
- <validator type="unspecified_build" />
- <validator type="dataset_metadata_in_data_table" table_name="sam_fa_indexes" metadata_name="dbkey" metadata_column="1" message="Sequences are not currently available for the specified build." /><!-- fixme!!! this needs to be a select -->
- </param>
+ <param name="input_bam" type="data" format="bam" label="BAM file">
+ <validator type="unspecified_build" />
+ <validator type="dataset_metadata_in_data_table" table_name="sam_fa_indexes" metadata_name="dbkey" metadata_column="value" message="Sequences are not currently available for the specified build." /><!-- fixme!!! this needs to be a select -->
+ </param></repeat><param name="ref_file" type="select" label="Using reference genome"><options from_data_table="sam_fa_indexes">
- <!-- <filter type="data_meta" ref="input_bam" key="dbkey" column="1" /> does not yet work in a repeat...-->
+ <!-- <filter type="data_meta" key="dbkey" ref="input_bam" column="value"/> does not yet work in a repeat...--></options></param></when><when value="history"><!-- FIX ME!!!! --><repeat name="input_bams" title="BAM file" min="1">
- <param name="input_bam" type="data" format="bam" label="BAM file">
- <validator type="metadata" check="bam_index" message="Metadata missing, click the pencil icon in the history item and use the auto-detect feature to correct this issue." />
- </param>
+ <param name="input_bam" type="data" format="bam" label="BAM file" >
+ <validator type="metadata" check="bam_index" message="Metadata missing, click the pencil icon in the history item and use the auto-detect feature to correct this issue."/>
+ </param></repeat><param name="ref_file" type="data" format="fasta" label="Using reference file" /></when>
https://bitbucket.org/galaxy/galaxy-central/commits/866d8b29854f/
Changeset: 866d8b29854f
Branch: next-stable
User: natefoo
Date: 2013-07-30 18:56:17
Summary: Open next-stable for the next release.
Affected #: 360 files
diff -r 7740b1dc41fad7bc6cfd80f1af41ae05dae2f4c3 -r 866d8b29854f4079250efae62a6fddf0204e51c4 .coveragerc
--- /dev/null
+++ b/.coveragerc
@@ -0,0 +1,3 @@
+[run]
+branch = True
+include = lib/galaxy/*
diff -r 7740b1dc41fad7bc6cfd80f1af41ae05dae2f4c3 -r 866d8b29854f4079250efae62a6fddf0204e51c4 .hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -60,7 +60,7 @@
job_conf.xml
data_manager_conf.xml
shed_data_manager_conf.xml
-visualizations_conf.xml
+config/visualizations/*.xml
static/welcome.html.*
static/welcome.html
@@ -82,6 +82,9 @@
# Test output
run_functional_tests.html
test/tool_shed/tmp/*
+.coverage
+htmlcov
+run_unit_tests.html
# Project files
*.kpf
diff -r 7740b1dc41fad7bc6cfd80f1af41ae05dae2f4c3 -r 866d8b29854f4079250efae62a6fddf0204e51c4 .hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -2,3 +2,4 @@
1c717491139269651bb59687563da9410b84c65d release_2013.02.08
75f09617abaadbc8cc732bb8ee519decaeb56ea7 release_2013.04.01
2cc8d10988e03257dc7b97f8bb332c7df745d1dd security_2013.04.08
+524f246ca85395082719ae7a6ff72260d7ad5612 release_2013.06.03
diff -r 7740b1dc41fad7bc6cfd80f1af41ae05dae2f4c3 -r 866d8b29854f4079250efae62a6fddf0204e51c4 README.txt
--- a/README.txt
+++ b/README.txt
@@ -7,7 +7,7 @@
HOW TO START
============
-Galaxy requires Python 2.5, 2.6 or 2.7. To check your python version, run:
+Galaxy requires Python 2.6 or 2.7. To check your python version, run:
% python -V
Python 2.7.3
diff -r 7740b1dc41fad7bc6cfd80f1af41ae05dae2f4c3 -r 866d8b29854f4079250efae62a6fddf0204e51c4 buildbot_setup.sh
--- a/buildbot_setup.sh
+++ b/buildbot_setup.sh
@@ -65,6 +65,7 @@
"
SAMPLES="
+tool_conf.xml.sample
datatypes_conf.xml.sample
universe_wsgi.ini.sample
tool_data_table_conf.xml.sample
diff -r 7740b1dc41fad7bc6cfd80f1af41ae05dae2f4c3 -r 866d8b29854f4079250efae62a6fddf0204e51c4 config/visualizations/circster.xml.sample
--- /dev/null
+++ b/config/visualizations/circster.xml.sample
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE visualization SYSTEM "visualization.dtd">
+<visualization name="circster">
+ <data_sources>
+ <data_source>
+ <model_class>HistoryDatasetAssociation</model_class>
+ <test type="isinstance" test_attr="datatype" result_type="datatype">data.Data</test>
+ <to_param param_attr="id">dataset_id</to_param>
+ <to_param assign="hda">hda_ldda</to_param>
+ </data_source>
+ <data_source>
+ <model_class>LibraryDatasetDatasetAssociation</model_class>
+ <test type="isinstance" test_attr="datatype" result_type="datatype">data.Data</test>
+ <to_param param_attr="id">dataset_id</to_param>
+ <to_param assign="ldda">hda_ldda</to_param>
+ </data_source>
+ </data_sources>
+ <params>
+ <param type="visualization">id</param>
+ <param type="hda_or_ldda">dataset_id</param>
+ <param_modifier type="string" modifies="dataset_id">hda_ldda</param_modifier>
+ <param type="dbkey">dbkey</param>
+ </params>
+ <template>circster.mako</template>
+ <render_location>_top</render_location>
+</visualization>
diff -r 7740b1dc41fad7bc6cfd80f1af41ae05dae2f4c3 -r 866d8b29854f4079250efae62a6fddf0204e51c4 config/visualizations/phyloviz.xml.sample
--- /dev/null
+++ b/config/visualizations/phyloviz.xml.sample
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE visualization SYSTEM "visualization.dtd">
+<visualization name="phyloviz">
+ <data_sources>
+ <data_source>
+ <model_class>HistoryDatasetAssociation</model_class>
+ <test type="isinstance" test_attr="datatype" result_type="datatype">data.Newick</test>
+ <test type="isinstance" test_attr="datatype" result_type="datatype">data.Nexus</test>
+ <to_param param_attr="id">dataset_id</to_param>
+ </data_source>
+ </data_sources>
+ <params>
+ <param type="dataset" var_name_in_template="hda" required="true">dataset_id</param>
+ <param type="integer" default="0">tree_index</param>
+ </params>
+ <template>phyloviz.mako</template>
+ <render_location>_top</render_location>
+</visualization>
diff -r 7740b1dc41fad7bc6cfd80f1af41ae05dae2f4c3 -r 866d8b29854f4079250efae62a6fddf0204e51c4 config/visualizations/scatterplot.xml.sample
--- /dev/null
+++ b/config/visualizations/scatterplot.xml.sample
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE visualization SYSTEM "visualization.dtd">
+<visualization name="scatterplot">
+ <data_sources>
+ <data_source>
+ <model_class>HistoryDatasetAssociation</model_class>
+ <test type="isinstance" test_attr="datatype" result_type="datatype">tabular.Tabular</test>
+ <to_param param_attr="id">dataset_id</to_param>
+ </data_source>
+ </data_sources>
+ <params>
+ <param type="dataset" var_name_in_template="hda" required="true">dataset_id</param>
+ </params>
+ <template>scatterplot.mako</template>
+</visualization>
diff -r 7740b1dc41fad7bc6cfd80f1af41ae05dae2f4c3 -r 866d8b29854f4079250efae62a6fddf0204e51c4 config/visualizations/sweepster.xml.sample
--- /dev/null
+++ b/config/visualizations/sweepster.xml.sample
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE visualization SYSTEM "visualization.dtd">
+<visualization name="sweepster">
+ <data_sources>
+ <data_source>
+ <model_class>HistoryDatasetAssociation</model_class>
+ <test type="isinstance" test_attr="datatype" result_type="datatype">data.Data</test>
+ <to_param param_attr="id">dataset_id</to_param>
+ <to_param assign="hda">hda_ldda</to_param>
+ </data_source>
+ <data_source>
+ <model_class>LibraryDatasetDatasetAssociation</model_class>
+ <test type="isinstance" test_attr="datatype" result_type="datatype">data.Data</test>
+ <to_param param_attr="id">dataset_id</to_param>
+ <to_param assign="ldda">hda_ldda</to_param>
+ </data_source>
+ </data_sources>
+ <params>
+ <param type="visualization" var_name_in_template="viz">visualization</param>
+ <param type="hda_or_ldda" var_name_in_template="dataset">dataset_id</param>
+ <param_modifier type="string" modifies="dataset_id">hda_ldda</param_modifier>
+ </params>
+ <template>sweepster.mako</template>
+ <render_location>_top</render_location>
+</visualization>
diff -r 7740b1dc41fad7bc6cfd80f1af41ae05dae2f4c3 -r 866d8b29854f4079250efae62a6fddf0204e51c4 config/visualizations/trackster.xml.sample
--- /dev/null
+++ b/config/visualizations/trackster.xml.sample
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE visualization SYSTEM "visualization.dtd">
+<visualization name="trackster">
+ <!--not tested yet -->
+ <data_sources>
+ <data_source>
+ <model_class>HistoryDatasetAssociation</model_class>
+ <test type="isinstance" test_attr="datatype" result_type="datatype">data.Data</test>
+ <to_param param_attr="id">dataset_id</to_param>
+ <to_param assign="hda">hda_ldda</to_param>
+ <to_param param_attr="dbkey">dbkey</to_param>
+ </data_source>
+ <data_source>
+ <model_class>LibraryDatasetDatasetAssociation</model_class>
+ <test type="isinstance" test_attr="datatype" result_type="datatype">data.Data</test>
+ <to_param param_attr="id">dataset_id</to_param>
+ <to_param assign="ldda">hda_ldda</to_param>
+ </data_source>
+ </data_sources>
+ <params>
+ <param type="visualization">id</param>
+ <param type="dataset">dataset_id</param>
+ <param type="genome_region">genome_region</param>
+ <param type="dbkey">dbkey</param>
+ </params>
+ <template_root>tracks</template_root>
+ <template>browser.mako</template>
+ <render_location>_top</render_location>
+</visualization>
diff -r 7740b1dc41fad7bc6cfd80f1af41ae05dae2f4c3 -r 866d8b29854f4079250efae62a6fddf0204e51c4 config/visualizations/visualization.dtd
--- /dev/null
+++ b/config/visualizations/visualization.dtd
@@ -0,0 +1,132 @@
+<!-- runnable on NIX with xmllint -->
+
+<!-- each visualization must have a template (all other elements are optional) -->
+<!ELEMENT visualization (data_sources*,params*,template_root*,template,link_text*,render_location*)>
+<!-- visualization name (e.g. 'trackster', 'scatterplot', etc.) is required -->
+<!ATTLIST visualization
+ name CDATA #REQUIRED
+>
+
+<!ELEMENT data_sources (data_source*)>
+<!-- data sources are elements that describe what objects (HDAs, LDDAs, Job, User, etc.)
+ are applicable to a visualization. Often these are used to fetch applicable links
+ to the visualizations that use them.
+-->
+ <!ELEMENT data_source (model_class,(test|to_param)*)>
+ <!ELEMENT model_class (#PCDATA)>
+ <!-- model_class is currently the class name of the object you want to make a visualization
+ applicable to (e.g. HistoryDatasetAssociation). Currently only classes in galaxy.model
+ can be used.
+ REQUIRED and currently limited to: 'HistoryDatasetAssociation', 'LibraryDatasetDatasetAssociation'
+ -->
+ <!ELEMENT test (#PCDATA)>
+ <!-- tests help define what conditions the visualization can be applied to the model_class/target.
+ Currently, all tests are OR'd and there is no logical grouping. Tests are run in order.
+ (text): the text of this element is what the given target will be compared to (REQUIRED)
+ type: what type of test to run (e.g. when the target is an HDA the test will often be of type 'isinstance'
+ and test whether the HDA's datatype isinstace of a class)
+ DEFAULT: string comparison.
+ test_attr: what attribute of the target object should be used in the test. For instance, 'datatype'
+ will attempt to get the HDA.datatype from a target HDA. If the given object doesn't have
+ that attribute the test will fail (with no error). test_attr can be dot separated attributes,
+ looking up each in turn. For example, if the target was a history, one could access the
+ history.user.email by setting test_attr to 'user.email' (why you would want that, I don't know)
+ DEFAULT: to comparing the object itself (and not any of it's attributes)
+ result_type: if the result (the text of the element mentioned above) needs to be parsed into
+ something other than a string, result_type will tell the registry how to do this. E.g.
+ if result_type is 'datatype' the registry will assume the text is a datatype class name
+ and parse it into the proper class before the test (often 'isinstance') is run.
+ DEFAULT: no parsing (result should be a string)
+ -->
+ <!ATTLIST test
+ type CDATA #IMPLIED
+ test_attr CDATA #IMPLIED
+ result_type CDATA #IMPLIED
+ >
+
+ <!ELEMENT to_param (#PCDATA)>
+ <!-- to_param tells the registry how to parse the data_source into a query string param.
+ For example, HDA data_sources can set param_to text to 'dataset_id' and param_attr to 'id' and the
+ the target HDA (if it passes the tests) will be passed as "dataset_id=HDA.id"
+ (text): the query string param key this source will be parsed into (e.g. dataset_id)
+ REQUIRED
+ param_attr: the attribute of the data_source object to use as the value in the query string param.
+ E.g. param_attr='id' for an HDA data_source would use the (encoded) id.
+ NOTE: a to_param MUST have either a param_attr or assign
+ assign: you can use this to directly assign a value to a query string's param. E.g. if the
+ data_source is a LDDA we can set 'hda_or_ldda=ldda' using assign='ldda'.
+ NOTE: a to_param MUST have either a param_attr or assign
+ -->
+ <!ATTLIST to_param
+ param_attr CDATA #IMPLIED
+ assign CDATA #IMPLIED
+ >
+
+<!ELEMENT params ((param|param_modifier)*)>
+<!-- params describe what data will be sent to a visualization template and
+ how to convert them from a query string in a URL into variables usable in a template.
+ For example,
+ param_modifiers are a special class of parameters that modify other params
+ (e.g. hda_ldda can be 'hda' or 'ldda' and modifies/informs dataset_id to fetch an HDA or LDDA)
+-->
+ <!ELEMENT param (#PCDATA)>
+ <!-- param tells the registry how to parse the query string param back into a resource/data_source.
+ For example, if a query string has "dataset_id=NNN" and the type is 'dataset', the registry
+ will attempt to fetch the hda with id of NNN from the database and pass it to the template.
+ (text): the query string param key this source will be parsed from (e.g. dataset_id)
+ REQUIRED
+ type: the type of the resource.
+ Can be: str (DEFAULT), bool, int, float, json, visualization, dbkey, dataset, or hda_ldda.
+ default: if a param is not passed on the query string (and is not required) OR the given param
+ fails to parse, this value is used instead.
+ DEFAULT: None
+ required: set this to true if the param is required for the template. Rendering will with an error
+ if the param hasn't been sent.
+ DEFAULT: false
+ csv: set this to true if the param is a comma separated list. The registry will attempt to
+ parse each value as the given type and send the result as a list to the template.
+ DEFAULT: false
+ constrain_to: (currently unused) constain a param to a set of values, error if not valid.
+ DEFAULT: don't constrain
+ var_name_in_template: a new name for the resource/variable to use in the template. E.g. an initial
+ query string param key might be 'dataset_id' in the URL, the registry parses it into an HDA,
+ and if var_name_in_template is set to 'hda', the template will be able to access the HDA
+ with the variable name 'hda' (as in hda.title).
+ DEFAULT: keep the original query string name
+ -->
+ <!ATTLIST param
+ type CDATA #IMPLIED
+ default CDATA #IMPLIED
+ required CDATA #IMPLIED
+ csv CDATA #IMPLIED
+ constrain_to CDATA #IMPLIED
+ var_name_in_template CDATA #IMPLIED
+ >
+ <!-- param_modifiers are the same as param but have a REQUIRED 'modifies' attribute.
+ 'modifies' must point to the param name (the text part of param element) that it will modify.
+ E.g. <param_modifier modifies="dataset_id">hda_ldda</param_modifier>
+ -->
+ <!ELEMENT param_modifier (#PCDATA)>
+ <!ATTLIST param_modifier
+ modifies CDATA #REQUIRED
+ type CDATA #IMPLIED
+ default CDATA #IMPLIED
+ required CDATA #IMPLIED
+ csv CDATA #IMPLIED
+ constrain_to CDATA #IMPLIED
+ var_name_in_template CDATA #IMPLIED
+ >
+
+<!-- template_root: the directory to search for the template relative to templates/webapps/galaxy
+ (optional) DEFAULT: visualizations
+-->
+<!ELEMENT template_root (#PCDATA)>
+<!-- template: the template used to render the visualization. REQUIRED -->
+<!ELEMENT template (#PCDATA)>
+<!-- link_text: the text component of an html anchor displayed when the registry builds the link information -->
+<!ELEMENT link_text (#PCDATA)>
+<!-- render_location: used as the target attribute of the link to the visualization.
+ Can be 'galaxy_main', '_top', '_blank'. DEFAULT: 'galaxy_main'
+-->
+<!-- TODO: rename -> render_target -->
+<!ELEMENT render_location (#PCDATA)>
diff -r 7740b1dc41fad7bc6cfd80f1af41ae05dae2f4c3 -r 866d8b29854f4079250efae62a6fddf0204e51c4 eggs.ini
--- a/eggs.ini
+++ b/eggs.ini
@@ -19,7 +19,7 @@
mercurial = 2.2.3
MySQL_python = 1.2.3c1
numpy = 1.6.0
-pbs_python = 4.1.0
+pbs_python = 4.3.5
psycopg2 = 2.0.13
pycrypto = 2.5
pysam = 0.4.2
diff -r 7740b1dc41fad7bc6cfd80f1af41ae05dae2f4c3 -r 866d8b29854f4079250efae62a6fddf0204e51c4 job_conf.xml.sample_advanced
--- a/job_conf.xml.sample_advanced
+++ b/job_conf.xml.sample_advanced
@@ -54,7 +54,15 @@
<param id="shell_hostname">foo.example.org</param><param id="Job_Execution_Time">24:00:00</param></destination>
- <destination id="condor" runner="condor"/>
+ <destination id="condor" runner="condor">
+ <!-- With no params, jobs are submitted to the 'vanilla' universe with:
+ notification = NEVER
+ getenv = true
+ Additional/override query ClassAd params can be specified with
+ <param> tags.
+ -->
+ <param id="request_cpus">8</param>
+ </destination></destinations><tools><!-- Tools can be configured to use specific destinations or handlers,
diff -r 7740b1dc41fad7bc6cfd80f1af41ae05dae2f4c3 -r 866d8b29854f4079250efae62a6fddf0204e51c4 lib/galaxy/app.py
--- a/lib/galaxy/app.py
+++ b/lib/galaxy/app.py
@@ -92,7 +92,7 @@
# Load additional entries defined by self.config.shed_tool_data_table_config into tool data tables.
self.tool_data_tables.load_from_config_file( config_filename=self.config.shed_tool_data_table_config,
tool_data_path=self.tool_data_tables.tool_data_path,
- from_shed_config=True )
+ from_shed_config=False )
# Initialize the job management configuration
self.job_config = jobs.JobConfiguration(self)
# Initialize the tools, making sure the list of tool configs includes the reserved migrated_tools_conf.xml file.
@@ -123,8 +123,10 @@
# Load genome indexer tool.
load_genome_index_tools( self.toolbox )
# visualizations registry: associates resources with visualizations, controls how to render
- self.visualizations_registry = ( VisualizationsRegistry( self.config.root, self.config.visualizations_conf_path )
- if self.config.visualizations_conf_path else None )
+ self.visualizations_registry = None
+ if self.config.visualizations_config_directory:
+ self.visualizations_registry = VisualizationsRegistry( self.config.root,
+ self.config.visualizations_config_directory )
# Load security policy.
self.security_agent = self.model.security_agent
self.host_security_agent = galaxy.security.HostAgent( model=self.security_agent.model, permitted_actions=self.security_agent.permitted_actions )
diff -r 7740b1dc41fad7bc6cfd80f1af41ae05dae2f4c3 -r 866d8b29854f4079250efae62a6fddf0204e51c4 lib/galaxy/config.py
--- a/lib/galaxy/config.py
+++ b/lib/galaxy/config.py
@@ -64,21 +64,33 @@
tcf = kwargs[ 'tool_config_files' ]
else:
tcf = 'tool_conf.xml'
+ self.tool_filters = listify( kwargs.get( "tool_filters", [] ) )
+ self.tool_label_filters = listify( kwargs.get( "tool_label_filters", [] ) )
+ self.tool_section_filters = listify( kwargs.get( "tool_section_filters", [] ) )
self.tool_configs = [ resolve_path( p, self.root ) for p in listify( tcf ) ]
+ self.shed_tool_data_path = kwargs.get( "shed_tool_data_path", None )
+ if self.shed_tool_data_path:
+ self.shed_tool_data_path = resolve_path( self.shed_tool_data_path, self.root )
+ else:
+ self.shed_tool_data_path = self.tool_data_path
self.tool_data_table_config_path = resolve_path( kwargs.get( 'tool_data_table_config_path', 'tool_data_table_conf.xml' ), self.root )
self.shed_tool_data_table_config = resolve_path( kwargs.get( 'shed_tool_data_table_config', 'shed_tool_data_table_conf.xml' ), self.root )
self.enable_tool_shed_check = string_as_bool( kwargs.get( 'enable_tool_shed_check', False ) )
+ self.hours_between_check = kwargs.get( 'hours_between_check', 12 )
try:
- self.hours_between_check = kwargs.get( 'hours_between_check', 12 )
- if isinstance( self.hours_between_check, float ):
+ hbc_test = int( self.hours_between_check )
+ self.hours_between_check = hbc_test
+ if self.hours_between_check < 1 or self.hours_between_check > 24:
+ self.hours_between_check = 12
+ except:
+ try:
# Float values are supported for functional tests.
+ hbc_test = float( self.hours_between_check )
+ self.hours_between_check = hbc_test
if self.hours_between_check < 0.001 or self.hours_between_check > 24.0:
self.hours_between_check = 12.0
- else:
- if self.hours_between_check < 1 or self.hours_between_check > 24:
- self.hours_between_check = 12
- except:
- self.hours_between_check = 12
+ except:
+ self.hours_between_check = 12
self.update_integrated_tool_panel = kwargs.get( "update_integrated_tool_panel", True )
self.enable_data_manager_user_view = string_as_bool( kwargs.get( "enable_data_manager_user_view", "False" ) )
self.data_manager_config_file = resolve_path( kwargs.get('data_manager_config_file', 'data_manager_conf.xml' ), self.root )
@@ -154,6 +166,7 @@
self.ucsc_display_sites = kwargs.get( 'ucsc_display_sites', "main,test,archaea,ucla" ).lower().split(",")
self.gbrowse_display_sites = kwargs.get( 'gbrowse_display_sites', "modencode,sgd_yeast,tair,wormbase,wormbase_ws120,wormbase_ws140,wormbase_ws170,wormbase_ws180,wormbase_ws190,wormbase_ws200,wormbase_ws204,wormbase_ws210,wormbase_ws220,wormbase_ws225" ).lower().split(",")
self.brand = kwargs.get( 'brand', None )
+ self.welcome_url = kwargs.get( 'welcome_url', '/static/welcome.html' )
# Configuration for the message box directly below the masthead.
self.message_box_visible = kwargs.get( 'message_box_visible', False )
self.message_box_content = kwargs.get( 'message_box_content', None )
@@ -275,8 +288,8 @@
self.fluent_log = string_as_bool( kwargs.get( 'fluent_log', False ) )
self.fluent_host = kwargs.get( 'fluent_host', 'localhost' )
self.fluent_port = int( kwargs.get( 'fluent_port', 24224 ) )
- # visualizations registry config path
- self.visualizations_conf_path = kwargs.get( 'visualizations_conf_path', None )
+ # visualization registries config directory
+ self.visualizations_config_directory = kwargs.get( 'visualizations_config_directory', None )
@property
def sentry_dsn_public( self ):
diff -r 7740b1dc41fad7bc6cfd80f1af41ae05dae2f4c3 -r 866d8b29854f4079250efae62a6fddf0204e51c4 lib/galaxy/datatypes/binary.py
--- a/lib/galaxy/datatypes/binary.py
+++ b/lib/galaxy/datatypes/binary.py
@@ -22,6 +22,7 @@
from galaxy.datatypes.metadata import MetadataElement
from galaxy.datatypes import metadata
from galaxy.datatypes.sniff import *
+import dataproviders
log = logging.getLogger(__name__)
@@ -74,6 +75,7 @@
trans.response.headers["Content-Disposition"] = 'attachment; filename="Galaxy%s-[%s].%s"' % (dataset.hid, fname, to_ext)
return open( dataset.file_name )
+
class Ab1( Binary ):
"""Class describing an ab1 binary sequence file"""
file_ext = "ab1"
@@ -93,12 +95,15 @@
Binary.register_unsniffable_binary_ext("ab1")
+
class GenericAsn1Binary( Binary ):
"""Class for generic ASN.1 binary format"""
file_ext = "asn1-binary"
Binary.register_unsniffable_binary_ext("asn1-binary")
+
+(a)dataproviders.decorators.has_dataproviders
class Bam( Binary ):
"""Class describing a BAM binary file"""
file_ext = "bam"
@@ -255,9 +260,92 @@
return dataset.peek
except:
return "Binary bam alignments file (%s)" % ( data.nice_size( dataset.get_size() ) )
+
+ # ------------- Dataproviders
+ # pipe through samtools view
+ #ALSO: (as Sam)
+ # bam does not use '#' to indicate comments/headers - we need to strip out those headers from the std. providers
+ #TODO:?? seems like there should be an easier way to do/inherit this - metadata.comment_char?
+ #TODO: incorporate samtools options to control output: regions first, then flags, etc.
+ @dataproviders.decorators.dataprovider_factory( 'line', dataproviders.line.FilteredLineDataProvider.settings )
+ def line_dataprovider( self, dataset, **settings ):
+ samtools_source = dataproviders.dataset.SamtoolsDataProvider( dataset )
+ settings[ 'comment_char' ] = '@'
+ return dataproviders.line.FilteredLineDataProvider( samtools_source, **settings )
+
+ @dataproviders.decorators.dataprovider_factory( 'regex-line', dataproviders.line.RegexLineDataProvider.settings )
+ def regex_line_dataprovider( self, dataset, **settings ):
+ samtools_source = dataproviders.dataset.SamtoolsDataProvider( dataset )
+ settings[ 'comment_char' ] = '@'
+ return dataproviders.line.RegexLineDataProvider( samtools_source, **settings )
+ @dataproviders.decorators.dataprovider_factory( 'column', dataproviders.column.ColumnarDataProvider.settings )
+ def column_dataprovider( self, dataset, **settings ):
+ samtools_source = dataproviders.dataset.SamtoolsDataProvider( dataset )
+ settings[ 'comment_char' ] = '@'
+ return dataproviders.column.ColumnarDataProvider( samtools_source, **settings )
+
+ @dataproviders.decorators.dataprovider_factory( 'dict', dataproviders.column.DictDataProvider.settings )
+ def dict_dataprovider( self, dataset, **settings ):
+ samtools_source = dataproviders.dataset.SamtoolsDataProvider( dataset )
+ settings[ 'comment_char' ] = '@'
+ return dataproviders.column.DictDataProvider( samtools_source, **settings )
+
+ # these can't be used directly - may need BamColumn, BamDict (Bam metadata -> column/dict)
+ # OR - see genomic_region_dataprovider
+ #(a)dataproviders.decorators.dataprovider_factory( 'dataset-column', dataproviders.column.ColumnarDataProvider.settings )
+ #def dataset_column_dataprovider( self, dataset, **settings ):
+ # settings[ 'comment_char' ] = '@'
+ # return super( Sam, self ).dataset_column_dataprovider( dataset, **settings )
+
+ #(a)dataproviders.decorators.dataprovider_factory( 'dataset-dict', dataproviders.column.DictDataProvider.settings )
+ #def dataset_dict_dataprovider( self, dataset, **settings ):
+ # settings[ 'comment_char' ] = '@'
+ # return super( Sam, self ).dataset_dict_dataprovider( dataset, **settings )
+
+ @dataproviders.decorators.dataprovider_factory( 'header', dataproviders.line.RegexLineDataProvider.settings )
+ def header_dataprovider( self, dataset, **settings ):
+ # in this case we can use an option of samtools view to provide just what we need (w/o regex)
+ samtools_source = dataproviders.dataset.SamtoolsDataProvider( dataset, '-H' )
+ return dataproviders.line.RegexLineDataProvider( samtools_source, **settings )
+
+ @dataproviders.decorators.dataprovider_factory( 'id-seq-qual', dataproviders.column.DictDataProvider.settings )
+ def id_seq_qual_dataprovider( self, dataset, **settings ):
+ settings[ 'indeces' ] = [ 0, 9, 10 ]
+ settings[ 'column_types' ] = [ 'str', 'str', 'str' ]
+ settings[ 'column_names' ] = [ 'id', 'seq', 'qual' ]
+ return self.dict_dataprovider( dataset, **settings )
+
+ @dataproviders.decorators.dataprovider_factory( 'genomic-region', dataproviders.column.ColumnarDataProvider.settings )
+ def genomic_region_dataprovider( self, dataset, **settings ):
+ # GenomicRegionDataProvider currently requires a dataset as source - may not be necc.
+ #TODO:?? consider (at least) the possible use of a kwarg: metadata_source (def. to source.dataset),
+ # or remove altogether...
+ #samtools_source = dataproviders.dataset.SamtoolsDataProvider( dataset )
+ #return dataproviders.dataset.GenomicRegionDataProvider( samtools_source, metadata_source=dataset,
+ # 2, 3, 3, **settings )
+
+ # instead, set manually and use in-class column gen
+ settings[ 'indeces' ] = [ 2, 3, 3 ]
+ settings[ 'column_types' ] = [ 'str', 'int', 'int' ]
+ return self.column_dataprovider( dataset, **settings )
+
+ @dataproviders.decorators.dataprovider_factory( 'genomic-region-dict', dataproviders.column.DictDataProvider.settings )
+ def genomic_region_dict_dataprovider( self, dataset, **settings ):
+ settings[ 'indeces' ] = [ 2, 3, 3 ]
+ settings[ 'column_types' ] = [ 'str', 'int', 'int' ]
+ settings[ 'column_names' ] = [ 'chrom', 'start', 'end' ]
+ return self.dict_dataprovider( dataset, **settings )
+
+ @dataproviders.decorators.dataprovider_factory( 'samtools' )
+ def samtools_dataprovider( self, dataset, **settings ):
+ """Generic samtools interface - all options available through settings."""
+ dataset_source = dataproviders.dataset.DatasetDataProvider( dataset )
+ return dataproviders.dataset.SamtoolsDataProvider( dataset_source, **settings )
+
Binary.register_sniffable_binary_format("bam", "bam", Bam)
+
class H5( Binary ):
"""Class describing an HDF5 file"""
file_ext = "h5"
@@ -277,6 +365,7 @@
Binary.register_unsniffable_binary_ext("h5")
+
class Scf( Binary ):
"""Class describing an scf binary sequence file"""
file_ext = "scf"
@@ -296,6 +385,7 @@
Binary.register_unsniffable_binary_ext("scf")
+
class Sff( Binary ):
""" Standard Flowgram Format (SFF) """
file_ext = "sff"
@@ -327,6 +417,7 @@
Binary.register_sniffable_binary_format("sff", "sff", Sff)
+
class BigWig(Binary):
"""
Accessing binary BigWig files from UCSC.
@@ -363,6 +454,7 @@
Binary.register_sniffable_binary_format("bigwig", "bigwig", BigWig)
+
class BigBed(BigWig):
"""BigBed support from UCSC."""
@@ -375,6 +467,7 @@
Binary.register_sniffable_binary_format("bigbed", "bigbed", BigBed)
+
class TwoBit (Binary):
"""Class describing a TwoBit format nucleotide file"""
@@ -399,3 +492,5 @@
return dataset.peek
except:
return "Binary TwoBit format nucleotide file (%s)" % (data.nice_size(dataset.get_size()))
+
+Binary.register_sniffable_binary_format("twobit", "twobit", TwoBit)
diff -r 7740b1dc41fad7bc6cfd80f1af41ae05dae2f4c3 -r 866d8b29854f4079250efae62a6fddf0204e51c4 lib/galaxy/datatypes/converters/bam_to_bigwig_converter.xml
--- a/lib/galaxy/datatypes/converters/bam_to_bigwig_converter.xml
+++ b/lib/galaxy/datatypes/converters/bam_to_bigwig_converter.xml
@@ -1,5 +1,9 @@
<tool id="CONVERTER_bam_to_bigwig_0" name="Convert BAM to BigWig" version="1.0.0" hidden="true"><!-- <description>__NOT_USED_CURRENTLY_FOR_CONVERTERS__</description> -->
+ <requirements>
+ <requirement type="package">ucsc_tools</requirement>
+ <requirement type="package">bedtools</requirement>
+ </requirements><command>
bedtools genomecov -bg -split -ibam $input -g $chromInfo
diff -r 7740b1dc41fad7bc6cfd80f1af41ae05dae2f4c3 -r 866d8b29854f4079250efae62a6fddf0204e51c4 lib/galaxy/datatypes/converters/bed_gff_or_vcf_to_bigwig_converter.xml
--- a/lib/galaxy/datatypes/converters/bed_gff_or_vcf_to_bigwig_converter.xml
+++ b/lib/galaxy/datatypes/converters/bed_gff_or_vcf_to_bigwig_converter.xml
@@ -1,5 +1,9 @@
<tool id="CONVERTER_bed_gff_or_vcf_to_bigwig_0" name="Convert BED, GFF, or VCF to BigWig" version="1.0.0" hidden="true"><!-- <description>__NOT_USED_CURRENTLY_FOR_CONVERTERS__</description> -->
+ <requirements>
+ <requirement type="package">ucsc_tools</requirement>
+ <requirement type="package">bedtools</requirement>
+ </requirements><command>
## Remove comments and sort by chromosome.
grep -v '^#' $input | sort -k1,1 |
diff -r 7740b1dc41fad7bc6cfd80f1af41ae05dae2f4c3 -r 866d8b29854f4079250efae62a6fddf0204e51c4 lib/galaxy/datatypes/converters/interval_to_bigwig_converter.xml
--- a/lib/galaxy/datatypes/converters/interval_to_bigwig_converter.xml
+++ b/lib/galaxy/datatypes/converters/interval_to_bigwig_converter.xml
@@ -1,6 +1,10 @@
<tool id="CONVERTER_interval_to_bigwig_0" name="Convert Genomic Intervals To Coverage"><!-- <description>__NOT_USED_CURRENTLY_FOR_CONVERTERS__</description> --><!-- Used on the metadata edit page. -->
+ <requirements>
+ <requirement type="package">ucsc_tools</requirement>
+ <requirement type="package">bedtools</requirement>
+ </requirements><command>
## Remove comments and sort by chromosome.
diff -r 7740b1dc41fad7bc6cfd80f1af41ae05dae2f4c3 -r 866d8b29854f4079250efae62a6fddf0204e51c4 lib/galaxy/datatypes/converters/interval_to_interval_index_converter.py
--- a/lib/galaxy/datatypes/converters/interval_to_interval_index_converter.py
+++ b/lib/galaxy/datatypes/converters/interval_to_interval_index_converter.py
@@ -11,15 +11,13 @@
from __future__ import division
-import sys, fileinput, optparse
+import optparse
from galaxy import eggs
-import pkg_resources; pkg_resources.require( "bx-python" )
-from galaxy.visualization.tracks.summary import *
-from galaxy.datatypes.util.gff_util import convert_gff_coords_to_bed
+eggs.require( "bx-python" )
from bx.interval_index_file import Indexes
def main():
-
+
# Read options, args.
parser = optparse.OptionParser()
parser.add_option( '-c', '--chr-col', type='int', dest='chrom_col', default=1 )
@@ -27,12 +25,12 @@
parser.add_option( '-e', '--end-col', type='int', dest='end_col', default=3 )
(options, args) = parser.parse_args()
input_fname, output_fname = args
-
+
# Make column indices 0-based.
options.chrom_col -= 1
options.start_col -= 1
options.end_col -= 1
-
+
# Do conversion.
index = Indexes()
offset = 0
@@ -46,9 +44,9 @@
chrom_end = int( feature[ options.end_col ] )
index.add( chrom, chrom_start, chrom_end, offset )
offset += len(line)
-
+
index.write( open(output_fname, "w") )
-if __name__ == "__main__":
+if __name__ == "__main__":
main()
-
\ No newline at end of file
+
diff -r 7740b1dc41fad7bc6cfd80f1af41ae05dae2f4c3 -r 866d8b29854f4079250efae62a6fddf0204e51c4 lib/galaxy/datatypes/converters/pileup_to_interval_index_converter.py
--- a/lib/galaxy/datatypes/converters/pileup_to_interval_index_converter.py
+++ b/lib/galaxy/datatypes/converters/pileup_to_interval_index_converter.py
@@ -8,20 +8,18 @@
from __future__ import division
-import sys, fileinput, optparse
+import optparse
from galaxy import eggs
-import pkg_resources; pkg_resources.require( "bx-python" )
-from galaxy.visualization.tracks.summary import *
-from galaxy.datatypes.util.gff_util import convert_gff_coords_to_bed
+eggs.require( "bx-python" )
from bx.interval_index_file import Indexes
def main():
-
+
# Read options, args.
parser = optparse.OptionParser()
(options, args) = parser.parse_args()
input_fname, output_fname = args
-
+
# Do conversion.
index = Indexes()
offset = 0
@@ -31,9 +29,9 @@
start = int( start ) - 1
index.add( chrom, start, start + 1, offset )
offset += len( line )
-
+
index.write( open(output_fname, "w") )
-if __name__ == "__main__":
+if __name__ == "__main__":
main()
-
\ No newline at end of file
+
diff -r 7740b1dc41fad7bc6cfd80f1af41ae05dae2f4c3 -r 866d8b29854f4079250efae62a6fddf0204e51c4 lib/galaxy/datatypes/converters/sam_to_bigwig_converter.xml
--- a/lib/galaxy/datatypes/converters/sam_to_bigwig_converter.xml
+++ b/lib/galaxy/datatypes/converters/sam_to_bigwig_converter.xml
@@ -1,4 +1,9 @@
<tool id="CONVERTER_sam_to_bigwig_0" name="Convert SAM to BigWig" version="1.0.0" hidden="true">
+ <requirements>
+ <requirement type="package">ucsc_tools</requirement>
+ <requirement type="package">samtools</requirement>
+ <requirement type="package">bedtools</requirement>
+ </requirements><command>
samtools view -bh $input | bedtools genomecov -bg -split -ibam stdin -g $chromInfo
diff -r 7740b1dc41fad7bc6cfd80f1af41ae05dae2f4c3 -r 866d8b29854f4079250efae62a6fddf0204e51c4 lib/galaxy/datatypes/data.py
--- a/lib/galaxy/datatypes/data.py
+++ b/lib/galaxy/datatypes/data.py
@@ -14,6 +14,8 @@
from galaxy.util.odict import odict
from galaxy.util.sanitize_html import sanitize_html
+import dataproviders
+
from galaxy import eggs
eggs.require( "Paste" )
import paste
@@ -56,6 +58,7 @@
cls.metadata_spec.update( base.metadata_spec ) #add contents of metadata spec of base class to cls
metadata.Statement.process( cls )
+(a)dataproviders.decorators.has_dataproviders
class Data( object ):
"""
Base class for all datatypes. Implements basic interfaces as well
@@ -545,7 +548,13 @@
def has_resolution(self):
return False
-
+ def matches_any( self, target_datatypes ):
+ """
+ Check if this datatype is of any of the target_datatypes or is
+ a subtype thereof.
+ """
+ datatype_classes = tuple( [ datatype.__class__ for datatype in target_datatypes ] )
+ return isinstance( self, datatype_classes )
def merge( split_files, output_file):
"""
Merge files with copy.copyfileobj() will not hit the
@@ -572,6 +581,39 @@
return [ 'trackster', 'circster' ]
return []
+ # ------------- Dataproviders
+ def has_dataprovider( self, data_format ):
+ """
+ Returns True if `data_format` is available in `dataproviders`.
+ """
+ return ( data_format in self.dataproviders )
+
+ def dataprovider( self, dataset, data_format, **settings ):
+ """
+ Base dataprovider factory for all datatypes that returns the proper provider
+ for the given `data_format` or raises a `NoProviderAvailable`.
+ """
+ if self.has_dataprovider( data_format ):
+ return self.dataproviders[ data_format ]( self, dataset, **settings )
+ raise dataproviders.exceptions.NoProviderAvailable( self, data_format )
+
+ @dataproviders.decorators.dataprovider_factory( 'base' )
+ def base_dataprovider( self, dataset, **settings ):
+ dataset_source = dataproviders.dataset.DatasetDataProvider( dataset )
+ return dataproviders.base.DataProvider( dataset_source, **settings )
+
+ @dataproviders.decorators.dataprovider_factory( 'chunk', dataproviders.chunk.ChunkDataProvider.settings )
+ def chunk_dataprovider( self, dataset, **settings ):
+ dataset_source = dataproviders.dataset.DatasetDataProvider( dataset )
+ return dataproviders.chunk.ChunkDataProvider( dataset_source, **settings )
+
+ @dataproviders.decorators.dataprovider_factory( 'chunk64', dataproviders.chunk.Base64ChunkDataProvider.settings )
+ def chunk64_dataprovider( self, dataset, **settings ):
+ dataset_source = dataproviders.dataset.DatasetDataProvider( dataset )
+ return dataproviders.chunk.Base64ChunkDataProvider( dataset_source, **settings )
+
+
+(a)dataproviders.decorators.has_dataproviders
class Text( Data ):
file_ext = 'txt'
line_class = 'line'
@@ -741,10 +783,31 @@
f.close()
split = classmethod(split)
+ # ------------- Dataproviders
+ @dataproviders.decorators.dataprovider_factory( 'line', dataproviders.line.FilteredLineDataProvider.settings )
+ def line_dataprovider( self, dataset, **settings ):
+ """
+ Returns an iterator over the dataset's lines (that have been `strip`ed)
+ optionally excluding blank lines and lines that start with a comment character.
+ """
+ dataset_source = dataproviders.dataset.DatasetDataProvider( dataset )
+ return dataproviders.line.FilteredLineDataProvider( dataset_source, **settings )
+
+ @dataproviders.decorators.dataprovider_factory( 'regex-line', dataproviders.line.RegexLineDataProvider.settings )
+ def regex_line_dataprovider( self, dataset, **settings ):
+ """
+ Returns an iterator over the dataset's lines
+ optionally including/excluding lines that match one or more regex filters.
+ """
+ dataset_source = dataproviders.dataset.DatasetDataProvider( dataset )
+ return dataproviders.line.RegexLineDataProvider( dataset_source, **settings )
+
+
class GenericAsn1( Text ):
"""Class for generic ASN.1 text format"""
file_ext = 'asn1'
+
class LineCount( Text ):
"""
Dataset contains a single line with a single integer that denotes the
@@ -752,6 +815,7 @@
"""
pass
+
class Newick( Text ):
"""New Hampshire/Newick Format"""
file_ext = "nhx"
diff -r 7740b1dc41fad7bc6cfd80f1af41ae05dae2f4c3 -r 866d8b29854f4079250efae62a6fddf0204e51c4 lib/galaxy/datatypes/dataproviders/__init__.py
--- /dev/null
+++ b/lib/galaxy/datatypes/dataproviders/__init__.py
@@ -0,0 +1,28 @@
+
+#TODO: ---- This is a work in progress ----
+"""
+Dataproviders are iterators with context managers that provide data to some
+consumer datum by datum.
+
+As well as subclassing and overriding to get the proper data, Dataproviders
+can be piped from one to the other.
+..example::
+
+.. note:: be careful to NOT pipe providers into subclasses of those providers.
+ Subclasses provide all the functionality of their superclasses,
+ so there's generally no need.
+
+.. note:: be careful to when using piped providers that accept the same keywords
+ in their __init__ functions (such as limit or offset) to pass those
+ keywords to the proper (often final) provider. These errors that result
+ can be hard to diagnose.
+"""
+import decorators
+import exceptions
+
+import base
+import chunk
+import line
+import column
+import external
+import dataset
diff -r 7740b1dc41fad7bc6cfd80f1af41ae05dae2f4c3 -r 866d8b29854f4079250efae62a6fddf0204e51c4 lib/galaxy/datatypes/dataproviders/base.py
--- /dev/null
+++ b/lib/galaxy/datatypes/dataproviders/base.py
@@ -0,0 +1,305 @@
+"""
+Base class(es) for all DataProviders.
+"""
+# there's a blurry line between functionality here and functionality in datatypes module
+# attempting to keep parsing to a minimum here and focus on chopping/pagination/reformat(/filtering-maybe?)
+# and using as much pre-computed info/metadata from the datatypes module as possible
+# also, this shouldn't be a replacement/re-implementation of the tool layer
+# (which provides traceability/versioning/reproducibility)
+
+from collections import deque
+import exceptions
+
+_TODO = """
+hooks into datatypes (define providers inside datatype modules) as factories
+capture tell() when provider is done
+ def stop( self ): self.endpoint = source.tell(); raise StopIteration()
+implement __len__ sensibly where it can be (would be good to have where we're giving some progress - '100 of 300')
+ seems like sniffed files would have this info
+unit tests
+add datum entry/exit point methods: possibly decode, encode
+ or create a class that pipes source through - how would decode work then?
+
+icorporate existing visualization/dataproviders
+some of the sources (esp. in datasets) don't need to be re-created
+YAGNI: InterleavingMultiSourceDataProvider, CombiningMultiSourceDataProvider
+
+datasets API entry point:
+ kwargs should be parsed from strings 2 layers up (in the DatasetsAPI) - that's the 'proper' place for that.
+ but how would it know how/what to parse if it doesn't have access to the classes used in the provider?
+ Building a giant list by sweeping all possible dprov classes doesn't make sense
+ For now - I'm burying them in the class __init__s - but I don't like that
+"""
+
+import logging
+log = logging.getLogger( __name__ )
+
+
+# ----------------------------------------------------------------------------- base classes
+class HasSettings( type ):
+ """
+ Metaclass for data providers that allows defining and inheriting
+ a dictionary named 'settings'.
+
+ Useful for allowing class level access to expected variable types
+ passed to class `__init__` functions so they can be parsed from a query string.
+ """
+ # yeah - this is all too acrobatic
+ def __new__( cls, name, base_classes, attributes ):
+ settings = {}
+ # get settings defined in base classes
+ for base_class in base_classes:
+ base_settings = getattr( base_class, 'settings', None )
+ if base_settings:
+ settings.update( base_settings )
+ # get settings defined in this class
+ new_settings = attributes.pop( 'settings', None )
+ if new_settings:
+ settings.update( new_settings )
+ attributes[ 'settings' ] = settings
+ return type.__new__( cls, name, base_classes, attributes )
+
+
+# ----------------------------------------------------------------------------- base classes
+class DataProvider( object ):
+ """
+ Base class for all data providers. Data providers:
+ (a) have a source (which must be another file-like object)
+ (b) implement both the iterator and context manager interfaces
+ (c) do not allow write methods
+ (but otherwise implement the other file object interface methods)
+ """
+ # a definition of expected types for keyword arguments sent to __init__
+ # useful for controlling how query string dictionaries can be parsed into correct types for __init__
+ # empty in this base class
+ __metaclass__ = HasSettings
+ settings = {}
+
+ def __init__( self, source, **kwargs ):
+ """
+ :param source: the source that this iterator will loop over.
+ (Should implement the iterable interface and ideally have the
+ context manager interface as well)
+ """
+ self.source = self.validate_source( source )
+
+ def validate_source( self, source ):
+ """
+ Is this a valid source for this provider?
+
+ :raises InvalidDataProviderSource: if the source is considered invalid.
+
+ Meant to be overridden in subclasses.
+ """
+ if not source or not hasattr( source, '__iter__' ):
+ # that's by no means a thorough check
+ raise exceptions.InvalidDataProviderSource( source )
+ return source
+
+ #TODO: (this might cause problems later...)
+ #TODO: some providers (such as chunk's seek and read) rely on this... remove
+ def __getattr__( self, name ):
+ if name == 'source':
+ # if we're inside this fn, source hasn't been set - provide some safety just for this attr
+ return None
+ # otherwise, try to get the attr from the source - allows us to get things like provider.encoding, etc.
+ if hasattr( self.source, name ):
+ return getattr( self.source, name )
+ # raise the proper error
+ return self.__getattribute__( name )
+
+ # write methods should not be allowed
+ def truncate( self, size ):
+ raise NotImplementedError( 'Write methods are purposely disabled' )
+ def write( self, string ):
+ raise NotImplementedError( 'Write methods are purposely disabled' )
+ def writelines( self, sequence ):
+ raise NotImplementedError( 'Write methods are purposely disabled' )
+
+ #TODO: route read methods through next?
+ #def readline( self ):
+ # return self.next()
+ def readlines( self ):
+ return [ line for line in self ]
+
+ # iterator interface
+ def __iter__( self ):
+ # it's generators all the way up, Timmy
+ with self as source:
+ for datum in self.source:
+ yield datum
+ def next( self ):
+ return self.source.next()
+
+ # context manager interface
+ def __enter__( self ):
+ # make the source's context manager interface optional
+ if hasattr( self.source, '__enter__' ):
+ self.source.__enter__()
+ return self
+ def __exit__( self, *args ):
+ # make the source's context manager interface optional, call on source if there
+ if hasattr( self.source, '__exit__' ):
+ self.source.__exit__( *args )
+ # alternately, call close()
+ elif hasattr( self.source, 'close' ):
+ self.source.close()
+
+ def __str__( self ):
+ """
+ String representation for easier debugging.
+
+ Will call `__str__` on it's source so this will display piped dataproviders.
+ """
+ # we need to protect against recursion (in __getattr__) if self.source hasn't been set
+ source_str = str( self.source ) if hasattr( self, 'source' ) else ''
+ return '%s(%s)' %( self.__class__.__name__, str( source_str ) )
+
+
+class FilteredDataProvider( DataProvider ):
+ """
+ Passes each datum through a filter function and yields it if that function
+ returns a non-`None` value.
+
+ Also maintains counters:
+ - `num_data_read`: how many data have been consumed from the source.
+ - `num_valid_data_read`: how many data have been returned from `filter`.
+ - `num_data_returned`: how many data has this provider yielded.
+ """
+ # not useful here - we don't want functions over the query string
+ #settings.update({ 'filter_fn': 'function' })
+
+ def __init__( self, source, filter_fn=None, **kwargs ):
+ """
+ :param filter_fn: a lambda or function that will be passed a datum and
+ return either the (optionally modified) datum or None.
+ """
+ super( FilteredDataProvider, self ).__init__( source, **kwargs )
+ self.filter_fn = filter_fn if hasattr( filter_fn, '__call__' ) else None
+ # count how many data we got from the source
+ self.num_data_read = 0
+ # how many valid data have we gotten from the source
+ # IOW, data that's passed the filter and been either provided OR have been skipped due to offset
+ self.num_valid_data_read = 0
+ # how many lines have been provided/output
+ self.num_data_returned = 0
+
+ def __iter__( self ):
+ parent_gen = super( FilteredDataProvider, self ).__iter__()
+ for datum in parent_gen:
+ self.num_data_read += 1
+ datum = self.filter( datum )
+ if datum != None:
+ self.num_valid_data_read += 1
+ self.num_data_returned += 1
+ yield datum
+
+ #TODO: may want to squash this into DataProvider
+ def filter( self, datum ):
+ """
+ When given a datum from the provider's source, return None if the datum
+ 'does not pass' the filter or is invalid. Return the datum if it's valid.
+
+ :param datum: the datum to check for validity.
+ :returns: the datum, a modified datum, or None
+
+ Meant to be overridden.
+ """
+ if self.filter_fn:
+ return self.filter_fn( datum )
+ # also can be overriden entirely
+ return datum
+
+
+class LimitedOffsetDataProvider( FilteredDataProvider ):
+ """
+ A provider that uses the counters from FilteredDataProvider to limit the
+ number of data and/or skip `offset` number of data before providing.
+
+ Useful for grabbing sections from a source (e.g. pagination).
+ """
+ # define the expected types of these __init__ arguments so they can be parsed out from query strings
+ settings = {
+ 'limit' : 'int',
+ 'offset': 'int'
+ }
+
+ #TODO: may want to squash this into DataProvider
+ def __init__( self, source, offset=0, limit=None, **kwargs ):
+ """
+ :param offset: the number of data to skip before providing.
+ :param limit: the final number of data to provide.
+ """
+ super( LimitedOffsetDataProvider, self ).__init__( source, **kwargs )
+
+ # how many valid data to skip before we start outputing data - must be positive
+ # (diff to support neg. indeces - must be pos.)
+ self.offset = max( offset, 0 )
+
+ # how many valid data to return - must be positive (None indicates no limit)
+ self.limit = limit
+ if self.limit != None:
+ self.limit = max( self.limit, 0 )
+
+ def __iter__( self ):
+ """
+ Iterate over the source until `num_valid_data_read` is greater than
+ `offset`, begin providing datat, and stop when `num_data_returned`
+ is greater than `offset`.
+ """
+ parent_gen = super( LimitedOffsetDataProvider, self ).__iter__()
+ for datum in parent_gen:
+
+ if self.limit != None and self.num_data_returned > self.limit:
+ break
+
+ if self.num_valid_data_read > self.offset:
+ yield datum
+ else:
+ # wot a cheezy way of doing this...
+ self.num_data_returned -= 1
+
+ #TODO: skipping lines is inefficient - somehow cache file position/line_num pair and allow provider
+ # to seek to a pos/line and then begin providing lines
+ # the important catch here is that we need to have accurate pos/line pairs
+ # in order to preserve the functionality of limit and offset
+ #if file_seek and len( file_seek ) == 2:
+ # seek_pos, new_line_num = file_seek
+ # self.seek_and_set_curr_line( seek_pos, new_line_num )
+
+ #def seek_and_set_curr_line( self, file_seek, new_curr_line_num ):
+ # self.seek( file_seek, os.SEEK_SET )
+ # self.curr_line_num = new_curr_line_num
+
+
+class MultiSourceDataProvider( DataProvider ):
+ """
+ A provider that iterates over a list of given sources and provides data
+ from one after another.
+
+ An iterator over iterators.
+ """
+ def __init__( self, source_list, **kwargs ):
+ """
+ :param source_list: an iterator of iterables
+ """
+ self.source_list = deque( source_list )
+
+ def __iter__( self ):
+ """
+ Iterate over the source_list, then iterate over the data in each source.
+
+ Skip a given source in `source_list` if it is `None` or invalid.
+ """
+ for source in self.source_list:
+ # just skip falsy sources
+ if not source:
+ continue
+ try:
+ self.source = self.validate_source( source )
+ except exceptions.InvalidDataProviderSource, invalid_source:
+ continue
+
+ parent_gen = super( MultiSourceDataProvider, self ).__iter__()
+ for datum in parent_gen:
+ yield datum
diff -r 7740b1dc41fad7bc6cfd80f1af41ae05dae2f4c3 -r 866d8b29854f4079250efae62a6fddf0204e51c4 lib/galaxy/datatypes/dataproviders/chunk.py
--- /dev/null
+++ b/lib/galaxy/datatypes/dataproviders/chunk.py
@@ -0,0 +1,84 @@
+"""
+Chunk (N number of bytes at M offset to a source's beginning) provider.
+
+Primarily for file sources but usable by any iterator that has both
+seek and read( N ).
+"""
+import os
+import base64
+
+import base
+import exceptions
+
+_TODO = """
+"""
+
+import logging
+log = logging.getLogger( __name__ )
+
+
+# -----------------------------------------------------------------------------
+class ChunkDataProvider( base.DataProvider ):
+ """
+ Data provider that yields chunks of data from it's file.
+
+ Note: this version does not account for lines and works with Binary datatypes.
+ """
+ MAX_CHUNK_SIZE = 2**16
+ DEFAULT_CHUNK_SIZE = MAX_CHUNK_SIZE
+ settings = {
+ 'chunk_index' : 'int',
+ 'chunk_size' : 'int'
+ }
+
+ #TODO: subclass from LimitedOffsetDataProvider?
+ # see web/framework/base.iterate_file, util/__init__.file_reader, and datatypes.tabular
+ def __init__( self, source, chunk_index=0, chunk_size=DEFAULT_CHUNK_SIZE, **kwargs ):
+ """
+ :param chunk_index: if a source can be divided into N number of
+ `chunk_size` sections, this is the index of which section to
+ return.
+ :param chunk_size: how large are the desired chunks to return
+ (gen. in bytes).
+ """
+ super( ChunkDataProvider, self ).__init__( source, **kwargs )
+ self.chunk_size = int( chunk_size )
+ self.chunk_pos = int( chunk_index ) * self.chunk_size
+
+ def validate_source( self, source ):
+ """
+ Does the given source have both the methods `seek` and `read`?
+ :raises InvalidDataProviderSource: if not.
+ """
+ source = super( ChunkDataProvider, self ).validate_source( source )
+ if( ( not hasattr( source, 'seek' ) )
+ or ( not hasattr( source, 'read' ) ) ):
+ raise exceptions.InvalidDataProviderSource( source )
+ return source
+
+ def __iter__( self ):
+ # not reeeally an iterator per se
+ self.__enter__()
+ self.source.seek( self.chunk_pos, os.SEEK_SET )
+ chunk = self.encode( self.source.read( self.chunk_size ) )
+ yield chunk
+ self.__exit__()
+
+ def encode( self, chunk ):
+ """
+ Called on the chunk before returning.
+
+ Overrride to modify, encode, or decode chunks.
+ """
+ return chunk
+
+
+class Base64ChunkDataProvider( ChunkDataProvider ):
+ """
+ Data provider that yields chunks of base64 encoded data from it's file.
+ """
+ def encode( self, chunk ):
+ """
+ Return chunks encoded in base 64.
+ """
+ return base64.b64encode( chunk )
diff -r 7740b1dc41fad7bc6cfd80f1af41ae05dae2f4c3 -r 866d8b29854f4079250efae62a6fddf0204e51c4 lib/galaxy/datatypes/dataproviders/column.py
--- /dev/null
+++ b/lib/galaxy/datatypes/dataproviders/column.py
@@ -0,0 +1,254 @@
+"""
+Providers that provide lists of lists generally where each line of a source
+is further subdivided into multiple data (e.g. columns from a line).
+"""
+
+import line
+
+_TODO = """
+move ColumnarDataProvider parsers to more sensible location
+
+TransposedColumnarDataProvider: provides each column as a single array
+ - see existing visualizations/dataprovider/basic.ColumnDataProvider
+"""
+
+import logging
+log = logging.getLogger( __name__ )
+
+
+# ----------------------------------------------------------------------------- base classes
+class ColumnarDataProvider( line.RegexLineDataProvider ):
+ """
+ Data provider that provide a list of columns from the lines of it's source.
+
+ Columns are returned in the order given in indeces, so this provider can
+ re-arrange columns.
+
+ If any desired index is outside the actual number of columns
+ in the source, this provider will None-pad the output and you are guaranteed
+ the same number of columns as the number of indeces asked for (even if they
+ are filled with None).
+ """
+ settings = {
+ 'indeces' : 'list:int',
+ 'column_count' : 'int',
+ 'column_types' : 'list:str',
+ 'parse_columns' : 'bool',
+ 'deliminator' : 'str'
+ }
+
+ def __init__( self, source, indeces=None,
+ column_count=None, column_types=None, parsers=None, parse_columns=True,
+ deliminator='\t', **kwargs ):
+ """
+ :param indeces: a list of indeces of columns to gather from each row
+ Optional: will default to `None`.
+ If `None`, this provider will return all rows (even when a
+ particular row contains more/less than others).
+ If a row/line does not contain an element at a given index, the
+ provider will-return/fill-with a `None` value as the element.
+ :type indeces: list or None
+
+ :param column_count: an alternate means of defining indeces, use an int
+ here to effectively provide the first N columns.
+ Optional: will default to `None`.
+ :type column_count: int
+
+ :param column_types: a list of string names of types that the
+ provider will use to look up an appropriate parser for the column.
+ (e.g. 'int', 'float', 'str', 'bool')
+ Optional: will default to parsing all columns as strings.
+ :type column_types: list of strings
+
+ :param parsers: a dictionary keyed with column type strings
+ and with values that are functions to use when parsing those
+ types.
+ Optional: will default to using the function `_get_default_parsers`.
+ :type parsers: dictionary
+
+ :param parse_columns: attempt to parse columns?
+ Optional: defaults to `True`.
+ :type parse_columns: bool
+
+ :param deliminator: character(s) used to split each row/line of the source.
+ Optional: defaults to the tab character.
+ :type deliminator: str
+
+ .. note: that the subclass constructors are passed kwargs - so they're
+ params (limit, offset, etc.) are also applicable here.
+ """
+ #TODO: other columnar formats: csv, etc.
+ super( ColumnarDataProvider, self ).__init__( source, **kwargs )
+
+ #IMPLICIT: if no indeces, column_count, or column_types passed: return all columns
+ self.selected_column_indeces = indeces
+ self.column_count = column_count
+ self.column_types = column_types or []
+ # if no column count given, try to infer from indeces or column_types
+ if not self.column_count:
+ if self.selected_column_indeces:
+ self.column_count = len( self.selected_column_indeces )
+ elif self.column_types:
+ self.column_count = len( self.column_types )
+ # if no indeces given, infer from column_count
+ if not self.selected_column_indeces and self.column_count:
+ self.selected_column_indeces = list( xrange( self.column_count ) )
+
+ self.deliminator = deliminator
+
+ # how/whether to parse each column value
+ self.parsers = {}
+ if parse_columns:
+ self.parsers = self.get_default_parsers()
+ # overwrite with user desired parsers
+ self.parsers.update( parsers or {} )
+
+ def get_default_parsers( self ):
+ """
+ Return parser dictionary keyed for each columnar type
+ (as defined in datatypes).
+
+ .. note: primitives only by default (str, int, float, boolean, None).
+ Other (more complex) types are retrieved as strings.
+ :returns: a dictionary of the form:
+ `{ <parser type name> : <function used to parse type> }`
+ """
+ #TODO: move to module level (or datatypes, util)
+ return {
+ # str is default and not needed here
+ 'int' : int,
+ 'float' : float,
+ 'bool' : bool,
+
+ # unfortunately, 'list' is used in dataset metadata both for
+ # query style maps (9th col gff) AND comma-sep strings.
+ # (disabled for now)
+ #'list' : lambda v: v.split( ',' ),
+ #'csv' : lambda v: v.split( ',' ),
+ ## i don't like how urlparses does sub-lists...
+ #'querystr' : lambda v: dict([ ( p.split( '=', 1 ) if '=' in p else ( p, True ) )
+ # for p in v.split( ';', 1 ) ])
+
+ #'scifloat': #floating point which may be in scientific notation
+
+ # always with the 1 base, biologists?
+ #'int1' : ( lambda i: int( i ) - 1 ),
+
+ #'gffval': string or '.' for None
+ #'gffint': # int or '.' for None
+ #'gffphase': # 0, 1, 2, or '.' for None
+ #'gffstrand': # -, +, ?, or '.' for None, etc.
+ }
+
+ def parse_value( self, val, type ):
+ """
+ Attempt to parse and return the given value based on the given type.
+
+ :param val: the column value to parse (often a string)
+ :param type: the string type 'name' used to find the appropriate parser
+ :returns: the parsed value
+ or `value` if no `type` found in `parsers`
+ or `None` if there was a parser error (ValueError)
+ """
+ if type == 'str' or type == None: return val
+ try:
+ return self.parsers[ type ]( val )
+ except KeyError, err:
+ # no parser - return as string
+ pass
+ except ValueError, err:
+ # bad value - return None
+ return None
+ return val
+
+ def get_column_type( self, index ):
+ """
+ Get the column type for the parser from `self.column_types` or `None`
+ if the type is unavailable.
+ :param index: the column index
+ :returns: string name of type (e.g. 'float', 'int', etc.)
+ """
+ try:
+ return self.column_types[ index ]
+ except IndexError, ind_err:
+ return None
+
+ def parse_column_at_index( self, columns, parser_index, index ):
+ """
+ Get the column type for the parser from `self.column_types` or `None`
+ if the type is unavailable.
+ """
+ try:
+ return self.parse_value( columns[ index ], self.get_column_type( parser_index ) )
+ # if a selected index is not within columns, return None
+ except IndexError, index_err:
+ return None
+
+ def parse_columns_from_line( self, line ):
+ """
+ Returns a list of the desired, parsed columns.
+ :param line: the line to parse
+ :type line: str
+ """
+ #TODO: too much going on in this loop - the above should all be precomputed AMAP...
+ all_columns = line.split( self.deliminator )
+ # if no indeces were passed to init, return all columns
+ selected_indeces = self.selected_column_indeces or list( xrange( len( all_columns ) ) )
+ parsed_columns = []
+ for parser_index, column_index in enumerate( selected_indeces ):
+ parsed_columns.append( self.parse_column_at_index( all_columns, parser_index, column_index ) )
+ return parsed_columns
+
+ def __iter__( self ):
+ parent_gen = super( ColumnarDataProvider, self ).__iter__()
+ for line in parent_gen:
+ columns = self.parse_columns_from_line( line )
+ yield columns
+
+ #TODO: implement column filters here and not below - flatten hierarchy
+
+class FilteredByColumnDataProvider( ColumnarDataProvider ):
+ """
+ Data provider that provide a list of columns from the lines of it's source
+ _only_ if they pass a given filter function.
+
+ e.g. column #3 is type int and > N
+ """
+ # TODO: how to do this and still have limit and offset work?
+ def __init__( self, source, **kwargs ):
+ raise NotImplementedError()
+ super( FilteredByColumnDataProvider, self ).__init__( source, **kwargs )
+
+
+class DictDataProvider( ColumnarDataProvider ):
+ """
+ Data provider that zips column_names and columns from the source's contents
+ into a dictionary.
+
+ A combination use of both `column_names` and `indeces` allows 'picking'
+ key/value pairs from the source.
+
+ .. note: that the subclass constructors are passed kwargs - so they're
+ params (limit, offset, etc.) are also applicable here.
+ """
+ settings = {
+ 'column_names' : 'list:str',
+ }
+
+ def __init__( self, source, column_names=None, **kwargs ):
+ """
+ :param column_names: an ordered list of strings that will be used as the keys
+ for each column in the returned dictionaries.
+ The number of key, value pairs each returned dictionary has will
+ be as short as the number of column names provided.
+ :type column_names:
+ """
+ #TODO: allow passing in a map instead of name->index { 'name1': index1, ... }
+ super( DictDataProvider, self ).__init__( source, **kwargs )
+ self.column_names = column_names or []
+
+ def __iter__( self ):
+ parent_gen = super( DictDataProvider, self ).__iter__()
+ for column_values in parent_gen:
+ map = dict( zip( self.column_names, column_values ) )
+ yield map
This diff is so big that we needed to truncate the remainder.
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: Dave Bouvier: Fix for revision select on repositories with multiple installable revisions.
by commits-noreply@bitbucket.org 30 Jul '13
by commits-noreply@bitbucket.org 30 Jul '13
30 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/08d24895889f/
Changeset: 08d24895889f
User: Dave Bouvier
Date: 2013-07-30 16:32:31
Summary: Fix for revision select on repositories with multiple installable revisions.
Affected #: 1 file
diff -r 161e2f4fae79cee9d8076c02bf1cdded59c92553 -r 08d24895889fc98a4d2f2ff8fa10411fe43e74b0 lib/tool_shed/util/shed_util_common.py
--- a/lib/tool_shed/util/shed_util_common.py
+++ b/lib/tool_shed/util/shed_util_common.py
@@ -815,7 +815,7 @@
changeset_revision_str = 'changeset_revision_'
if k.startswith( changeset_revision_str ):
repository_id = trans.security.encode_id( int( k.lstrip( changeset_revision_str ) ) )
- repository = suc.get_repository_in_tool_shed( trans, repository_id )
+ repository = get_repository_in_tool_shed( trans, repository_id )
if repository.tip( trans.app ) != v:
return v, repository
# This should never be reached - raise an exception?
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: Dave Bouvier: Clear tool test results when the skip tool tests option is enabled.
by commits-noreply@bitbucket.org 30 Jul '13
by commits-noreply@bitbucket.org 30 Jul '13
30 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/161e2f4fae79/
Changeset: 161e2f4fae79
User: Dave Bouvier
Date: 2013-07-30 15:23:39
Summary: Clear tool test results when the skip tool tests option is enabled.
Affected #: 1 file
diff -r 2d288287e40bca9a5954f3da1bebc2dd49849a04 -r 161e2f4fae79cee9d8076c02bf1cdded59c92553 lib/galaxy/webapps/tool_shed/controllers/repository.py
--- a/lib/galaxy/webapps/tool_shed/controllers/repository.py
+++ b/lib/galaxy/webapps/tool_shed/controllers/repository.py
@@ -1947,6 +1947,10 @@
# Handle the mapper behavior.
skip_tool_test = skip_tool_test[ 0 ]
if skip_tool_tests_checked:
+ if repository_metadata.tool_test_results:
+ repository_metadata.tool_test_results = None
+ trans.sa_session.add( repository_metadata )
+ trans.sa_session.flush()
if skip_tool_test:
comment = skip_tool_test.comment
if comment != skip_tool_tests_comment:
@@ -1959,12 +1963,12 @@
comment=skip_tool_tests_comment )
trans.sa_session.add( skip_tool_test )
trans.sa_session.flush()
- message = "Tools in this revision will be tested by the automated test framework."
+ message = "Tools in this revision will not be tested by the automated test framework."
else:
if skip_tool_test:
trans.sa_session.delete( skip_tool_test )
trans.sa_session.flush()
- message = "Tools in this revision will not be tested by the automated test framework."
+ message = "Tools in this revision will be tested by the automated test framework."
elif kwd.get( 'manage_categories_button', False ):
flush_needed = False
# Delete all currently existing categories.
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: jgoecks: Move welcome_url setting to 'UI Localization' section of the config file.
by commits-noreply@bitbucket.org 30 Jul '13
by commits-noreply@bitbucket.org 30 Jul '13
30 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/2d288287e40b/
Changeset: 2d288287e40b
User: jgoecks
Date: 2013-07-30 04:38:17
Summary: Move welcome_url setting to 'UI Localization' section of the config file.
Affected #: 1 file
diff -r 4d4faedba9b6caa555e3825e0f86a34c483e51ff -r 2d288287e40bca9a5954f3da1bebc2dd49849a04 universe_wsgi.ini.sample
--- a/universe_wsgi.ini.sample
+++ b/universe_wsgi.ini.sample
@@ -228,10 +228,6 @@
# -- Display sites
-# The URL of the page to display in Galaxy's middle pane when loaded. This can be
-# an absolute or relative URL.
-#welcome_url = /static/welcome.html
-
# Galaxy can display data at various external browsers. These options specify
# which browsers should be available. URLs and builds available at these
# browsers are defined in the specifield files.
@@ -284,6 +280,10 @@
# Append "/{brand}" to the "Galaxy" text in the masthead.
#brand = None
+# The URL of the page to display in Galaxy's middle pane when loaded. This can be
+# an absolute or relative URL.
+#welcome_url = /static/welcome.html
+
# The URL linked by the "Galaxy/brand" text.
#logo_url = /
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0