1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/a968515e0a31/
Changeset: a968515e0a31
User: dan
Date: 2014-05-20 16:18:49
Summary: merge next-stable
Affected #: 1 file
diff -r 9fee549c5ef78f80e35fa5ca37c1861267bc12f8 -r a968515e0a3128b39d2e5290d7d15559ae38ca44 lib/galaxy/util/dbkeys.py
--- a/lib/galaxy/util/dbkeys.py
+++ b/lib/galaxy/util/dbkeys.py
@@ -22,17 +22,16 @@
self._static_dbkeys[ key ] = value
def get_genome_build_names( self, trans=None ):
- #FIXME: how to deal with key duplicates?
- #Load old builds.txt static keys
- rval = ( self._static_dbkeys.items() )
- #load dbkeys from dbkey data table
- dbkey_table = self._app.tool_data_tables.get( self._data_table_name, None )
- if dbkey_table is not None:
- for field_dict in dbkey_table.get_named_fields_list():
- rval.append( ( field_dict[ 'value' ], field_dict[ 'name' ] ) )
- #load user custom genome builds
+ # FIXME: how to deal with key duplicates?
+ rval = []
+ # load user custom genome builds
if trans is not None:
if trans.history:
+ # This is a little bit Odd. We are adding every .len file in the current history to dbkey list,
+ # but this is previous behavior from trans.db_names, so we'll continue to do it.
+ # It does allow one-off, history specific dbkeys to be created by a user. But we are not filtering,
+ # so a len file will be listed twice (as the build name and again as dataset name),
+ # if custom dbkey creation/conversion occurred within the current history.
datasets = trans.sa_session.query( self._app.model.HistoryDatasetAssociation ) \
.filter_by( deleted=False, history_id=trans.history.id, extension="len" )
for dataset in datasets:
@@ -42,10 +41,17 @@
user_keys = from_json_string( user.preferences['dbkeys'] )
for key, chrom_dict in user_keys.iteritems():
rval.append( ( key, "%s (%s) [Custom]" % ( chrom_dict['name'], key ) ) )
+ # Load old builds.txt static keys
+ rval.extend( self._static_dbkeys.items() )
+ #load dbkeys from dbkey data table
+ dbkey_table = self._app.tool_data_tables.get( self._data_table_name, None )
+ if dbkey_table is not None:
+ for field_dict in dbkey_table.get_named_fields_list():
+ rval.append( ( field_dict[ 'value' ], field_dict[ 'name' ] ) )
return rval
def get_chrom_info( self, dbkey, trans=None, custom_build_hack_get_len_from_fasta_conversion=True ):
- #FIXME: flag to turn off custom_build_hack_get_len_from_fasta_conversion should not be required
+ # FIXME: flag to turn off custom_build_hack_get_len_from_fasta_conversion should not be required
chrom_info = None
db_dataset = None
# Collect chromInfo from custom builds
@@ -75,7 +81,7 @@
dbkey_table = self._app.tool_data_tables.get( self._data_table_name, None )
if dbkey_table is not None:
chrom_info = dbkey_table.get_entry( 'value', dbkey, 'len_path', default=None )
- #use configured len path
+ # use configured server len path
if not chrom_info:
# Default to built-in build.
chrom_info = os.path.join( self._static_chrom_info_path, "%s.len" % dbkey )
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/f3948f90b900/
Changeset: f3948f90b900
Branch: next-stable
User: dan
Date: 2014-05-20 16:18:28
Summary: To maintain previous behavior, list custom genome build names first.
Affected #: 1 file
diff -r b3342bc20de522e5b98f9b97de69737b069d6d64 -r f3948f90b9002ae47f0941b0e39cb63d122415a3 lib/galaxy/util/dbkeys.py
--- a/lib/galaxy/util/dbkeys.py
+++ b/lib/galaxy/util/dbkeys.py
@@ -22,17 +22,16 @@
self._static_dbkeys[ key ] = value
def get_genome_build_names( self, trans=None ):
- #FIXME: how to deal with key duplicates?
- #Load old builds.txt static keys
- rval = ( self._static_dbkeys.items() )
- #load dbkeys from dbkey data table
- dbkey_table = self._app.tool_data_tables.get( self._data_table_name, None )
- if dbkey_table is not None:
- for field_dict in dbkey_table.get_named_fields_list():
- rval.append( ( field_dict[ 'value' ], field_dict[ 'name' ] ) )
- #load user custom genome builds
+ # FIXME: how to deal with key duplicates?
+ rval = []
+ # load user custom genome builds
if trans is not None:
if trans.history:
+ # This is a little bit Odd. We are adding every .len file in the current history to dbkey list,
+ # but this is previous behavior from trans.db_names, so we'll continue to do it.
+ # It does allow one-off, history specific dbkeys to be created by a user. But we are not filtering,
+ # so a len file will be listed twice (as the build name and again as dataset name),
+ # if custom dbkey creation/conversion occurred within the current history.
datasets = trans.sa_session.query( self._app.model.HistoryDatasetAssociation ) \
.filter_by( deleted=False, history_id=trans.history.id, extension="len" )
for dataset in datasets:
@@ -42,10 +41,17 @@
user_keys = from_json_string( user.preferences['dbkeys'] )
for key, chrom_dict in user_keys.iteritems():
rval.append( ( key, "%s (%s) [Custom]" % ( chrom_dict['name'], key ) ) )
+ # Load old builds.txt static keys
+ rval.extend( self._static_dbkeys.items() )
+ #load dbkeys from dbkey data table
+ dbkey_table = self._app.tool_data_tables.get( self._data_table_name, None )
+ if dbkey_table is not None:
+ for field_dict in dbkey_table.get_named_fields_list():
+ rval.append( ( field_dict[ 'value' ], field_dict[ 'name' ] ) )
return rval
def get_chrom_info( self, dbkey, trans=None, custom_build_hack_get_len_from_fasta_conversion=True ):
- #FIXME: flag to turn off custom_build_hack_get_len_from_fasta_conversion should not be required
+ # FIXME: flag to turn off custom_build_hack_get_len_from_fasta_conversion should not be required
chrom_info = None
db_dataset = None
# Collect chromInfo from custom builds
@@ -75,7 +81,7 @@
dbkey_table = self._app.tool_data_tables.get( self._data_table_name, None )
if dbkey_table is not None:
chrom_info = dbkey_table.get_entry( 'value', dbkey, 'len_path', default=None )
- #use configured len path
+ # use configured server len path
if not chrom_info:
# Default to built-in build.
chrom_info = os.path.join( self._static_chrom_info_path, "%s.len" % dbkey )
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/9fee549c5ef7/
Changeset: 9fee549c5ef7
User: dan
Date: 2014-05-20 16:01:53
Summary: merge next-stable
Affected #: 2 files
diff -r 11403745e7ceb0a6946af648dcd3ca24a638ca7e -r 9fee549c5ef78f80e35fa5ca37c1861267bc12f8 lib/galaxy/tools/actions/__init__.py
--- a/lib/galaxy/tools/actions/__init__.py
+++ b/lib/galaxy/tools/actions/__init__.py
@@ -193,7 +193,7 @@
# Collect chromInfo dataset and add as parameters to incoming
db_datasets = {}
- ( chrom_info, db_dataset ) = trans.app.genome_builds.get_chrom_info( input_dbkey, tool, trans=trans )
+ ( chrom_info, db_dataset ) = trans.app.genome_builds.get_chrom_info( input_dbkey, trans=trans, custom_build_hack_get_len_from_fasta_conversion=tool.id!='CONVERTER_fasta_to_len' )
if db_dataset:
inp_data.update( { "chromInfo": db_dataset } )
incoming[ "chromInfo" ] = chrom_info
diff -r 11403745e7ceb0a6946af648dcd3ca24a638ca7e -r 9fee549c5ef78f80e35fa5ca37c1861267bc12f8 lib/galaxy/util/dbkeys.py
--- a/lib/galaxy/util/dbkeys.py
+++ b/lib/galaxy/util/dbkeys.py
@@ -44,19 +44,18 @@
rval.append( ( key, "%s (%s) [Custom]" % ( chrom_dict['name'], key ) ) )
return rval
- def get_chrom_info( self, dbkey, tool, trans=None ):
+ def get_chrom_info( self, dbkey, trans=None, custom_build_hack_get_len_from_fasta_conversion=True ):
+ #FIXME: flag to turn off custom_build_hack_get_len_from_fasta_conversion should not be required
chrom_info = None
db_dataset = None
# Collect chromInfo from custom builds
if trans:
db_dataset = trans.db_dataset_for( dbkey )
if db_dataset:
- #incoming[ "chromInfo" ] = db_dataset.file_name
chrom_info = db_dataset.file_name
else:
- # -- Get chrom_info (len file) from either a custom or built-in build. --
+ # Do Custom Build handling
if trans.user and ( 'dbkeys' in trans.user.preferences ) and ( dbkey in from_json_string( trans.user.preferences[ 'dbkeys' ] ) ):
- # Custom build.
custom_build_dict = from_json_string( trans.user.preferences[ 'dbkeys' ] )[ dbkey ]
# HACK: the attempt to get chrom_info below will trigger the
# fasta-to-len converter if the dataset is not available or,
@@ -64,17 +63,19 @@
# running the fasta-to-len tool. So, use a hack in the second
# condition below to avoid getting chrom_info when running the
# fasta-to-len converter.
- if 'fasta' in custom_build_dict and tool.id != 'CONVERTER_fasta_to_len':
+ if 'fasta' in custom_build_dict and custom_build_hack_get_len_from_fasta_conversion:
# Build is defined by fasta; get len file, which is obtained from converting fasta.
build_fasta_dataset = trans.sa_session.query( trans.app.model.HistoryDatasetAssociation ).get( custom_build_dict[ 'fasta' ] )
chrom_info = build_fasta_dataset.get_converted_dataset( trans, 'len' ).file_name
elif 'len' in custom_build_dict:
# Build is defined by len file, so use it.
chrom_info = trans.sa_session.query( trans.app.model.HistoryDatasetAssociation ).get( custom_build_dict[ 'len' ] ).file_name
+ # Check Data table
if not chrom_info:
dbkey_table = self._app.tool_data_tables.get( self._data_table_name, None )
if dbkey_table is not None:
chrom_info = dbkey_table.get_entry( 'value', dbkey, 'len_path', default=None )
+ #use configured len path
if not chrom_info:
# Default to built-in build.
chrom_info = os.path.join( self._static_chrom_info_path, "%s.len" % dbkey )
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/b3342bc20de5/
Changeset: b3342bc20de5
Branch: next-stable
User: dan
Date: 2014-05-20 16:01:28
Summary: Cleanup for dbkey handling.
Affected #: 2 files
diff -r b29ac7cfd60ed2aaec658f520f3e47f1af4d1ab2 -r b3342bc20de522e5b98f9b97de69737b069d6d64 lib/galaxy/tools/actions/__init__.py
--- a/lib/galaxy/tools/actions/__init__.py
+++ b/lib/galaxy/tools/actions/__init__.py
@@ -193,7 +193,7 @@
# Collect chromInfo dataset and add as parameters to incoming
db_datasets = {}
- ( chrom_info, db_dataset ) = trans.app.genome_builds.get_chrom_info( input_dbkey, tool, trans=trans )
+ ( chrom_info, db_dataset ) = trans.app.genome_builds.get_chrom_info( input_dbkey, trans=trans, custom_build_hack_get_len_from_fasta_conversion=tool.id!='CONVERTER_fasta_to_len' )
if db_dataset:
inp_data.update( { "chromInfo": db_dataset } )
incoming[ "chromInfo" ] = chrom_info
diff -r b29ac7cfd60ed2aaec658f520f3e47f1af4d1ab2 -r b3342bc20de522e5b98f9b97de69737b069d6d64 lib/galaxy/util/dbkeys.py
--- a/lib/galaxy/util/dbkeys.py
+++ b/lib/galaxy/util/dbkeys.py
@@ -44,19 +44,18 @@
rval.append( ( key, "%s (%s) [Custom]" % ( chrom_dict['name'], key ) ) )
return rval
- def get_chrom_info( self, dbkey, tool, trans=None ):
+ def get_chrom_info( self, dbkey, trans=None, custom_build_hack_get_len_from_fasta_conversion=True ):
+ #FIXME: flag to turn off custom_build_hack_get_len_from_fasta_conversion should not be required
chrom_info = None
db_dataset = None
# Collect chromInfo from custom builds
if trans:
db_dataset = trans.db_dataset_for( dbkey )
if db_dataset:
- #incoming[ "chromInfo" ] = db_dataset.file_name
chrom_info = db_dataset.file_name
else:
- # -- Get chrom_info (len file) from either a custom or built-in build. --
+ # Do Custom Build handling
if trans.user and ( 'dbkeys' in trans.user.preferences ) and ( dbkey in from_json_string( trans.user.preferences[ 'dbkeys' ] ) ):
- # Custom build.
custom_build_dict = from_json_string( trans.user.preferences[ 'dbkeys' ] )[ dbkey ]
# HACK: the attempt to get chrom_info below will trigger the
# fasta-to-len converter if the dataset is not available or,
@@ -64,17 +63,19 @@
# running the fasta-to-len tool. So, use a hack in the second
# condition below to avoid getting chrom_info when running the
# fasta-to-len converter.
- if 'fasta' in custom_build_dict and tool.id != 'CONVERTER_fasta_to_len':
+ if 'fasta' in custom_build_dict and custom_build_hack_get_len_from_fasta_conversion:
# Build is defined by fasta; get len file, which is obtained from converting fasta.
build_fasta_dataset = trans.sa_session.query( trans.app.model.HistoryDatasetAssociation ).get( custom_build_dict[ 'fasta' ] )
chrom_info = build_fasta_dataset.get_converted_dataset( trans, 'len' ).file_name
elif 'len' in custom_build_dict:
# Build is defined by len file, so use it.
chrom_info = trans.sa_session.query( trans.app.model.HistoryDatasetAssociation ).get( custom_build_dict[ 'len' ] ).file_name
+ # Check Data table
if not chrom_info:
dbkey_table = self._app.tool_data_tables.get( self._data_table_name, None )
if dbkey_table is not None:
chrom_info = dbkey_table.get_entry( 'value', dbkey, 'len_path', default=None )
+ #use configured len path
if not chrom_info:
# Default to built-in build.
chrom_info = os.path.join( self._static_chrom_info_path, "%s.len" % dbkey )
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.