Mercurial > repos > bgruening > wordcloud
view wordcloud.xml @ 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 |
line wrap: on
line source
<tool id="wordcloud" name="Generate a word cloud" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@" license="MIT"> <description>with highly customizable appearance</description> <macros> <token name="@TOOL_VERSION@">1.9.4</token> <token name="@VERSION_SUFFIX@">1</token> <token name="@PROFILE@">23.0</token> </macros> <requirements> <requirement type="package" version="@TOOL_VERSION@">wordcloud</requirement> </requirements> <version_command>wordcloud_cli --version</version_command> <command detect_errors="exit_code"><![CDATA[ wordcloud_cli --imagefile 'output.png' --text $text #if $stopwords --stopwords $stopwords #end if #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 #if $max_font_size --max_font_size $max_font_size #end if #if $font_step --font_step $font_step #end if #if $min_word_length --min_word_length $min_word_length #end if #if str($max_words): --max_words $max_words #end if #if str($width): --width $width #end if #if str($height): --height $height #end if #if str($margin): --margin $margin #end if #if $background --background '$background' #end if #if $mask --mask $mask #end if #if $color_choice == "color": --color '$color' #else if $color_choice == "colormask": --colormask $colormask #end if #if $colormap --colormap $colormap #end if #if $mode --mode $mode #end if #if $contour_width --contour_width $contour_width #end if #if $contour_color --contour_color '$contour_color' #end if #if str($prefer_horizontal): --prefer_horizontal $prefer_horizontal #end if #if str($scale): --scale $scale #end if #if str($relative_scaling): --relative_scaling $relative_scaling #end if $no_collocations $include_numbers $no_normalize_plurals $repeat #if str($random_state): --random_state $random_state #end if ]]> </command> <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"/> <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"/> <param argument="--min_word_length" type="integer" value="0" optional ="True" label="Minimum number of letters a word must have to be included"/> <param argument="--max_words" type="integer" min="1" value="200" optional="true" label="Maximum number of words"/> <param argument="--width" type="integer" min="1" value="400" optional="true" label="Define output image width"/> <param argument="--height" type="integer" min="1" value="200" optional="true" label="Define output image height"/> <param argument="--margin" type="integer" value="2" label="Spacing to leave around words"/> <param argument="--background" type="color" value="#000000" optional="true" label="Use given color as background color for the image"> <validator type="regex" message="Please select a valid RGB color">[#][0-9A-Fa-f]{6}</validator> </param> <param argument="--mask" type="data" format="png" optional="true" label="Mask to use for the image form"/> <conditional name="color_choice" label="Choose color option"> <param name="color_option" type="select" label="Color option"> <option value="color">Color</option> <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"> <validator type="regex" message="Please select a valid RGB color">[#][0-9A-Fa-f]{6}</validator> </param> </when> <when value="colormask"> <param argument="--colormask" type="data" format="png" optional="true" label="Color Mask" help="Upload a color mask image"/> </when> </conditional> <param argument="--colormap" type="select" value="viridis" optional="true" label="Matplotlib colormap name"> <option value="viridis">viridis</option> <option value="plasma">plasma</option> <option value="inferno">inferno</option> <option value="magma">magma</option> <option value="cividis">cividis</option> <option value="Greys">Greys</option> <option value="Purples">Purples</option> <option value="Blues">Blues</option> <option value="Greens">Greens</option> <option value="Oranges">Oranges</option> <option value="Reds">Reds</option> <option value="YlOrBr">YlOrBr</option> <option value="YlOrRd">YlOrRd</option> <option value="OrRd">OrRd</option> <option value="PuRd">PuRd</option> <option value="RdPu">RdPu</option> <option value="BuPu">BuPu</option> <option value="GnBu">GnBu</option> <option value="PuBu">PuBu</option> <option value="YlGnBu">YlGnBu</option> <option value="PuBuGn">PuBuGn</option> <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"> <option value="RGB">RGB</option> <option value="RGBA">RGBA</option> </param> <param argument="--contour_width" type="float" min="0" value="0" optional="true" label="Contour width" help="Use given color as mask contour color"/> <param argument="--contour_color" type="color" value="#000000" optional="true" label="Contour color"> <validator type="regex" message="Please select a valid RGB color">[#][0-9A-Fa-f]{6}</validator> </param> <param argument="--prefer_horizontal" type="float" min="0" max="1" value="0.9" optional="true" label="Ratio of times to try horizontal fitting as opposed to vertical"/> <param argument="--scale" type="float" value="1.0" optional="True" label="Scaling between computation and drawing"/> <param argument="--relative_scaling" type="float" min="0.0" max="1.0" value="0.0" optional="true" label="Scaling of words by frequency (0 - 1)"/> <param argument="--no_collocations" type="boolean" truevalue="--no_collocations" falsevalue="" value="True" label="Do not add collocations (bigrams) to word cloud"/> <param argument="--include_numbers" type="boolean" truevalue="--include_numbers" falsevalue="" value="False" label="Whether to include numbers as phrases or not"/> <param argument="--no_normalize_plurals" type="boolean" truevalue="--no_normalize_plurals" falsevalue="" label="Whether to remove trailing s from words"/> <param argument="--repeat" type="boolean" truevalue="--repeat" falsevalue="" label="Whether to repeat words and phrases until max_words or min_font_size is reached"/> <param argument="--random_state" type="integer" value="10" label="Random seed" /> </inputs> <outputs> <data name="output" format="png" label="Word cloud image" from_work_dir="output.png"/> </outputs> <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"/> <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"/> <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"/> <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"/> <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> </tests> <help><![CDATA[ A word cloud is a visual representation (image) of word data. In other words, it is a collection, or cluster, of words depicted in different sizes. The bigger and bolder the word appears, the more often it's mentioned within a given text and the more important it is. ]]></help> <citations> <citation type="bibtex"> @misc{amueller2018wordcloud, title={Word Clouds with Python}, author={Amueller, Sebastian}, year={2018}, url={https://amueller.github.io/word_cloud/} } </citation> </citations> </tool>