Merge branch 'master' into add-slimfastq

This commit is contained in:
Chris Cheshire 2022-05-03 12:11:19 +01:00 committed by GitHub
commit 6015478b72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 319 additions and 1 deletions

View file

@ -43,4 +43,15 @@ process GATK4_MERGEBAMALIGNMENT {
gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.bam
cat <<-END_VERSIONS > versions.yml
"${task.process}":
gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
}

View file

@ -57,4 +57,18 @@ process GATK4_MUTECT2 {
gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.vcf.gz
touch ${prefix}.vcf.gz.tbi
touch ${prefix}.vcf.gz.stats
touch ${prefix}.f1r2.tar.gz
cat <<-END_VERSIONS > versions.yml
"${task.process}":
gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
}

View file

@ -39,4 +39,15 @@ process GATK4_REVERTSAM {
gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.reverted.bam
cat <<-END_VERSIONS > versions.yml
"${task.process}":
gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
}

View file

@ -40,4 +40,17 @@ process GATK4_SAMTOFASTQ {
gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.fastq.gz
touch ${prefix}_1.fastq.gz
touch ${prefix}_2.fastq.gz
cat <<-END_VERSIONS > versions.yml
"${task.process}":
gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
}

View file

@ -23,7 +23,7 @@ process METAPHLAN3 {
script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def input_type = ("$input".endsWith(".fastq.gz")) ? "--input_type fastq" : ("$input".contains(".fasta")) ? "--input_type fasta" : ("$input".endsWith(".bowtie2out.txt")) ? "--input_type bowtie2out" : "--input_type sam"
def input_type = ("$input".endsWith(".fastq.gz") || "$input".endsWith(".fq.gz")) ? "--input_type fastq" : ("$input".contains(".fasta")) ? "--input_type fasta" : ("$input".endsWith(".bowtie2out.txt")) ? "--input_type bowtie2out" : "--input_type sam"
def input_data = ("$input_type".contains("fastq")) && !meta.single_end ? "${input[0]},${input[1]}" : "$input"
def bowtie2_out = "$input_type" == "--input_type bowtie2out" || "$input_type" == "--input_type sam" ? '' : "--bowtie2out ${prefix}.bowtie2out.txt"

View file

@ -41,4 +41,16 @@ process SAMTOOLS_VIEW {
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""
stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.bam
touch ${prefix}.cram
cat <<-END_VERSIONS > versions.yml
"${task.process}":
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""
}

View file

@ -0,0 +1,50 @@
def VERSION = '1.8.3'
process VARDICTJAVA {
tag "$meta.id"
label 'process_medium'
conda (params.enable_conda ? "bioconda::vardict-java=1.8.3" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/vardict-java:1.8.3--hdfd78af_0':
'quay.io/biocontainers/vardict-java:1.8.3--hdfd78af_0' }"
input:
tuple val(meta), path(bam), path(bai)
path(bed)
tuple path(fasta), path(fasta_fai)
output:
tuple val(meta), path("*.vcf.gz"), emit: vcf
path "versions.yml" , emit: versions
when:
task.ext.when == null || task.ext.when
script:
def args = task.ext.args ?: ''
def args2 = task.ext.args2 ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
vardict-java \\
$args \\
-c 1 -S 2 -E 3 \\
-b $bam \\
-th $task.cpus \\
-N $prefix \\
-G $fasta \\
$bed \\
| teststrandbias.R \\
| var2vcf_valid.pl \\
$args2 \\
-N $prefix \\
| gzip -c > ${prefix}.vcf.gz
cat <<-END_VERSIONS > versions.yml
"${task.process}":
vardict-java: $VERSION
var2vcf_valid.pl: \$(echo \$(var2vcf_valid.pl -h | sed -n 2p | awk '{ print \$2 }'))
END_VERSIONS
"""
}

View file

@ -0,0 +1,60 @@
name: "vardictjava"
description: The Java port of the VarDict variant caller
keywords:
- variant calling
- VarDict
- AstraZeneca
tools:
- "vardictjava":
description: "Java port of the VarDict variant discovery program"
homepage: "https://github.com/AstraZeneca-NGS/VarDictJava"
documentation: "https://github.com/AstraZeneca-NGS/VarDictJava"
tool_dev_url: "https://github.com/AstraZeneca-NGS/VarDictJava"
doi: "10.1093/nar/gkw227 "
licence: "['MIT']"
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- bam:
type: file
description: BAM/SAM file
pattern: "*.{bam,sam}"
- bai:
type: file
description: Index of the BAM file
pattern: "*.bai"
- fasta:
type: file
description: FASTA of the reference genome
pattern: "*.{fa,fasta}"
- fasta_fai:
type: file
description: The index of the FASTA of the reference genome
pattern: "*.fai"
- bed:
type: file
description: BED with the regions of interest
pattern: "*.bed"
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 file output
pattern: "*.vcf.gz"
authors:
- "@nvnieuwk"

View file

@ -1924,6 +1924,10 @@ unzip:
- modules/unzip/**
- tests/modules/unzip/**
vardictjava:
- modules/vardictjava/**
- tests/modules/vardictjava/**
variantbam:
- modules/variantbam/**
- tests/modules/variantbam/**

View file

@ -14,3 +14,14 @@ workflow test_gatk4_mergebamalignment {
GATK4_MERGEBAMALIGNMENT ( input, fasta, dict )
}
workflow test_gatk4_mergebamalignment_stubs {
input = [ [ id:'test' ], // meta map
"test_foo.bam",
"test_bar.bam"
]
fasta = "genome.fasta"
dict = "genome.fasta.dict"
GATK4_MERGEBAMALIGNMENT ( input, fasta, dict )
}

View file

@ -7,3 +7,12 @@
- path: output/gatk4/test.bam
md5sum: e6f1b343700b7ccb94e81ae127433988
- path: output/gatk4/versions.yml
- name: gatk4 mergebamalignment test_gatk4_mergebamalignment_stubs
command: nextflow run ./tests/modules/gatk4/mergebamalignment -entry test_gatk4_mergebamalignment -c ./tests/config/nextflow.config -c ./tests/modules/gatk4/mergebamalignment/nextflow.config -stub-run
tags:
- gatk4
- gatk4/mergebamalignment
files:
- path: output/gatk4/test.bam
- path: output/gatk4/versions.yml

View file

@ -118,3 +118,25 @@ workflow test_gatk4_mutect2_mitochondria {
GATK4_MUTECT2_MITO ( input, fasta, fai, dict, [], [], [], [] )
}
workflow test_gatk4_mutect2_tumor_normal_pair_f1r2_stubs {
input = [ [ id:'test', normal_id:'normal', tumor_id:'tumour' ], // meta map
[ "foo_paired.bam",
"foo_paired2.bam"
],
[ "foo_paired.bam.bai",
"foo_paired2.bam.bai"
],
[]
]
fasta = "genome.fasta"
fai = "genome.fasta.fai"
dict = "genome.fasta.dict"
germline_resource = "genome_gnomAD.r2.1.1.vcf.gz"
germline_resource_tbi = "genome_gnomAD.r2.1.1.vcf.gz.tbi"
panel_of_normals = "genome_mills_and_1000G.indels.hg38.vcf.gz"
panel_of_normals_tbi = "genome_mills_and_1000G.indels.hg38.vcf.gz.tbi"
GATK4_MUTECT2_F1R2 ( input, fasta, fai, dict, germline_resource, germline_resource_tbi, panel_of_normals, panel_of_normals_tbi )
}

View file

@ -69,3 +69,15 @@
md5sum: fc6ea14ca2da346babe78161beea28c9
- path: output/gatk4/test.vcf.gz.tbi
- path: output/gatk4/versions.yml
- name: gatk4 mutect2 test_gatk4_mutect2_tumor_normal_pair_f1r2_stubs
command: nextflow run ./tests/modules/gatk4/mutect2 -entry test_gatk4_mutect2_tumor_normal_pair_f1r2 -c ./tests/config/nextflow.config -c ./tests/modules/gatk4/mutect2/nextflow.config -stub-run
tags:
- gatk4
- gatk4/mutect2
files:
- path: output/gatk4/test.f1r2.tar.gz
- path: output/gatk4/test.vcf.gz
- path: output/gatk4/test.vcf.gz.stats
- path: output/gatk4/test.vcf.gz.tbi
- path: output/gatk4/versions.yml

View file

@ -11,3 +11,11 @@ workflow test_gatk4_revertsam {
GATK4_REVERTSAM ( input )
}
workflow test_gatk4_revertsam_stubs {
input = [ [ id:'test' ], // meta map
"foo_paired_end.bam"
]
GATK4_REVERTSAM ( input )
}

View file

@ -7,3 +7,12 @@
- path: output/gatk4/test.reverted.bam
md5sum: f783a88deb45c3a2c20ca12cbe1c5652
- path: output/gatk4/versions.yml
- name: gatk4 revertsam test_gatk4_revertsam_stubs
command: nextflow run ./tests/modules/gatk4/revertsam -entry test_gatk4_revertsam -c ./tests/config/nextflow.config -c ./tests/modules/gatk4/revertsam/nextflow.config -stub-run
tags:
- gatk4
- gatk4/revertsam
files:
- path: output/gatk4/test.reverted.bam
- path: output/gatk4/versions.yml

View file

@ -19,3 +19,11 @@ workflow test_gatk4_samtofastq_paired_end {
GATK4_SAMTOFASTQ ( input )
}
workflow test_gatk4_samtofastq_paired_end_stubs {
input = [ [ id:'test', single_end: false ], // meta map
[ "foo_paired_end.bam" ]
]
GATK4_SAMTOFASTQ ( input )
}

View file

@ -19,3 +19,13 @@
- path: output/gatk4/test_2.fastq.gz
md5sum: 613bf64c023609e1c62ad6ce9e4be8d7
- path: output/gatk4/versions.yml
- name: gatk4 samtofastq test_gatk4_samtofastq_paired_end_stubs
command: nextflow run ./tests/modules/gatk4/samtofastq -entry test_gatk4_samtofastq_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/gatk4/samtofastq/nextflow.config -stub-run
tags:
- gatk4
- gatk4/samtofastq
files:
- path: output/gatk4/test_1.fastq.gz
- path: output/gatk4/test_2.fastq.gz
- path: output/gatk4/versions.yml

View file

@ -22,3 +22,12 @@ workflow test_samtools_view_cram {
SAMTOOLS_VIEW ( input, fasta )
}
workflow test_samtools_view_stubs {
input = [ [ id:'test', single_end:false ], // meta map
"foo_paired_end.bam",
[]
]
SAMTOOLS_VIEW ( input, [] )
}

View file

@ -14,3 +14,11 @@
- samtools
files:
- path: output/samtools/test.cram
- name: samtools view test_samtools_view_stubs
command: nextflow run ./tests/modules/samtools/view -entry test_samtools_view -c ./tests/config/nextflow.config -c ./tests/modules/samtools/view/nextflow.config -stub-run
tags:
- samtools/view
- samtools
files:
- path: output/samtools/test.bam

View file

@ -0,0 +1,23 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { VARDICTJAVA } from '../../../modules/vardictjava/main.nf'
workflow test_vardictjava {
bam_input_ch = Channel.value([
[ id:'test' ], // meta map
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true),
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true)
])
bed = Channel.value(file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true))
reference = Channel.value([
file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true),
file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true)
])
VARDICTJAVA ( bam_input_ch, bed, reference )
}

View file

@ -0,0 +1,5 @@
process {
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
}

View file

@ -0,0 +1,9 @@
- name: vardictjava test_vardictjava
command: nextflow run tests/modules/vardictjava -entry test_vardictjava -c tests/config/nextflow.config
tags:
- vardictjava
files:
- path: output/vardictjava/test.vcf.gz
md5sum: 3f1f227afc532bddeb58f16fd3013fc8
- path: output/vardictjava/versions.yml
md5sum: 9b62c431a4f2680412b61c7071bdb1cd