Mercurial > repos > recetox > table_pandas_rename_column
comparison table_pandas_rename_column.xml @ 0:3f54cd56a65e 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:31 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:3f54cd56a65e |
---|---|
1 <tool id="table_pandas_rename_column" name="table rename column" version="@PANDAS_VERSION@+galaxy@VERSION_SUFFIX@" profile="20.01" license="MIT"> | |
2 <description>of a table</description> | |
3 <!-- <xrefs> | |
4 <xref type="bio.tools"></xref> | |
5 </xrefs> --> | |
6 <macros> | |
7 <import>macros.xml</import> | |
8 <token name="@VERSION_SUFFIX@">0</token> | |
9 </macros> | |
10 <!-- TODO: please annotate this tool with topics and operations from http://edamontology.org --> | |
11 <!-- TODO: for more information see: https://galaxy-iuc-standards.readthedocs.io/en/latest/best_practices/tool_xml.html#edam-topics-and-operations --> | |
12 <!-- <edam_topics> | |
13 <edam_topic>topic_TODO</edam_topic> | |
14 </edam_topics> | |
15 <edam_operations> | |
16 <edam_operation>operation_TODO</edam_operation> | |
17 </edam_operations> --> | |
18 <requirements> | |
19 <expand macro="requirement_pandas_pyarrow"/> | |
20 </requirements> | |
21 <required_files> | |
22 <include path="table_pandas_rename_column.py" /> | |
23 <include path="utils.py" /> | |
24 </required_files> | |
25 <expand macro="creator" /> | |
26 <command detect_errors="exit_code"><![CDATA[ | |
27 #set rename_dict = " ".join([str($key_value_pair.column) + '=' + str($key_value_pair.new_name) for $key_value_pair in $columns_selection]) | |
28 python3 '$__tool_directory__/table_pandas_rename_column.py' | |
29 --input_dataset '$input_dataset' '$input_dataset.ext' | |
30 --rename $rename_dict | |
31 --output_dataset '$output_dataset' '$output_dataset.ext' | |
32 ]]></command> | |
33 <inputs> | |
34 <param name="input_dataset" type="data" format="csv,tsv,tabular,parquet" label="Input Dataset"/> | |
35 <repeat name="columns_selection" title="Rename column" min="1"> | |
36 <param name="column" type="data_column" data_ref="input_dataset" use_header_names="true" label="Column" help="Column from the dataset to rename."/> | |
37 <param argument="new_name" type="text" value="" label="New column name" help="New name for the column"> | |
38 <sanitizer invalid_char=""> | |
39 <valid initial="string.letters,string.digits"> | |
40 <add value="_" /> | |
41 </valid> | |
42 </sanitizer> | |
43 <validator type="regex">[0-9a-zA-Z_]+</validator> | |
44 </param> | |
45 </repeat> | |
46 </inputs> | |
47 <outputs> | |
48 <data name="output_dataset" format_source="input_dataset" label="${tool.name} on ${on_string}"> | |
49 <change_format> | |
50 <when input="input_dataset.ext" value="tsv" format="tabular" /> | |
51 </change_format> | |
52 </data> | |
53 </outputs> | |
54 <tests> | |
55 <test> | |
56 <param name="input_dataset" value="reference.txt" ftype="tabular"/> | |
57 <param name="column" value="2"/> | |
58 <param name="new_name" value="retention_time"/> | |
59 <output name="output_dataset" file="rename/reference_rt_renamed.tabular" ftype="tabular"/> | |
60 </test> | |
61 <test> | |
62 <param name="input_dataset" value="reference.txt" ftype="tabular"/> | |
63 <repeat name="columns_selection"> | |
64 <param name="column" value="2"/> | |
65 <param name="new_name" value="retention_time"/> | |
66 </repeat> | |
67 <repeat name="columns_selection"> | |
68 <param name="column" value="1"/> | |
69 <param name="new_name" value="retention_index"/> | |
70 </repeat> | |
71 <output name="output_dataset" file="rename/reference_both_renamed.tabular" ftype="tabular"/> | |
72 </test> | |
73 </tests> | |
74 <help><![CDATA[ | |
75 This tool renames columns in a table. | |
76 | |
77 Inputs | |
78 ------ | |
79 | |
80 - **Input Dataset**: The input dataset in CSV, TSV, tabular, or Parquet format. | |
81 - **Columns to Rename**: Specify the columns to rename and their new names. You can use the "repeat" function to rename multiple columns. | |
82 | |
83 Outputs | |
84 ------- | |
85 | |
86 - **Output Dataset**: The output dataset with the renamed columns. | |
87 | |
88 ]]></help> | |
89 <citations> | |
90 <citation type="doi">10.5281/zenodo.3509134</citation> | |
91 </citations> | |
92 </tool> |