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

Add variant caller to bcftools/vcftools + multiqc #618

Merged
merged 17 commits into from
Jul 14, 2022
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#630](https://github.com/nf-core/sarek/pull/630) - Update citations file
- [#632](https://github.com/nf-core/sarek/pull/632) - Update `snpEff` version to `5.1` and cache up to `105`
- [#632](https://github.com/nf-core/sarek/pull/632) - Update `VEP` version to `106.1` and cache up to `106`
- [#618](https://github.com/nf-core/sarek/pull/618) - Update `multiqc` module update test yml files
- [#618](https://github.com/nf-core/sarek/pull/618) - Update test yml files

### Fixed

Expand Down Expand Up @@ -126,6 +128,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#619](https://github.com/nf-core/sarek/pull/619) - Fix issue with checking samplesheet content with AWS
- [#628](https://github.com/nf-core/sarek/pull/628) - Fix issue with value converting to string before schema validation
- [#628](https://github.com/nf-core/sarek/pull/628) - Fix dbsnp check issue with `--step annotate`
- [#618](https://github.com/nf-core/sarek/pull/618) - Fix `bcftools/vcftools` sample labelling in multiqc report
- [#618](https://github.com/nf-core/sarek/pull/618) - Fix issue with tiddit [#621](https://github.com/nf-core/sarek/issues/621)
- [#618](https://github.com/nf-core/sarek/pull/618) - Fix channel issue with `targets.bed` in prepare_intervals

### Deprecated

Expand Down
75 changes: 43 additions & 32 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -516,17 +516,18 @@ process{

// DEEPVARIANT
withName: 'MERGE_DEEPVARIANT_.*' {
ext.prefix = {"${meta.id}.deepvariant"}
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/${meta.id}/deepvariant" },
pattern: "*{vcf.gz,vcf.gz.tbi}"
]
}
withName: 'MERGE_DEEPVARIANT_GVCF' {
ext.prefix = {"${meta.id}.g"}
ext.prefix = {"${meta.id}.deepvariant.g"}
}
withName: 'DEEPVARIANT' {
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}" : "${meta.id}_${intervals.simpleName}" }
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.deepvariant" : "${meta.id}.deepvariant.${intervals.simpleName}" }
ext.args = { params.wes ? "--model_type WES" : "--model_type WGS" }
ext.when = { params.tools && params.tools.contains('deepvariant') }
publishDir = [
Expand All @@ -537,6 +538,7 @@ process{
]
}
withName : 'TABIX_VC_DEEPVARIANT_.*' {
ext.prefix = {"${meta.id}.deepvariant"}
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/${meta.id}/deepvariant" },
Expand All @@ -546,15 +548,16 @@ process{

// FREEBAYES
withName: 'MERGE_FREEBAYES' {
ext.prefix = { "${meta.id}.freebayes" }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/${meta.id}/freebayes" },
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}
withName: 'FREEBAYES' {
//To make sure no naming conflicts ensue with module BCFTOOLS_SORT & the naming being correct in the output folder
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.freebayes" : "${meta.id}_${target_bed.simpleName}.freebayes" }
//To make sure no naming conflicts ensure with module BCFTOOLS_SORT & the naming being correct in the output folder
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}" : "${meta.id}.${target_bed.simpleName}" }
ext.args = '--min-alternate-fraction 0.1 --min-mapping-quality 1'
ext.when = { params.tools && params.tools.contains('freebayes') }
publishDir = [
Expand All @@ -563,7 +566,7 @@ process{
}

withName: 'BCFTOOLS_SORT' {
ext.prefix = { "${vcf.baseName.minus(".freebayes.vcf")}" }
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.freebayes" : "${vcf.minus("vcf")}.sort" }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/${meta.id}/" },
Expand All @@ -582,7 +585,7 @@ process{

// HAPLOTYPECALLER
withName: 'MERGE_HAPLOTYPECALLER.*' {
ext.prefix = { params.joint_germline ? "${meta.id}.g" : "${meta.id}" }
ext.prefix = { params.joint_germline ? "${meta.id}.haplotypecaller.g" : "${meta.id}.haplotypecaller" }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/${meta.id}/haplotypecaller" },
Expand All @@ -592,7 +595,7 @@ process{

withName: 'HAPLOTYPECALLER' {
ext.args = { params.joint_germline ? "-ERC GVCF" : "" }
ext.prefix = { meta.num_intervals <= 1 ? ( params.joint_germline ? "${meta.id}.g" : "${meta.id}" ) : ( params.joint_germline ? "${meta.id}_${intervals.simpleName}.g" :"${meta.id}_${intervals.simpleName}" ) }
ext.prefix = { meta.num_intervals <= 1 ? ( params.joint_germline ? "${meta.id}.haplotypecaller.g" : "${meta.id}.haplotypecaller" ) : ( params.joint_germline ? "${meta.id}.haplotypecaller.${intervals.simpleName}.g" :"${meta.id}.haplotypecaller.${intervals.simpleName}" ) }
ext.when = { params.tools && params.tools.contains('haplotypecaller') }
publishDir = [
mode: params.publish_dir_mode,
Expand All @@ -607,6 +610,7 @@ process{
]
}
withName: 'FILTERVARIANTTRANCHES' {
ext.prefix = {"${meta.id}.haplotypecaller"}
ext.args = { "--info-key CNN_1D" }
publishDir = [
mode: params.publish_dir_mode,
Expand All @@ -616,6 +620,7 @@ process{
}

withName: 'GENOTYPEGVCFS' {
ext.prefix = {"${meta.id}.haplotypecaller"}
ext.when = { params.tools && params.tools.contains('haplotypecaller') && params.joint_germline}
publishDir = [
mode: params.publish_dir_mode,
Expand All @@ -633,16 +638,16 @@ process{
]
}
withName: 'MERGE_MANTA_DIPLOID' {
ext.prefix = {"${meta.id}.diploid_sv"}
ext.prefix = {"${meta.id}.manta.diploid_sv"}
}
withName: 'MERGE_MANTA_SMALL_INDELS' {
ext.prefix = {"${meta.id}.candidate_small_indels"}
ext.prefix = {"${meta.id}.manta.candidate_small_indels"}
}
withName: 'MERGE_MANTA_SV' {
ext.prefix = {"${meta.id}.candidate_sv"}
ext.prefix = {"${meta.id}.manta.candidate_sv"}
}
withName: 'MANTA.*' {
ext.prefix = { meta.num_intervals <= 1 ? meta.id : "${meta.id}_${target_bed.simpleName}" }
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.manta" : "${meta.id}.manta.${target_bed.simpleName}" }
ext.args = { params.wes ? "--exome" : "" }
ext.when = { params.tools && params.tools.contains('manta') }
publishDir = [
Expand All @@ -662,13 +667,13 @@ process{
]
}
withName: 'MERGE_STRELKA' {
ext.prefix = {"${meta.id}.variants"}
ext.prefix = {"${meta.id}.strelka.variants"}
}
withName: 'MERGE_STRELKA_GENOME' {
ext.prefix = {"${meta.id}.genome"}
ext.prefix = {"${meta.id}.strelka.genome"}
}
withName: 'STRELKA_.*' {
ext.prefix = { meta.num_intervals <= 1 ? meta.id : "${meta.id}_${target_bed.simpleName}" }
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.strelka" : "${meta.id}.strelka.${target_bed.simpleName}" }
ext.args = { params.wes ? "--exome" : "" }
ext.when = { params.tools && params.tools.contains('strelka') }
publishDir = [
Expand All @@ -683,14 +688,15 @@ process{
withName: 'TIDDIT_SV' {
ext.when = { params.tools && params.tools.contains('tiddit') }
ext.args = { bwa_index ? "" : "--skip_assembly" }
ext.prefix = { "${meta.id}.tiddit" }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/${meta.id}/tiddit" },
pattern: "*tab",
]
}
withName : 'TABIX_BGZIP_TIDDIT_SV' {
ext.prefix = { "${meta.id}.vcf" }
ext.prefix = { "${meta.id}.tiddit.vcf" }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/${meta.id}/tiddit" },
Expand Down Expand Up @@ -827,20 +833,22 @@ process{

//MANTA
withName: 'MERGE_MANTA_TUMOR' {
ext.prefix = {"${meta.id}.tumor_sv"}
ext.prefix = {"${meta.id}.manta.tumor_sv"}
}

//MUTECT2
withName: 'CALCULATECONTAMINATION' {
ext.args = { "-tumor-segmentation ${meta.id}.segmentation.table" }
publishDir = [
ext.prefix = { "${meta.id}.mutect2" }
ext.args = { "-tumor-segmentation ${meta.id}.mutect2.segmentation.table" }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/" },
saveAs: { filename -> filename.equals('versions.yml') ? null : "${meta.id}/mutect2/${filename}" }
]
}

withName: 'MERGE_MUTECT2.*' {
ext.prefix = { "${meta.id}.mutect2" }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/${meta.id}/mutect2" },
Expand All @@ -849,7 +857,7 @@ process{
}

withName: 'FILTERMUTECTCALLS.*'{
ext.prefix = {"${meta.id}.filtered"}
ext.prefix = {"${meta.id}.mutect2.filtered"}
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/" },
Expand All @@ -858,6 +866,7 @@ process{
}

withName: 'GATHERPILEUPSUMMARIES' {
ext.prefix = { "${meta.id}.mutect2" }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/${meta.id}/mutect2" },
Expand All @@ -866,6 +875,7 @@ process{
}

withName: 'GATHERPILEUPSUMMARIES_.*' {
ext.prefix = { "${meta.id}.mutect2" }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/${meta.tumor_id}_vs_${meta.normal_id}/mutect2" },
Expand All @@ -874,7 +884,7 @@ process{
}

withName: 'GETPILEUPSUMMARIES.*' {
ext.prefix = { meta.num_intervals <= 1 ? meta.id : "${meta.id}_${intervals.simpleName}" }
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.mutect2" : "${meta.id}.mutect2.${intervals.simpleName}" }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/" },
Expand All @@ -884,6 +894,7 @@ process{
}

withName: 'GETPILEUPSUMMARIES_.*' {
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.mutect2" : "${meta.id}.mutect2.${intervals.simpleName}" }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/" },
Expand All @@ -893,7 +904,7 @@ process{
}

withName: 'LEARNREADORIENTATIONMODEL'{
ext.prefix = { "${meta.id}.artifactprior" }
ext.prefix = { "${meta.id}.mutect2.artifactprior" }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/${meta.id}/mutect2" },
Expand All @@ -902,7 +913,7 @@ process{
}

withName: 'MERGEMUTECTSTATS' {
ext.prefix = { "${meta.id}" }
ext.prefix = { "${meta.id}.mutect2" }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/${meta.id}/mutect2" },
Expand All @@ -911,7 +922,7 @@ process{
}

withName: 'MUTECT2'{
ext.prefix = { meta.num_intervals <= 1 ? meta.id : "${meta.id}_${intervals.simpleName}" }
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.mutect2" : "${meta.id}.mutect2.${intervals.simpleName}" }
ext.when = { params.tools && params.tools.contains('mutect2') }
ext.args = { params.ignore_soft_clipped_bases ? "--dont-use-soft-clipped-bases true --f1r2-tar-gz ${task.ext.prefix}.f1r2.tar.gz" : "--f1r2-tar-gz ${task.ext.prefix}.f1r2.tar.gz" }
publishDir = [
Expand Down Expand Up @@ -1044,7 +1055,7 @@ process{

//MANTA
withName: 'MERGE_MANTA_SOMATIC' {
ext.prefix = {"${meta.id}.somatic_sv"}
ext.prefix = {"${meta.id}.manta.somatic_sv"}
}

//MUTECT2
Expand All @@ -1067,24 +1078,25 @@ process{

//STRELKA
withName: 'MERGE_STRELKA_INDELS' {
ext.prefix = {"${meta.id}.somatic_indels"}
ext.prefix = {"${meta.id}.strelka.somatic_indels"}
}
withName: 'MERGE_STRELKA_SNVS' {
ext.prefix = {"${meta.id}.somatic_snvs"}
ext.prefix = {"${meta.id}.strelka.somatic_snvs"}
}

if (params.tools && params.tools.contains('tiddit')) {
//TIDDIT
//TIDDIT
withName: 'NFCORE_SAREK:SAREK:PAIR_VARIANT_CALLING:RUN_TIDDIT_NORMAL:TABIX_BGZIP_TIDDIT_SV' {
ext.prefix = {"${meta.id}.normal.vcf"}
ext.prefix = {"${meta.id}.tiddit.normal.vcf"}
}

withName: 'NFCORE_SAREK:SAREK:PAIR_VARIANT_CALLING:RUN_TIDDIT_TUMOR:TABIX_BGZIP_TIDDIT_SV' {
ext.prefix = {"${meta.id}.tumor.vcf"}
ext.prefix = {"${meta.id}.tiddit.tumor.vcf"}
}

//SVDB
withName: 'NFCORE_SAREK:SAREK:PAIR_VARIANT_CALLING:SVDB_MERGE' {
ext.prefix = { "${meta.id}.tiddit" }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/${meta.id}/tiddit" },
Expand All @@ -1099,7 +1111,7 @@ process{
ext.prefix = { "${vcf.baseName.minus(".vcf")}" }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/reports/bcftools" },
path: { "${params.outdir}/reports/bcftools/${meta.id}/${meta.variantcaller}/" },
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}
Expand All @@ -1109,7 +1121,7 @@ process{
ext.prefix = { "${variant_file.baseName.minus(".vcf")}" }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/reports/vcftools" },
path: { "${params.outdir}/reports/vcftools/${meta.id}/${meta.variantcaller}/" },
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}
Expand Down Expand Up @@ -1207,6 +1219,5 @@ process{
// MULTIQC
withName:'MULTIQC' {
errorStrategy = {task.exitStatus == 143 ? 'retry' : 'ignore'}
ext.args = { params.multiqc_config ? "--config $multiqc_custom_config" : "" }
}
}
2 changes: 1 addition & 1 deletion modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
"git_sha": "f0800157544a82ae222931764483331a81812012"
},
"multiqc": {
"git_sha": "49b18b1639f4f7104187058866a8fab33332bdfe"
"git_sha": "5138acca0985ca01c38a1c4fba917d83772b1106"
},
"samblaster": {
"git_sha": "897c33d5da084b61109500ee44c01da2d3e4e773"
Expand Down
16 changes: 11 additions & 5 deletions modules/nf-core/modules/multiqc/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions modules/nf-core/modules/multiqc/meta.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@
},
"ascat_chromosomes": {
"type": "string",
"description": "Chromosomes to run ASCAT on.",
"fa_icon": "fa-solid fa-text",
"default": "c(1:22, 'X')",
"help_text": "Specify specific chromosomes to run ASCAT on, i.e 'c('21', '22')'."
Expand Down
Loading