Mercurial > repos > iuc > snipit
view snipit.xml @ 3:877e80114d25 draft default tip
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/snipit commit 64c7062a60708a60b5779fa3406aca8e07828d35
author | iuc |
---|---|
date | Sat, 16 Nov 2024 11:07:42 +0000 |
parents | 92b9fd5f1f9f |
children |
line wrap: on
line source
<tool id="snipit" name="snipit" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="23.1"> <description>Summarise snps relative to a reference sequence</description> <macros> <token name="@TOOL_VERSION@">1.6</token> <token name="@VERSION_SUFFIX@">0</token> <xml name="ref_select" token_help=""> <conditional name="ref"> <param name="select" type="select" label="The reference sequence ..." help="@HELP@"> <option value="first">is the first sequence in the input</option> <option value="by_id">should be picked via its ID</option> </param> <when value="first" /> <when value="by_id"> <param name="id" argument="--reference" type="text" label="ID of reference sequence" /> </when> </conditional> </xml> <xml name="handle_background" tokens="format"> <when value="@FORMAT@"> <param argument="--solid-background" name="transparent_background" type="boolean" truevalue="" falsevalue="--solid-background" label="Plot on transparent background?" /> </when> </xml> </macros> <xrefs> <xref type="bio.tools">snipit</xref> </xrefs> <requirements> <requirement type="package" version="@TOOL_VERSION@">snipit</requirement> </requirements> <version_command>snipit -v</version_command> <command detect_errors="exit_code"><![CDATA[ snipit '$alignment' --sequence-type $mode.sequence_type ## --cds-mode flag broken in this version of snipit ## but this is how it'd be used. ##if str($mode.sequence_type) == 'nt' ## $mode.cds_mode ##end if #if str($mode.ref.select) == 'by_id' -r '$ref.id' #end if #if not str($mode.colouring.palette) --recombi-mode --recombi-references '$mode.colouring.parent1,$mode.colouring.parent2' #else -c $mode.colouring.palette #end if $pos_restrict.show_indels --ambig-mode $pos_restrict.ambig_mode #if len($pos_restrict.include_positions) --include-positions #for $p in $pos_restrict.include_positions '$p.pos' #end for #end if #if len($pos_restrict.exclude_positions) --exclude-positions #for $p in $pos_restrict.exclude_positions '$p.pos' #end for #end if #if str($style.labels.choose) -l '$style.labels.source' #if str($style.labels.choose) == 'custom_csv' --l-header '${style.labels.names_column},${style.labels.labels_column}' #end if #end if $style.position_labels -f $plot.format #if str($plot.format) in ['png', 'svg', 'tiff'] $plot.transparent_background #end if $write_snps #if $dims.height > 0 --height $dims.height #end if #if $dims.width > 0 --width $dims.width #end if $dims.size_option $style.flip_vertical $style.sort.order #if str($style.sort.order) == '--sort-by-mutation-number' $style.sort.high_to_low #else if str($style.sort.order) == '--sort-by-mutations' #echo ','.join([str(p['pos']) for p in $style.sort.positions]) $style.sort.high_to_low #end if ]]></command> <environment_variables> <environment_variable name="MPLCONFIGDIR">.matplotlib</environment_variable> </environment_variables> <inputs> <param name="alignment" format="fasta" type="data" label="Input alignment fasta file" /> <conditional name="mode"> <param argument="--sequence-type" type="select" label="Type of input"> <option value="nt">DNA sequence alignment</option> <option value="aa">Protein sequence alignment</option> </param> <when value="nt"> <expand macro="ref_select" help="Please note that you will HAVE to specify the reference explicitly via its ID if you choose the 'recombinant mutations colouring' scheme and in this case the reference can NOT be one of the recombinant parents." /> <!-- cds-mode flag is broken in this version of snipit so not enabling the param for now. When enabling remember to fix the double dashes! <param argument="- -cds-mode" type="boolean" truevalue="- -cds-mode" falsevalue="" label="Perform coding sequence alignment check?" help="By selecting this option you are indicating that your input is an alignment of coding sequences. The tool will check that all sequence lengths are multiples of three and will fail if that is not the case." /> --> <conditional name="colouring"> <param name="palette" argument="--colour-palette" type="select" label="Plotted Mutations colouring scheme" help="Mutations can be coloured by base change or, alternatively, by their presence/absence in any of two parent sequences in the alignment (recombinant mode)."> <option value="primary">primary</option> <option value="classic" selected="true">classic</option> <option value="classic_extended">classic_extended (only scheme defining colours for ambiguous bases)</option> <option value="purine-pyrimidine">purine-pyrimidine</option> <option value="greyscale">greyscale</option> <option value="wes">wes</option> <option value="verity">verity</option> <option value="">recombinant mutations colouring</option> </param> <when value="primary" /> <when value="classic" /> <when value="classic_extended" /> <when value="purine-pyrimidine" /> <when value="greyscale" /> <when value="wes" /> <when value="verity" /> <when value=""> <param name="parent1" type="text" label="Sequence ID of first recombinant parent sequence in alignment" /> <param name="parent2" type="text" label="Sequence ID of second recombinant parent sequence in alignment" /> </when> </conditional> </when> <when value="aa"> <expand macro="ref_select" /> <conditional name="colouring"> <param name="palette" argument="--colour-palette" type="select" label="Plotted Mutations colouring scheme" help="The only currently available colour scheme for protein sequences is 'ugene', which defines colours for the 20 AAs and all AA ambiguity symbols."> <option value="ugene">ugene</option> </param> <when value="ugene" /> </conditional> </when> </conditional> <section name="pos_restrict" title="Restrict alignment positions to be plotted" expanded="true"> <param argument="--show-indels" type="boolean" truevalue="--show-indels" falsevalue="" label="Include insertion and deletion mutations" /> <param argument="--ambig-mode" type="select" label="Plotting of positions with ambiguity symbols"> <option value="all">Treat ambiguity symbols like mutations; plot all such positions (all)</option> <option value="snps" selected="true">Show ambiguity symbols for positions with mutations in other sequences (snps)</option> <option value="exclude">Never plot positions that involve ambiguous symbols (exclude)</option> </param> <repeat name="include_positions" title="Restrict plot to specific regions/positions" min="0" default="0"> <param argument="--include-positions" name="pos" type="text" label="Include position/region" help="A range (closed, inclusive; one-indexed) or specific position to include in the output, e.g. '100-150' or '100'"> <validator type="regex" message="Either a single position, e.g. 8347, or an interval like 8000-8500 is required">[0-9]+(-[0-9]+)*$</validator> </param> </repeat> <repeat name='exclude_positions' title="Exclude specific regions/positions from plot" min="0" default="0"> <param argument="--exclude-positions" name="pos" type="text" label="Exclude position/region" help="A range (closed, inclusive; one-indexed) or specific position to exclude from the output, e.g. '100-150' or '100'; considered after any '--include-positions'."> <validator type="regex" message="Either a single position, e.g. 8347, or an interval like 8000-8500 is required">[0-9]+(-[0-9]+)*$</validator> </param> </repeat> </section> <section name="style" title="Customize rendering of samples and mutations" expanded="true"> <conditional name="labels"> <param name="choose" argument="-l" type="select" label="Provide custom labels for sequences?"> <option value="">No, just use the sequence identifiers as labels in the plot</option> <option value="simple_csv">Yes, via a simple CSV dataset mapping names to labels</option> <option value="custom_csv">Yes, via a custom CSV dataset with column specification</option> </param> <when value="" /> <when value="simple_csv"> <param argument="--labels" name="source" type="data" format="csv" label="Labels mapping source" help="This expects a CSV dataset with two columns named 'name' and 'label' where the values in the 'name' column must have matches for all sequence IDs (including the reference) in the alignment input." /> </when> <when value="custom_csv"> <param argument="--labels" name="source" type="data" format="csv" label="Labels mapping source" help="Select a CSV dataset with an arbitrary number of named columns here and specify below which column contains the sequence IDs to be mapped and which one the labels to be used instead. The dataset must define mappings for all sequence IDs including the reference." /> <param name="names_column" type="text" label="Name of the sequence ID column" /> <param name="labels_column" type="text" label="Name of the column with desired labels" /> </when> </conditional> <param name="position_labels" type="boolean" truevalue="" falsevalue="--remove-site-text" checked="true" label="Label plotted sites with position" /> <conditional name="sort"> <param name="order" type="select" label="Order of samples in the plot"> <option value="">Go with default</option> <option value="--sort-by-id">Sort by sequence ID/label</option> <option value="--sort-by-mutation-number">Sort by number of mutations</option> <option value="--sort-by-mutations">Sort by bases at specified positions</option> </param> <when value="" /> <when value="--sort-by-id" /> <when value="--sort-by-mutation-number"> <param argument="--high-to-low" type="boolean" truevalue="--high-to-low" falsevalue="" label="Invert sort order" help="If selected sort sequences from highest to lowest number of mutations instead of from lowest to highest." /> </when> <when value="--sort-by-mutations"> <repeat name="positions" title="Sort on" min="1" default="1"> <param name="pos" type="integer" min="1" value="1" label="Sort (alphabetically) by base at position" /> </repeat> <param argument="--high-to-low" type="boolean" truevalue="--high-to-low" falsevalue="" label="Invert resulting sort order" /> </when> </conditional> <param argument="--flip-vertical" type="boolean" truevalue="--flip-vertical" falsevalue="" label="Flip plot orientation?" help="Flip the orientation of the plot so sequences are below the reference rather than above it." /> </section> <conditional name="plot"> <param argument="--format" type="select" value="png" label="Plot output file format"> <option value="png" selected="true">png</option> <option value="jpg">jpg</option> <option value="pdf">pdf</option> <option value="svg">svg</option> <option value="tiff">tiff</option> </param> <when value="jpg" /> <when value="pdf" /> <expand macro="handle_background" format="png" /> <expand macro="handle_background" format="svg" /> <expand macro="handle_background" format="tiff" /> </conditional> <section name="dims" title="Customize plot dimensions" expanded="false"> <param argument="--width" type="float" value="0" min="0" label="Figure width" help="Set to 0 to keep default figure width." /> <param argument="--height" type="float" value="0" min="0" label="Figure height" help="Set to 0 to keep default figure height." /> <param argument="--size-option" type="select" value="scale" label="Plot sizing options"> <option value="--size-option expand">expand</option> <option value="" selected="true">scale</option> </param> </section> <param argument="--write-snps" type="boolean" truevalue="-s" falsevalue="" label="Write out SNPs?" help="Produces extra CSV output with lists of SNPs per sequence in the alignment if enabled." /> </inputs> <outputs> <data name="snp_plot" format="png" label="snipit on ${on_string}: Plot" from_work_dir="snp_plot.*"> <change_format> <when input="plot.format" value="jpg" format="jpg" /> <when input="plot.format" value="pdf" format="pdf" /> <when input="plot.format" value="svg" format="svg" /> <when input="plot.format" value="tiff" format="tiff" /> </change_format> </data> <data name="snps" format="csv" label="snipit on ${on_string}: SNPs" from_work_dir="snps.csv"> <filter>write_snps</filter> <actions> <action name="column_names" type="metadata" default="record,snps,num_snps" /> </actions> </data> </outputs> <tests> <test expect_num_outputs="2"> <param name="alignment" value="input.fasta" /> <param name="write_snps" value="true" /> <conditional name="plot"> <param name="transparent_background" value="true" /> </conditional> <output name="snp_plot" ftype="png" file="snp_plot.png" compare="sim_size" /> <output name="snps" ftype="csv" file="snps.csv" /> </test> <test expect_num_outputs="1"> <param name="alignment" value="input.fasta" /> <conditional name="mode"> <conditional name="ref"> <param name="select" value="by_id" /> <param name="id" value="USA_2" /> </conditional> </conditional> <section name="style"> <param name="flip_vertical" value="true" /> </section> <conditional name="plot"> <param name="format" value="pdf" /> </conditional> <assert_command> <has_text text="-r 'USA_2'" /> <has_text text="--flip-vertical" /> </assert_command> <output name="snp_plot" ftype="pdf" file="snp_plot.pdf" compare="sim_size" /> </test> <test expect_num_outputs="1"> <param name="alignment" value="input.fasta" /> <conditional name="mode"> <conditional name="colouring"> <param name="palette" value="verity" /> </conditional> </conditional> <conditional name="plot"> <param name="format" value="jpg" /> <param name="transparent_background" value="true" /> </conditional> <output name="snp_plot" ftype="jpg" file="snp_plot.jpg" compare="sim_size" /> </test> <test expect_num_outputs="1"> <param name="alignment" value="input.fasta" /> <section name="pos_restrict"> <param name="ambig_mode" value="exclude" /> <repeat name="include_positions"> <param name="pos" value="1-10000" /> </repeat> <repeat name="include_positions"> <param name="pos" value="10001-30000" /> </repeat> <repeat name="exclude_positions"> <param name="pos" value="1000-2000" /> </repeat> </section> <section name="style"> <conditional name="sort"> <param name="order" value="--sort-by-mutations" /> <repeat name="positions"> <param name="pos" value="3" /> </repeat> <repeat name="positions"> <param name="pos" value="1" /> </repeat> <repeat name="positions"> <param name="pos" value="2" /> </repeat> <param name="high_to_low" value="true" /> </conditional> </section> <conditional name="plot"> <param name="format" value="svg" /> <param name="transparent_background" value="true" /> </conditional> <assert_command> <has_text text="--include-positions '1-10000' '10001-30000'" /> <has_text text="--exclude-positions '1000-2000'" /> <has_text text="--ambig-mode exclude" /> <has_text text="--sort-by-mutations 3,1,2" /> <has_text text="--high-to-low" /> </assert_command> <output name="snp_plot" ftype="svg"> <assert_contents> <!-- check that the plot does NOT refer to excluded position 1059, uses darkseagreen (to highlight Ts) and transparent (i.e. NOT white) background --> <has_line_matching expression=".*<text .+>1059</text>" negate="true" /> <has_text text="style="fill: #8fbc8f" /> <not_has_text text="style="fill: #ffffff"" /> </assert_contents> </output> </test> <test expect_num_outputs="1"> <param name="alignment" value="input.fasta" /> <conditional name="mode"> <conditional name="ref"> <param name="select" value="by_id" /> <param name="id" value="reference" /> </conditional> <conditional name="colouring"> <param name="palette" value="" /> <param name="parent1" value="USA_1" /> <param name="parent2" value="USA_5" /> </conditional> </conditional> <conditional name="plot"> <param name="format" value="svg" /> </conditional> <output name="snp_plot" ftype="svg"> <assert_contents> <!-- check that the plot does mention position 1059, uses goldenrod and #EA5463 as colors (to indicate private and parent2 mutations, respectively, in recombi-mode) and uses a solid white background --> <has_line_matching expression=".*<text .+>1059</text>" /> <has_text text="style="fill: #daa520" /> <has_text text="style="fill: #ea5463" /> <has_text text="style="fill: #ffffff"" /> </assert_contents> </output> </test> <test expect_num_outputs="1"> <param name="alignment" value="input.fasta" /> <section name="style"> <conditional name="labels"> <param name="choose" value="custom_csv" /> <param name="source" value="custom_labels.csv" /> <param name="names_column" value="ori" /> <param name="labels_column" value="new" /> </conditional> </section> <conditional name="plot"> <param name="format" value="svg" /> </conditional> <output name="snp_plot" ftype="svg"> <assert_contents> <!-- check that the plot does not mention the original seq IDs but the mapped labels --> <not_has_text text="USA_" /> <has_text text="SAMPLE_" /> </assert_contents> </output> </test> </tests> <help><![CDATA[ **What it does** Snipit finds mutations relative to a reference in a multiple sequence alignment and presents these changes in a nice overview plot. ]]> </help> <citations> <citation type="bibtex"> @UNPUBLISHED{OToole2017, author = {O'Toole, Aine}, title = {snipit: Summarise snps relative to your reference sequence.}, year = {2017}, url = {https://github.com/aineniamh/snipit} } </citation> </citations> </tool>