diff --git a/CHANGELOG.md b/CHANGELOG.md index aad84bd..154e604 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,11 +4,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [v0.0.4] +### Added +- Minimum coverage parameter + ## [v0.0.3] ### Changed - Args parser for fastqingress - Set out_dir option type to ensure output is written to correct directory on Windows -- + ## [v0.0.2] ### Changed - Tidied up docs diff --git a/main.nf b/main.nf index 369dea5..d4fbf03 100644 --- a/main.nf +++ b/main.nf @@ -81,7 +81,7 @@ process medakaVariants { medaka variant --gvcf ${reference} ${sample_id}.hdf ${sample_id}.vcf --verbose medaka tools annotate --debug --pad 25 ${sample_id}.vcf ${reference} ${sample_id}.bam ${sample_id}.annotate.vcf - bcftools filter -e "ALT='.'" ${sample_id}.annotate.vcf | bcftools filter -o ${sample_id}.annotate.filtered.vcf -O v -e "INFO/DP<20" - + bcftools filter -e "ALT='.'" ${sample_id}.annotate.vcf | bcftools filter -o ${sample_id}.annotate.filtered.vcf -O v -e "INFO/DP<${params.min_coverage}" - vcf-annotator ${sample_id}.annotate.filtered.vcf ${genbank} > ${sample_id}.vcf-annotator.vcf """ @@ -99,7 +99,7 @@ process makeConsensus { tuple val(sample_id), val(type), path("${sample_id}.draft.consensus.fasta") """ reference_name=`basename ${reference} .fasta` - awk -v ref=\${reference_name} '{if (\$2<20) print ref"\t"\$1+1}' ${depth} > mask.regions + awk -v ref=\${reference_name} '{if (\$2<${params.min_coverage}) print ref"\t"\$1+1}' ${depth} > mask.regions bgzip ${sample_id}.annotate.filtered.vcf tabix ${sample_id}.annotate.filtered.vcf.gz bcftools consensus --mask mask.regions --mark-del '-' --mark-ins lc --fasta-ref ${reference} -o ${sample_id}.draft.consensus.fasta ${sample_id}.annotate.filtered.vcf.gz diff --git a/nextflow.config b/nextflow.config index 9cb46e4..d6ef686 100644 --- a/nextflow.config +++ b/nextflow.config @@ -17,10 +17,11 @@ params { sample = null sample_sheet = null sanitize_fastq = false - wfversion = "v0.0.3" + wfversion = "v0.0.4" threads = 4 assembly = true medaka_options = null + min_coverage = 20 aws_image_prefix = null aws_queue = null report_name = "report" diff --git a/nextflow_schema.json b/nextflow_schema.json index 89fe082..e75b909 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -1,9 +1,9 @@ { "$schema": "http://json-schema.org/draft-07/schema", "$id": "https://raw.githubusercontent.com/./master/nextflow_schema.json", - "title": "epi2me-labs/wf-template", - "description": "Nextflow workflow template repository.", - "url": "https://github.com/epi2me-labs/wf-template", + "title": "epi2me-labs/wf-mpx", + "description": "A basic workflow for Monkeypox analysis.", + "url": "https://github.com/epi2me-labs/wf-mpx", "type": "object", "definitions": { "basic_input_output_options": { @@ -15,7 +15,7 @@ "out_dir": { "type": "string", "default": "output", - "format": "path", + "format": "directory-path", "description": "Directory for output of all user-facing files." }, "fastq": { @@ -42,6 +42,11 @@ "type": "string", "description": "Pass through options to medaka." }, + "min_coverage": { + "type": "number", + "description": "Coverage threshold for masking in consensus step.", + "default": 20 + }, "reference": { "type": "string", "description": "The reference genome to use for mapping.", @@ -129,7 +134,7 @@ }, "wfversion": { "type": "string", - "default": "v0.0.3", + "default": "v0.0.4", "hidden": true }, "monochrome_logs": {