nf-core_modules/modules/vardictjava/main.nf
nvnieuwk eab173f2bb
Added java options to vardict java (#1695)
* Added java options to vardict java

* updated test.yml

* correctly added java options

* Added automatic version numbers for vardictjava

* possible fix for version number in conda

* removed the cram tests

* linting

* Update modules/vardictjava/main.nf

Co-authored-by: Mahesh Binzer-Panchal <mahesh.binzer-panchal@nbis.se>

* Update modules/vardictjava/main.nf

Co-authored-by: Mahesh Binzer-Panchal <mahesh.binzer-panchal@nbis.se>

* removed the version line

Co-authored-by: Mahesh Binzer-Panchal <mahesh.binzer-panchal@nbis.se>
2022-08-10 14:13:03 +02:00

48 lines
1.5 KiB
Text

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)
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}"
"""
export JAVA_OPTS='"-Xms${task.memory.toMega()/4}m" "-Xmx${task.memory.toGiga()}g" "-Dsamjdk.reference_fasta=$fasta"'
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: \$( realpath \$( command -v vardict-java ) | sed 's/.*java-//;s/-.*//' )
var2vcf_valid.pl: \$( var2vcf_valid.pl -h | sed '2!d;s/.* //' )
END_VERSIONS
"""
}