comparison ivar_consensus.xml @ 0:f362150bef41 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ivar/ commit 4b0b7fb6c79dcd437392a496a99301d124c9f1dd"
author iuc
date Mon, 30 Mar 2020 06:37:01 -0400
parents
children 3e4f434a69c6
comparison
equal deleted inserted replaced
-1:000000000000 0:f362150bef41
1 <tool id="ivar_consensus" name="ivar consensus" version="@VERSION@+galaxy0">
2 <description>Call consensus from aligned BAM file</description>
3 <macros>
4 <import>macros.xml</import>
5 </macros>
6 <expand macro="requirements" />
7 <expand macro="version_command" />
8 <command detect_errors="exit_code"><![CDATA[
9 #import re
10 #set $clean_name = re.sub('[^\w\-]', '_', str($input_bam.element_identifier))
11 ln -s '$input_bam' sorted.bam &&
12 samtools mpileup -A -d 0 -Q 0 sorted.bam | ivar consensus
13 -p consensus
14 -q $min_qual
15 -t $min_freq
16 -m $min_depth
17 $filter_depth
18 #if $gap
19 -n N
20 #end if
21 &&
22 sed -i "s|consensus|$clean_name|" consensus.fa
23 ]]> </command>
24 <inputs>
25 <param name="input_bam" type="data" format="bam" label="Bam file" help="Aligned reads, to trim primers and quality"/>
26 <param name="min_qual" argument="-q" type="integer" min="0" value="20" label="Minimum quality score threshold to count base"/>
27 <param name="min_freq" argument="-t" type="float" min="0" max="1" value="0.0" label="Minimum frequency threshold">
28 <help>
29 <![CDATA[
30 0 - Majority or most common base <br/>
31 0.2 - Bases that make up atleast 20% of the depth at a position <br/>
32 0.5 - Strict or bases that make up atleast 50% of the depth at a position <br/>
33 0.9 - Strict or bases that make up atleast 90% of the depth at a position <br/>
34 1 - Identical or bases that make up 100% of the depth at a position. Will have highest ambiguities
35 ]]>
36 </help>
37 </param>
38 <param name="min_depth" argument="-m" type="integer" min="1" value="10" label="Minimum depth to call consensus"/>
39 <param name="filter_depth" argument="-k" type="boolean" truevalue="-k" falsevalue="" checked="false" label="Exclude regions with smaller depth than the minimum threshold"/>
40 <param name="gap" argument="-n" type="boolean" truevalue="true" falsevalue="false" checked="false" label="Use N instead of - for regions with less than minimum coverage"/>
41 </inputs>
42 <outputs>
43 <data name="consensus" format="fasta" label="${tool.name} on ${on_string} Consensus" from_work_dir="consensus.fa"/>
44 </outputs>
45 <tests>
46 <test>
47 <param name="input_bam" value="covid19/PC00101P_sub.trimmed.sorted.bam" />
48 <param name="gap" value="true" />
49 <output name="consensus" file="covid19/PC00101P_sub.fa" ftype="fasta" compare="contains" lines_diff="1"/>
50 </test>
51 </tests>
52 <help><![CDATA[
53 .. class:: infomark
54
55 To generate a consensus sequence iVar uses the output of samtools mpileup
56 command. The mpileup output must be piped into ivar consensus
57
58 The command for this wrapper is from https://github.com/andersen-lab/ivar/blob/master/pipeline_consensus/Snakefile :
59
60 samtools mpileup -A -d 0 -Q 0 sorted.bam | ivar consensus [options]
61
62 There are five parameters that can be set:
63
64 - Minimum quality (Default: 20): the minimum quality of a base to be considered in calculations of variant frequencies at a given position
65
66 - Minimum frequency threshold (Default: 0): the minimum frequency that a base must match to be called as the consensus base at a position.
67
68 - Minimum depth to call a consensus (Default: 1): the minimum required depth to call a consensus
69
70 - Filter depth is a flag to exclude nucleotides from regions with depth less than the minimum depth and a character to call in regions with coverage lower than the speicifed minimum depth(Default: '-'). If this flag is set then these regions are not included in the consensus sequence. If it is not set then by default, a '-' is called in these regions.
71 - You can also specfy which character you want to add to the consensus to cover regions with depth less than the minimum depth. This can be done using gap option. It takes of two values: '-' or 'N'.
72 ]]> </help>
73 <expand macro="citations" />
74 </tool>