Mercurial > repos > bgruening > wordcloud
changeset 1:b98bcfdec481 draft default tip
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/wordcloud commit 3a7c1e056d37cf5c5a4eca3d9c86d0f27acaac19
author | bgruening |
---|---|
date | Sat, 08 Mar 2025 10:16:16 +0000 |
parents | 54c2d8ebf0cf |
children | |
files | test-data/fonts.loc tool-data/fonts.loc.sample tool_data_table_conf.xml.sample tool_data_table_conf.xml.test wordcloud.xml |
diffstat | 5 files changed, 123 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/fonts.loc Sat Mar 08 10:16:16 2025 +0000 @@ -0,0 +1,14 @@ +#This file lists the locations and font files. +#The file has the format (white space characters are +#TAB characters): +# +#<unique_font_id> <name> <version> <file_path> +# +#So, fonts.loc could look something like this: +# +#sakurata SAKURATA Font 1.0 /foo/bar/fonts/SAKURATA.ttf +#germaniaone_regular Germania One Font 1.0 /foo/bar/fonts/GermaniaOne-Regular.ttf +#hunting Hunting Font 1.0 /foo/bar/fonts/Hunting.ttf +#irannastaliq IranNastaliq Font 1.0 /foo/bar/fonts/IranNastaliq.ttf +# +test_font Test Font 1 ${__HERE__}/font.ttf \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tool-data/fonts.loc.sample Sat Mar 08 10:16:16 2025 +0000 @@ -0,0 +1,13 @@ +# This file lists the locations and font files. +# The file has the format (white space characters are +# TAB characters): +# +# <unique_font_id> <name> <version> <file_path> +# +# So, fonts.loc could look something like this: +# +# sakurata SAKURATA Font 1.0 /foo/bar/fonts/SAKURATA.ttf +# germaniaone_regular Germania One Font 1.0 /foo/bar/fonts/GermaniaOne-Regular.ttf +# hunting Hunting Font 1.0 /foo/bar/fonts/Hunting.ttf +# irannastaliq IranNastaliq Font 1.0 /foo/bar/fonts/IranNastaliq.ttf +# \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tool_data_table_conf.xml.sample Sat Mar 08 10:16:16 2025 +0000 @@ -0,0 +1,6 @@ +<tables> + <table name="fonts" comment_char="#"> + <columns>value, name, version, path</columns> + <file path="tool-data/fonts.loc" /> + </table> +</tables> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tool_data_table_conf.xml.test Sat Mar 08 10:16:16 2025 +0000 @@ -0,0 +1,7 @@ +<tables> + <!-- Locations of font files --> + <table name="fonts" comment_char="#" allow_duplicate_entries="false"> + <columns>value, name, version, path</columns> + <file path="${__HERE__}/test-data/fonts.loc" /> + </table> +</tables> \ No newline at end of file
--- a/wordcloud.xml Fri Dec 13 21:43:12 2024 +0000 +++ b/wordcloud.xml Sat Mar 08 10:16:16 2025 +0000 @@ -2,11 +2,11 @@ <description>with highly customizable appearance</description> <macros> <token name="@TOOL_VERSION@">1.9.4</token> - <token name="@VERSION_SUFFIX@">0</token> + <token name="@VERSION_SUFFIX@">1</token> <token name="@PROFILE@">23.0</token> </macros> <requirements> - <requirement type="package" version="1.9.4">wordcloud</requirement> + <requirement type="package" version="@TOOL_VERSION@">wordcloud</requirement> </requirements> <version_command>wordcloud_cli --version</version_command> <command detect_errors="exit_code"><![CDATA[ @@ -16,9 +16,13 @@ #if $stopwords --stopwords $stopwords #end if - #if $fontfile - --fontfile $fontfile + + #if $fonts.fonts_selector == 'cached': + --fontfile ${fonts.fonts_select.fields.path} + #elif $fonts.fonts_selector == 'history': + --fontfile ${fonts.fontfile} #end if + #if $min_font_size --min_font_size $min_font_size #end if @@ -79,7 +83,7 @@ $include_numbers $no_normalize_plurals $repeat - #if $random_state + #if str($random_state): --random_state $random_state #end if ]]> @@ -87,7 +91,27 @@ <inputs> <param argument="--text" type="data" format="txt" label="Input file" help="Input file to process"/> <param argument="--stopwords" type="data" format="txt" optional="true" label="Stopwords file" help="Specify file of stopwords (containing one word per line) to remove from the given text after parsing"/> - <param argument="--fontfile" type="data" format="binary" optional="true" label="Font file you wish to use " help="The font file you want to use"/> + + <conditional name="fonts"> + <param name="fonts_selector" type="select" label="Do you want to select a special font?" help="You can pass a specific file from your history or select a few prebuild fonts. By default DroidSansMono is used."> + <option value="none">Use the default DroidSansMono font</option> + <option value="cached">Select from a list of fonts</option> + <option value="history">Choose a font from your history</option> + </param> + <when value="none"/> + <when value="cached"> + <param name="fonts_select" type="select" label="Select font from list"> + <options from_data_table="fonts"> + <filter type="sort_by" column="2" /> + <validator type="no_options" message="No fonts are available" /> + </options> + </param> + </when> + <when value="history"> + <param argument="--fontfile" type="data" format="binary" optional="true" label="Font file you wish to use" help="The font file you want to use"/> + </when> + </conditional> + <param argument="--min_font_size" type="integer" min="1" value="4" optional="true" label=" Smallest font size to use" /> <param argument="--max_font_size" type="integer" min="1" optional="true" label="Maximum font size for the largest word" /> <param argument="--font_step" type="integer" value="1" label="Step size for the font" help="Font_step > 1 might speed up computation but give a worse fit"/> @@ -106,7 +130,7 @@ <option value="colormask">Color Mask</option> </param> <when value="color"> - <param argument="--color" type="color" value="#00FF00" optional="true" label="Use given color as coloring for the image"> + <param argument="--color" type="color" value="#00ff00" optional="true" label="Use given color as coloring for the image"> <validator type="regex" message="Please select a valid RGB color">[#][0-9A-Fa-f]{6}</validator> </param> </when> @@ -139,7 +163,7 @@ <option value="BuGn">BuGn</option> <option value="YlGn">YlGn</option> </param> - <param argument="--mode" type="select" value="RGB" optional="True" label="Use RGB or RGBA for transparent background"> + <param argument="--mode" type="select" value="RGB" optional="true" label="Use RGB or RGBA for transparent background"> <option value="RGB">RGB</option> <option value="RGBA">RGBA</option> </param> @@ -162,13 +186,22 @@ <tests> <test expect_num_outputs="1"> <param name="text" value="test.txt" ftype="txt"/> + <conditional name="color_choice"> + <param name="color_option" value="color"/> + <param name="color" value="#00ff00"/> + </conditional> + <param name="contour_color" value="#1f4068"/> <param name="random_state" value="10"/> + <param name="background" value="#000000"/> <output name="output" file="output_1.png" compare="image_diff" /> </test> <test expect_num_outputs="1"> <param name="text" value="test.txt" ftype="txt"/> <param name="stopwords" value="stopwords.txt"/> - <param name="fontfile" value="font.ttf"/> + <conditional name="fonts"> + <param name="fonts_selector" value="cached" /> + <param name="fonts_select" value="test_font"/> + </conditional> <param name="min_font_size" value="4"/> <param name="max_font_size" value="100"/> <param name="font_step" value="1"/> @@ -177,13 +210,51 @@ <param name="width" value="800"/> <param name="height" value="600"/> <param name="margin" value="0"/> - <param name="background" value="#FFFFFF"/> + <param name="background" value="#ffffff"/> <param name="mask" value="mask.png"/> - <param name="color" value="#1F4068"/> + <conditional name="color_choice"> + <param name="color_option" value="color"/> + <param name="color" value="#1f4068"/> + </conditional> <param name="colormap" value="viridis"/> <param name="mode" value="RGB"/> <param name="contour_width" value="8"/> - <param name="contour_color" value="#1F4068"/> + <param name="contour_color" value="#1f4068"/> + <param name="prefer_horizontal" value="0.9"/> + <param name="scale" value="1.0"/> + <param name="relative_scaling" value="0.0"/> + <param name="no_collocations" value="True"/> + <param name="include_numbers" value="False"/> + <param name="no_normalize_plurals" value="True"/> + <param name="repeat" value="True"/> + <param name="random_state" value="10"/> + <output name="output" file="output_2.png" compare="image_diff" /> + </test> + <test expect_num_outputs="1"> + <param name="text" value="test.txt" ftype="txt"/> + <param name="stopwords" value="stopwords.txt"/> + <conditional name="fonts"> + <param name="fonts_selector" value="history" /> + <param name="fontfile" value="font.ttf"/> + </conditional> + <param name="min_font_size" value="4"/> + <param name="max_font_size" value="100"/> + <param name="font_step" value="1"/> + <param name="min_word_length" value="0"/> + <param name="max_words" value="200"/> + <param name="width" value="800"/> + <param name="height" value="600"/> + <param name="margin" value="0"/> + <param name="background" value="#ffffff"/> + <param name="mask" value="mask.png"/> + <conditional name="color_choice"> + <param name="color_option" value="color"/> + <param name="color" value="#1f4068"/> + </conditional> + <param name="colormap" value="viridis"/> + <param name="mode" value="RGB"/> + <param name="contour_width" value="8"/> + <param name="contour_color" value="#1f4068"/> <param name="prefer_horizontal" value="0.9"/> <param name="scale" value="1.0"/> <param name="relative_scaling" value="0.0"/>