Mercurial > repos > recetox > table_pandas_rename_columns_regex
comparison table_pandas_rename_columns_regex.xml @ 0:505a8e975968 draft default tip
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/tables commit d0ff40eb2b536fec6c973c3a9ea8e7f31cd9a0d6
author | recetox |
---|---|
date | Wed, 29 Jan 2025 15:35:08 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:505a8e975968 |
---|---|
1 <tool id="table_pandas_rename_columns_regex" name="table rename columns via regex" version="@PANDAS_VERSION@+galaxy@VERSION_SUFFIX@" profile="20.01" license="MIT"> | |
2 <description>rename columns in a table using regex</description> | |
3 <macros> | |
4 <import>macros.xml</import> | |
5 <token name="@VERSION_SUFFIX@">0</token> | |
6 </macros> | |
7 | |
8 <requirements> | |
9 <expand macro="requirement_pandas_pyarrow"/> | |
10 </requirements> | |
11 | |
12 <required_files> | |
13 <include path="table_pandas_rename_columns_regex.py" /> | |
14 <include path="utils.py" /> | |
15 </required_files> | |
16 | |
17 <expand macro="creator" /> | |
18 | |
19 <command detect_errors="exit_code"><![CDATA[ | |
20 python3 '$__tool_directory__/table_pandas_rename_columns_regex.py' | |
21 --input_dataset '$input_dataset' '$input_dataset.ext' | |
22 --columns '$columns' | |
23 --regex_check '$regex_check' | |
24 --regex_replace '$regex_replace' | |
25 --output_dataset '$output_dataset' '$output_dataset.ext' | |
26 ]]></command> | |
27 | |
28 <inputs> | |
29 <param name="input_dataset" type="data" format="csv,tsv,tabular,parquet" label="Input Dataset" help="The input dataset in CSV, TSV, tabular, or Parquet format."/> | |
30 <param name="columns" type="data_column" data_ref="input_dataset" multiple="true" use_header_names="true" min="1" label="Columns to Rename" help="Select one or more columns from the dataset to rename. You can select columns by their header names."/> | |
31 <param name="regex_check" type="text" label="Regex to Check For" help="The regular expression pattern to search for in the column names. This pattern will be used to identify parts of the column names to be replaced."> | |
32 <expand macro="regex_sanitizer"/> | |
33 </param> | |
34 <param name="regex_replace" type="text" label="Regex to Replace With" optional="true" help="The regular expression pattern to replace the matched parts of the column names with. This pattern will be used to rename the columns."> | |
35 <expand macro="regex_sanitizer"/> | |
36 </param> | |
37 </inputs> | |
38 | |
39 <outputs> | |
40 <data name="output_dataset" format_source="input_dataset" label="${tool.name} on ${on_string}"> | |
41 <change_format> | |
42 <when input="input_dataset.ext" value="tsv" format="tabular" /> | |
43 </change_format> | |
44 </data> | |
45 </outputs> | |
46 | |
47 <tests> | |
48 <test expect_num_outputs="1"> | |
49 <param name="input_dataset" value="rename/reference_both_renamed.tabular" ftype="tabular"/> | |
50 <param name="columns" value="1,2"/> | |
51 <param name="regex_check" value="retention_"/> | |
52 <param name="regex_replace" value=""/> | |
53 <output name="output_dataset" ftype="tabular"> | |
54 <assert_contents> | |
55 <has_text text="retention" negate="true"/> | |
56 </assert_contents> | |
57 </output> | |
58 </test> | |
59 </tests> | |
60 | |
61 <help><![CDATA[ | |
62 This tool renames columns in a table using the specified regex patterns. | |
63 | |
64 Inputs | |
65 ------ | |
66 | |
67 - **Input Dataset**: The input dataset in CSV, TSV, tabular, or Parquet format. | |
68 - **Columns to Rename**: Select one or more columns from the dataset to rename. You can select columns by their header names. | |
69 - **Regex to Check For**: The regular expression pattern to search for in the column names. This pattern will be used to identify parts of the column names to be replaced. | |
70 - **Regex to Replace With**: The regular expression pattern to replace the matched parts of the column names with. This pattern will be used to rename the columns. | |
71 | |
72 Outputs | |
73 ------- | |
74 | |
75 - **Output Dataset**: The output dataset with the renamed columns. | |
76 ]]></help> | |
77 | |
78 <citations> | |
79 <citation type="doi">10.5281/zenodo.3509134</citation> | |
80 <citation type="doi">10.25080/Majora-92bf1922-00a</citation> | |
81 </citations> | |
82 </tool> |