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 mpileup subworkflow for paired, germline and tumoronly varcalling #570

Merged
merged 49 commits into from
Jun 17, 2022
Merged
Show file tree
Hide file tree
Changes from 46 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
dcfbf39
Extracted mpileup code from the somatic controlfreec subworkflow into…
WackerO May 25, 2022
a15cf36
Removed a comment
WackerO May 25, 2022
de7ae88
Pulled recent changes
WackerO Jun 8, 2022
84e234e
Changed tumoronly subworkflow to use new simplified mpileup
WackerO Jun 8, 2022
746f866
Shortened tumor_variant_calling, simplified modules.config, some code…
WackerO Jun 1, 2022
ac9efbe
Corrected test_tools output files
WackerO Jun 2, 2022
fb093d6
Bugfixing
WackerO Jun 3, 2022
fd45882
pytest runs now successfully
WackerO Jun 3, 2022
9dc8616
Added mpileup to germline variant calling
WackerO Jun 8, 2022
f153855
removed controllfreec_input from germline varcalling
WackerO Jun 8, 2022
eb1d5ec
More error fixing
WackerO Jun 8, 2022
bd3cf57
Merge branch 'dev' of https://github.com/nf-core/sarek into mpileup2
WackerO Jun 8, 2022
642fb57
Fixed CNVKIT error
WackerO Jun 9, 2022
37391c3
Changed output prefix for SAMTOOLS_MPILEUP
WackerO Jun 9, 2022
87fb389
Fixed linting
WackerO Jun 9, 2022
d1246cb
Merge branch 'dev' of https://github.com/nf-core/sarek into mpileup2
WackerO Jun 9, 2022
d6b5de6
Trying to prevent mpileup_normal from being redundantly run
WackerO Jun 9, 2022
21d7076
Merge branch 'dev' of https://github.com/nf-core/sarek into mpileup2
WackerO Jun 9, 2022
181a4c3
Update conf/modules.config
WackerO Jun 10, 2022
1fcd57b
Update subworkflows/nf-core/variantcalling/mpileup/main.nf
WackerO Jun 10, 2022
a1151ea
Update subworkflows/nf-core/variantcalling/controlfreec/tumoronly/mai…
WackerO Jun 10, 2022
fa33af8
Update subworkflows/nf-core/variantcalling/controlfreec/somatic/main.nf
WackerO Jun 10, 2022
2a623a3
Update subworkflows/local/pair_variant_calling.nf
WackerO Jun 10, 2022
a0d2a81
Update subworkflows/local/tumor_variant_calling.nf
WackerO Jun 10, 2022
059882d
Fixed some previous changes
WackerO Jun 10, 2022
d21633f
Merge branch 'mpileup2' of https://github.com/WackerO/sarek into mpil…
WackerO Jun 10, 2022
1147b93
Merge branch 'dev' of https://github.com/nf-core/sarek into mpileup2
WackerO Jun 10, 2022
c236cee
Undid changes for double mpileup
WackerO Jun 10, 2022
3f89fac
Updated CAT module
WackerO Jun 10, 2022
5062793
Cleaned up
WackerO Jun 10, 2022
3179248
Update subworkflows/local/germline_variant_calling.nf
WackerO Jun 13, 2022
f549a01
Fixed some indents
WackerO Jun 13, 2022
8728b77
Merge branch 'dev' of https://github.com/nf-core/sarek into mpileup2
WackerO Jun 13, 2022
2d69f2c
Merge branch 'dev' of https://github.com/nf-core/sarek into mpileup2
WackerO Jun 14, 2022
10fa4c2
Changed modules.config w.r.t. compressed mpileup files
WackerO Jun 14, 2022
79294db
Update conf/modules.config
WackerO Jun 14, 2022
fd3eeab
Update conf/modules.config
WackerO Jun 14, 2022
bc5b749
Fixed incorrectly renamed publishdir
WackerO Jun 14, 2022
d2f7906
Merge branch 'mpileup2' of https://github.com/WackerO/sarek into mpil…
WackerO Jun 14, 2022
eee39d4
Undid another folder rename
WackerO Jun 14, 2022
08a6804
Merge branch 'dev' of https://github.com/nf-core/sarek into mpileup2,…
WackerO Jun 15, 2022
303854d
Reset controlfreec
WackerO Jun 15, 2022
2f909ce
Merge branch 'dev' of https://github.com/nf-core/sarek into mpileup2
WackerO Jun 17, 2022
454ebcc
Changed test_tools, updated ci.yaml, removed mpileup from pair_varcal…
WackerO Jun 17, 2022
044b060
Merge branch 'dev' of https://github.com/nf-core/sarek into mpileup2
WackerO Jun 17, 2022
3924373
prettiered Changelog
WackerO Jun 17, 2022
914bbcf
Sorted changelog, added versions to paired and tumor VC
WackerO Jun 17, 2022
8b47980
Fixed incorrect placement of versions.mix
WackerO Jun 17, 2022
520c39b
Modified subway map
WackerO Jun 17, 2022
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
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
- "haplotypecaller"
- "manta"
- "markduplicates"
- "mpileup"
- "msisensorpro"
- "mutect2"
- "prepare_recalibration"
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- [#570](https://github.com/nf-core/sarek/pull/570) - Extract mpileup into its own subworkflow; zip mpileup files
- [#383](https://github.com/nf-core/sarek/pull/383), [#528](https://github.com/nf-core/sarek/pull/528) - Update `CHANGELOG`
- [#390](https://github.com/nf-core/sarek/pull/390) - Update `nextflow_schema.json`
- [#408](https://github.com/nf-core/sarek/pull/408) - Sync `TEMPLATE` with `tools` `2.0.1`
Expand Down
50 changes: 33 additions & 17 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -682,11 +682,11 @@ process{
]
}

withName: 'CAT_MPILEUP_.*' {
withName: 'CAT_MPILEUP' {
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/${meta.id}/controlfreec" },
pattern: "*mpileup"
path: { "${params.outdir}/variant_calling/${meta.id}/mpileup" },
pattern: "*{mpileup.gz}",
]
}

Expand Down Expand Up @@ -758,14 +758,13 @@ process{
]
}

withName: 'MPILEUP_.*' {
ext.prefix = { meta.num_intervals <= 1 ? meta.id : "${meta.id}_${intervals.simpleName}"}
ext.when = { params.tools && params.tools.contains('controlfreec') }
withName: 'SAMTOOLS_MPILEUP' {
ext.when = { params.tools && (params.tools.contains('controlfreec') || params.tools.contains('mpileup')) }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/${meta.id}/" },
pattern: "*mpileup",
saveAs: { meta.num_intervals > 1 ? null : "controlfreec/${it}" }
path: { "${params.outdir}/variant_calling/${meta.id}/mpileup" },
pattern: "*mpileup.gz",
saveAs: { meta.num_intervals > 1 ? null : it }
]
}

Expand Down Expand Up @@ -910,20 +909,36 @@ process{
}

//CONTROLFREEC
withName: 'MPILEUP_NORMAL' {
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.normal" : "${meta.id}_${intervals.simpleName}.normal" }
withName: 'NFCORE_SAREK:SAREK:PAIR_VARIANT_CALLING:RUN_MPILEUP_NORMAL:SAMTOOLS_MPILEUP' {
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.normal" : "${meta.id}_${intervals.simpleName}.normal" }
}

withName: 'NFCORE_SAREK:SAREK:PAIR_VARIANT_CALLING:RUN_MPILEUP_TUMOR:SAMTOOLS_MPILEUP' {
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.tumor" : "${meta.id}_${intervals.simpleName}.tumor" }
}

withName: 'NFCORE_SAREK:SAREK:PAIR_VARIANT_CALLING:RUN_MPILEUP_NORMAL:CAT_MPILEUP' {
ext.prefix = { "${meta.id}.normal.mpileup.gz" }
}

withName: 'NFCORE_SAREK:SAREK:PAIR_VARIANT_CALLING:RUN_MPILEUP_TUMOR:CAT_MPILEUP' {
ext.prefix = { "${meta.id}.tumor.mpileup.gz" }
}

withName: 'MPILEUP_TUMOR' {
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.tumor" : "${meta.id}_${intervals.simpleName}.tumor" }
withName: 'NFCORE_SAREK:SAREK:TUMOR_ONLY_VARIANT_CALLING:RUN_MPILEUP:CAT_MPILEUP' {
ext.prefix = { "${meta.id}.tumor.mpileup.gz" }
}

withName: 'CAT_MPILEUP_NORMAL' {
ext.prefix = { "${meta.id}.normal.mpileup" }
withName: 'NFCORE_SAREK:SAREK:GERMLINE_VARIANT_CALLING:RUN_MPILEUP:SAMTOOLS_MPILEUP' {
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.normal" : "${meta.id}_${intervals.simpleName}.normal" }
}

withName: 'CAT_MPILEUP_TUMOR' {
ext.prefix = { "${meta.id}.tumor.mpileup" }
withName: 'NFCORE_SAREK:SAREK:GERMLINE_VARIANT_CALLING:RUN_MPILEUP:CAT_MPILEUP' {
ext.prefix = { "${meta.id}.normal.mpileup.gz" }
}

withName: 'NFCORE_SAREK:SAREK:TUMOR_ONLY_VARIANT_CALLING:RUN_MPILEUP:SAMTOOLS_MPILEUP' {
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.tumor" : "${meta.id}_${intervals.simpleName}.tumor" }
}

withName: 'FREEC_SOMATIC'{
Expand Down Expand Up @@ -972,6 +987,7 @@ process{
pattern: "*{bed,cnn,cnr,cns,pdf,png}"
]
}

//FREEBAYES
withName: 'NFCORE_SAREK:SAREK:PAIR_VARIANT_CALLING:RUN_FREEBAYES_SOMATIC:FREEBAYES' {
ext.args = "--pooled-continuous \
Expand Down
Binary file modified docs/images/sarek_subway.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
214 changes: 156 additions & 58 deletions docs/images/sarek_subway.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
"git_sha": "897c33d5da084b61109500ee44c01da2d3e4e773"
},
"samtools/mpileup": {
"git_sha": "897c33d5da084b61109500ee44c01da2d3e4e773"
"git_sha": "24e05f6097a5dde57dd80d33295ed120f1b81aef"
},
"samtools/stats": {
"git_sha": "897c33d5da084b61109500ee44c01da2d3e4e773"
Expand Down
5 changes: 3 additions & 2 deletions modules/nf-core/modules/samtools/mpileup/main.nf

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

14 changes: 14 additions & 0 deletions subworkflows/local/germline_variant_calling.nf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ include { RUN_DEEPVARIANT } from '../nf-core/variantcalling/deepvariant/main
include { RUN_FREEBAYES } from '../nf-core/variantcalling/freebayes/main.nf'
include { RUN_HAPLOTYPECALLER } from '../nf-core/variantcalling/haplotypecaller/main.nf'
include { RUN_MANTA_GERMLINE } from '../nf-core/variantcalling/manta/germline/main.nf'
include { RUN_MPILEUP } from '../nf-core/variantcalling/mpileup/main'
include { RUN_STRELKA_SINGLE } from '../nf-core/variantcalling/strelka/single/main.nf'
include { RUN_TIDDIT } from '../nf-core/variantcalling/tiddit/main.nf'

Expand Down Expand Up @@ -39,6 +40,7 @@ workflow GERMLINE_VARIANT_CALLING {
manta_vcf = Channel.empty()
strelka_vcf = Channel.empty()
tiddit_vcf = Channel.empty()
mpileup = Channel.empty()

// Remap channel with intervals
cram_recalibrated_intervals = cram_recalibrated.combine(intervals)
Expand All @@ -63,6 +65,18 @@ workflow GERMLINE_VARIANT_CALLING {
cram, crai, bed_new, tbi_new]
}

if(params.tools.contains('mpileup')){
cram_intervals_no_index = cram_recalibrated_intervals
.map { meta, cram, crai, intervals ->
[meta, cram, intervals]
}

RUN_MPILEUP(cram_intervals_no_index,
fasta)
mpileup_germline = RUN_MPILEUP.out.mpileup
ch_versions = ch_versions.mix(RUN_MPILEUP.out.versions)
}

// CNVKIT

if(tools.contains('cnvkit')){
Expand Down
14 changes: 12 additions & 2 deletions subworkflows/local/pair_variant_calling.nf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ include { RUN_FREEBAYES as RUN_FREEBAYES_SOMATIC } from '../nf-core/variantca
include { RUN_MANTA_SOMATIC } from '../nf-core/variantcalling/manta/somatic/main.nf'
include { RUN_STRELKA_SOMATIC } from '../nf-core/variantcalling/strelka/somatic/main.nf'
include { RUN_CNVKIT_SOMATIC } from '../nf-core/variantcalling/cnvkit/somatic/main.nf'
include { RUN_MPILEUP as RUN_MPILEUP_NORMAL } from '../nf-core/variantcalling/mpileup/main'
include { RUN_MPILEUP as RUN_MPILEUP_TUMOR } from '../nf-core/variantcalling/mpileup/main'

workflow PAIR_VARIANT_CALLING {
take:
Expand Down Expand Up @@ -73,9 +75,17 @@ workflow PAIR_VARIANT_CALLING {
.map {meta, normal_cram, normal_crai, tumor_cram, tumor_crai, intervals ->
[meta, tumor_cram, intervals]
}
RUN_MPILEUP_NORMAL(cram_normal_intervals_no_index, fasta)
mpileup_normal = RUN_MPILEUP_NORMAL.out.mpileup
RUN_MPILEUP_TUMOR(cram_tumor_intervals_no_index, fasta)
mpileup_tumor = RUN_MPILEUP_TUMOR.out.mpileup

controlfreec_input = mpileup_normal.cross(mpileup_tumor)
.map{ normal, tumor ->
[normal[0], normal[1], tumor[1], [], [], [], []]
}

RUN_CONTROLFREEC_SOMATIC(cram_normal_intervals_no_index,
cram_tumor_intervals_no_index,
RUN_CONTROLFREEC_SOMATIC(controlfreec_input,
fasta,
fasta_fai,
dbsnp,
Expand Down
15 changes: 13 additions & 2 deletions subworkflows/local/tumor_variant_calling.nf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ include { RUN_MANTA_TUMORONLY } from '../nf-core/variantcall
include { RUN_STRELKA_SINGLE } from '../nf-core/variantcalling/strelka/single/main.nf'
include { RUN_CONTROLFREEC_TUMORONLY } from '../nf-core/variantcalling/controlfreec/tumoronly/main.nf'
include { RUN_CNVKIT_TUMORONLY } from '../nf-core/variantcalling/cnvkit/tumoronly/main.nf'
include { RUN_MPILEUP } from '../nf-core/variantcalling/mpileup/main'

workflow TUMOR_ONLY_VARIANT_CALLING {
take:
Expand Down Expand Up @@ -62,12 +63,22 @@ workflow TUMOR_ONLY_VARIANT_CALLING {
cram, crai, bed_new, tbi_new]
}

if(tools.contains('controlfreec')){
if (tools.contains('mpileup') || tools.contains('controlfreec')){
cram_intervals_no_index = cram_recalibrated_intervals.map { meta, cram, crai, intervals ->
[meta, cram, intervals]
}
RUN_MPILEUP(cram_intervals_no_index,
fasta)
}

if (tools.contains('controlfreec')){
controlfreec_input = RUN_MPILEUP.out.mpileup
.map{ meta, pileup_tumor ->
[meta, [], pileup_tumor, [], [], [], []]
}

RUN_CONTROLFREEC_TUMORONLY(
cram_intervals_no_index,
controlfreec_input,
fasta,
fasta_fai,
dbsnp,
Expand Down

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

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

Loading