1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/f1495dd691c2/
changeset: r5155:f1495dd691c2
user: dan
date: 2011-03-02 17:34:03
summary: Allow DataToolParameter to be filtered on attributes other than dbkey.
affected #: 1 file (1.3 KB)
--- a/lib/galaxy/tools/parameters/basic.py Wed Mar 02 09:59:24 2011 -0500
+++ b/lib/galaxy/tools/parameters/basic.py Wed Mar 02 11:34:03 2011 -0500
@@ -1256,8 +1256,14 @@
options = elem.find( 'options' )
if options is None:
self.options = None
+ self.options_filter_attribute = None
else:
self.options = dynamic_options.DynamicOptions( options, self )
+
+ #HACK to get around current hardcoded limitation of when a set of dynamic options is defined for a DataToolParameter
+ #it always causes available datasets to be filtered by dbkey
+ #this behavior needs to be entirely reworked (in a backwards compatible manner)
+ self.options_filter_attribute = options.get( 'options_filter_attribute', None )
self.is_dynamic = self.options is not None
# Load conversions required for the dataset input
self.conversions = []
@@ -1302,7 +1308,7 @@
# associated with the dataset that restrict it's access from "public".
if self.tool and self.tool.tool_type == 'data_destination' and not trans.app.security_agent.dataset_is_public( hda.dataset ):
continue
- if self.options and hda.get_dbkey() != filter_value:
+ if self.options and self._options_filter_attribute( hda ) != filter_value:
continue
if isinstance( hda.datatype, self.formats):
selected = ( value and ( hda in value ) )
@@ -1363,7 +1369,7 @@
return False
for i, data in enumerate( datasets ):
if data.visible and not data.deleted and data.state not in [data.states.ERROR, data.states.DISCARDED] and ( isinstance( data.datatype, self.formats) or is_convertable( data ) ):
- if self.options and data.get_dbkey() != filter_value:
+ if self.options and self._options_filter_attribute( data ) != filter_value:
continue
most_recent_dataset[0] = data
# Also collect children via association object
@@ -1437,6 +1443,25 @@
self.tool.visit_inputs( other_values, visitor )
return False not in converter_safe
+ def _options_filter_attribute( self, value ):
+ #HACK to get around current hardcoded limitation of when a set of dynamic options is defined for a DataToolParameter
+ #it always causes available datasets to be filtered by dbkey
+ #this behavior needs to be entirely reworked (in a backwards compatible manner)
+ options_filter_attribute = self.options_filter_attribute
+ if options_filter_attribute is None:
+ return value.get_dbkey()
+ if options_filter_attribute.endswith( "()" ):
+ call_attribute = True
+ options_filter_attribute = options_filter_attribute[:-2]
+ else:
+ call_attribute = False
+ ref = value
+ for attribute in options_filter_attribute.split( '.' ):
+ ref = getattr( ref, attribute )
+ if call_attribute:
+ ref = ref()
+ return ref
+
# class RawToolParameter( ToolParameter ):
# """
# Completely nondescript parameter, HTML representation is provided as text
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 changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/69552e72d144/
changeset: r5153:69552e72d144
user: rc
date: 2011-03-02 15:40:10
summary: Fix for vcf_extract tool test
affected #: 1 file (15 bytes)
--- a/tools/vcf_tools/extract.xml Wed Mar 02 08:38:19 2011 -0500
+++ b/tools/vcf_tools/extract.xml Wed Mar 02 09:40:10 2011 -0500
@@ -40,7 +40,7 @@
<param name="keep_info" value='' /><param name="discard_info" value='' /><param name="pass_filter" value='true' />
- <output name="output" file="test_extract_pass_filter_quality_9_DP_2000_lt.vcf" ftype="vcf" />
+ <output name="output" file="test_extract_pass_filter_quality_9_DP_2000_lt.vcf" lines_diff="6" ftype="vcf" /></test><test><param name="input1" value="test.small.vcf" ftype="vcf" />
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 changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/9e717f1746c8/
changeset: r5149:9e717f1746c8
user: natefoo
date: 2011-03-01 21:46:35
summary: Enable the ftype attribute for test outputs, fixes the sam-to-bam test.
affected #: 2 files (116 bytes)
--- a/lib/galaxy/tools/__init__.py Tue Mar 01 15:21:25 2011 -0500
+++ b/lib/galaxy/tools/__init__.py Tue Mar 01 15:46:35 2011 -0500
@@ -642,6 +642,8 @@
attributes['delta'] = int( attrib.pop( 'delta', '10000' ) )
attributes['sort'] = util.string_as_bool( attrib.pop( 'sort', False ) )
attributes['extra_files'] = []
+ if 'ftype' in attrib:
+ attributes['ftype'] = attrib['ftype']
for extra in output_elem.findall( 'extra_files' ):
# File or directory, when directory, compare basename
# by basename
--- a/tools/samtools/sam_to_bam.xml Tue Mar 01 15:21:25 2011 -0500
+++ b/tools/samtools/sam_to_bam.xml Tue Mar 01 15:46:35 2011 -0500
@@ -60,7 +60,7 @@
--><param name="index_source" value="cached" /><param name="input1" value="3.sam" ftype="sam" dbkey="equCab2" />
- <output name="output1" file="sam_to_bam_out2.bam" />
+ <output name="output1" file="sam_to_bam_out2.bam" ftype="bam" /></test></tests><help>
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.