Skip to content

Commit

Permalink
Merge branch 'min-coverage-param' into 'dev'
Browse files Browse the repository at this point in the history
Adding min coverage parameter

See merge request epi2melabs/workflow-containers/wf-mpx!8
  • Loading branch information
mattdmem committed Jul 12, 2022
2 parents b650610 + 0c352fc commit 038b325
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions main.nf
Expand Up @@ -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
"""
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion nextflow.config
Expand Up @@ -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"
Expand Down
15 changes: 10 additions & 5 deletions 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": {
Expand All @@ -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": {
Expand All @@ -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.",
Expand Down Expand Up @@ -129,7 +134,7 @@
},
"wfversion": {
"type": "string",
"default": "v0.0.3",
"default": "v0.0.4",
"hidden": true
},
"monochrome_logs": {
Expand Down

0 comments on commit 038b325

Please sign in to comment.