Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bcftools roh logic update #579

Merged
merged 5 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### `Added`

- Print warning messages if user intends to perform ranking when there are no affected samples [#579](https://github.com/nf-core/raredisease/pull/579)
- Two new parameters `skip_repeat_annotation` and `skip_repeat_calling` to skip calling and annotation of repeat expansions [#574](https://github.com/nf-core/raredisease/pull/574)
- A new parameter `skip_smncopynumbercaller` to skip smncopynumbercaller module[#574](https://github.com/nf-core/raredisease/pull/574)
- A new parameter `skip_sv_calling` to skip sv calling workflow [#572](https://github.com/nf-core/raredisease/pull/572)
Expand All @@ -15,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### `Changed`

- Skip ROH calling with bcftools if there are no affected samples [#579](https://github.com/nf-core/raredisease/pull/579)
- Refactored tool citation list [#577](https://github.com/nf-core/raredisease/pull/577)
- Removed `skip_repeat_analysis` added in #571 [#574](https://github.com/nf-core/raredisease/pull/574)
- Remove several skip parameters that had been included in the pipeline to avoid failed CI tests (see parameters table below) [#574](https://github.com/nf-core/raredisease/pull/574)
Expand Down
3 changes: 2 additions & 1 deletion conf/modules/annotate_genome_snvs.config
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
process {

withName: '.*ANNOTATE_GENOME_SNVS:BCFTOOLS_ROH' {
ext.when = { meta.probands.size()>0 }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

ext.args = { "--samples ${meta.probands.unique().first()} --skip-indels " }
ext.prefix = { "${meta.id}_roh" }
}
Expand All @@ -31,7 +32,7 @@ process {
}

withName: '.*ANNOTATE_GENOME_SNVS:VCFANNO' {
ext.prefix = { "${vcf.simpleName}_vcfanno" }
ext.prefix = { "${meta.prefix}_vcfanno" }
}

withName: '.*ANNOTATE_GENOME_SNVS:UPD_SITES' {
Expand Down
4 changes: 2 additions & 2 deletions docs/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,8 @@ Based on VEP annotations, custom scripts used by the pipeline further annotate e
<summary>Output files</summary>

- `annotate_snv/genome`
- `<case_id>_rhocall_vcfanno_filter_<cadd_vep|vep>.vcf.gz`: file containing bcftools roh, vcfanno, cadd and vep annotations.
- `<case_id>_rhocall_vcfanno_filter_<cadd_vep|vep>.vcf.gz.tbi`: index of the file containing bcftools roh, vcfanno, cadd and vep annotations.
- `<case_id>_<rhocall_vcfanno|vcfanno>_filter_<cadd_vep|vep>.vcf.gz`: file containing bcftools roh, vcfanno, cadd and vep annotations.
- `<case_id>_<rhocall_vcfanno|vcfanno>_filter_<cadd_vep|vep>.vcf.gz.tbi`: index of the file containing bcftools roh, vcfanno, cadd and vep annotations.

</details>

Expand Down
18 changes: 14 additions & 4 deletions subworkflows/local/annotate_genome_snvs.nf
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,21 @@ workflow ANNOTATE_GENOME_SNVS {

ZIP_TABIX_ROHCALL (RHOCALL_ANNOTATE.out.vcf)

ZIP_TABIX_ROHCALL.out.gz_tbi
.map { meta, vcf, tbi -> return [meta, vcf, tbi, []]}
.set { ch_vcf_in }
ch_vcf
.join(ZIP_TABIX_ROHCALL.out.gz_tbi, remainder: true)
.branch { it ->
noroh: it[3].equals(null)
return [it[0] + [prefix: it[0].id], it[1], it[2]]
roh: !(it[3].equals(null))
return [it[0] + [prefix: it[0].id + "_rhocall"], it[3], it[4]]
}
.set { ch_for_mix }

ch_for_mix.noroh.mix(ch_for_mix.roh)
.map { meta, vcf, tbi -> return [meta, vcf, tbi, []] }
.set { ch_vcfanno_in }

VCFANNO (ch_vcf_in, ch_vcfanno_toml, ch_vcfanno_lua, ch_vcfanno_resources)
VCFANNO (ch_vcfanno_in, ch_vcfanno_toml, ch_vcfanno_lua, ch_vcfanno_resources)

VCFANNO.out.vcf
.map {meta, vcf ->
Expand Down
33 changes: 30 additions & 3 deletions workflows/raredisease.nf
Original file line number Diff line number Diff line change
Expand Up @@ -541,8 +541,17 @@ workflow RAREDISEASE {
)
ch_versions = ch_versions.mix(ANN_CSQ_PLI_SNV.out.versions)

ANN_CSQ_PLI_SNV.out.vcf_ann
.filter { it ->
if (it[0].probands.size()==0) {
log.warn("Skipping nuclear SNV ranking since no affected samples are detected in the case")
}
it[0].probands.size()>0
}
.set {ch_ranksnv_nuclear_in}

RANK_VARIANTS_SNV (
ANN_CSQ_PLI_SNV.out.vcf_ann,
ch_ranksnv_nuclear_in,
ch_pedfile,
ch_reduced_penetrance,
ch_score_config_snv
Expand Down Expand Up @@ -582,8 +591,17 @@ workflow RAREDISEASE {
)
ch_versions = ch_versions.mix(ANN_CSQ_PLI_MT.out.versions)

ANN_CSQ_PLI_MT.out.vcf_ann
.filter { it ->
if (it[0].probands.size()==0) {
log.warn("Skipping mitochondrial SNV ranking since no affected samples are detected in the case")
}
it[0].probands.size()>0
}
.set {ch_ranksnv_mt_in}

RANK_VARIANTS_MT (
ANN_CSQ_PLI_MT.out.vcf_ann,
ch_ranksnv_mt_in,
ch_pedfile,
ch_reduced_penetrance,
ch_score_config_mt
Expand Down Expand Up @@ -648,8 +666,17 @@ workflow RAREDISEASE {
)
ch_versions = ch_versions.mix(ANN_CSQ_PLI_SV.out.versions)

ANN_CSQ_PLI_SV.out.vcf_ann
.filter { it ->
if (it[0].probands.size()==0) {
log.warn("Skipping SV ranking since no affected samples are detected in the case")
}
it[0].probands.size()>0
}
.set {ch_ranksnv_sv_in}

RANK_VARIANTS_SV (
ANN_CSQ_PLI_SV.out.vcf_ann,
ch_ranksnv_sv_in,
ch_pedfile,
ch_reduced_penetrance,
ch_score_config_sv
Expand Down