2021-02-16 07:40:06 -05:00
|
|
|
// Import generic module functions
|
|
|
|
include { initOptions; saveFiles; getSoftwareName } from './functions'
|
|
|
|
|
|
|
|
params.options = [:]
|
2021-03-15 08:16:43 -04:00
|
|
|
options = initOptions(params.options)
|
2021-02-16 07:40:06 -05:00
|
|
|
|
2021-03-08 08:45:46 -05:00
|
|
|
process GATK4_CREATESEQUENCEDICTIONARY {
|
2021-02-16 07:40:06 -05:00
|
|
|
tag "$fasta"
|
|
|
|
label 'process_medium'
|
|
|
|
publishDir "${params.outdir}",
|
|
|
|
mode: params.publish_dir_mode,
|
2021-04-09 12:23:56 -04:00
|
|
|
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:[:], publish_by_meta:[]) }
|
2021-02-16 07:40:06 -05:00
|
|
|
|
2021-07-16 05:24:29 -04:00
|
|
|
conda (params.enable_conda ? "bioconda::gatk4=4.2.0.0" : null)
|
2021-02-16 07:40:06 -05:00
|
|
|
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
|
2021-07-16 05:24:29 -04:00
|
|
|
container "https://depot.galaxyproject.org/singularity/gatk4:4.2.0.0--0"
|
2021-02-16 07:40:06 -05:00
|
|
|
} else {
|
2021-07-16 05:24:29 -04:00
|
|
|
container "quay.io/biocontainers/gatk4:4.2.0.0--0"
|
2021-02-16 07:40:06 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
input:
|
|
|
|
path fasta
|
|
|
|
|
|
|
|
output:
|
2021-02-16 07:42:34 -05:00
|
|
|
path "*.dict" , emit: dict
|
2021-02-16 07:40:06 -05:00
|
|
|
path "*.version.txt" , emit: version
|
|
|
|
|
|
|
|
script:
|
|
|
|
def software = getSoftwareName(task.process)
|
2021-02-16 07:54:40 -05:00
|
|
|
def avail_mem = 6
|
|
|
|
if (!task.memory) {
|
|
|
|
log.info '[GATK] Available memory not known - defaulting to 6GB. Specify process memory requirements to change this.'
|
|
|
|
} else {
|
|
|
|
avail_mem = task.memory.giga
|
|
|
|
}
|
2021-02-16 07:40:06 -05:00
|
|
|
"""
|
2021-02-16 07:54:40 -05:00
|
|
|
gatk --java-options "-Xmx${avail_mem}g" \\
|
2021-02-16 07:40:06 -05:00
|
|
|
CreateSequenceDictionary \\
|
|
|
|
--REFERENCE $fasta \\
|
2021-02-16 17:08:11 -05:00
|
|
|
--URI $fasta \\
|
2021-02-16 07:40:06 -05:00
|
|
|
$options.args
|
|
|
|
|
2021-07-01 11:13:01 -04:00
|
|
|
echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//' > ${software}.version.txt
|
2021-02-16 07:40:06 -05:00
|
|
|
"""
|
|
|
|
}
|