view wgmlst_remove.xml @ 2:4394da33d837 draft default tip

planemo upload for repository https://github.com/bvalot/pyMLST commit 142042a3856f8886031cacaa4fb28743a1bcd540
author bvalot
date Wed, 15 Nov 2023 12:22:07 +0000
parents 5b2c48fa0175
children
line wrap: on
line source

<tool id="wgmlst_remove_wrapper"
	  name="Remove strain/gene to cg/wgMLST database"
	  version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="20.05">
  <description></description>
  <macros>
    <import>macro.xml</import>
  </macros>
  <expand macro="requirements" />
  <stdio>
    <exit_code range="1:" level="fatal" />
  </stdio>
  <version_command>wgMLST -v</version_command>
  <command><![CDATA[
	cp '${database}' '${databaseout}' && wgMLST remove 
	#if $element == "strain"
	  --strains
	#else 
	  --genes
	#end if
	#if $data.input == "textinput"
	  '${databaseout}' 
	  #for $strain in $data.textelement.split(" ")
	    '$strain'
	  #end for
	#else
	  -f '${data.fileelement}' '${databaseout}'
	#end if
	#if $log
	  2> '${logfile}'
	#end if
	]]>
  </command>
  <inputs>
	<param name="database" type="data"
           format="sqlite"
           label="cg/wgMLST database"
           help="Sqlite format from cg/wgMLST database" />
	<param name="element" type="select" label="Select type of data to remove">
        <option value="strain" selected="true">Strain(s)</option>
        <option value="gene">Gene(s)</option>
	  </param>
	<conditional name="data">
	  <param name="input" type="select" label="Select source of data">
        <option value="textinput" selected="true">List elements manually</option>
        <option value="fileinput">List elements from file</option>
	  </param>
	  <when value="textinput">
		<param name="textelement" type="text" value="" optional="false" size="50"
               label="Name of strain/gene to removed from database"
               help="Separated each strain/gene by a space and quote it"/>
      </when>	  
	  <when value="fileinput">
        <param name="fileelement" type="data" format="txt"
               label="File list of strain/gene to removed"
			   help="txt format" />
      </when>	
	</conditional>
	<param name="log" type="boolean" checked="true"
           label="Write log file" />
  </inputs>
  <outputs>
    <data name="databaseout" format="sqlite" label="${database.name}">
	</data>
    <data name="logfile" format="txt" label="${tool.name} on ${database.name}: log">
	  <filter>log</filter>
	</data>	
  </outputs>
  <tests>
	<test expect_num_outputs="2">
	  <param name="database" value="wgmlst_ecoli.db" />
	  <param name="element" value="strain" />	  
	  <conditional name="data">
		<param name="input" value="textinput" />
		<param name="textelement" value="EEES_003 EEES_004" />
	  </conditional>
	  <output name="logfile" ftype="txt">
	  <assert_contents>
		<has_text text="EEES_004 : OK" />
		<has_text text="EEES_003 : OK" />
	  </assert_contents>
	  </output>
	</test>
	<test expect_num_outputs="2">
	  <param name="database" value="wgmlst_ecoli.db" />
	  <param name="element" value="gene" />	  
	  <conditional name="data">
		<param name="input" value="fileinput" />
		<param name="fileelement" ftype="txt" value="wgmlst_ecoli.db.gene_to_removed" />
	  </conditional>
	  <output name="logfile" ftype="txt">
	  <assert_contents>
		<has_text text="b0004 : OK" />
		<has_text text="C-RS24040 : OK" />
		<has_text text="ECs4518 : OK" />
	  </assert_contents>
	  </output>
	</test>
  </tests>
  <help>
**What it does**

Remove STRAINS or GENES from a cg/wgMLST DATABASE.

You can indicated the STRAIN or GENE to remove:
 - Typing element separated by space
 - Using a file containing these elements

**Options:**
  --strains / --genes  Choose the item you wish to remove
  -f, --file FILENAME  File list of genes or strains to removed on the wgMLST database.

**License and citation**

This Galaxy tool is Copyright © 2022 `B. Valot` and is released under the `GPL3 license`.
  </help>
  <citations>
  </citations>
</tool>