Skip to content

Commit

Permalink
Updating the deepvariant module
Browse files Browse the repository at this point in the history
  • Loading branch information
abhi18av authored Sep 15, 2021
1 parent 6462bc8 commit cefd07d
Showing 1 changed file with 10 additions and 25 deletions.
35 changes: 10 additions & 25 deletions modules/local/deepvariant/main.nf
Original file line number Diff line number Diff line change
@@ -1,42 +1,26 @@
// TODO Remove the module declaration
nextflow.enable.dsl=2

// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'

// TODO nf-core: A module file SHOULD only define input and output files as command-line parameters.
// All other parameters MUST be provided as a string i.e. "options.args"
// where "params.options" is a Groovy Map that MUST be provided via the addParams section of the including workflow.
// Any parameters that need to be evaluated in the context of a particular sample
// e.g. single-end/paired-end data MUST also be defined and evaluated appropriately.

params.options = [:]
options = initOptions(params.options)

process DEEPVARIANT {
tag "$meta.id"
label 'process_high'
label 'process_medium'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) }

conda (params.enable_conda ? "bioconda::deepvariant=1.1.0" : null)
conda (params.enable_conda ? "bioconda::deepvariant=1.2.0" : null)
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/deepvariant:1.1.0--py36hf3e76ba_2"
container "docker://google/deepvariant:1.2.0"
} else {
// TODO update the bioconda container to work with run_deepvariant.sh script
// container "quay.io/biocontainers/deepvariant:1.1.0--py36hf3e76ba_2"
container "google/deepvariant:1.1.0"
container "google/deepvariant:1.2.0"
}

input:
// TODO nf-core: Where applicable all sample-specific information e.g. "id", "single_end", "read_group"
// MUST be provided as an input via a Groovy Map called "meta".
// This information may not be required in some instances e.g. indexing reference genome files:
// https://github.com/nf-core/modules/blob/master/software/bwa/index/main.nf
tuple val(meta), path(bam), path(bai)
path fasta
path fai
path(fasta)
path(fai)

output:
tuple val(meta), path("*.vcf.gz"), emit: vcf
Expand All @@ -46,16 +30,17 @@ process DEEPVARIANT {
script:
def software = getSoftwareName(task.process)
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"

"""
/opt/deepvariant/bin/run_deepvariant \\
--ref=${fasta} \\
--reads=${bam} \\
--output_vcf=${prefix}.vcf.gz \\
--output_gvcf=${prefix}.g.vcf.gz \\
--num_shards=${task.cpus} \\
${options.args}
${options.args} \\
--num_shards=${task.cpus}
echo \$(/opt/deepvariant/bin/run_deepvariant --version) > ${software}.version.txt
echo \$(/opt/deepvariant/bin/run_deepvariant --version) | sed 's/^.*version //; s/ .*\$//' > ${software}.version.txt
"""

}

0 comments on commit cefd07d

Please sign in to comment.