The current code in: lib/galaxy/tools/parameters/
only searches the top layer of the dict to find the dependency value.

A fix is provide in pull request:
#343: Need to traverse the other_value dict to find dependencies for ParamValueFilter 

SnpEff  tool_config

        <param format="vcf,tabular,pileup,bed" name="input" type="data" label="Sequence 
changes (SNPs, MNPs, InDels)"/>
        <conditional name="snpDb">
            <param name="genomeSrc" type="select" label="Genome source">
                <option value="cached">Locally installed reference 
                <option value="history">Reference genome from your 
                <option value="named">Named on demand</option>
            <when value="cached">
                <param name="genomeVersion" type="select" label="Genome">
                    <!--GENOME    DESCRIPTION-->
                    <options from_data_table="snpeff_genomedb">
                           <filter type="unique_value" column="0" />
                <param name="extra_annotations" type="select" display="checkboxes" 
multiple="true" label="Additional Annotations">
                       <help>These are available for only a few genomes</help>
                       <options from_data_table="snpeff_annotations">
                           <filter type="param_value" ref="genomeVersion" key="genome" 
column="0" />
                           <filter type="unique_value" column="1" />

When running workflow:   input.vcf ->  SnpEff

The values in ParamValueFilter filter_options function:

|>>>| ||self*.*ref_name||

||>>>| ||other_values||
|{u'spliceSiteSize': '1', u'filterHomHet': 'no_filter', u'outputFormat': 'vcf', 
u'filterOut': None, u'inputFormat': 'vcf', u'filterIn': 'no_filter', u'udLength': 
'5000', u'generate_stats': True, u'noLog': True, u'chr': 'None', u'intervals': None, 
u'snpDb': {'extra_annotations': None, 'regulation': None, 'genomeVersion': 
'GRCh37.71', 'genomeSrc': 'cached', '__current_case__': 0}, u'offset': '', u'input': 
< object at 0x11451b8d0>, 
u'transcripts': None, u'annotations': ['-canon', '-lof', '-onlyReg']}
Since |||'genomeVersion' isn't in the keys of other_values, but rather in 
this failed the assertion:
||||||||||        assert self.ref_name in other_values, "Required dependency '%s' 
not found in incoming values" % self.ref_name

Pull request |||||343:
|||||$ hg diff lib/galaxy/tools/parameters/
diff -r 95517f976cca lib/galaxy/tools/parameters/
--- a/lib/galaxy/tools/parameters/ Thu Feb 27 16:56:25 2014 
+++ b/lib/galaxy/tools/parameters/ Fri Feb 28 11:37:04 2014 
@@ -177,8 +177,27 @@
         return self.ref_name
     def filter_options( self, options, trans, other_values ):
         if trans is not None and trans.workflow_building_mode: return []
-        assert self.ref_name in other_values, "Required dependency '%s' not found 
in incoming values" % self.ref_name
-        ref = other_values.get( self.ref_name, None )
+        ## Depth first traversal to find the value for a dependency
+        def get_dep_value(param_name, dep_name, cur_val, layer):
+            dep_val = cur_val
+            if isinstance(layer, dict ):
+                if dep_name in layer:
+                    dep_val = layer[dep_name]
+                if param_name in layer:
+                    return dep_val
+                else:
+                    for l in layer.itervalues():
+                        dep_val = get_dep_value(param_name, dep_name, dep_val, 
+                        if dep_val:
+                            break
+            elif isinstance( layer, list):
+                for l in layer:
+                    dep_val = get_dep_value(param_name, dep_name, dep_val, l)
+                    if dep_val:
+                        break
+            return None
+        ref = get_dep_value(, 
self.ref_name, None, other_values)
+        assert not ref, "Required dependency '%s' not found in incoming 
values" % self.ref_name
         for ref_attribute in self.ref_attribute:
             if not hasattr( ref, ref_attribute ):
                 return [] #ref does not have attribute, so we cannot filter, 
return empty list

James E. Johnson, Minnesota Supercomputing Institute, University of Minnesota
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:

To search Galaxy mailing lists use the unified search at:

Reply via email to