galaxy.tools.data package
extend base tool data table implementations with special implementations requiring full Galaxy dependencies (specifically the refgenie configuration client currently).
- class galaxy.tools.data.RefgenieToolDataTable(config_element, tool_data_path, tool_data_path_files, from_shed_config=False, filename=None, other_config_dict=None)[source]
Bases:
TabularToolDataTable
Data stored in refgenie
<table name="all_fasta" type="refgenie" asset="fasta" > <file path="refgenie.yml" /> <field name="value" template="true">${__REFGENIE_UUID__}</field> <field name="dbkey" template="true">${__REFGENIE_GENOME__}</field> <field name="name" template="true">${__REFGENIE_DISPLAY_NAME__}</field> <field name="path" template="true">${__REFGENIE_ASSET__}</field> </table>
- dict_collection_visible_keys = ['name']
- dict_element_visible_keys = ['name', 'fields']
- dict_export_visible_keys = ['name', 'data', 'rg_asset', 'largest_index', 'columns', 'missing_index_file']
- __init__(config_element, tool_data_path, tool_data_path_files, from_shed_config=False, filename=None, other_config_dict=None) None [source]
- configure_and_load(config_element, tool_data_path, from_shed_config=False, url_timeout=10)[source]
Configure and load table from an XML element.
- parse_column_spec(config_element)[source]
Parse column definitions, which can either be a set of ‘column’ elements with a name and index (as in dynamic options config), or a shorthand comma separated list of names in order as the text of a ‘column_names’ element.
A column named ‘value’ is required.
- class galaxy.tools.data.TabularToolDataField(data: Dict)[source]
Bases:
Dictifiable
- class galaxy.tools.data.TabularToolDataTable(config_element: Element, tool_data_path: str | PathLike | None, tool_data_path_files: ToolDataPathFiles, from_shed_config: bool = False, filename: str | PathLike | None = None, other_config_dict: StoresConfigFilePaths | None = None)[source]
Bases:
ToolDataTable
Data stored in a tabular / separated value format on disk, allows multiple files to be merged but all must have the same column definitions:
<table type="tabular" name="test"> <column name='...' index = '...' /> <file path="..." /> <file path="..." /> </table>
- dict_collection_visible_keys = ['name']
- dict_element_visible_keys = ['name', 'fields']
- dict_export_visible_keys = ['name', 'data', 'largest_index', 'columns', 'missing_index_file']
- __init__(config_element: Element, tool_data_path: str | PathLike | None, tool_data_path_files: ToolDataPathFiles, from_shed_config: bool = False, filename: str | PathLike | None = None, other_config_dict: StoresConfigFilePaths | None = None) None [source]
- configure_and_load(config_element: Element, tool_data_path: str | PathLike | None, from_shed_config: bool = False, url_timeout: float = 10) None [source]
Configure and load table from an XML element.
- parse_column_spec(config_element: Element) None [source]
Parse column definitions, which can either be a set of ‘column’ elements with a name and index (as in dynamic options config), or a shorthand comma separated list of names in order as the text of a ‘column_names’ element.
A column named ‘value’ is required.
- parse_file_fields(filename: str, errors: List[str] | None = None, here: str = '__HERE__') List[List[str]] [source]
Parse separated lines from file and return a list of tuples.
TODO: Allow named access to fields using the column names.
- get_entry(query_attr: str, query_val: str, return_attr: str, default: None = None)[source]
Returns table entry associated with a col/val pair.
- get_entries(query_attr: str, query_val: str, return_attr: str, limit=None) List [source]
Returns table entries associated with a col/val pair.
- get_filename_for_source(source: dict | RepoInfo | DataManager | None, default: str | None = None) str | None [source]
- filter_file_fields(loc_file, values)[source]
Reads separated lines from file and print back only the lines that pass a filter.
- property xml_string
- class galaxy.tools.data.ToolDataTable(config_element: Element, tool_data_path: str | PathLike | None, tool_data_path_files: ToolDataPathFiles, from_shed_config: bool = False, filename: str | PathLike | None = None, other_config_dict: StoresConfigFilePaths | None = None)[source]
Bases:
Dictifiable
- __init__(config_element: Element, tool_data_path: str | PathLike | None, tool_data_path_files: ToolDataPathFiles, from_shed_config: bool = False, filename: str | PathLike | None = None, other_config_dict: StoresConfigFilePaths | None = None) None [source]
- add_entry(entry: List[str] | Dict[str, str], allow_duplicates: bool = True, persist: bool = False, entry_source: dict | RepoInfo | DataManager | None = None, tool_data_file_path: str | None = None, use_first_file_path: bool = False, **kwd) int [source]
- add_entries(entries: List[List[str]], allow_duplicates: bool = True, persist: bool = False, entry_source: dict | RepoInfo | DataManager | None = None, **kwd) int [source]
- class galaxy.tools.data.ToolDataTableManager(tool_data_path: str, config_filename: str | PathLike | List[str | PathLike] | None = None, tool_data_table_config_path_set=None, other_config_dict: StoresConfigFilePaths | None = None)[source]
Bases:
ToolDataTableManager
- tool_data_table_types = {'refgenie': <class 'galaxy.tools.data.RefgenieToolDataTable'>, 'tabular': <class 'galaxy.tool_util.data.TabularToolDataTable'>}
- data_tables: Dict[str, ToolDataTable]