From c093611bbb56281f4b1f9f2f1590ef85416ff7b0 Mon Sep 17 00:00:00 2001 From: kubranarci Date: Mon, 17 Jun 2024 10:01:29 +0200 Subject: [PATCH 1/8] sort raw vcf --- .gitignore | 2 ++ modules/local/file_concatenator.nf | 4 +-- modules/local/sort_nonstandard_vcf.nf | 38 ++++++++++++++++++++++++++ run_pipeline.sh | 2 +- subworkflows/local/mpileup_snv_call.nf | 13 ++++++++- 5 files changed, 55 insertions(+), 4 deletions(-) create mode 100644 modules/local/sort_nonstandard_vcf.nf diff --git a/.gitignore b/.gitignore index a9cfb02..bc7f825 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ __pycache__ output/ results/ result/ +results2/ results37/ test.xml test_output/ @@ -19,3 +20,4 @@ work/ testdata_hg37/ .github/CODEOWNERS-tmp bin/vcfparser.pyc +singularity/ diff --git a/modules/local/file_concatenator.nf b/modules/local/file_concatenator.nf index 678ab24..c3602aa 100644 --- a/modules/local/file_concatenator.nf +++ b/modules/local/file_concatenator.nf @@ -21,9 +21,9 @@ process FILE_CONCATENATOR { def prefix = task.ext.prefix ?: "${meta.id}" """ - headeredFileConcatenator.pl $vcfs > snvs_${prefix}_raw.vcf + headeredFileConcatenator.pl $vcfs > snvs_${prefix}.vcf - bgzip snvs_${prefix}_raw.vcf && tabix -p vcf snvs_${prefix}_raw.vcf.gz + bgzip snvs_${prefix}.vcf && tabix -p vcf snvs_${prefix}.vcf.gz cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/local/sort_nonstandard_vcf.nf b/modules/local/sort_nonstandard_vcf.nf new file mode 100644 index 0000000..0321aaa --- /dev/null +++ b/modules/local/sort_nonstandard_vcf.nf @@ -0,0 +1,38 @@ +process SORT_NONSTANDARD_VCF { + tag "$meta.id" + label 'process_single' + + conda (params.enable_conda ? "" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'docker://kubran/odcf_mpileupsnvcalling:v0':'kubran/odcf_mpileupsnvcalling:v0' }" + + input: + tuple val(meta), path(vcf_gz), path(index) + + output: + tuple val(meta), path("*_raw.vcf.gz"),path("*_raw.vcf.gz.tbi") , emit: output + path "versions.yml" , emit: versions + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + + """ + bgzip -d $vcf_gz > temp.vcf + + (head -n 5000 temp.vcf | \\ + grep "#" ; cat temp.vcf | \\ + grep -v "#" | \\ + sort -T . -k1,1V -n -k2,2n ) > temp_sorted.vcf + + bgzip temp_sorted.vcf > snvs_${prefix}_sorted.vcf.gz + tabix -p vcf snvs_${prefix}_sorted.vcf.gz + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + samtools: \$(echo \$(samtools 2>&1) | sed -e 's/.*Version: //; s/ Usage.*//') + END_VERSIONS + """ + +} \ No newline at end of file diff --git a/run_pipeline.sh b/run_pipeline.sh index 5ce5fac..82fb564 100644 --- a/run_pipeline.sh +++ b/run_pipeline.sh @@ -1,3 +1,3 @@ #!/bin/bash module load nextflow/22.07.1-edge -nextflow run main.nf -profile dkfz_cluster_hg38,singularity --outdir results \ No newline at end of file +nextflow run main.nf -profile dkfz_cluster_hg38,singularity --outdir results2 --input assets/samplesheet_hg38_WGS.csv -resume \ No newline at end of file diff --git a/subworkflows/local/mpileup_snv_call.nf b/subworkflows/local/mpileup_snv_call.nf index 125d0b0..417108f 100644 --- a/subworkflows/local/mpileup_snv_call.nf +++ b/subworkflows/local/mpileup_snv_call.nf @@ -8,6 +8,7 @@ include { BCFTOOLS_MPILEUP } from '../../modules/nf-core/modules/bcftools/m include { MPILEUP_COMPARE } from '../../modules/local/mpileup_compare.nf' addParams( options: params.options ) include { SEQ_CONTEXT_ANNOTATOR } from '../../modules/local/seq_context_annotator.nf' addParams( options: params.options ) include { FILE_CONCATENATOR } from '../../modules/local/file_concatenator.nf' addParams( options: params.options ) +include { SORT_NONSTANDARD_VCF } from '../../modules/local/sort_nonstandard_vcf.nf' addParams( options: params.options ) workflow MPILEUP_SNV_CALL { @@ -120,7 +121,17 @@ workflow MPILEUP_SNV_CALL { combined_vcf ) versions = versions.mix(FILE_CONCATENATOR.out.versions) - vcf_ch=FILE_CONCATENATOR.out.vcf + + // + // MODULE: SORT_NONSTANDARD_VCF + // + // Sort raw file + SORT_NONSTANDARD_VCF( + FILE_CONCATENATOR.out.vcf + ) + versions = versions.mix(SORT_NONSTANDARD_VCF.out.versions) + vcf_ch=SORT_NONSTANDARD_VCF.out.output + emit: vcf_ch From b89418c88620cdd3723d9b0610a2f89b80a5b768 Mon Sep 17 00:00:00 2001 From: kubranarci Date: Mon, 17 Jun 2024 16:37:10 +0200 Subject: [PATCH 2/8] docker changed --- modules/local/sort_nonstandard_vcf.nf | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/modules/local/sort_nonstandard_vcf.nf b/modules/local/sort_nonstandard_vcf.nf index 0321aaa..5cb6a4e 100644 --- a/modules/local/sort_nonstandard_vcf.nf +++ b/modules/local/sort_nonstandard_vcf.nf @@ -4,7 +4,7 @@ process SORT_NONSTANDARD_VCF { conda (params.enable_conda ? "" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'docker://kubran/odcf_mpileupsnvcalling:v0':'kubran/odcf_mpileupsnvcalling:v0' }" + 'docker://kubran/samtools:v1.9':'kubran/samtools:v1.9' }" input: tuple val(meta), path(vcf_gz), path(index) @@ -17,17 +17,13 @@ process SORT_NONSTANDARD_VCF { def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - """ - bgzip -d $vcf_gz > temp.vcf - - (head -n 5000 temp.vcf | \\ - grep "#" ; cat temp.vcf | \\ + (zcat $vcf_gz | head -n 5000 | \\ + grep "#" ; zcat $vcf_gz | \\ grep -v "#" | \\ - sort -T . -k1,1V -n -k2,2n ) > temp_sorted.vcf + sort -T . -k1,1V -k2,2n ) | bgzip > snvs_${prefix}_raw.vcf.gz - bgzip temp_sorted.vcf > snvs_${prefix}_sorted.vcf.gz - tabix -p vcf snvs_${prefix}_sorted.vcf.gz + tabix -p vcf snvs_${prefix}_raw.vcf.gz cat <<-END_VERSIONS > versions.yml "${task.process}": From ff6fd9f504e3d5c9455ac16316f71aefc1cdc2f6 Mon Sep 17 00:00:00 2001 From: kubranarci Date: Thu, 20 Jun 2024 15:12:12 +0200 Subject: [PATCH 3/8] fix sorting pipe --- assets/samplesheet_hg38_WGS.csv | 3 +-- modules/local/seq_context_annotator.nf | 7 ++----- modules/local/sort_nonstandard_vcf.nf | 9 ++++----- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/assets/samplesheet_hg38_WGS.csv b/assets/samplesheet_hg38_WGS.csv index 1867eb4..5b241fd 100644 --- a/assets/samplesheet_hg38_WGS.csv +++ b/assets/samplesheet_hg38_WGS.csv @@ -1,3 +1,2 @@ sample,tumor,tumor_index,control,control_index -SEQC2_LL1,/omics/odcf/analysis/OE0526_projects/public_data_analyses/seqc2/sequencing/whole_genome_sequencing/results_per_pid/SEQC2_LL1/alignment/tumor01_SEQC2_LL1_merged.mdup.bam,/omics/odcf/analysis/OE0526_projects/public_data_analyses/seqc2/sequencing/whole_genome_sequencing/results_per_pid/SEQC2_LL1/alignment/tumor01_SEQC2_LL1_merged.mdup.bam.bai,/omics/odcf/analysis/OE0526_projects/public_data_analyses/seqc2/sequencing/whole_genome_sequencing/results_per_pid/SEQC2_LL1/alignment/control01_SEQC2_LL1_merged.mdup.bam,/omics/odcf/analysis/OE0526_projects/public_data_analyses/seqc2/sequencing/whole_genome_sequencing/results_per_pid/SEQC2_LL1/alignment/control01_SEQC2_LL1_merged.mdup.bam.bai -SEQC2_LL2,/omics/odcf/project/public_data/seqc2/sequencing/whole_genome_sequencing/view-by-pid/SEQC2_IL2/tumor01/paired/merged-alignment/tumor01_SEQC2_IL2_merged.mdup.bam,/omics/odcf/project/public_data/seqc2/sequencing/whole_genome_sequencing/view-by-pid/SEQC2_IL2/tumor01/paired/merged-alignment/tumor01_SEQC2_IL2_merged.mdup.bam.bai,/omics/odcf/project/public_data/seqc2/sequencing/whole_genome_sequencing/view-by-pid/SEQC2_IL2/control01/paired/merged-alignment/control01_SEQC2_IL2_merged.mdup.bam,/omics/odcf/project/public_data/seqc2/sequencing/whole_genome_sequencing/view-by-pid/SEQC2_IL2/control01/paired/merged-alignment/control01_SEQC2_IL2_merged.mdup.bam.bai \ No newline at end of file +SEQC2_LL1,/omics/odcf/analysis/OE0526_projects/public_data_analyses/seqc2/sequencing/whole_genome_sequencing/results_per_pid/SEQC2_LL1/alignment/tumor01_SEQC2_LL1_merged.mdup.bam,/omics/odcf/analysis/OE0526_projects/public_data_analyses/seqc2/sequencing/whole_genome_sequencing/results_per_pid/SEQC2_LL1/alignment/tumor01_SEQC2_LL1_merged.mdup.bam.bai,/omics/odcf/analysis/OE0526_projects/public_data_analyses/seqc2/sequencing/whole_genome_sequencing/results_per_pid/SEQC2_LL1/alignment/control01_SEQC2_LL1_merged.mdup.bam,/omics/odcf/analysis/OE0526_projects/public_data_analyses/seqc2/sequencing/whole_genome_sequencing/results_per_pid/SEQC2_LL1/alignment/control01_SEQC2_LL1_merged.mdup.bam.bai \ No newline at end of file diff --git a/modules/local/seq_context_annotator.nf b/modules/local/seq_context_annotator.nf index 1cc1393..5e46085 100644 --- a/modules/local/seq_context_annotator.nf +++ b/modules/local/seq_context_annotator.nf @@ -26,11 +26,8 @@ process SEQ_CONTEXT_ANNOTATOR { """ seqContext_annotator.pl fastaFromBed $vcf $fasta 10 | \\ rawSnvFilter.py --outf=${prefix}.${intervals}.bias.vcf.temp $args - - (head -n 5000 ${prefix}.${intervals}.bias.vcf.temp | \\ - grep "#" ; cat ${prefix}.${intervals}.bias.vcf.temp | \\ - grep -v "#" | \\ - sort -T . -k1,1V -n -k2,2n ) > ${prefix}.${intervals}.bias.vcf + + awk '/^#/ {print; next} {print | "sort -T . -k1,1V -k2,2n"}' ${prefix}.${intervals}.bias.vcf.temp > ${prefix}.${intervals}.bias.vcf bcftools stats ${prefix}.${intervals}.bias.vcf > ${prefix}.${intervals}.bias.bcftools_stats.txt diff --git a/modules/local/sort_nonstandard_vcf.nf b/modules/local/sort_nonstandard_vcf.nf index 5cb6a4e..aba1c50 100644 --- a/modules/local/sort_nonstandard_vcf.nf +++ b/modules/local/sort_nonstandard_vcf.nf @@ -18,16 +18,15 @@ process SORT_NONSTANDARD_VCF { def prefix = task.ext.prefix ?: "${meta.id}" """ - (zcat $vcf_gz | head -n 5000 | \\ - grep "#" ; zcat $vcf_gz | \\ - grep -v "#" | \\ - sort -T . -k1,1V -k2,2n ) | bgzip > snvs_${prefix}_raw.vcf.gz + zcat $vcf_gz | \ + awk 'BEGIN {header=1} /^#/ {print; next} {header=0; print | "sort -T . -k1,1V -k2,2n"}' | \ + bgzip > snvs_${prefix}_raw.vcf.gz tabix -p vcf snvs_${prefix}_raw.vcf.gz cat <<-END_VERSIONS > versions.yml "${task.process}": - samtools: \$(echo \$(samtools 2>&1) | sed -e 's/.*Version: //; s/ Usage.*//') + tabix: \$(echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/ .*\$//') END_VERSIONS """ From 459c4207b4adc494e578963a19b29754be0d432b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=BCbra=20Narc=C4=B1?= Date: Thu, 20 Jun 2024 14:38:39 +0000 Subject: [PATCH 4/8] run on singularity --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f64d02f..2cf3a2d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -39,9 +39,9 @@ jobs: - name: DELAY to try address some odd behaviour with what appears to be a conflict between parallel htslib jobs leading to CI hangs run: | if [[ $NXF_VER = '' ]]; then sleep 1200; fi - - name: BASIC Run the basic pipeline with docker + - name: BASIC Run the basic pipeline with singularity run: | - nextflow run ${GITHUB_WORKSPACE} -profile test,docker + nextflow run ${GITHUB_WORKSPACE} -profile test,singularity - name: BASIC Run the basic pipeline when --runcontig set to "ALT_HLA" (contigs does not exist in bam) run: | - nextflow run ${GITHUB_WORKSPACE} -profile test,docker --runcontigs "ALT_HLA" \ No newline at end of file + nextflow run ${GITHUB_WORKSPACE} -profile test,singularity --runcontigs "ALT_HLA" \ No newline at end of file From c96c5393ef54b4224aa509716cf95388f6659cbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=BCbra=20Narc=C4=B1?= Date: Thu, 20 Jun 2024 15:09:04 +0000 Subject: [PATCH 5/8] back to docker --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2cf3a2d..f64d02f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -39,9 +39,9 @@ jobs: - name: DELAY to try address some odd behaviour with what appears to be a conflict between parallel htslib jobs leading to CI hangs run: | if [[ $NXF_VER = '' ]]; then sleep 1200; fi - - name: BASIC Run the basic pipeline with singularity + - name: BASIC Run the basic pipeline with docker run: | - nextflow run ${GITHUB_WORKSPACE} -profile test,singularity + nextflow run ${GITHUB_WORKSPACE} -profile test,docker - name: BASIC Run the basic pipeline when --runcontig set to "ALT_HLA" (contigs does not exist in bam) run: | - nextflow run ${GITHUB_WORKSPACE} -profile test,singularity --runcontigs "ALT_HLA" \ No newline at end of file + nextflow run ${GITHUB_WORKSPACE} -profile test,docker --runcontigs "ALT_HLA" \ No newline at end of file From 286faf0aa0b288adc69c26bfa23ca074e951e036 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=BCbra=20Narc=C4=B1?= Date: Fri, 21 Jun 2024 12:06:33 +0000 Subject: [PATCH 6/8] bcftools docker new image --- .../nf-core/modules/bcftools/mpileup/main.nf | 3 +- .../modules/bcftools/reheader/environment.yml | 7 - .../nf-core/modules/bcftools/reheader/main.nf | 74 ------- .../modules/bcftools/reheader/meta.yml | 63 ------ .../bcftools/reheader/tests/bcf.config | 4 - .../bcftools/reheader/tests/main.nf.test | 197 ------------------ .../bcftools/reheader/tests/main.nf.test.snap | 166 --------------- .../modules/bcftools/reheader/tests/tags.yml | 2 - .../bcftools/reheader/tests/vcf.config | 4 - .../bcftools/reheader/tests/vcf.gz.config | 4 - modules/nf-core/modules/bcftools/sort/main.nf | 3 +- 11 files changed, 2 insertions(+), 525 deletions(-) delete mode 100644 modules/nf-core/modules/bcftools/reheader/environment.yml delete mode 100644 modules/nf-core/modules/bcftools/reheader/main.nf delete mode 100644 modules/nf-core/modules/bcftools/reheader/meta.yml delete mode 100644 modules/nf-core/modules/bcftools/reheader/tests/bcf.config delete mode 100644 modules/nf-core/modules/bcftools/reheader/tests/main.nf.test delete mode 100644 modules/nf-core/modules/bcftools/reheader/tests/main.nf.test.snap delete mode 100644 modules/nf-core/modules/bcftools/reheader/tests/tags.yml delete mode 100644 modules/nf-core/modules/bcftools/reheader/tests/vcf.config delete mode 100644 modules/nf-core/modules/bcftools/reheader/tests/vcf.gz.config diff --git a/modules/nf-core/modules/bcftools/mpileup/main.nf b/modules/nf-core/modules/bcftools/mpileup/main.nf index 263311c..a2f02e3 100644 --- a/modules/nf-core/modules/bcftools/mpileup/main.nf +++ b/modules/nf-core/modules/bcftools/mpileup/main.nf @@ -4,8 +4,7 @@ process BCFTOOLS_MPILEUP { conda (params.enable_conda ? "bioconda::bcftools=1.9" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/bcftools:1.9--h47928c2_2': - 'quay.io/biocontainers/bcftools:1.9--h47928c2_2' }" + 'docker://kubran/bcftools:1.9':'kubran/bcftools:1.9' }" input: tuple val(meta), path(tumor), path(tumor_bai), path(control), path(control_bai), val(tumorname), val(controlname), val(intervals), path(interval_file) diff --git a/modules/nf-core/modules/bcftools/reheader/environment.yml b/modules/nf-core/modules/bcftools/reheader/environment.yml deleted file mode 100644 index aab0dc9..0000000 --- a/modules/nf-core/modules/bcftools/reheader/environment.yml +++ /dev/null @@ -1,7 +0,0 @@ -name: bcftools_reheader -channels: - - conda-forge - - bioconda - - defaults -dependencies: - - bioconda::bcftools=1.18 diff --git a/modules/nf-core/modules/bcftools/reheader/main.nf b/modules/nf-core/modules/bcftools/reheader/main.nf deleted file mode 100644 index 25716cb..0000000 --- a/modules/nf-core/modules/bcftools/reheader/main.nf +++ /dev/null @@ -1,74 +0,0 @@ -process BCFTOOLS_REHEADER { - tag "$meta.id" - label 'process_low' - - //conda "${moduleDir}/environment.yml" - conda (params.enable_conda ? "${moduleDir}/environment.yml" : null) - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/bcftools:1.18--h8b25389_0': - 'quay.io/biocontainers/bcftools:1.18--h8b25389_0' }" - - input: - tuple val(meta), path(vcf), path(header), path(samples) - tuple val(meta2), path(fai) - - output: - tuple val(meta), path("*.{vcf,vcf.gz,bcf,bcf.gz}"), emit: vcf - path "versions.yml" , emit: versions - - when: - task.ext.when == null || task.ext.when - - script: - def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" - def fai_argument = fai ? "--fai $fai" : "" - def header_argument = header ? "--header $header" : "" - def samples_argument = samples ? "--samples $samples" : "" - - def args2 = task.ext.args2 ?: '--output-type z' - def extension = args2.contains("--output-type b") || args2.contains("-Ob") ? "bcf.gz" : - args2.contains("--output-type u") || args2.contains("-Ou") ? "bcf" : - args2.contains("--output-type z") || args2.contains("-Oz") ? "vcf.gz" : - args2.contains("--output-type v") || args2.contains("-Ov") ? "vcf" : - "vcf" - def vcf_name = vcf.getExtension() == "gz" ? vcf.getBaseName() : vcf.getName() - vcf_name = vcf_name.take(vcf_name.size() - 4) - - """ - bcftools \\ - reheader \\ - $fai_argument \\ - $header_argument \\ - $samples_argument \\ - $args \\ - --threads $task.cpus \\ - $vcf \\ - | bcftools view \\ - $args2 \\ - --output ${vcf_name}.header.${extension} - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - bcftools: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//') - END_VERSIONS - """ - - stub: - def args2 = task.ext.args2 ?: '--output-type z' - def prefix = task.ext.prefix ?: "${meta.id}" - - def extension = args2.contains("--output-type b") || args2.contains("-Ob") ? "bcf.gz" : - args2.contains("--output-type u") || args2.contains("-Ou") ? "bcf" : - args2.contains("--output-type z") || args2.contains("-Oz") ? "vcf.gz" : - args2.contains("--output-type v") || args2.contains("-Ov") ? "vcf" : - "vcf" - """ - touch ${prefix}.${extension} - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - bcftools: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//') - END_VERSIONS - """ -} diff --git a/modules/nf-core/modules/bcftools/reheader/meta.yml b/modules/nf-core/modules/bcftools/reheader/meta.yml deleted file mode 100644 index 690d4ea..0000000 --- a/modules/nf-core/modules/bcftools/reheader/meta.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: bcftools_reheader -description: Reheader a VCF file -keywords: - - reheader - - vcf - - update header -tools: - - reheader: - description: | - Modify header of VCF/BCF files, change sample names. - homepage: http://samtools.github.io/bcftools/bcftools.html - documentation: http://samtools.github.io/bcftools/bcftools.html#reheader - doi: 10.1093/gigascience/giab008 - licence: ["MIT"] -input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - vcf: - type: file - description: VCF/BCF file - pattern: "*.{vcf.gz,vcf,bcf}" - - header: - type: file - description: New header to add to the VCF - pattern: "*.{header.txt}" - - samples: - type: file - description: File containing sample names to update (one sample per line) - pattern: "*.{samples.txt}" - - meta2: - type: map - description: | - Groovy Map containing reference information - e.g. [ id:'genome' ] - - fai: - type: file - description: Fasta index to update header sequences with - pattern: "*.{fai}" -output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" - - vcf: - type: file - description: VCF with updated header, bgzipped per default - pattern: "*.{vcf,vcf.gz,bcf,bcf.gz}" -authors: - - "@bjohnnyd" - - "@jemten" - - "@ramprasadn" -maintainers: - - "@bjohnnyd" - - "@jemten" - - "@ramprasadn" diff --git a/modules/nf-core/modules/bcftools/reheader/tests/bcf.config b/modules/nf-core/modules/bcftools/reheader/tests/bcf.config deleted file mode 100644 index 2b7dff5..0000000 --- a/modules/nf-core/modules/bcftools/reheader/tests/bcf.config +++ /dev/null @@ -1,4 +0,0 @@ -process { - ext.args2 = { "--no-version --output-type b" } - ext.prefix = "tested" -} \ No newline at end of file diff --git a/modules/nf-core/modules/bcftools/reheader/tests/main.nf.test b/modules/nf-core/modules/bcftools/reheader/tests/main.nf.test deleted file mode 100644 index f3200cb..0000000 --- a/modules/nf-core/modules/bcftools/reheader/tests/main.nf.test +++ /dev/null @@ -1,197 +0,0 @@ -nextflow_process { - - name "Test Process BCFTOOLS_REHEADER" - script "../main.nf" - process "BCFTOOLS_REHEADER" - tag "modules" - tag "modules_nfcore" - tag "bcftools" - tag "bcftools/reheader" - - test("sarscov2 - [vcf, [], []], fai - vcf output") { - - config "./vcf.config" - when { - - process { - """ - input[0] = [ - [ id:'test', single_end:false ], - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - [], - [] - ] - input[1] = [ - [ id:'genome' ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) - ] - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - - } - - test("sarscov2 - [vcf, [], []], fai - vcf.gz output") { - - config "./vcf.gz.config" - when { - - process { - """ - input[0] = [ - [ id:'test', single_end:false ], - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - [], - [] - ] - input[1] = [ - [ id:'genome' ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) - ] - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - - } - - test("sarscov2 - [vcf, [], []], fai - bcf output") { - - config "./bcf.config" - when { - - process { - """ - input[0] = [ - [ id:'test', single_end:false ], - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - [], - [] - ] - input[1] = [ - [ id:'genome' ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) - ] - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - - } - - test("sarscov2 - [vcf, header, []], []") { - - config "./vcf.config" - when { - - process { - """ - input[0] = [ - [ id:'test', single_end:false ], - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true), - [] - ] - input[1] = [ - [ id:'genome' ], // meta map - [] - ] - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - - } - - test("sarscov2 - [vcf, [], samples], fai") { - - config "./vcf.config" - when { - - process { - """ - ch_no_samples = Channel.of([ - [ id:'test', single_end:false ], - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - [] - ]) - ch_samples = Channel.of(["samples.txt", "new_name"]) - .collectFile(newLine:true) - input[0] = ch_no_samples.combine(ch_samples) - input[1] = [ - [ id:'genome' ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) - ] - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - - } - - test("sarscov2 - [vcf, [], []], fai - stub") { - - options "-stub" - config "./vcf.config" - when { - - process { - """ - input[0] = [ - [ id:'test', single_end:false ], - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - [], - [] - ] - input[1] = [ - [ id:'genome' ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) - ] - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot( - file(process.out.vcf[0][1]).name, - process.out.versions, - ).match() } - ) - } - - } - -} diff --git a/modules/nf-core/modules/bcftools/reheader/tests/main.nf.test.snap b/modules/nf-core/modules/bcftools/reheader/tests/main.nf.test.snap deleted file mode 100644 index 112736a..0000000 --- a/modules/nf-core/modules/bcftools/reheader/tests/main.nf.test.snap +++ /dev/null @@ -1,166 +0,0 @@ -{ - "sarscov2 - [vcf, [], []], fai - vcf output": { - "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "tested.vcf:md5,8e722884ffb75155212a3fc053918766" - ] - ], - "1": [ - "versions.yml:md5,fbf8ac8da771b6295a47392003f983ce" - ], - "vcf": [ - [ - { - "id": "test", - "single_end": false - }, - "tested.vcf:md5,8e722884ffb75155212a3fc053918766" - ] - ], - "versions": [ - "versions.yml:md5,fbf8ac8da771b6295a47392003f983ce" - ] - } - ], - "timestamp": "2023-11-29T13:05:44.058376693" - }, - "sarscov2 - [vcf, [], []], fai - bcf output": { - "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "tested.bcf.gz:md5,c31d9afd8614832c2a46d9a55682c97a" - ] - ], - "1": [ - "versions.yml:md5,fbf8ac8da771b6295a47392003f983ce" - ], - "vcf": [ - [ - { - "id": "test", - "single_end": false - }, - "tested.bcf.gz:md5,c31d9afd8614832c2a46d9a55682c97a" - ] - ], - "versions": [ - "versions.yml:md5,fbf8ac8da771b6295a47392003f983ce" - ] - } - ], - "timestamp": "2023-11-29T13:06:03.793372514" - }, - "sarscov2 - [vcf, [], []], fai - vcf.gz output": { - "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "tested.vcf.gz:md5,a1e45fe6d2b386fc2611766e5d2937ee" - ] - ], - "1": [ - "versions.yml:md5,fbf8ac8da771b6295a47392003f983ce" - ], - "vcf": [ - [ - { - "id": "test", - "single_end": false - }, - "tested.vcf.gz:md5,a1e45fe6d2b386fc2611766e5d2937ee" - ] - ], - "versions": [ - "versions.yml:md5,fbf8ac8da771b6295a47392003f983ce" - ] - } - ], - "timestamp": "2023-11-29T13:05:53.954090441" - }, - "sarscov2 - [vcf, [], []], fai - stub": { - "content": [ - "tested.vcf", - [ - "versions.yml:md5,fbf8ac8da771b6295a47392003f983ce" - ] - ], - "timestamp": "2023-11-29T13:06:33.549685303" - }, - "sarscov2 - [vcf, [], samples], fai": { - "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "tested.vcf:md5,c64c373c10b0be24b29d6f18708ec1e8" - ] - ], - "1": [ - "versions.yml:md5,fbf8ac8da771b6295a47392003f983ce" - ], - "vcf": [ - [ - { - "id": "test", - "single_end": false - }, - "tested.vcf:md5,c64c373c10b0be24b29d6f18708ec1e8" - ] - ], - "versions": [ - "versions.yml:md5,fbf8ac8da771b6295a47392003f983ce" - ] - } - ], - "timestamp": "2023-11-29T13:06:23.474745156" - }, - "sarscov2 - [vcf, header, []], []": { - "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "tested.vcf:md5,3189bc9a720d5d5d3006bf72d91300cb" - ] - ], - "1": [ - "versions.yml:md5,fbf8ac8da771b6295a47392003f983ce" - ], - "vcf": [ - [ - { - "id": "test", - "single_end": false - }, - "tested.vcf:md5,3189bc9a720d5d5d3006bf72d91300cb" - ] - ], - "versions": [ - "versions.yml:md5,fbf8ac8da771b6295a47392003f983ce" - ] - } - ], - "timestamp": "2023-11-29T13:06:13.841648691" - } -} \ No newline at end of file diff --git a/modules/nf-core/modules/bcftools/reheader/tests/tags.yml b/modules/nf-core/modules/bcftools/reheader/tests/tags.yml deleted file mode 100644 index c252941..0000000 --- a/modules/nf-core/modules/bcftools/reheader/tests/tags.yml +++ /dev/null @@ -1,2 +0,0 @@ -bcftools/reheader: - - modules/nf-core/bcftools/reheader/** diff --git a/modules/nf-core/modules/bcftools/reheader/tests/vcf.config b/modules/nf-core/modules/bcftools/reheader/tests/vcf.config deleted file mode 100644 index 820f2ae..0000000 --- a/modules/nf-core/modules/bcftools/reheader/tests/vcf.config +++ /dev/null @@ -1,4 +0,0 @@ -process { - ext.args2 = { "--no-version" } - ext.prefix = "tested" -} \ No newline at end of file diff --git a/modules/nf-core/modules/bcftools/reheader/tests/vcf.gz.config b/modules/nf-core/modules/bcftools/reheader/tests/vcf.gz.config deleted file mode 100644 index c3031c3..0000000 --- a/modules/nf-core/modules/bcftools/reheader/tests/vcf.gz.config +++ /dev/null @@ -1,4 +0,0 @@ -process { - ext.args2 = { "--no-version --output-type z" } - ext.prefix = "tested" -} \ No newline at end of file diff --git a/modules/nf-core/modules/bcftools/sort/main.nf b/modules/nf-core/modules/bcftools/sort/main.nf index ef2513f..3b9e5c2 100644 --- a/modules/nf-core/modules/bcftools/sort/main.nf +++ b/modules/nf-core/modules/bcftools/sort/main.nf @@ -5,8 +5,7 @@ process BCFTOOLS_SORT { //conda "${moduleDir}/environment.yml" conda (params.enable_conda ? "${moduleDir}/environment.yml" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/bcftools:1.18--h8b25389_0': - 'quay.io/biocontainers/bcftools:1.18--h8b25389_0' }" + 'docker://kubran/bcftools:1.9':'kubran/bcftools:1.9' }" input: tuple val(meta), path(vcf), path(index) From 7187c57f6e17dce2240ad1fe9965d3582768938b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=BCbra=20Narc=C4=B1?= Date: Fri, 21 Jun 2024 13:14:29 +0000 Subject: [PATCH 7/8] --output-file --- modules/nf-core/modules/bcftools/sort/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-core/modules/bcftools/sort/main.nf b/modules/nf-core/modules/bcftools/sort/main.nf index 3b9e5c2..993b97e 100644 --- a/modules/nf-core/modules/bcftools/sort/main.nf +++ b/modules/nf-core/modules/bcftools/sort/main.nf @@ -31,7 +31,7 @@ process BCFTOOLS_SORT { """ bcftools \\ sort \\ - --output ${vcf_name}.sorted.${extension} \\ + --output-file ${vcf_name}.sorted.${extension} \\ --temp-dir . \\ $args \\ $vcf From d456009e472ec4b65c3fae3694141422327014c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=BCbra=20Narc=C4=B1?= Date: Mon, 24 Jun 2024 10:09:31 +0200 Subject: [PATCH 8/8] outputs --- .github/workflows/main.yml | 5 +---- conf/modules.config | 10 ++-------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f64d02f..61f767d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -41,7 +41,4 @@ jobs: if [[ $NXF_VER = '' ]]; then sleep 1200; fi - name: BASIC Run the basic pipeline with docker run: | - nextflow run ${GITHUB_WORKSPACE} -profile test,docker - - name: BASIC Run the basic pipeline when --runcontig set to "ALT_HLA" (contigs does not exist in bam) - run: | - nextflow run ${GITHUB_WORKSPACE} -profile test,docker --runcontigs "ALT_HLA" \ No newline at end of file + nextflow run ${GITHUB_WORKSPACE} -profile test,docker \ No newline at end of file diff --git a/conf/modules.config b/conf/modules.config index d3cc3d7..a32597d 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -64,7 +64,7 @@ process { mode: params.publish_dir_mode ] } - withName: FILE_CONCATENATOR { + withName: SORT_NONSTANDARD_VCF { publishDir = [ path: {"${params.outdir}/${meta.id}"}, pattern: "*{.vcf.gz,vcf.gz.tbi}", @@ -175,12 +175,6 @@ process { ] ] } - withName: 'CONVERT_TO_VCF' { - publishDir = [ - path: { "${params.outdir}/test" }, - enabled: false - ] - } withName: 'BCFTOOLS_SORT' { publishDir = [ path: { "${params.outdir}/${meta.id}/standard_vcf/" }, @@ -199,7 +193,7 @@ process { // Don't publish results for these processes // process { - withName: 'GREP_SAMPLENAME|ANNOVAR|MUTATION_DISTANCE|CONTEXT_FREQUENCIES|ANNOTATE_VCF|FILTER_BY_CRIT|SNV_RELIABILITY_PIPE|DBSNP_COUNTER|FLAG_BIAS|CONFIDENCE_ANNOTATION' { + withName: 'GREP_SAMPLENAME|ANNOVAR|MUTATION_DISTANCE|CONTEXT_FREQUENCIES|ANNOTATE_VCF|FILTER_BY_CRIT|SNV_RELIABILITY_PIPE|DBSNP_COUNTER|FLAG_BIAS|CONFIDENCE_ANNOTATION|CONVERT_TO_VCF|FILE_CONCATENATOR' { publishDir = [ path: { "${params.outdir}/test" }, enabled: false