A final pointer: to see tools that use dynamic options, take a look at "Extract GFF features" and "Filter GFF dataset by feature count"

Good luck,
J.

On Mar 22, 2012, at 12:15 PM, Greg Von Kuster wrote:

It's always best to look at examples in the code base for technical details like this rather than the wiki.   You probably will need a combination of a <conditional> constructor along with a select list item in your tooll  There are many tools that include these types of constructors that refresh the page when a <when> condition is met.  One example is the extract_genomic_dna.xml tool config, which includes the following tag sets.

  <inputs>
      <param format="interval,gff" name="input" type="data" label="Fetch sequences for intervals in"/>
      <param name="interpret_features" type="select" label="Interpret features when possible" help="Only meaningful for GFF, GTF datasets.">
          <option value="yes">Yes</option>
          <option value="no">No</option>
      </param>
      <conditional name="seq_source">
          <param name="index_source" type="select" label="Source for Genomic Data">
              <option value="cached">Locally cached</option>
              <option value="history">History</option>
          </param>
          <when value="cached">
          </when>
          <when value="history">
              <param name="ref_file" type="data" format="fasta" label="Using reference file" />
          </when>
      </conditional>
  <param name="out_format" type="select" label="Output data type">
      <option value="fasta">FASTA</option>
      <option value="interval">Interval</option>
  </param>
  </inputs>

Sorry, but I don't have the time to get too much more involved in this than I have - as always, I'm stretched as thin as can be.  Good luck!


On Mar 22, 2012, at 5:09 AM, Leandro Hermida wrote:

Dear Greg,

On Wed, Mar 21, 2012 at 3:20 PM, Greg Von Kuster <greg@bx.psu.edu> wrote:
Leandro,

For refresh_on_change to work you need a set of optional selections and a
set of refresh_on_change values, so in your example, the type should
probably be a select instead of data.  You'll also need the select list
options to be generated based on your history items (at least that's what I
think you're attempt here), so your list of refresh_on_change values will be
attributes of those history items.

Greg Von Kuster

Could you show an example of this functionality that you described?
This is new to me I really apologize and I looked for things on the
Galaxy wiki but couldn't find. How would one do the simple example I
illustrated in this thread:

<inputs>
   <param type="data" format="txt" name="dataset" label="Select a
text file from you history" />
   <param type="select" multiple="true" name="dataset_values"
dynamic_options="get_options_from_file(dataset.file_name)" />
</inputs>

Where in the tool form if the user changes the first drop-down menu to
select a different file of a particular format from their history it
will cause a refresh of the page so that the dynamic_options function
in the second menu can be re-executed using the new file name as a
parameter then generating new options in this second menu?

regards,
Leandro


On Mar 21, 2012, at 9:27 AM, Leandro Hermida wrote:


Here's one example:


<inputs>

   <param type="data" name="dataset" refresh_on_change="true"

label="Select a file from you history" />

   <param type="select" multiple="true" name="dataset_values"

dynamic_options="get_options_from_file(dataset.file_name)" />

</inputs>


If the user changes their selection of data from their history it

should refresh the page and call the dynamic options again to load the

other select menu with the choices from the new file. Currently you

have to do this with repeat or pages tags which is really cumbersome

for the user in the UI or doesn't allow workflowing, respectively.



Page should refresh automatically when dataset is changed and dynamic

options are used. If not, it's a bug.


Ok, not sure what this means, the above example I wrote doesn't work
so is this a bug or is there another way to write the above example so
that it will work?

regards,
Leandro



___________________________________________________________
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:

 http://lists.bx.psu.edu/



___________________________________________________________
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:

 http://lists.bx.psu.edu/


___________________________________________________________
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:

 http://lists.bx.psu.edu/