1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/fcf327d7dd51/ Changeset: fcf327d7dd51 User: carlfeberhard Date: 2013-05-17 20:50:27 Summary: API/datasets.show: allow _raw_data to assign a DataProvider by name Affected #: 1 file diff -r ffc6ff4fe6dfef48d6440c1cdb910661010f559d -r fcf327d7dd51c19b2478fe2ab4361b67fe8d3897 lib/galaxy/webapps/galaxy/api/datasets.py --- a/lib/galaxy/webapps/galaxy/api/datasets.py +++ b/lib/galaxy/webapps/galaxy/api/datasets.py @@ -23,7 +23,7 @@ return 'not implemented' @web.expose_api - def show( self, trans, id, hda_ldda='hda', data_type=None, **kwd ): + def show( self, trans, id, hda_ldda='hda', data_type=None, provider=None, **kwd ): """ GET /api/datasets/{encoded_dataset_id} Displays information about and/or content of a dataset. @@ -46,7 +46,7 @@ elif data_type == 'features': rval = self._search_features( trans, dataset, kwd.get( 'query' ) ) elif data_type == 'raw_data': - rval = self._raw_data( trans, dataset, **kwd ) + rval = self._raw_data( trans, dataset, provider, **kwd ) elif data_type == 'track_config': rval = self.get_new_track_config( trans, dataset ) elif data_type == 'genome_data': @@ -201,7 +201,7 @@ result.update( { 'dataset_type': data_provider.dataset_type, 'extra_info': extra_info } ) return result - def _raw_data( self, trans, dataset, **kwargs ): + def _raw_data( self, trans, dataset, provider=None, **kwargs ): """ Uses original (raw) dataset to return data. This method is useful when the dataset is not yet indexed and hence using data would @@ -212,8 +212,15 @@ if msg: return msg + registry = trans.app.data_provider_registry + # allow the caller to specifiy which provider is used + if provider and provider in registry.dataset_type_name_to_data_provider: + data_provider = registry.dataset_type_name_to_data_provider[ provider ]( dataset ) + # or have it look up by datatype + else: + data_provider = registry.get_data_provider( trans, raw=True, original_dataset=dataset ) + # Return data. - data_provider = trans.app.data_provider_registry.get_data_provider( trans, raw=True, original_dataset=dataset ) data = data_provider.get_data( **kwargs ) return data 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.