Mercurial > repos > iuc > seaborn_pairgrid
comparison seaborn_pairgrid.xml @ 0:4a46d83cb08f 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:22 +0000 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:4a46d83cb08f |
|---|---|
| 1 <tool id="seaborn_pairgrid" name="seaborn pair-wise scatterplot" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="23.0" license="MIT"> | |
| 2 <description>of all-vs-all column combinations</description> | |
| 3 <macros> | |
| 4 <import>macros.xml</import> | |
| 5 </macros> | |
| 6 | |
| 7 <expand macro="edam"/> | |
| 8 <expand macro="requirements"/> | |
| 9 <expand macro="creator" /> | |
| 10 | |
| 11 <command detect_errors="exit_code"><![CDATA[ | |
| 12 python3 '${run_script}' | |
| 13 ]]></command> | |
| 14 | |
| 15 <configfiles> | |
| 16 <configfile name="run_script"><![CDATA[ | |
| 17 index_col = $index_col | |
| 18 | |
| 19 @INIT@ | |
| 20 | |
| 21 from scipy.stats import gaussian_kde | |
| 22 | |
| 23 def scatter_density(x, y, **kwargs): | |
| 24 kwargs.pop('color') | |
| 25 # Calculate the point density | |
| 26 xy = np.vstack([x, y]) | |
| 27 z = gaussian_kde(xy)(xy) | |
| 28 plt.scatter(x, y, c=z, cmap="jet", **kwargs) | |
| 29 | |
| 30 | |
| 31 g = sns.PairGrid(data) | |
| 32 g.map_lower(sns.regplot, scatter_kws=dict(s=4)) | |
| 33 g.map_lower(sns.kdeplot, levels=4, color=".2") | |
| 34 g.map_upper(scatter_density, s=6) | |
| 35 g.map_diag(sns.histplot) | |
| 36 | |
| 37 plt.savefig(f"{output_file}", format=output_format, dpi=300) | |
| 38 ]]></configfile> | |
| 39 </configfiles> | |
| 40 <inputs> | |
| 41 <expand macro="inputs"/> | |
| 42 <param argument="index_col" type="boolean" truevalue="0" falsevalue="None" checked="false" label="Is the first column the index?" help="Specify whether the first column of the input data should be treated as the index. If selected, the first column will not be used as data for plotting." /> | |
| 43 <expand macro="transformation"/> | |
| 44 </inputs> | |
| 45 <outputs> | |
| 46 <data name="output_file" format="png" label="${tool.name} on ${on_string}" /> | |
| 47 </outputs> | |
| 48 <tests> | |
| 49 <!-- Test 1: Generate a pairgrid plot with default settings --> | |
| 50 <test> | |
| 51 <param name="input_data" value="mtcars.txt" /> | |
| 52 <output name="output_file"> | |
| 53 <assert_contents> | |
| 54 <has_image_channels channels="4"/> | |
| 55 <has_image_height height="8250"/> | |
| 56 <has_image_width width="8250" /> | |
| 57 <has_image_center_of_mass center_of_mass="4143.08, 4103.67" eps="0.1"/> | |
| 58 </assert_contents> | |
| 59 </output> | |
| 60 </test> | |
| 61 </tests> | |
| 62 <help><![CDATA[ | |
| 63 .. class:: infomark | |
| 64 | |
| 65 **What it does** | |
| 66 | |
| 67 This tool generates a scatterplot matrix (pair-wise scatterplots) of all column combinations in the input dataset using the Seaborn library. The scatterplot matrix provides a visual summary of the relationships between variables in the dataset, making it useful for exploratory data analysis. | |
| 68 The tool uses Seaborn's `PairGrid` functionality to create the matrix, with the following features: | |
| 69 | |
| 70 - **Lower Triangle**: Regression plots and kernel density estimates (KDE). | |
| 71 - **Upper Triangle**: Scatterplots with point density coloring. | |
| 72 - **Diagonal**: Histograms of individual variables. | |
| 73 | |
| 74 **Usage** | |
| 75 | |
| 76 1. **Input**: Provide a tabular data file in one of the supported formats (TSV, CSV, TXT, or Parquet). Optionally, specify whether the first column should be treated as the index. | |
| 77 2. **Advanced Options**: Apply transformations to the data (e.g., log10 or log2) before plotting. | |
| 78 3. **Output**: The tool generates a PNG image of the scatterplot matrix, which can be downloaded or used in further analyses. | |
| 79 | |
| 80 **Input** | |
| 81 | |
| 82 - **Input Data Table**: Upload your data file in TSV, CSV, TXT, or Parquet format. The file should contain numerical data for plotting. | |
| 83 - **Index Column**: Specify whether the first column of the input data should be treated as the index. If selected, the first column will not be used for plotting. | |
| 84 - **Data Transformation**: Apply transformations such as log10 or log2 to numerical data before plotting. | |
| 85 | |
| 86 **Output** | |
| 87 | |
| 88 The tool generates a PNG file containing the scatterplot matrix. The file can be downloaded or used as input for other tools in Galaxy. | |
| 89 | |
| 90 **Example Input** | |
| 91 | |
| 92 Here is an example of a simple input dataset: | |
| 93 | |
| 94 +------------+------------+------------+------------+ | |
| 95 | Category | Value1 | Value2 | Value3 | | |
| 96 +============+============+============+============+ | |
| 97 | A | 10 | 20 | 30 | | |
| 98 +------------+------------+------------+------------+ | |
| 99 | B | 15 | 25 | 35 | | |
| 100 +------------+------------+------------+------------+ | |
| 101 | C | 20 | 30 | 40 | | |
| 102 +------------+------------+------------+------------+ | |
| 103 | |
| 104 **Example Output** | |
| 105 | |
| 106 The tool will generate a scatterplot matrix where: | |
| 107 - The lower triangle contains regression plots and KDE plots. | |
| 108 - The upper triangle contains scatterplots with point density coloring. | |
| 109 - The diagonal contains histograms of individual variables. | |
| 110 | |
| 111 **Links** | |
| 112 | |
| 113 - For more information about Seaborn's `PairGrid`, visit the official documentation: https://seaborn.pydata.org/generated/seaborn.PairGrid.html | |
| 114 - For detailed parameter descriptions, refer to the Galaxy tool documentation. | |
| 115 ]]></help> | |
| 116 <expand macro="citation"/> | |
| 117 </tool> |
