diff --git a/lib/galaxy/tool_util/xsd/galaxy.xsd b/lib/galaxy/tool_util/xsd/galaxy.xsd index 5fa1fd5813a2..7f32306bdde0 100644 --- a/lib/galaxy/tool_util/xsd/galaxy.xsd +++ b/lib/galaxy/tool_util/xsd/galaxy.xsd @@ -3937,7 +3937,7 @@ exclusively use ``filter``s to populate options. * ``from_dataset`` - The options for the select list are dynamically obtained from input dataset selected for the tool from the current history. * ``from_file`` - The options for the select list are dynamically obtained from - a file. This mechanis is discourage in favor of the more generic + a file. This mechanism is discouraged in favor of the more generic ``from_data_table``. * ``from_parameter`` - The options for the select list are dynamically obtained from a parameter. @@ -4013,6 +4013,10 @@ Starting from Galaxy v21.01, ``meta_file_key`` can be used together with medadata file that the ``meta_file_key`` implies, instead of the dataset itself. +Note that in any case only the first mega byte of the referred dataset (or file) +is considered. Lines starting with ``#`` are ignored. By using the ``startswith`` +attribute also lines starting with other strings can be ignored. + ```xml @@ -4087,7 +4091,7 @@ used to generate dynamic options. - Determine options from the dataset given in the referred input parameter. If 'meta_file_key' is given, the options are determined from the data in the metadata file of the input. + Determine options from (the first MB of) the dataset given in the referred input parameter. If 'meta_file_key' is given, the options are determined from (the first MB of) the data in the metadata file of the input. @@ -4117,7 +4121,7 @@ used to generate dynamic options. - Ignore lines starting with the given character. + Ignore lines starting with the given string. @@ -4125,6 +4129,11 @@ used to generate dynamic options. Works with from_dataset only. See [docs](#from-dataset) + + + Split tabular data with this character (default is tab) + + diff --git a/lib/galaxy/tools/parameters/dynamic_options.py b/lib/galaxy/tools/parameters/dynamic_options.py index 6eaac75fad46..803d54349f60 100644 --- a/lib/galaxy/tools/parameters/dynamic_options.py +++ b/lib/galaxy/tools/parameters/dynamic_options.py @@ -645,7 +645,7 @@ def parse_file_fields(self, reader): rval = [] field_count = None for line in reader: - if line.startswith('#') or (self.line_startswith and not line.startswith(self.line_startswith)): + if line.startswith("#") or (self.line_startswith and line.startswith(self.line_startswith)): continue line = line.rstrip("\n\r") if line: diff --git a/test/functional/tools/options_from_metadata_file.xml b/test/functional/tools/options_from_metadata_file.xml index 23347ebf938a..87e1863bbb8d 100644 --- a/test/functional/tools/options_from_metadata_file.xml +++ b/test/functional/tools/options_from_metadata_file.xml @@ -1,19 +1,30 @@ '${output}'; +echo '${species_comma}' >> '${output}'; echo '${species_2}' >> '${output}' ]]> + - - - + + + + + + + + + + - + + - + @@ -21,23 +32,25 @@ echo '${species_2}' >> '${output}' - + - - + + + - - + + - + - - + + + diff --git a/test/functional/tools/samples_tool_conf.xml b/test/functional/tools/samples_tool_conf.xml index 4c6ea5df1d66..be536e1c0052 100644 --- a/test/functional/tools/samples_tool_conf.xml +++ b/test/functional/tools/samples_tool_conf.xml @@ -53,6 +53,7 @@ + diff --git a/test/functional/tools/select_from_csvdataset.xml b/test/functional/tools/select_from_csvdataset.xml new file mode 100644 index 000000000000..6ca646a1db3c --- /dev/null +++ b/test/functional/tools/select_from_csvdataset.xml @@ -0,0 +1,40 @@ + + Create dynamic options from CSV data sets + '$output' + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file