'Check all of the tool\'s input parameters, looking for any that are dynamically
generated using external data files to make sure the files exist.'

def check_tool_input_params(self, repo_dir, tool_config_name, tool, sample_files):

    invalid_files_and_errors_tups = []
    correction_msg = ''
    for input_param in tool.input_params:
        if (isinstance(input_param, parameters.basic.SelectToolParameter) and input_param.is_dynamic):
            options = (input_param.dynamic_options or input_param.options)
            if (options and isinstance(options, dynamic_options.DynamicOptions)):
                if (options.tool_data_table or options.missing_tool_data_table_name):
                    sample_tool_data_table_conf = hg_util.get_config_from_disk('tool_data_table_conf.xml.sample', repo_dir)
                    if sample_tool_data_table_conf:
                        (error, correction_msg) = self.tdtm.handle_sample_tool_data_table_conf_file(sample_tool_data_table_conf, persist=False)
                        if error:
                            invalid_files_and_errors_tups.append(('tool_data_table_conf.xml.sample', correction_msg))
                        else:
                            options.missing_tool_data_table_name = None
                    else:
                        correction_msg = 'This    file    requires    an    entry    in    the    tool_data_table_conf.xml    file.        '
                        correction_msg += 'Upload    a    file    named    tool_data_table_conf.xml.sample    to    the    repository    '
                        correction_msg += 'that    includes    the    required    entry    to    correct    this    error.<br/>'
                        invalid_tup = (tool_config_name, correction_msg)
                        if (invalid_tup not in invalid_files_and_errors_tups):
                            invalid_files_and_errors_tups.append(invalid_tup)
                if (options.index_file or options.missing_index_file):
                    index_file = (options.index_file or options.missing_index_file)
                    index_file_name = basic_util.strip_path(index_file)
                    sample_found = False
                    for sample_file in sample_files:
                        sample_file_name = basic_util.strip_path(sample_file)
                        if (sample_file_name == ('%s.sample' % index_file_name)):
                            options.index_file = index_file_name
                            options.missing_index_file = None
                            if options.tool_data_table:
                                options.tool_data_table.missing_index_file = None
                            sample_found = True
                            break
                    if (not sample_found):
                        correction_msg = ('This    file    refers    to    a    file    named    <b>%s</b>.        ' % str(index_file_name))
                        correction_msg += ('Upload    a    file    named    <b>%s.sample</b>    to    the    repository    to    correct    this    error.' % str(index_file_name))
                        invalid_files_and_errors_tups.append((tool_config_name, correction_msg))
    return invalid_files_and_errors_tups
