I am trying to use dynamic options in galaxy but it isn't working.
Essentially a user can include a covariate tabular file. In this file there will be columns which could be added to a multi plot figure script we are working on to summarize SNVs across a cohort. Here is an example tool config file I am using:
<tool id="testdynamicoptions" name="TestDynamicOptions" version="1.0.0">
<description>test</description>
<command detect_errors="aggressive">echo $option</command>
<inputs>
<param type="data" format="tabular" name="optionfile" label="Test Tabular Data"/>
<param type="select" name="option" label="Select Option From Tabular Data File" dynamic_options="fetch_patient_covariates( optionfile )" />
</inputs>
<code file="test_dynamic_options.py"/>
</tool>
Then I have the test_dynamic_options.py here:
import csv
def fetch_patient_covariates( covariate_file ):
covariate_fh = open(covariate_file,'rb')
covariates = csv.reader(covariate_fh, delimiter='\t')
header = covariates.next()
options = []
for item in header:
if item.endswith("_col"):
continue
if item == "patient":
continue
options.append((item,item,False))
return options
If there is anything obvious about this that is wrong, please let me know :)