comparison macros.xml @ 0:293a939f28c8 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/seaborn commit 24dc6373560bd5e409fca84154634f5a528001c3
author iuc
date Wed, 14 May 2025 08:39:42 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:293a939f28c8
1 <macros>
2 <token name="@TOOL_VERSION@">0.13.2</token>
3 <token name="@VERSION_SUFFIX@">0</token>
4
5 <xml name="edam">
6 <edam_topics>
7 <edam_topic>topic_0092</edam_topic>
8 </edam_topics>
9 <edam_operations>
10 <edam_operation>operation_0337</edam_operation>
11 </edam_operations>
12 </xml>
13
14 <xml name="requirements">
15 <requirements>
16 <requirement type="package" version="@TOOL_VERSION@">seaborn</requirement>
17 <yield/>
18 </requirements>
19 </xml>
20
21 <xml name="inputs">
22 <param argument="--input_data" type="data" format="tsv,tabular,csv,parquet" label="Input data table" help="Provide the input data file in one of the supported formats: TSV, TXT, CSV, or Parquet. This file will be used to generate the plot." />
23 </xml>
24
25 <xml name="transformation">
26 <param name="transformation" type="select" label="Transformation" help="Choose a transformation function to apply to the numerical data in the input file. This can be useful for scaling or normalizing the data before plotting.">
27 <option value="lambda x: x" selected="true">no transformation</option>
28 <option value="np.log10">log10</option>
29 <option value="np.log2">log2</option>
30 </param>
31 </xml>
32
33 <xml name="columns" tokens="header">
34 <param name="xcol" type="data_column" data_ref="input_data" label="x-axis" optional="true" use_header_names="@HEADER@" help="Select the column from the input data to use for the x-axis of the plot."/>
35 <param name="ycol" type="data_column" data_ref="input_data" label="y-axis" optional="true" use_header_names="@HEADER@" help="Select the column from the input data to use for the y-axis of the plot."/>
36 <section name="advanced_input" title="Advanced">
37 <param name="hue" type="data_column" data_ref="input_data" label="hue" optional="true" use_header_names="@HEADER@" help="Select a column to group data by color (hue) in the plot. This is useful for visualizing categorical data."/>
38 <param name="col" type="data_column" data_ref="input_data" label="column-facetting" optional="true" use_header_names="@HEADER@" help="Select a column to create facets (subplots) along the columns of the plot grid. This is useful for visualizing how data varies across different categories or groups in the selected column."/>
39 <param name="row" type="data_column" data_ref="input_data" label="row-facetting" optional="true" use_header_names="@HEADER@" help="Select a column to create facets (subplots) along the rows of the plot grid. This allows you to compare data across different categories or groups in the selected column."/>
40 </section>
41 </xml>
42
43 <token name="@INIT@">
44 import pandas as pd
45 import seaborn as sns
46 import numpy as np
47 import matplotlib.pyplot as plt
48
49 file_name = "$input_data"
50 file_extension = "$input_data.ext"
51
52 transformation = $transformation
53 output_format = "png"
54 output_file = "${output_file}"
55
56 # load and transform data
57 if file_extension == "csv":
58 df = pd.read_csv(file_name, index_col=index_col)
59 elif file_extension in ["tsv", "tabular"]:
60 df = pd.read_csv(file_name, sep="\t", index_col=index_col)
61 elif file_extension == "parquet":
62 df = pd.read_parquet(file_name, index_col=index_col)
63 else:
64 raise ValueError(f"Unsupported file format: {file_extension}")
65 data = df.apply(lambda x: transformation(x) if np.issubdtype(x.dtype, np.number) else x)
66 </token>
67
68 <xml name="creator">
69 <creator>
70 <person
71 givenName="Helge"
72 familyName="Hecht"
73 url="https://github.com/hechth"
74 identifier="0000-0001-6744-996X" />
75 <organization
76 url="https://www.recetox.muni.cz/"
77 email="GalaxyToolsDevelopmentandDeployment@space.muni.cz"
78 name="RECETOX MUNI" />
79 </creator>
80 </xml>
81
82 <xml name="citation">
83 <citations>
84 <citation type="doi">10.21105/joss.03021</citation>
85 </citations>
86 </xml>
87 </macros>