Skip to content

Commit

Permalink
Added two parameters to increase stringency of variant calling:
Browse files Browse the repository at this point in the history
1. Changed clipping penalty parameter in bwa mem from 5 to 1.  This favors more soft-trimming at the ends of reads.  Since variants at the ends of reads are less reliable, this reduces false-positive variant calling.
2. Expanded ivar trim trimming using the -x offset parameter.  This trims extra bases around primer binding sites.  This also makes variant calling more stringent.

See these issues for more information on these settings:

nf-core/viralrecon#170

andersen-lab/ivar#88
  • Loading branch information
stenglein-lab committed Jul 26, 2022
1 parent fc6a885 commit 701d8c2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 2 additions & 0 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,7 @@ process bwa_align_to_refseq {
rg=$(echo "@RG\\tID:$id\\tSM:$id"_"$sm\\tLB:$id"_"$sm\\tPL:ILLUMINA")
bwa mem \
-L !{params.bwa_clipping_penalty} \
-t !{params.refseq_bwa_threads} \
-R $rg \
!{params.refseq_fasta} !{input_fastq} > !{sample_id}.unsorted.bam
Expand Down Expand Up @@ -621,6 +622,7 @@ process ivar_trim {
"""
ivar trim \
-i $bam \
-x $params.ivar_trim_offset \
-e \
-b $params.primer_bed \
-p "${sample_id}.ivar_trim_unsorted" \
Expand Down
16 changes: 9 additions & 7 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,19 @@ params {
// ------------------
// Trimming settings
// ------------------
always_trim_5p_bases = "0"
always_trim_3p_bases = "0"
post_trim_min_length = "30"
always_trim_5p_bases = "0"
always_trim_3p_bases = "0"
post_trim_min_length = "30"
bwa_clipping_penalty = "1"

// -----------------------------------------
// Fasta format files of primers to trim off
// -----------------------------------------
primer_fasta_5p = "${refseq_dir}/swift_primers.5p.fasta"
primer_fasta_3p = "${refseq_dir}/swift_primers.3p.fasta"
primer_bed = "${refseq_dir}/swift_v2_primers.bed"
ivar_trim = false
primer_fasta_5p = "${refseq_dir}/swift_primers.5p.fasta"
primer_fasta_3p = "${refseq_dir}/swift_primers.3p.fasta"
primer_bed = "${refseq_dir}/swift_v2_primers.bed"
ivar_trim = true
ivar_trim_offset = "5"

// -------------------------
// Variant calling defaults
Expand Down

0 comments on commit 701d8c2

Please sign in to comment.