Skip to content

Commit

Permalink
Update snipit to v1.2 (galaxyproject#4971)
Browse files Browse the repository at this point in the history
* Implement version command through snipit's new -v/--version command line flag

* Implement new --show-indels option

* Handle matplotlib config dir transparently

Moved setting of the corresponding environment variable out of the
command section.

* Document new ref requirement

* Add bio.tools xref

* Add long_description to .shed.yml
  • Loading branch information
wm75 authored Jan 27, 2024
1 parent 7f509fd commit 58fa506
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
4 changes: 3 additions & 1 deletion tools/snipit/.shed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ categories:
- Variant Analysis
- Sequence Analysis
description: Summarise snps relative to a reference sequence
long_description: |
Snipit finds SNPs relative to a reference in a multiple sequence alignment and produces a plot highlighting these changes.
homepage_url: https://github.com/aineniamh/snipit
remote_repository_url: https://github.com/galaxyproject/tools-iuc/tree/master/tools/snipit
remote_repository_url: https://github.com/galaxyproject/tools-iuc/tree/main/tools/snipit
name: snipit
owner: iuc
type: unrestricted
20 changes: 17 additions & 3 deletions tools/snipit/snipit.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
<tool id="snipit" name="snipit" version="@TOOL_VERSION@+galaxy0">
<description>Summarise snps relative to a reference sequence</description>
<macros>
<token name="@TOOL_VERSION@">1.0.7</token>
<token name="@TOOL_VERSION@">1.2</token>
<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[
MPLCONFIGDIR=.matplotlib snipit '$alignment'
snipit '$alignment'
#if str($ref.select) == 'by_id'
-r '$ref.id'
#end if
Expand All @@ -35,6 +39,7 @@
#end if
$dims.size_option
$style.flip_vertical
$show_indels
#if len($pos_restrict.include_positions)
--include-positions
#for $p in $pos_restrict.include_positions
Expand All @@ -61,10 +66,14 @@
-c $style.colouring.palette
#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="ref">
<param name="select" type="select" label="The reference sequence ...">
<param name="select" type="select" label="The reference sequence ..."
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.">
<option value="first">is the first sequence in the input</option>
<option value="by_id">should be picked via its ID</option>
</param>
Expand Down Expand Up @@ -167,6 +176,7 @@
<option value="" selected="true">scale</option>
</param>
</section>
<param argument="--show-indels" type="boolean" truevalue="--show-indels" falsevalue="" label="Try to plot indels" help="This is newly introduced functionality for which you may encounter bugs still." />
<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>
Expand Down Expand Up @@ -279,6 +289,10 @@
</test>
<test expect_num_outputs="1">
<param name="alignment" value="input.fasta" />
<conditional name="ref">
<param name="select" value="by_id" />
<param name="id" value="reference" />
</conditional>
<section name="style">
<conditional name="colouring">
<param name="palette" value="" />
Expand Down
10 changes: 5 additions & 5 deletions tools/snipit/test-data/snps.csv
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
record,snps,num_snps
USA_1,1059CT;3037CT;8782TC;14408CT;23403AG;25563GT;28144CT,52
USA_2,15240CT;17747CT;17858AG;18060CT;21774CT,39
USA_3,1059CT;3037CT;8782TC;13006TC;14408CT;23403AG;25563GT;25688CT;28144CT,68
USA_4,2005CA;2749CA;3037CT;8782TC;14408CT;20268AG;23403AG;28144CT,59
USA_5,17747CT;17858AG;18060CT;20281TC,31
USA_1,1059:CT;3037:CT;8782:TC;14408:CT;23403:AG;25563:GT;28144:CT,7
USA_2,15240:CT;17747:CT;17858:AG;18060:CT;21774:CT,5
USA_3,1059:CT;3037:CT;8782:TC;13006:TC;14408:CT;23403:AG;25563:GT;25688:CT;28144:CT,9
USA_4,2005:CA;2749:CA;3037:CT;8782:TC;14408:CT;20268:AG;23403:AG;28144:CT,8
USA_5,17747:CT;17858:AG;18060:CT;20281:TC,4

0 comments on commit 58fa506

Please sign in to comment.