Skip to content

Commit 68f0d74

Browse files
author
Szilveszter Juhos
authored
Merge pull request nf-core#568 from MaxUlysse/vcftools
Add VCFtools
2 parents 81cc16e + f722f79 commit 68f0d74

13 files changed

Lines changed: 161 additions & 18 deletions

File tree

buildContainers.nf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ def defineContainersList(){
192192
'snpeff',
193193
'snpeffgrch37',
194194
'snpeffgrch38',
195+
'vcftools',
195196
'vepgrch37',
196197
'vepgrch38'
197198
]
@@ -211,8 +212,8 @@ def helpMessage() {
211212
log.info " Default: all"
212213
log.info " Possible values:"
213214
log.info " all, fastqc, freebayes, gatk, igvtools, multiqc, mutect1"
214-
log.info " picard, qualimap, r-base, runallelecount, sarek"
215-
log.info " snpeff, snpeffgrch37, snpeffgrch38, vepgrch37, vepgrch38"
215+
log.info " picard, qualimap, r-base, runallelecount, sarek, snpeff"
216+
log.info " snpeffgrch37, snpeffgrch38, vcftools, vepgrch37, vepgrch38"
216217
log.info " --docker: Build containers using Docker"
217218
log.info " --help"
218219
log.info " you're reading it"

configuration/containers.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,6 @@ process {
3939
$RunSnpeff.container = {params.genome == 'GRCh38' ? "${params.repository}/snpeffgrch38:${params.tag}" : "${params.repository}/snpeffgrch37:${params.tag}"}
4040
$RunStrelka.container = "${params.repository}/sarek:${params.tag}"
4141
$RunStrelkaBP.container = "${params.repository}/sarek:${params.tag}"
42+
$RunVcftools.container = "${params.repository}/vcftools:${params.tag}"
4243
$RunVEP.container = {params.genome == 'GRCh38' ? "${params.repository}/vepgrch38:${params.tag}" : "${params.repository}/vepgrch37:${params.tag}"}
4344
}

configuration/singularity-path.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,6 @@ process {
4545
$RunSnpeff.container = {params.genome == 'GRCh38' ? "${params.containerPath}/snpeffgrch38-${params.tag}.img" : "${params.containerPath}/snpeffgrch37-${params.tag}.img"}
4646
$RunStrelka.container = "${params.containerPath}/sarek-${params.tag}.img"
4747
$RunStrelkaBP.container = "${params.containerPath}/sarek-${params.tag}.img"
48+
$RunVcftools.container = "${params.containerPath}/vcftools-${params.tag}.img"
4849
$RunVEP.container = {params.genome == 'GRCh38' ? "${params.containerPath}/vepgrch38-${params.tag}.img" : "${params.containerPath}/vepgrch37-${params.tag}.img"}
4950
}

containers/vcftools/Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM nfcore/base:latest
2+
3+
LABEL \
4+
author="Maxime Garcia" \
5+
description="vcftools image used in Sarek 2.0" \
6+
maintainer="maxime.garcia@scilifelab.se"
7+
8+
COPY environment.yml /
9+
10+
RUN \
11+
conda env create -f /environment.yml && \
12+
conda clean -a
13+
14+
# Export PATH
15+
ENV PATH /opt/conda/envs/sarek-vcftools-2.0/bin:$PATH
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# You can use this file to create a conda environment:
2+
# conda env create -f environment.yml
3+
name: sarek-vcftools-2.0
4+
channels:
5+
- defaults
6+
- conda-forge
7+
- bioconda
8+
dependencies:
9+
- vcftools=0.1.15

doc/BUILD.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ nextflow run . [--docker] [--singularity] [--containerPath <path>] [--push] [--c
2727
- `snpeff` this container serves as a base for `snpeffgrch37` and `snpeffgrch38`
2828
- `snpeffgrch37`
2929
- `snpeffgrch38`
30+
- `vcftools`
3031
- `vepgrch37`
3132
- `vepgrch38`
3233

doc/CONTAINERS.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ For processing + germline variant calling + Reports:
99
- [picard](#picard-)
1010
- [qualimap](#qualimap-)
1111
- [sarek](#sarek-)
12+
- [vcftools](#vcftools-)
1213

1314
For processing + somatic variant calling + Reports:
1415
- [fastqc](#fastqc-)
@@ -21,6 +22,7 @@ For processing + somatic variant calling + Reports:
2122
- [r-base](#r-base-)
2223
- [runallelecount](#runallelecount-)
2324
- [sarek](#sarek-)
25+
- [vcftools](#vcftools-)
2426

2527
For annotation for GRCh37, you will need:
2628
- [snpeffgrch37](#snpeffgrch37-)
@@ -104,6 +106,12 @@ A container named after the process is made for each process. If a container can
104106
- Contain **[snpEff][snpeff-link]** 4.3i
105107
- Contain GRCh38.86
106108

109+
## vcftools [![vcftools-docker status][vcftools-docker-badge]][vcftools-docker-link]
110+
111+
- Based on `nfcore/base:latest`
112+
- Contain **[vcftools][vcftools-link]** 0.1.15
113+
114+
107115
## vepgrch37 [![vepgrch37-docker status][vepgrch37-docker-badge]][vepgrch37-docker-link]
108116

109117
- Based on `willmclaren/ensembl-vep:release_90.6`
@@ -169,6 +177,9 @@ A container named after the process is made for each process. If a container can
169177
[snpeffgrch38-docker-badge]: https://img.shields.io/docker/automated/maxulysse/snpeffgrch38.svg
170178
[snpeffgrch38-docker-link]: https://hub.docker.com/r/maxulysse/snpeffgrch38
171179
[strelka-link]: https://github.com/Illumina/strelka
180+
[vcftools-docker-badge]: https://img.shields.io/docker/automated/maxulysse/vcftools.svg
181+
[vcftools-docker-link]: https://hub.docker.com/r/maxulysse/vcftools
182+
[vcftools-link]: https://vcftools.github.io/index.html
172183
[vep-docker-badge]: https://img.shields.io/docker/automated/maxulysse/vep.svg
173184
[vep-docker-link]: https://hub.docker.com/r/maxulysse/vep
174185
[vep-link]: https://github.com/Ensembl/ensembl-vep

doc/PROCESS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ We divide them for the moment into 5 main steps:
4242
- RunSamtoolsStats - Run Samtools stats on recalibrated BAM files
4343
- RunBamQC - Run qualimap BamQC on recalibrated BAM files
4444
- RunBcftoolsStats - Run BCFTools stats on vcf files
45+
- RunVcftools - Run VCFTools on vcf files
4546

4647
## Annotation:
4748

germlineVC.nf

Lines changed: 57 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -399,8 +399,8 @@ process ConcatVCF {
399399
file(genomeIndex) from Channel.value(referenceMap.genomeIndex)
400400

401401
output:
402-
set variantCaller, idPatient, idSampleNormal, idSampleTumor, file("*.vcf.gz") into vcfConcatenated
403-
file("*.vcf.gz.tbi") into vcfConcatenatedTbi
402+
set variantCaller, idPatient, idSampleNormal, idSampleTumor, file("*.vcf.gz"), file("*.vcf.gz.tbi") into vcfConcatenated
403+
404404

405405
when: ( 'haplotypecaller' in tools || 'mutect1' in tools || 'mutect2' in tools || 'freebayes' in tools ) && !params.onlyQC
406406

@@ -453,8 +453,9 @@ process ConcatVCF {
453453

454454
if (params.verbose) vcfConcatenated = vcfConcatenated.view {
455455
"Variant Calling output:\n\
456-
Tool : ${it[0]}\tID : ${it[1]}\tSample: [${it[3]}, ${it[2]}]\n\
457-
File : ${it[4].fileName}"
456+
Tool : ${it[0]}\tID : ${it[1]}\tSample: ${it[2]}\n\
457+
Files : ${it[4].fileName}\n\
458+
Index : ${it[5].fileName}"
458459
}
459460

460461
process RunSingleStrelka {
@@ -549,7 +550,11 @@ if (params.verbose) singleMantaOutput = singleMantaOutput.view {
549550
Index : ${it[4].fileName}"
550551
}
551552

552-
vcfForBCFtools = Channel.empty().mix(
553+
vcfForQC = Channel.empty().mix(
554+
vcfConcatenated.map {
555+
variantcaller, idPatient, idSampleNormal, idSampleTumor, vcf, tbi ->
556+
[variantcaller, vcf]
557+
},
553558
singleStrelkaOutput.map {
554559
variantcaller, idPatient, idSample, vcf, tbi ->
555560
[variantcaller, vcf[1]]
@@ -559,6 +564,8 @@ vcfForBCFtools = Channel.empty().mix(
559564
[variantcaller, vcf[2]]
560565
})
561566

567+
(vcfForBCFtools, vcfForVCFtools) = vcfForQC.into(2)
568+
562569
process RunBcftoolsStats {
563570
tag {vcf}
564571

@@ -585,6 +592,49 @@ if (params.verbose) bcfReport = bcfReport.view {
585592

586593
bcfReport.close()
587594

595+
process RunVcftools {
596+
tag {vcf}
597+
598+
publishDir directoryMap.vcftools, mode: 'link'
599+
600+
input:
601+
set variantCaller, file(vcf) from vcfForVCFtools
602+
603+
output:
604+
file ("${vcf.baseName}.*") into vcfReport
605+
606+
when: !params.noReports
607+
608+
script:
609+
"""
610+
vcftools \
611+
--gzvcf ${vcf} \
612+
--relatedness2 \
613+
--out ${vcf.baseName}
614+
615+
vcftools \
616+
--gzvcf ${vcf} \
617+
--TsTv-by-count \
618+
--out ${vcf.baseName}
619+
620+
vcftools \
621+
--gzvcf ${vcf} \
622+
--TsTv-by-qual \
623+
--out ${vcf.baseName}
624+
625+
vcftools \
626+
--gzvcf ${vcf} \
627+
--FILTER-summary \
628+
--out ${vcf.baseName}
629+
"""
630+
}
631+
632+
if (params.verbose) vcfReport = vcfReport.view {
633+
"VCFTools stats report:\n\
634+
File : [${it.fileName}]"
635+
}
636+
637+
vcfReport.close()
588638
/*
589639
================================================================================
590640
= F U N C T I O N S =
@@ -646,10 +696,11 @@ def defineDirectoryMap() {
646696
'bamQC' : "${params.outDir}/Reports/bamQC",
647697
'bcftoolsStats' : "${params.outDir}/Reports/BCFToolsStats",
648698
'samtoolsStats' : "${params.outDir}/Reports/SamToolsStats",
699+
'vcftools' : "${params.outDir}/Reports/VCFTools",
649700
'ascat' : "${params.outDir}/VariantCalling/Ascat",
650701
'freebayes' : "${params.outDir}/VariantCalling/FreeBayes",
651-
'haplotypecaller' : "${params.outDir}/VariantCalling/HaplotypeCaller",
652702
'gvcf-hc' : "${params.outDir}/VariantCalling/HaplotypeCallerGVCF",
703+
'haplotypecaller' : "${params.outDir}/VariantCalling/HaplotypeCaller",
653704
'manta' : "${params.outDir}/VariantCalling/Manta",
654705
'mutect1' : "${params.outDir}/VariantCalling/MuTect1",
655706
'mutect2' : "${params.outDir}/VariantCalling/MuTect2",

runMultiQC.nf

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ process GenerateMultiQCconfig {
8989
echo "- 'samtools'" >> multiqc_config.yaml
9090
echo "- 'qualimap'" >> multiqc_config.yaml
9191
echo "- 'bcftools'" >> multiqc_config.yaml
92+
echo "- 'vcftools'" >> multiqc_config.yaml
9293
echo "- 'snpeff'" >> multiqc_config.yaml
9394
"""
9495
}
@@ -106,6 +107,7 @@ reportsForMultiQC = Channel.empty()
106107
Channel.fromPath("${directoryMap.markDuplicatesQC}/*"),
107108
Channel.fromPath("${directoryMap.samtoolsStats}/*"),
108109
Channel.fromPath("${directoryMap.snpeffReports}/*"),
110+
Channel.fromPath("${directoryMap.vcftools}/*"),
109111
multiQCconfig
110112
).collect()
111113

@@ -148,10 +150,11 @@ def defineDirectoryMap() {
148150
'bamQC' : "${params.outDir}/Reports/bamQC",
149151
'bcftoolsStats' : "${params.outDir}/Reports/BCFToolsStats",
150152
'fastQC' : "${params.outDir}/Reports/FastQC",
151-
'snpeffReports' : "${params.outDir}/Reports/SnpEff",
152153
'markDuplicatesQC' : "${params.outDir}/Reports/MarkDuplicates",
153154
'multiQC' : "${params.outDir}/Reports/MultiQC",
154-
'samtoolsStats' : "${params.outDir}/Reports/SamToolsStats"
155+
'samtoolsStats' : "${params.outDir}/Reports/SamToolsStats",
156+
'snpeffReports' : "${params.outDir}/Reports/SnpEff",
157+
'vcftools' : "${params.outDir}/Reports/VCFTools"
155158
]
156159
}
157160

0 commit comments

Comments
 (0)