Skip to content

Commit

Permalink
Merge pull request #489 from nickhsmith/nf-core-dev
Browse files Browse the repository at this point in the history
Nf core dev / variant calling bugs / ideas
  • Loading branch information
maxulysse authored Feb 24, 2022
2 parents 66d66e0 + 720b2b9 commit 9bc4815
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bin/concatenateVCFs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ else
bgzip -@${cpus} rawcalls.unsorted.vcf
fi

bcftools sort rawcalls.unsorted.vcf.gz | bgzip > rawcalls.vcf.gz
bcftools sort -T . rawcalls.unsorted.vcf.gz | bgzip > rawcalls.vcf.gz
tabix -p vcf rawcalls.vcf.gz

set +u
Expand Down
21 changes: 18 additions & 3 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,24 @@ process{
path: { "${params.outdir}/variant_calling/${meta.sample}/haplotypecaller" }
]
}
withName: 'HAPLOTYPECALLER' {
publishDir = [
enabled: false,
mode: 'copy',
path: { "${params.outdir}/variant_calling/haplotypecaller"},
pattern: "*{vcf.gz,vcf.gz.tbi}"
]
ext.args = '-ERC GVCF'
ext.prefix = {"${meta.id}.g"}
}
withName: 'GENOTYPEGVCFS' {
publishDir = [
enabled: true,
mode: "${params.publish_dir_mode}",
path: { "${params.outdir}/variant_calling/${meta.id}/haplotypecaller"},
pattern: "*{vcf.gz,vcf.gz.tbi}"
]
}
withName: 'CONCAT_VCF_MANTA_.*' {
ext.args = { params.no_intervals ? "-n" : "" }
ext.prefix = {"${meta.sample}"}
Expand Down Expand Up @@ -540,9 +558,6 @@ process{
//withName: 'GENOMICSDBIMPORT' {
//
//}
withName: 'HAPLOTYPECALLER' {
ext.args = '-ERC GVCF'
}
withName: 'MANTA_GERMLINE|MANTA_TUMORONLY|MANTA_SOMATIC' {
ext.args = { params.wes ? "--exome" : "" }
publishDir = [
Expand Down
2 changes: 1 addition & 1 deletion modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"git_sha": "967fb22dedc2c8855f00e64c3d7b5814c85242a6"
},
"gatk4/genotypegvcfs": {
"git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d"
"git_sha": "871779213588426bf176d60d8307fe056143d5c0"
},
"gatk4/getpileupsummaries": {
"git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d"
Expand Down
2 changes: 1 addition & 1 deletion modules/nf-core/modules/gatk4/genotypegvcfs/main.nf

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

5 changes: 4 additions & 1 deletion modules/nf-core/modules/gatk4/genotypegvcfs/meta.yml

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

2 changes: 1 addition & 1 deletion nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -768,4 +768,4 @@
"$ref": "#/definitions/generic_options"
}
]
}
}
24 changes: 23 additions & 1 deletion subworkflows/local/germline_variant_calling.nf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ include { DEEPVARIANT } from '../../modules/nf-c
include { FREEBAYES } from '../../modules/nf-core/modules/freebayes/main'
include { GATK_JOINT_GERMLINE_VARIANT_CALLING } from '../../subworkflows/nf-core/joint_germline_variant_calling/main'
include { GATK4_HAPLOTYPECALLER as HAPLOTYPECALLER } from '../../modules/nf-core/modules/gatk4/haplotypecaller/main'
include { GATK4_GENOTYPEGVCFS as GENOTYPEGVCFS } from '../../modules/nf-core/modules/gatk4/genotypegvcfs/main'
include { MANTA_GERMLINE } from '../../modules/nf-core/modules/manta/germline/main'
include { STRELKA_GERMLINE } from '../../modules/nf-core/modules/strelka/germline/main'
include { TIDDIT_SV } from '../../modules/nf-core/modules/tiddit/sv/main'
Expand Down Expand Up @@ -62,6 +63,7 @@ workflow GERMLINE_VARIANT_CALLING {
deepvariant_vcf = Channel.empty()
freebayes_vcf = Channel.empty()
haplotypecaller_gvcf = Channel.empty()
genotypegvcfs_vcf = Channel.empty()
manta_vcf = Channel.empty()
strelka_vcf = Channel.empty()

Expand Down Expand Up @@ -192,6 +194,7 @@ workflow GERMLINE_VARIANT_CALLING {
if(no_intervals){
TABIX_HAPLOTYPECALLER(HAPLOTYPECALLER.out.vcf)
haplotypecaller_gvcf_gz = HAPLOTYPECALLER.out.vcf
haplotypecaller_gvcf_gz_tbi = HAPLOTYPECALLER.out.tbi
ch_versions = ch_versions.mix(TABIX_HAPLOTYPECALLER.out.versions)
}else{
BGZIP_HAPLOTYPECALLER(HAPLOTYPECALLER.out.vcf)
Expand All @@ -205,11 +208,30 @@ workflow GERMLINE_VARIANT_CALLING {

CONCAT_VCF_HAPLOTYPECALLER(haplotypecaller_gvcf_to_concat, fasta_fai, intervals_bed_combine_gz)
haplotypecaller_gvcf_gz = CONCAT_VCF_HAPLOTYPECALLER.out.vcf
haplotypecaller_gvcf_gz_tbi = CONCAT_VCF_HAPLOTYPECALLER.out.tbi

ch_versions = ch_versions.mix(BGZIP_HAPLOTYPECALLER.out.versions)
ch_versions = ch_versions.mix(CONCAT_VCF_HAPLOTYPECALLER.out.versions)
}

haplotypecaller_gvcf_gz.join(haplotypecaller_gvcf_gz_tbi)
.combine(intervals_bed_combine_gz_tbi)
.map{
meta, gvcf, gvf_tbi, intervals, intervals_tbi ->
new_intervals = intervals.simpleName != "no_intervals" ? intervals : []
new_intervals_tbi = intervals_tbi.simpleName != "no_intervals" ? intervals_tbi : []
[meta, gvcf, gvf_tbi, new_intervals, new_intervals_tbi]
}.set{haplotypecaller_gvcf_to_call}

genotypegvcfs_vcf_gz = GENOTYPEGVCFS(
haplotypecaller_gvcf_to_call,
fasta,
fasta_fai,
dict,
dbsnp,
dbsnp_tbi)

genotypegvcfs_vcf = genotypegvcfs_vcf.mix(genotypegvcfs_vcf_gz)

if(joint_germline){
run_haplotypecaller = false
Expand All @@ -236,7 +258,6 @@ workflow GERMLINE_VARIANT_CALLING {
}

haplotypecaller_gvcf = haplotypecaller_gvcf.mix(haplotypecaller_gvcf_gz)

}

if (tools.contains('manta')){
Expand Down Expand Up @@ -374,6 +395,7 @@ workflow GERMLINE_VARIANT_CALLING {
deepvariant_vcf
freebayes_vcf
haplotypecaller_gvcf
genotypegvcfs_vcf
manta_vcf
strelka_vcf

Expand Down

0 comments on commit 9bc4815

Please sign in to comment.