Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating the deepvariant module #427

Merged
merged 1 commit into from
Sep 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
"""

}