1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/22788c1262a2/
changeset: 22788c1262a2
user: jgoecks
date: 2013-01-28 22:36:02
summary: Language improvements for tophat wrappers.
affected #: 2 files
diff -r dfcc7e9469f81116ae01eb3aebf57b2a3d22ca82 -r 22788c1262a2756a50e03d92f8ee14705d019b98 tools/ngs_rna/tophat2_wrapper.xml
--- a/tools/ngs_rna/tophat2_wrapper.xml
+++ b/tools/ngs_rna/tophat2_wrapper.xml
@@ -144,15 +144,15 @@
</when></conditional><conditional name="refGenomeSource">
- <param name="genomeSource" type="select" label="Will you select a reference genome from your history or use a built-in index?" help="Built-ins were indexed using default options">
- <option value="indexed">Use a built-in index</option>
- <option value="history">Use one from the history</option>
+ <param name="genomeSource" type="select" label="Use a built in reference genome or own from your history" help="Built-in genomes were created using default options">
+ <option value="indexed" selected="True">Use a built-in genome</option>
+ <option value="history">Use a genome from history</option></param><when value="indexed"><param name="index" type="select" label="Select a reference genome" help="If your genome of interest is not listed, contact the Galaxy team"><options from_data_table="tophat2_indexes"><filter type="sort_by" column="2"/>
- <validator type="no_options" message="No indexes are available for the selected input dataset"/>
+ <validator type="no_options" message="No genomes are available for the selected input dataset"/></options></param></when>
diff -r dfcc7e9469f81116ae01eb3aebf57b2a3d22ca82 -r 22788c1262a2756a50e03d92f8ee14705d019b98 tools/ngs_rna/tophat_wrapper.xml
--- a/tools/ngs_rna/tophat_wrapper.xml
+++ b/tools/ngs_rna/tophat_wrapper.xml
@@ -152,15 +152,15 @@
<inputs><param format="fastqsanger" name="input1" type="data" label="RNA-Seq FASTQ file" help="Nucleotide-space: Must have Sanger-scaled quality values with ASCII offset 33" /><conditional name="refGenomeSource">
- <param name="genomeSource" type="select" label="Will you select a reference genome from your history or use a built-in index?" help="Built-ins were indexed using default options">
- <option value="indexed">Use a built-in index</option>
- <option value="history">Use one from the history</option>
+ <param name="genomeSource" type="select" label="Use a built in reference genome or own from your history" help="Built-ins genomes were created using default options">
+ <option value="indexed" selected="True">Use a built-in genome</option>
+ <option value="history">Use a genome from history</option></param><when value="indexed"><param name="index" type="select" label="Select a reference genome" help="If your genome of interest is not listed, contact the Galaxy team"><options from_data_table="tophat_indexes"><filter type="sort_by" column="2"/>
- <validator type="no_options" message="No indexes are available for the selected input dataset"/>
+ <validator type="no_options" message="No genomes are available for the selected input dataset"/></options></param></when>
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.
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/84d6dc6656ec/
changeset: 84d6dc6656ec
user: carlfeberhard
date: 2013-01-28 22:20:49
summary: History grid, view: allow user to view their own histories
affected #: 1 file
diff -r 149f0fc73fae0494fa5cf29ec719bf38981c01b6 -r 84d6dc6656ec2bcabfa6e298400f053af2ff7c35 lib/galaxy/webapps/galaxy/controllers/history.py
--- a/lib/galaxy/webapps/galaxy/controllers/history.py
+++ b/lib/galaxy/webapps/galaxy/controllers/history.py
@@ -847,7 +847,9 @@
if not history_to_view:
return trans.show_error_message( "The specified history does not exist." )
# Admin users can view any history
- if not trans.user_is_admin() and not history_to_view.importable:
+ if( ( history_to_view.user != trans.user )
+ and ( not trans.user_is_admin() )
+ and ( not history_to_view.importable ) ):
error( "Either you are not allowed to view this history or the owner of this history has not made it accessible." )
# View history.
show_deleted = util.string_as_bool( show_deleted )
https://bitbucket.org/galaxy/galaxy-central/commits/dfcc7e9469f8/
changeset: dfcc7e9469f8
user: carlfeberhard
date: 2013-01-28 22:22:47
summary: history panel: log responseText of history-model update errors; pack scripts
affected #: 2 files
diff -r 84d6dc6656ec2bcabfa6e298400f053af2ff7c35 -r dfcc7e9469f81116ae01eb3aebf57b2a3d22ca82 static/scripts/mvc/history/history-model.js
--- a/static/scripts/mvc/history/history-model.js
+++ b/static/scripts/mvc/history/history-model.js
@@ -56,7 +56,7 @@
// if we've got hdas passed in the constructor, load them and set up updates if needed
if( initialHdas ){
- if( _.isArray( initialHdas ) ){
+ if( _.isArray( initialHdas ) ){
this.hdas.reset( initialHdas );
this.checkForUpdates();
@@ -192,6 +192,7 @@
//TODO: remove when iframes are removed
if( !( ( xhr.readyState === 0 ) && ( xhr.status === 0 ) ) ){
alert( _l( 'Error getting history updates from the server.' ) + '\n' + error );
+ history.log( 'stateUpdater error:', error, 'responseText:', xhr.responseText );
}
});
},
diff -r 84d6dc6656ec2bcabfa6e298400f053af2ff7c35 -r dfcc7e9469f81116ae01eb3aebf57b2a3d22ca82 static/scripts/packed/mvc/history/history-model.js
--- a/static/scripts/packed/mvc/history/history-model.js
+++ b/static/scripts/packed/mvc/history/history-model.js
@@ -1,1 +1,1 @@
-var History=BaseModel.extend(LoggableMixin).extend({defaults:{id:"",name:"",state:"",diskSize:0,deleted:false,annotation:null,message:null},urlRoot:"api/histories/",url:function(){return"api/histories/"+this.get("id")},initialize:function(a,b){this.log(this+".initialize:",a,b);this.hdas=new HDACollection();if(b){if(_.isArray(b)){this.hdas.reset(b);this.checkForUpdates()}else{if(_.isString(b)&&(b.match(/error/i))){alert(_l("Error loading bootstrapped history")+":\n"+b)}}}},loadFromApi:function(a,c){var b=this;b.attributes.id=a;jQuery.when(jQuery.ajax("api/users/current"),b.fetch()).then(function(e,d){b.attributes.user=e[0];b.trigger("loaded:user",e[0]);b.trigger("loaded",d[0])}).then(function(){jQuery.ajax(b.url()+"/contents?"+jQuery.param({ids:b.hdaIdsFromStateIds().join(",")})).success(function(d){b.hdas.reset(d);b.checkForUpdates();b.trigger("loaded:hdas",d);if(c){callback(b)}})})},hdaIdsFromStateIds:function(){return _.reduce(_.values(this.get("state_ids")),function(b,a){return b.concat(a)})},checkForUpdates:function(a){if(this.hdas.running().length){this.stateUpdater()}else{this.trigger("ready")}return this},stateUpdater:function(){var c=this,a=this.get("state"),b=this.get("state_ids");jQuery.ajax("api/histories/"+this.get("id")).success(function(d){c.set(d);c.log("current history state:",c.get("state"),"(was)",a,"new size:",c.get("nice_size"));var e=[];_.each(_.keys(d.state_ids),function(g){var f=_.difference(d.state_ids[g],b[g]);e=e.concat(f)});if(e.length){c.fetchHdaUpdates(e)}if((c.get("state")===HistoryDatasetAssociation.STATES.RUNNING)||(c.get("state")===HistoryDatasetAssociation.STATES.QUEUED)){setTimeout(function(){c.stateUpdater()},History.UPDATE_DELAY)}else{c.trigger("ready")}}).error(function(f,d,e){if(!((f.readyState===0)&&(f.status===0))){alert(_l("Error getting history updates from the server.")+"\n"+e)}})},fetchHdaUpdates:function(b){var a=this;jQuery.ajax({url:this.url()+"/contents?"+jQuery.param({ids:b.join(",")}),error:function(h,c,d){if((h.readyState===0)&&(h.status===0)){return}var f=JSON.parse(h.responseText);if(_.isArray(f)){var e=_.groupBy(f,function(i){if(_.has(i,"error")){return"errored"}return"ok"});a.log("fetched, errored datasets:",e.errored);a.updateHdas(f)}else{var g=_l("ERROR updating hdas from api history contents")+": ";a.log(g,b,h,c,d,errorJSON);alert(g+b.join(","))}},success:function(d,c,e){a.log(a+".fetchHdaUpdates, success:",c,e);a.updateHdas(d)}})},updateHdas:function(a){var c=this,b=[];c.log(c+".updateHdas:",a);_.each(a,function(e,f){var d=c.hdas.get(e.id);if(d){c.log("found existing model in list for id "+e.id+", updating...:");d.set(e)}else{c.log("NO existing model for id "+e.id+", creating...:");b.push(e)}});if(b.length){c.addHdas(b)}},addHdas:function(a){var b=this;_.each(a,function(c,d){var e=b.hdas.hidToCollectionIndex(c.hid);c.history_id=b.get("id");b.hdas.add(new HistoryDatasetAssociation(c),{at:e,silent:true})});b.hdas.trigger("add",a)},toString:function(){var a=(this.get("name"))?(","+this.get("name")):("");return"History("+this.get("id")+a+")"}});History.UPDATE_DELAY=4000;var HistoryCollection=Backbone.Collection.extend(LoggableMixin).extend({model:History,urlRoot:"api/histories"});
\ No newline at end of file
+var History=BaseModel.extend(LoggableMixin).extend({defaults:{id:"",name:"",state:"",diskSize:0,deleted:false,annotation:null,message:null},urlRoot:"api/histories/",url:function(){return"api/histories/"+this.get("id")},initialize:function(a,b){this.log(this+".initialize:",a,b);this.hdas=new HDACollection();if(b){if(_.isArray(b)){this.hdas.reset(b);this.checkForUpdates()}else{if(_.isString(b)&&(b.match(/error/i))){alert(_l("Error loading bootstrapped history")+":\n"+b)}}}},loadFromApi:function(a,c){var b=this;b.attributes.id=a;jQuery.when(jQuery.ajax("api/users/current"),b.fetch()).then(function(e,d){b.attributes.user=e[0];b.trigger("loaded:user",e[0]);b.trigger("loaded",d[0])}).then(function(){jQuery.ajax(b.url()+"/contents?"+jQuery.param({ids:b.hdaIdsFromStateIds().join(",")})).success(function(d){b.hdas.reset(d);b.checkForUpdates();b.trigger("loaded:hdas",d);if(c){callback(b)}})})},hdaIdsFromStateIds:function(){return _.reduce(_.values(this.get("state_ids")),function(b,a){return b.concat(a)})},checkForUpdates:function(a){if(this.hdas.running().length){this.stateUpdater()}else{this.trigger("ready")}return this},stateUpdater:function(){var c=this,a=this.get("state"),b=this.get("state_ids");jQuery.ajax("api/histories/"+this.get("id")).success(function(d){c.set(d);c.log("current history state:",c.get("state"),"(was)",a,"new size:",c.get("nice_size"));var e=[];_.each(_.keys(d.state_ids),function(g){var f=_.difference(d.state_ids[g],b[g]);e=e.concat(f)});if(e.length){c.fetchHdaUpdates(e)}if((c.get("state")===HistoryDatasetAssociation.STATES.RUNNING)||(c.get("state")===HistoryDatasetAssociation.STATES.QUEUED)){setTimeout(function(){c.stateUpdater()},History.UPDATE_DELAY)}else{c.trigger("ready")}}).error(function(f,d,e){if(!((f.readyState===0)&&(f.status===0))){alert(_l("Error getting history updates from the server.")+"\n"+e);c.log("stateUpdater error:",e,"responseText:",f.responseText)}})},fetchHdaUpdates:function(b){var a=this;jQuery.ajax({url:this.url()+"/contents?"+jQuery.param({ids:b.join(",")}),error:function(h,c,d){if((h.readyState===0)&&(h.status===0)){return}var f=JSON.parse(h.responseText);if(_.isArray(f)){var e=_.groupBy(f,function(i){if(_.has(i,"error")){return"errored"}return"ok"});a.log("fetched, errored datasets:",e.errored);a.updateHdas(f)}else{var g=_l("ERROR updating hdas from api history contents")+": ";a.log(g,b,h,c,d,errorJSON);alert(g+b.join(","))}},success:function(d,c,e){a.log(a+".fetchHdaUpdates, success:",c,e);a.updateHdas(d)}})},updateHdas:function(a){var c=this,b=[];c.log(c+".updateHdas:",a);_.each(a,function(e,f){var d=c.hdas.get(e.id);if(d){c.log("found existing model in list for id "+e.id+", updating...:");d.set(e)}else{c.log("NO existing model for id "+e.id+", creating...:");b.push(e)}});if(b.length){c.addHdas(b)}},addHdas:function(a){var b=this;_.each(a,function(c,d){var e=b.hdas.hidToCollectionIndex(c.hid);c.history_id=b.get("id");b.hdas.add(new HistoryDatasetAssociation(c),{at:e,silent:true})});b.hdas.trigger("add",a)},toString:function(){var a=(this.get("name"))?(","+this.get("name")):("");return"History("+this.get("id")+a+")"}});History.UPDATE_DELAY=4000;var HistoryCollection=Backbone.Collection.extend(LoggableMixin).extend({model:History,urlRoot:"api/histories"});
\ 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.
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/cfdcd1bd7681/
changeset: cfdcd1bd7681
user: Kyle Ellrott
date: 2012-12-01 00:32:47
summary: Adding handler for httpexceptions.HTTPFound, so that the redirect tool will work (rather then causing an error)
affected #: 1 file
diff -r 88aba66bb81351cbd625ca7fb9ed39874016b36a -r cfdcd1bd7681ddb38fb4d71fcdedd5ebaf1385b6 lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -36,6 +36,8 @@
from galaxy.util.shed_util_common import *
from galaxy.web import url_for
+from paste import httpexceptions
+
from galaxy.visualization.genome.visual_analytics import TracksterConfig
log = logging.getLogger( __name__ )
@@ -1790,6 +1792,9 @@
elif state.page == self.last_page:
try:
_, out_data = self.execute( trans, incoming=params, history=history )
+ except httpexceptions.HTTPFound, e:
+ #if it's a paste redirect exception, pass it up the stack
+ raise e
except Exception, e:
log.exception('Exception caught while attempting tool execution:')
return 'message.mako', dict( status='error', message='Error executing tool: %s' % str(e), refresh_frames=[] )
https://bitbucket.org/galaxy/galaxy-central/commits/b1a778e027ff/
changeset: b1a778e027ff
user: dannon
date: 2013-01-28 18:57:28
summary: Merged in kellrott/galaxy-central (pull request #92)
Adding handler for httpexceptions.HTTPFound, so that the redirect tool will work (rather then causing an error)
affected #: 1 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 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/f6ab35e84116/
changeset: f6ab35e84116
user: Kyle Ellrott
date: 2012-12-01 00:32:47
summary: Adding handler for httpexceptions.HTTPFound, so that the redirect tool will work (rather then causing an error)
affected #: 1 file
diff -r 70d52f421c7fc8edef571ad93726dbc474c35211 -r f6ab35e841165d113b1b63633e80db8d98e48b17 lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -35,6 +35,8 @@
import galaxy.util.shed_util_common
from galaxy.web import url_for
+from paste import httpexceptions
+
from galaxy.visualization.genome.visual_analytics import TracksterConfig
log = logging.getLogger( __name__ )
@@ -1801,6 +1803,9 @@
elif state.page == self.last_page:
try:
_, out_data = self.execute( trans, incoming=params, history=history )
+ except httpexceptions.HTTPFound, e:
+ #if it's a paste redirect exception, pass it up the stack
+ raise e
except Exception, e:
log.exception('Exception caught while attempting tool execution:')
return 'message.mako', dict( status='error', message='Error executing tool: %s' % str(e), refresh_frames=[] )
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 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/70d52f421c7f/
changeset: 70d52f421c7f
user: joachimjacob
date: 2013-01-28 16:46:12
summary: Changed wording from unpause to resume, in accordance with corresponding history menu item.
affected #: 1 file
diff -r 18d528947af20aca02f105722a844d32f90fa0ec -r 70d52f421c7fc8edef571ad93726dbc474c35211 static/scripts/mvc/dataset/hda-base.js
--- a/static/scripts/mvc/dataset/hda-base.js
+++ b/static/scripts/mvc/dataset/hda-base.js
@@ -426,7 +426,7 @@
* @param {jQuery} parent DOM to which to append this body
*/
_render_body_paused: function( parent ){
- parent.append( $( '<div>' + _l( 'Job is paused. Use the history menu to unpause' ) + '.</div>' ) );
+ parent.append( $( '<div>' + _l( 'Job is paused. Use the history menu to resume' ) + '.</div>' ) );
parent.append( this._render_primaryActionButtons( this.defaultPrimaryActionButtonRenderers ));
},
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.
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/853b1da64f4d/
changeset: 853b1da64f4d
user: jgoecks
date: 2013-01-27 21:19:27
summary: Cleanup and documentation for method that gets genome's chromosome information.
affected #: 1 file
diff -r f36d5d615dd4775d71ee778f500bd0c1d3fdf68e -r 853b1da64f4db37e93d1cbf43b6d0b5f45e63d38 lib/galaxy/visualization/genomes.py
--- a/lib/galaxy/visualization/genomes.py
+++ b/lib/galaxy/visualization/genomes.py
@@ -215,8 +215,7 @@
dbkeys.extend( [ ( genome.description, genome.key ) for key, genome in self.genomes.items() if filter_fn( genome ) ] )
return dbkeys
- #return [ (v, k) for k, v in trans.db_builds if ( ( k in self.genomes and self.genomes[ k ].len_file ) or k in user_keys ) ]
-
+
def chroms( self, trans, dbkey=None, num=None, chrom=None, low=None ):
"""
@@ -256,15 +255,25 @@
genome = Genome( dbkey, dbkey_name, len_file=len_file, twobit_file=twobit_file )
- # Look in system builds.
+ # Look in history and system builds.
if not genome:
+ # Look in history for chromosome len file.
len_ds = trans.db_dataset_for( dbkey )
- if not len_ds:
+ if len_ds:
+ genome = Genome( dbkey, dbkey_name, len_file=len_ds.file_name )
+ # Look in system builds.
+ elif dbkey in self.genomes:
genome = self.genomes[ dbkey ]
- else:
- genome = Genome( dbkey, dbkey_name, len_file=len_ds.file_name )
+
+ # Set up return value or log exception if genome not found for key.
+ rval = None
+ if genome:
+ rval = genome.to_dict( num=num, chrom=chrom, low=low )
+ else:
+ log.exception( 'genome not found for key %s' % dbkey )
- return genome.to_dict( num=num, chrom=chrom, low=low )
+ return rval
+
def has_reference_data( self, trans, dbkey, dbkey_owner=None ):
"""
https://bitbucket.org/galaxy/galaxy-central/commits/18d528947af2/
changeset: 18d528947af2
user: jgoecks
date: 2013-01-28 00:13:13
summary: Reinstate grid footer updates because they now work again with embedded grids. This also prevents spurious grid posts.
affected #: 1 file
diff -r 853b1da64f4db37e93d1cbf43b6d0b5f45e63d38 -r 18d528947af20aca02f105722a844d32f90fa0ec templates/grid_base.mako
--- a/templates/grid_base.mako
+++ b/templates/grid_base.mako
@@ -569,7 +569,7 @@
$('#grid-table-body').html(parsed_response_text[0]);
// FIXME: this does not work at all; what's needed is a function
// that updates page links when number of pages changes.
- //$('#grid-table-footer').html(parsed_response_text[1]);
+ $('#grid-table-footer').html(parsed_response_text[1]);
// Trigger custom event to indicate grid body has changed.
$('#grid-table-body').trigger('update');
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 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/f36d5d615dd4/
changeset: f36d5d615dd4
user: jgoecks
date: 2013-01-25 22:10:01
summary: Unify system genome builds, custom builds, build len files, and build two bit files into a single python structure. Add function to get genome builds with or without build length information, and fix bugs so that the full build set (system + custom) is available via the API and when adding datasets to libraries.
affected #: 4 files
diff -r 4a60baf34969dea43d30b4f18094dfd30c167b25 -r f36d5d615dd4775d71ee778f500bd0c1d3fdf68e lib/galaxy/visualization/genomes.py
--- a/lib/galaxy/visualization/genomes.py
+++ b/lib/galaxy/visualization/genomes.py
@@ -1,7 +1,7 @@
import os, re, sys, glob, logging
from bx.seq.twobit import TwoBitFile
from galaxy.util.json import from_json_string
-from galaxy import model
+from galaxy import model, util
from galaxy.util.bunch import Bunch
log = logging.getLogger( __name__ )
@@ -50,8 +50,9 @@
"""
Encapsulates information about a known genome/dbkey.
"""
- def __init__( self, key, len_file=None, twobit_file=None ):
+ def __init__( self, key, description, len_file=None, twobit_file=None ):
self.key = key
+ self.description = description
self.len_file = len_file
self.twobit_file = twobit_file
@@ -160,16 +161,19 @@
"""
def __init__( self, app ):
- # Create list of known genomes from len files.
+ # Create list of genomes from util.dbnames
self.genomes = {}
+ for key, description in util.dbnames:
+ self.genomes[ key ] = Genome( key, description )
+
+ # Add len files to genomes.
len_files = glob.glob( os.path.join( app.config.len_file_path, "*.len" ) )
for f in len_files:
key = os.path.split( f )[1].split( ".len" )[0]
- self.genomes[ key ] = Genome( key, len_file=f )
+ if key in self.genomes:
+ self.genomes[ key ].len_file = f
# Add genome data (twobit files) to genomes.
- # FIXME: If a galaxy instance does not have ~/tool-data/twobit.loc file, the following error is thrown:
- # IOError: [Errno 2] No such file or directory: '~/tool-data/twobit.loc'
try:
for line in open( os.path.join( app.config.tool_data_path, "twobit.loc" ) ):
if line.startswith("#"): continue
@@ -179,6 +183,7 @@
if key in self.genomes:
self.genomes[ key ].twobit_file = path
except IOError, e:
+ # Thrown if twobit.loc does not exist.
log.exception( str( e ) )
def get_build( self, dbkey ):
@@ -188,17 +193,30 @@
rval = self.genomes[ dbkey ]
return rval
- def get_dbkeys_with_chrom_info( self, trans ):
- """ Returns all valid dbkeys that have chromosome information. """
+ def get_dbkeys( self, trans, chrom_info=False ):
+ """ Returns all known dbkeys. If chrom_info is True, only dbkeys with
+ chromosome lengths are returned. """
+ dbkeys = []
- # All user keys have a len file.
- user_keys = {}
+ # Add user's custom keys to dbkeys.
+ user_keys_dict = {}
user = trans.get_user()
if 'dbkeys' in user.preferences:
- user_keys = from_json_string( user.preferences['dbkeys'] )
+ user_keys_dict = from_json_string( user.preferences[ 'dbkeys' ] )
+ dbkeys.extend( [ (attributes[ 'name' ], key ) for key, attributes in user_keys_dict.items() ] )
- dbkeys = [ (v, k) for k, v in trans.db_builds if ( ( k in self.genomes and self.genomes[ k ].len_file ) or k in user_keys ) ]
+ # Add app keys to dbkeys.
+
+ # If chrom_info is True, only include keys with len files (which contain chromosome info).
+ filter_fn = lambda b: True
+ if chrom_info:
+ filter_fn = lambda b: b.len_file is not None
+
+ dbkeys.extend( [ ( genome.description, genome.key ) for key, genome in self.genomes.items() if filter_fn( genome ) ] )
+
return dbkeys
+ #return [ (v, k) for k, v in trans.db_builds if ( ( k in self.genomes and self.genomes[ k ].len_file ) or k in user_keys ) ]
+
def chroms( self, trans, dbkey=None, num=None, chrom=None, low=None ):
"""
@@ -224,6 +242,7 @@
user_keys = from_json_string( dbkey_user.preferences['dbkeys'] )
if dbkey in user_keys:
dbkey_attributes = user_keys[ dbkey ]
+ dbkey_name = dbkey_attributes[ 'name' ]
if 'fasta' in dbkey_attributes:
build_fasta = trans.sa_session.query( trans.app.model.HistoryDatasetAssociation ).get( dbkey_attributes[ 'fasta' ] )
len_file = build_fasta.get_converted_dataset( trans, 'len' ).file_name
@@ -234,7 +253,7 @@
elif 'len' in dbkey_attributes:
len_file = trans.sa_session.query( trans.app.model.HistoryDatasetAssociation ).get( user_keys[ dbkey ][ 'len' ] ).file_name
if len_file:
- genome = Genome( dbkey, len_file=len_file, twobit_file=twobit_file )
+ genome = Genome( dbkey, dbkey_name, len_file=len_file, twobit_file=twobit_file )
# Look in system builds.
@@ -243,7 +262,7 @@
if not len_ds:
genome = self.genomes[ dbkey ]
else:
- genome = Genome( dbkey, len_file=len_ds.file_name )
+ genome = Genome( dbkey, dbkey_name, len_file=len_ds.file_name )
return genome.to_dict( num=num, chrom=chrom, low=low )
@@ -294,9 +313,9 @@
user_keys = from_json_string( dbkey_user.preferences['dbkeys'] )
dbkey_attributes = user_keys[ dbkey ]
fasta_dataset = trans.app.model.HistoryDatasetAssociation.get( dbkey_attributes[ 'fasta' ] )
- error = self._convert_dataset( trans, fasta_dataset, 'twobit' )
- if error:
- return error
+ msg = fasta_dataset.convert_dataset( trans, 'twobit' )
+ if msg:
+ return msg
else:
twobit_dataset = fasta_dataset.get_converted_dataset( trans, 'twobit' )
twobit_file_name = twobit_dataset.file_name
@@ -309,31 +328,3 @@
return { 'dataset_type': 'refseq', 'data': seq_data }
except IOError:
return None
-
- ## FIXME: copied from tracks.py (tracks controller) - this should be consolidated when possible.
- def _convert_dataset( self, trans, dataset, target_type ):
- """
- Converts a dataset to the target_type and returns a message indicating
- status of the conversion. None is returned to indicate that dataset
- was converted successfully.
- """
-
- # Get converted dataset; this will start the conversion if necessary.
- try:
- converted_dataset = dataset.get_converted_dataset( trans, target_type )
- except NoConverterException:
- return messages.NO_CONVERTER
- except ConverterDependencyException, dep_error:
- return { 'kind': messages.ERROR, 'message': dep_error.value }
-
- # Check dataset state and return any messages.
- msg = None
- if converted_dataset and converted_dataset.state == model.Dataset.states.ERROR:
- job_id = trans.sa_session.query( trans.app.model.JobToOutputDatasetAssociation ) \
- .filter_by( dataset_id=converted_dataset.id ).first().job_id
- job = trans.sa_session.query( trans.app.model.Job ).get( job_id )
- msg = { 'kind': messages.ERROR, 'message': job.stderr }
- elif not converted_dataset or converted_dataset.state != model.Dataset.states.OK:
- msg = messages.PENDING
-
- return msg
\ No newline at end of file
diff -r 4a60baf34969dea43d30b4f18094dfd30c167b25 -r f36d5d615dd4775d71ee778f500bd0c1d3fdf68e lib/galaxy/webapps/galaxy/api/genomes.py
--- a/lib/galaxy/webapps/galaxy/api/genomes.py
+++ b/lib/galaxy/webapps/galaxy/api/genomes.py
@@ -20,7 +20,7 @@
GET /api/genomes: returns a list of installed genomes
"""
- return self.app.genomes.get_dbkeys_with_chrom_info( trans )
+ return self.app.genomes.get_dbkeys( trans )
@web.json
def show( self, trans, id, num=None, chrom=None, low=None, high=None, **kwd ):
diff -r 4a60baf34969dea43d30b4f18094dfd30c167b25 -r f36d5d615dd4775d71ee778f500bd0c1d3fdf68e lib/galaxy/webapps/galaxy/controllers/library_common.py
--- a/lib/galaxy/webapps/galaxy/controllers/library_common.py
+++ b/lib/galaxy/webapps/galaxy/controllers/library_common.py
@@ -944,7 +944,7 @@
# Send list of data formats to the upload form so the "extension" select list can be populated dynamically
file_formats = trans.app.datatypes_registry.upload_file_formats
- dbkeys = trans.app.genomes.get_dbkeys_with_chrom_info( trans )
+ dbkeys = trans.app.genomes.get_dbkeys( trans )
# Send the current history to the form to enable importing datasets from history to library
history = trans.get_history()
if history is not None:
diff -r 4a60baf34969dea43d30b4f18094dfd30c167b25 -r f36d5d615dd4775d71ee778f500bd0c1d3fdf68e lib/galaxy/webapps/galaxy/controllers/visualization.py
--- a/lib/galaxy/webapps/galaxy/controllers/visualization.py
+++ b/lib/galaxy/webapps/galaxy/controllers/visualization.py
@@ -601,7 +601,7 @@
from the visualization title, but can be edited. This field
must contain only lowercase letters, numbers, and
the '-' character.""" )
- .add_select( "visualization_dbkey", "Visualization DbKey/Build", value=visualization_dbkey, options=trans.app.genomes.get_dbkeys_with_chrom_info( trans ), error=None)
+ .add_select( "visualization_dbkey", "Visualization DbKey/Build", value=visualization_dbkey, options=trans.app.genomes.get_dbkeys( trans, chrom_info=True ), error=None)
.add_text( "visualization_annotation", "Visualization annotation", value=visualization_annotation, error=visualization_annotation_err,
help="A description of the visualization; annotation is shown alongside published visualizations."),
template="visualization/create.mako" )
@@ -683,7 +683,7 @@
Provide info necessary for creating a new trackster browser.
"""
return trans.fill_template( "tracks/new_browser.mako",
- dbkeys=trans.app.genomes.get_dbkeys_with_chrom_info( trans ),
+ dbkeys=trans.app.genomes.get_dbkeys( trans, chrom_info=True ),
default_dbkey=kwargs.get("default_dbkey", None) )
@web.expose
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.