Skip to content

Commit

Permalink
Add found_in tag to SV-calling (#417)
Browse files Browse the repository at this point in the history
  • Loading branch information
fellen31 authored Oct 8, 2024
1 parent 98ec9a1 commit 7d187a6
Show file tree
Hide file tree
Showing 8 changed files with 134 additions and 173 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#388](https://github.com/genomic-medicine-sweden/nallo/pull/388) - Added longphase as the default phaser
- [#388](https://github.com/genomic-medicine-sweden/nallo/pull/388) - Added single-sample tbi output to the short variant calling subworkflow
- [#393](https://github.com/genomic-medicine-sweden/nallo/pull/393) - Added a new `--minimap2_read_mapping_preset` parameter
- [#403](https://github.com/genomic-medicine-sweden/nallo/pull/403) - Added `FOUND_IN=hificnv` tags to CNV output
- [#403](https://github.com/genomic-medicine-sweden/nallo/pull/403) - Added `FOUND_IN=hificnv` tags to CNV calling output
- [#417](https://github.com/genomic-medicine-sweden/nallo/pull/417) - Added `FOUND_IN=deepvariant` tags to SNV calling output

### `Changed`

Expand All @@ -43,9 +44,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#403](https://github.com/genomic-medicine-sweden/nallo/pull/403) - Revert [#404](https://github.com/genomic-medicine-sweden/nallo/pull/404)
- [#404](https://github.com/genomic-medicine-sweden/nallo/pull/404) - Changed to only run nf-tests where files have changes compared to the base branch
- [#407](https://github.com/genomic-medicine-sweden/nallo/pull/407) - Changed echtvar example file in docs
- [#406](https://github.com/genomic-medicine-sweden/nallo/issues/406) - Updated genmod to version 3.8.3
- [#410](https://github.com/genomic-medicine-sweden/nallo/pull/410) - Updated genmod to version 3.8.3
- [#411](https://github.com/genomic-medicine-sweden/nallo/pull/411) - Updated longphase module to most recent version. ([#409](https://github.com/genomic-medicine-sweden/nallo/issues/409)).
- [#416](https://github.com/genomic-medicine-sweden/nallo/pull/416) - Updated WhatsHap to 2.3 and added the `--use-supplementary` flag to use supplementary reads for phasing by default. Changed modules to use biocontainers instead of custom containers. ([#296](https://github.com/genomic-medicine-sweden/nallo/issues/296))
- [#417](https://github.com/genomic-medicine-sweden/nallo/pull/417) - Updated SNV annotation tests to use correct configuration, and snapshot the md5sum, and summary of the variants

### `Removed`

Expand Down
10 changes: 10 additions & 0 deletions conf/modules/short_variant_calling.config
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ process {
]
}

withName: '.*:SHORT_VARIANT_CALLING:ADD_FOUND_IN_TAG' {
ext.prefix = { "${meta.id}_found_in" }
ext.args = '--no-version'
ext.args2 = [
'--output-type b',
'--no-version'
].join(' ')
}


withName: '.*:SHORT_VARIANT_CALLING:DEEPVARIANT' {
ext.prefix = { intervals ? "${meta.id}_${intervals}_deepvariant" : "${meta.id}_deepvariant" }
ext.args = { [
Expand Down
15 changes: 11 additions & 4 deletions subworkflows/local/short_variant_calling/main.nf
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//
// Workflow to call and merge SNVs
//
include { ADD_FOUND_IN_TAG } from '../../../modules/local/add_found_in_tag/main'
include { BCFTOOLS_CONCAT } from '../../../modules/nf-core/bcftools/concat/main'
include { BCFTOOLS_FILLTAGS } from '../../../modules/local/bcftools/filltags/main'
include { BCFTOOLS_NORM as BCFTOOLS_NORM_MULTISAMPLE } from '../../../modules/nf-core/bcftools/norm/main'
Expand Down Expand Up @@ -84,12 +85,18 @@ workflow SHORT_VARIANT_CALLING {
BCFTOOLS_FILLTAGS ( GLNEXUS.out.bcf )
ch_versions = ch_versions.mix(BCFTOOLS_FILLTAGS.out.versions)

BCFTOOLS_FILLTAGS.out.vcf
.map { meta, vcf -> [ meta, vcf, [] ] }
.set { bcftools_norm_in }
// Annotate with FOUND_IN tag
ADD_FOUND_IN_TAG (
BCFTOOLS_FILLTAGS.out.vcf.map { meta, vcf -> [ meta, vcf, [] ] },
"deepvariant"
)
ch_versions = ch_versions.mix(ADD_FOUND_IN_TAG.out.versions)

// Decompose and normalize variants
BCFTOOLS_NORM_MULTISAMPLE ( bcftools_norm_in, ch_fasta )
BCFTOOLS_NORM_MULTISAMPLE (
ADD_FOUND_IN_TAG.out.vcf.map { meta, vcf -> [ meta, vcf, [] ] },
ch_fasta
)
ch_versions = ch_versions.mix(BCFTOOLS_NORM_MULTISAMPLE.out.versions)

emit:
Expand Down
132 changes: 84 additions & 48 deletions subworkflows/local/short_variant_calling/tests/main.nf.test.snap

Large diffs are not rendered by default.

21 changes: 15 additions & 6 deletions subworkflows/local/short_variant_calling/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
process {
withName: 'DEEPVARIANT' {
withName: 'SHORT_VARIANT_CALLING:DEEPVARIANT' {
ext.prefix = { intervals ? "${meta.id}_${intervals}_deepvariant" : "${meta.id}_deepvariant" }
ext.args = { [
'--model_type WGS',
Expand All @@ -8,19 +8,19 @@ process {
].join(' ') }
}

withName: 'GLNEXUS' {
withName: 'SHORT_VARIANT_CALLING:GLNEXUS' {
ext.args = '--config DeepVariant_unfiltered'
}

withName: 'BCFTOOLS_CONCAT' {
withName: 'SHORT_VARIANT_CALLING:BCFTOOLS_CONCAT' {
ext.prefix = { "${meta.id}_concat" }
ext.args = [
'--no-version',
'--allow-overlaps'
].join(' ')
}

withName: 'BCFTOOLS_NORM_MULTISAMPLE' {
withName: 'SHORT_VARIANT_CALLING:BCFTOOLS_NORM_MULTISAMPLE' {
ext.prefix = { "${meta.id}_norm_multisample" }
ext.args = [
'--no-version',
Expand All @@ -31,7 +31,7 @@ process {
].join(' ')
}

withName: 'BCFTOOLS_NORM_SINGLESAMPLE' {
withName: 'SHORT_VARIANT_CALLING:BCFTOOLS_NORM_SINGLESAMPLE' {
ext.prefix = { "${meta.id}_norm_singlesample" }
ext.args = [
'--no-version',
Expand All @@ -42,12 +42,21 @@ process {
].join(' ')
}

withName: 'BCFTOOLS_FILLTAGS' {
withName: 'SHORT_VARIANT_CALLING:BCFTOOLS_FILLTAGS' {
ext.prefix = { "${meta.id}_ac" }
ext.args = [
'--no-version',
'--output-type u'
].join(' ')
}

withName: 'SHORT_VARIANT_CALLING:ADD_FOUND_IN_TAG' {
ext.prefix = { "${meta.id}_found_in" }
ext.args = '--no-version'
ext.args2 = [
'--output-type z',
'--no-version'
].join(' ')
}

}
4 changes: 2 additions & 2 deletions subworkflows/local/snv_annotation/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ nextflow_workflow {
{ assert snapshot(
workflow.out.versions,
file(workflow.out.tbi.get(0).get(1)).name,
path(workflow.out.vcf.get(0).get(1)).linesGzip[48..118], // Stable
path(workflow.out.vcf.get(0).get(1)).linesGzip[121..150] // Stable
path(workflow.out.vcf.get(0).get(1)).vcf.variantsMD5,
path(workflow.out.vcf.get(0).get(1)).vcf.summary,
).match() }
)
}
Expand Down
Loading

0 comments on commit 7d187a6

Please sign in to comment.