Skip to content

Commit

Permalink
Merge pull request #5127 from wm75/ivar-update
Browse files Browse the repository at this point in the history
ivar update
  • Loading branch information
mvdbeek authored Feb 13, 2023
2 parents 28a15bb + d5cd4a3 commit 02d1d48
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 47 deletions.
10 changes: 7 additions & 3 deletions tools/ivar/ivar_consensus.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<tool id="ivar_consensus" name="ivar consensus" version="@TOOL_VERSION@+galaxy2" profile="@PROFILE@">
<tool id="ivar_consensus" name="ivar consensus" version="@TOOL_VERSION@+galaxy0" profile="@PROFILE@">
<description>Call consensus from aligned BAM file</description>
<macros>
<import>macros.xml</import>
Expand All @@ -13,6 +13,7 @@
-p consensus
-q $min_qual
-t $min_freq
-c $min_indel_freq
-m $min_depth
$depth_action
&&
Expand All @@ -34,6 +35,7 @@
]]>
</help>
</param>
<param name="min_indel_freq" argument="-c" type="float" min="0" max="1" value="0.8" label="Minimum indel frequency threshold" help="Same meaning as the &quot;Minimum frequency threshold&quot; above, but applied to indels."/>
<param name="min_depth" argument="-m" type="integer" min="1" max="255" value="10" label="Minimum depth to call consensus"/>
<param name="depth_action" type="select" label="How to represent positions with coverage less than the minimum depth threshold">
<option value="-k">Drop from output (-k)</option>
Expand All @@ -60,12 +62,14 @@
samtools mpileup -A -a -d 0 -Q 0 sorted.bam | ivar consensus [options]
There are four parameters that can be set:
There are five parameters that can be set:
- **Minimum quality**: the minimum quality of a base to be considered in calculations of variant frequencies at a given position
- **Minimum frequency threshold**: the minimum frequency that the most likely base must surpass to be called as the consensus base at a position.
- **Minimum indel frequency threshold**: has the same meaning as the previous threshold, but gets applied to indels specifically. Setting this threshold higher than the threshold applied to SNVs helps reduce indel artefacts in the generated consensus.
- **Minimum depth to call consensus**: the minimum required depth to call a consensus base
- **How to represent positions with coverage less than the minimum depth threshold**: for positions for which the above minimum depth to call a consensus base is not reached, you can choose one of three different actions:
Expand Down
2 changes: 1 addition & 1 deletion tools/ivar/ivar_filtervariants.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<tool id="ivar_filtervariants" name="ivar filtervariants" version="@TOOL_VERSION@+galaxy1" profile="@PROFILE@">
<tool id="ivar_filtervariants" name="ivar filtervariants" version="@TOOL_VERSION@+galaxy0" profile="@PROFILE@">
<description>Filter variants across replicates or multiple samples aligned using the same reference</description>
<macros>
<import>macros.xml</import>
Expand Down
16 changes: 13 additions & 3 deletions tools/ivar/ivar_removereads.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<tool id="ivar_removereads" name="ivar removereads" version="@TOOL_VERSION@+galaxy4" profile="@PROFILE@">
<tool id="ivar_removereads" name="ivar removereads" version="@TOOL_VERSION@+galaxy0" profile="@PROFILE@">
<description>Remove reads from trimmed BAM file</description>
<macros>
<import>macros.xml</import>
Expand Down Expand Up @@ -60,9 +60,14 @@
<param name="computed" value="no"/>
<param name="amplicon_info" value="zika/db/pair_information.tsv"/>
</conditional>
<assert_stdout>
<!-- check that primer pairs are picked up correctly
from the amplicon info file -->
<has_text text="400_18_out_L**&#009;400_18_out_R**&#009;400_23_out_L&#009;400_23_out_R&#009;400_32_out_L&#009;400_32_out_R"/>
</assert_stdout>
<output name="output_bam" ftype="bam">
<assert_contents>
<has_size value="3185672" delta="1000"/>
<has_size value="3130923" delta="1000"/>
</assert_contents>
</output>
</test>
Expand All @@ -73,9 +78,14 @@
<conditional name="amplicons">
<param name="computed" value="yes"/>
</conditional>
<assert_stdout>
<!-- check that primer pairs are picked up correctly
from the autogenerated amplicon info file -->
<has_text text="400_18_out_L**&#009;400_18_out_R**&#009;400_23_out_L&#009;400_23_out_R&#009;400_32_out_L&#009;400_32_out_R"/>
</assert_stdout>
<output name="output_bam" ftype="bam">
<assert_contents>
<has_size value="3185672" delta="1000"/>
<has_size value="3130923" delta="1000"/>
</assert_contents>
</output>
</test>
Expand Down
2 changes: 1 addition & 1 deletion tools/ivar/ivar_trim.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<tool id="ivar_trim" name="ivar trim" version="@TOOL_VERSION@+galaxy6" profile="@PROFILE@">
<tool id="ivar_trim" name="ivar trim" version="@TOOL_VERSION@+galaxy0" profile="@PROFILE@">
<description>Trim reads in aligned BAM</description>
<macros>
<import>macros.xml</import>
Expand Down
6 changes: 3 additions & 3 deletions tools/ivar/ivar_variants.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<tool id="ivar_variants" name="ivar variants" version="@TOOL_VERSION@+galaxy3" profile="@PROFILE@">
<tool id="ivar_variants" name="ivar variants" version="@TOOL_VERSION@+galaxy0" profile="@PROFILE@">
<description>Call variants from aligned BAM file</description>
<macros>
<import>macros.xml</import>
Expand Down Expand Up @@ -27,7 +27,7 @@
<inputs>
<param name="input_bam" type="data" format="bam" label="Bam file" help="Aligned reads, to trim primers and quality"/>
<param name="ref" type="data" format="fasta" label="Reference"/>
<param name="min_qual" argument="-q" type="integer" min="1" value="20" label="Minimum quality score threshold to count base"/>
<param name="min_qual" argument="-q" type="integer" min="0" max="255" value="20" label="Minimum quality score threshold to count base"/>
<param name="min_freq" argument="-t" type="float" min="0" max="1" value="0.03" label="Minimum frequency threshold"/>
<conditional name="output_format">
<param name="choice" type="select" label="Output format">
Expand All @@ -51,7 +51,7 @@
<data name="output_variants_tabular" from_work_dir="./variants.tsv" format="tabular" label="${tool.name} tabular output on ${on_string}">
<filter>output_format['choice'] == 'tabular' or output_format['choice'] == 'tabular_and_vcf'</filter>
<actions>
<action name="column_names" type="metadata" default="REGION,POS,REF,ALT,REF_DP,REF_RV,REF_QUAL,ALT_DP,ALT_RV,ALT_QUAL,ALT_FREQ,TOTAL_DP,PVAL,PASS,GFF_FEATURE,REF_CODON,REF_AA,ALT_CODON,ALT_AA"/>
<action name="column_names" type="metadata" default="REGION,POS,REF,ALT,REF_DP,REF_RV,REF_QUAL,ALT_DP,ALT_RV,ALT_QUAL,ALT_FREQ,TOTAL_DP,PVAL,PASS,GFF_FEATURE,REF_CODON,REF_AA,ALT_CODON,ALT_AA,POS_AA"/>
</actions>
</data>
<data name="output_variants_vcf" from_work_dir="./variants.vcf" format="vcf" label="${tool.name} VCF on ${on_string}">
Expand Down
4 changes: 2 additions & 2 deletions tools/ivar/macros.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0"?>
<macros>
<token name="@TOOL_VERSION@">1.3.1</token>
<token name="@TOOL_VERSION@">1.3.2</token>
<token name="@PROFILE@">21.01</token>
<xml name="requirements">
<requirements>
<requirement type="package" version="@TOOL_VERSION@">ivar</requirement>
<requirement type="package" version="3.10.8">python</requirement>
<requirement type="package" version="1.16">samtools</requirement>
<requirement type="package" version="1.16.1">samtools</requirement>
<yield/>
</requirements>
</xml>
Expand Down
34 changes: 17 additions & 17 deletions tools/ivar/test-data/zika/Z52_a.tsv
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
REGION POS REF ALT REF_DP REF_RV REF_QUAL ALT_DP ALT_RV ALT_QUAL ALT_FREQ TOTAL_DP PVAL PASS GFF_FEATURE REF_CODON REF_AA ALT_CODON ALT_AA
PRV 350 A T 101 101 36 5 5 35 0.0471698 106 0.0304989 FALSE NA NA NA NA NA
PRV 722 C +A 280 234 36 9 0 20 0.0319149 282 0.0349042 FALSE NA NA NA NA NA
PRV 1682 C T 1097 984 37 34 33 37 0.0300088 1133 7.79053e-10 TRUE NA NA NA NA NA
PRV 1965 T G 302 113 37 63 25 37 0.172603 365 4.41891e-21 TRUE NA NA NA NA NA
PRV 2702 A G 31 31 36 1 1 23 0.03125 32 0.507937 FALSE NA NA NA NA NA
PRV 2781 T G 354 70 37 48 8 36 0.117647 408 4.33605e-16 TRUE NA NA NA NA NA
PRV 2922 C T 264 0 36 11 0 36 0.04 275 0.000440953 TRUE NA NA NA NA NA
PRV 3148 Y T 0 0 0 1324 264 36 0.77563 1707 0 TRUE NA NA NA NA NA
PRV 3148 Y C 0 0 0 381 75 36 0.223199 1707 0 TRUE NA NA NA NA NA
PRV 3295 A G 1002 1002 35 38 38 33 0.0365385 1040 4.30837e-11 TRUE NA NA NA NA NA
PRV 5680 C T 27 10 44 8 3 46 0.228571 35 0.000596701 TRUE NA NA NA NA NA
PRV 5723 T G 31 31 35 1 1 21 0.03125 32 0.507937 FALSE NA NA NA NA NA
PRV 6201 A G 10 0 35 2 0 38 0.166667 12 0.26087 FALSE NA NA NA NA NA
PRV 6211 T C 8 0 36 1 0 35 0.111111 9 0.5 FALSE NA NA NA NA NA
PRV 7916 C T 351 289 36 81 78 37 0.1875 432 5.39655e-27 TRUE NA NA NA NA NA
PRV 9713 C T 374 0 37 13 0 35 0.0335917 387 0.00010474 TRUE NA NA NA NA NA
REGION POS REF ALT REF_DP REF_RV REF_QUAL ALT_DP ALT_RV ALT_QUAL ALT_FREQ TOTAL_DP PVAL PASS GFF_FEATURE REF_CODON REF_AA ALT_CODON ALT_AA POS_AA
PRV 350 A T 101 101 36 5 5 35 0.0471698 106 0.0304989 FALSE NA NA NA NA NA NA
PRV 722 C +A 280 234 36 9 0 20 0.0319149 282 0.0349042 FALSE NA NA NA NA NA NA
PRV 1682 C T 1097 984 37 34 33 37 0.0300088 1133 7.79053e-10 TRUE NA NA NA NA NA NA
PRV 1965 T G 302 113 37 63 25 37 0.172603 365 4.41891e-21 TRUE NA NA NA NA NA NA
PRV 2702 A G 31 31 36 1 1 23 0.03125 32 0.507937 FALSE NA NA NA NA NA NA
PRV 2781 T G 354 70 37 48 8 36 0.117647 408 4.33605e-16 TRUE NA NA NA NA NA NA
PRV 2922 C T 264 0 36 11 0 36 0.04 275 0.000440953 TRUE NA NA NA NA NA NA
PRV 3148 Y T 0 0 0 1324 264 36 0.77563 1707 0 TRUE NA NA NA NA NA NA
PRV 3148 Y C 0 0 0 381 75 36 0.223199 1707 0 TRUE NA NA NA NA NA NA
PRV 3295 A G 1002 1002 35 38 38 33 0.0365385 1040 4.30837e-11 TRUE NA NA NA NA NA NA
PRV 5680 C T 27 10 44 8 3 46 0.228571 35 0.000596701 TRUE NA NA NA NA NA NA
PRV 5723 T G 31 31 35 1 1 21 0.03125 32 0.507937 FALSE NA NA NA NA NA NA
PRV 6201 A G 10 0 35 2 0 38 0.166667 12 0.26087 FALSE NA NA NA NA NA NA
PRV 6211 T C 8 0 36 1 0 35 0.111111 9 0.5 FALSE NA NA NA NA NA NA
PRV 7916 C T 351 289 36 81 78 37 0.1875 432 5.39655e-27 TRUE NA NA NA NA NA NA
PRV 9713 C T 374 0 37 13 0 35 0.0335917 387 0.00010474 TRUE NA NA NA NA NA NA
34 changes: 17 additions & 17 deletions tools/ivar/test-data/zika/Z52_a_annotated.tsv
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
REGION POS REF ALT REF_DP REF_RV REF_QUAL ALT_DP ALT_RV ALT_QUAL ALT_FREQ TOTAL_DP PVAL PASS GFF_FEATURE REF_CODON REF_AA ALT_CODON ALT_AA
PRV 350 A T 101 101 36 5 5 35 0.0471698 106 0.0304989 FALSE cds-YP_002790881.1 AAA K TAA *
PRV 722 C +A 280 234 36 9 0 20 0.0319149 282 0.0349042 FALSE NA NA NA NA NA
PRV 1682 C T 1097 984 37 34 33 37 0.0300088 1133 7.79053e-10 TRUE cds-YP_002790881.1 CTG L TTG L
PRV 1965 T G 302 113 37 63 25 37 0.172603 365 4.41891e-21 TRUE cds-YP_002790881.1 GTT V GGT G
PRV 2702 A G 31 31 36 1 1 23 0.03125 32 0.507937 FALSE cds-YP_002790881.1 AGA R GGA G
PRV 2781 T G 354 70 37 48 8 36 0.117647 408 4.33605e-16 TRUE cds-YP_002790881.1 GTG V GGG G
PRV 2922 C T 264 0 36 11 0 36 0.04 275 0.000440953 TRUE cds-YP_002790881.1 ACT T ATT I
PRV 3148 Y T 0 0 0 1324 264 36 0.77563 1707 0 TRUE cds-YP_002790881.1 GAY X GAT D
PRV 3148 Y C 0 0 0 381 75 36 0.223199 1707 0 TRUE cds-YP_002790881.1 GAY X GAC D
PRV 3295 A G 1002 1002 35 38 38 33 0.0365385 1040 4.30837e-11 TRUE cds-YP_002790881.1 GCA A GCG A
PRV 5680 C T 27 10 44 8 3 46 0.228571 35 0.000596701 TRUE cds-YP_002790881.1 TTC F TTT F
PRV 5723 T G 31 31 35 1 1 21 0.03125 32 0.507937 FALSE cds-YP_002790881.1 TGA * GGA G
PRV 6201 A G 10 0 35 2 0 38 0.166667 12 0.26087 FALSE cds-YP_002790881.1 GAA E GGA G
PRV 6211 T C 8 0 36 1 0 35 0.111111 9 0.5 FALSE cds-YP_002790881.1 TGT C TGC C
PRV 7916 C T 351 289 36 81 78 37 0.1875 432 5.39655e-27 TRUE cds-YP_002790881.1 CAG Q TAG *
PRV 9713 C T 374 0 37 13 0 35 0.0335917 387 0.00010474 TRUE cds-YP_002790881.1 CTT L TTT F
REGION POS REF ALT REF_DP REF_RV REF_QUAL ALT_DP ALT_RV ALT_QUAL ALT_FREQ TOTAL_DP PVAL PASS GFF_FEATURE REF_CODON REF_AA ALT_CODON ALT_AA POS_AA
PRV 350 A T 101 101 36 5 5 35 0.0471698 106 0.0304989 FALSE POLY:cds-YP_002790881.1 AAA K TAA * 82
PRV 722 C +A 280 234 36 9 0 20 0.0319149 282 0.0349042 FALSE NA NA NA NA NA NA
PRV 1682 C T 1097 984 37 34 33 37 0.0300088 1133 7.79053e-10 TRUE POLY:cds-YP_002790881.1 CTG L TTG L 526
PRV 1965 T G 302 113 37 63 25 37 0.172603 365 4.41891e-21 TRUE POLY:cds-YP_002790881.1 GTT V GGT G 620
PRV 2702 A G 31 31 36 1 1 23 0.03125 32 0.507937 FALSE POLY:cds-YP_002790881.1 AGA R GGA G 866
PRV 2781 T G 354 70 37 48 8 36 0.117647 408 4.33605e-16 TRUE POLY:cds-YP_002790881.1 GTG V GGG G 892
PRV 2922 C T 264 0 36 11 0 36 0.04 275 0.000440953 TRUE POLY:cds-YP_002790881.1 ACT T ATT I 939
PRV 3148 Y T 0 0 0 1324 264 36 0.77563 1707 0 TRUE POLY:cds-YP_002790881.1 GAY X GAT D 1014
PRV 3148 Y C 0 0 0 381 75 36 0.223199 1707 0 TRUE POLY:cds-YP_002790881.1 GAY X GAC D 1014
PRV 3295 A G 1002 1002 35 38 38 33 0.0365385 1040 4.30837e-11 TRUE POLY:cds-YP_002790881.1 GCA A GCG A 1063
PRV 5680 C T 27 10 44 8 3 46 0.228571 35 0.000596701 TRUE POLY:cds-YP_002790881.1 TTC F TTT F 1858
PRV 5723 T G 31 31 35 1 1 21 0.03125 32 0.507937 FALSE POLY:cds-YP_002790881.1 TGA * GGA G 1873
PRV 6201 A G 10 0 35 2 0 38 0.166667 12 0.26087 FALSE POLY:cds-YP_002790881.1 GAA E GGA G 2032
PRV 6211 T C 8 0 36 1 0 35 0.111111 9 0.5 FALSE POLY:cds-YP_002790881.1 TGT C TGC C 2035
PRV 7916 C T 351 289 36 81 78 37 0.1875 432 5.39655e-27 TRUE POLY:cds-YP_002790881.1 CAG Q TAG * 2604
PRV 9713 C T 374 0 37 13 0 35 0.0335917 387 0.00010474 TRUE POLY:cds-YP_002790881.1 CTT L TTT F 3203

0 comments on commit 02d1d48

Please sign in to comment.