mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-22 02:58:17 +00:00
* New modules added: issues #200 and #310 * Update main.nf * Update meta.yml * Update tests/modules/gatk4/genotypegvcfs/main.nf * Apply suggestions from code review * Update main.nf * Updating tests for GenomicsDB input and adding the path for this test resource to test_data.config * Some minor changes on one of the test files I forgot to include Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com> Co-authored-by: GCJMackenzie <43276267+GCJMackenzie@users.noreply.github.com>
This commit is contained in:
parent
a6ca2b006b
commit
1a4c7cec1b
12 changed files with 715 additions and 0 deletions
78
modules/gatk4/genotypegvcfs/functions.nf
Normal file
78
modules/gatk4/genotypegvcfs/functions.nf
Normal file
|
@ -0,0 +1,78 @@
|
|||
//
|
||||
// Utility functions used in nf-core DSL2 module files
|
||||
//
|
||||
|
||||
//
|
||||
// Extract name of software tool from process name using $task.process
|
||||
//
|
||||
def getSoftwareName(task_process) {
|
||||
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
|
||||
}
|
||||
|
||||
//
|
||||
// Extract name of module from process name using $task.process
|
||||
//
|
||||
def getProcessName(task_process) {
|
||||
return task_process.tokenize(':')[-1]
|
||||
}
|
||||
|
||||
//
|
||||
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
|
||||
//
|
||||
def initOptions(Map args) {
|
||||
def Map options = [:]
|
||||
options.args = args.args ?: ''
|
||||
options.args2 = args.args2 ?: ''
|
||||
options.args3 = args.args3 ?: ''
|
||||
options.publish_by_meta = args.publish_by_meta ?: []
|
||||
options.publish_dir = args.publish_dir ?: ''
|
||||
options.publish_files = args.publish_files
|
||||
options.suffix = args.suffix ?: ''
|
||||
return options
|
||||
}
|
||||
|
||||
//
|
||||
// Tidy up and join elements of a list to return a path string
|
||||
//
|
||||
def getPathFromList(path_list) {
|
||||
def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries
|
||||
paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes
|
||||
return paths.join('/')
|
||||
}
|
||||
|
||||
//
|
||||
// Function to save/publish module results
|
||||
//
|
||||
def saveFiles(Map args) {
|
||||
def ioptions = initOptions(args.options)
|
||||
def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
|
||||
|
||||
// Do not publish versions.yml unless running from pytest workflow
|
||||
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
|
||||
return null
|
||||
}
|
||||
if (ioptions.publish_by_meta) {
|
||||
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
|
||||
for (key in key_list) {
|
||||
if (args.meta && key instanceof String) {
|
||||
def path = key
|
||||
if (args.meta.containsKey(key)) {
|
||||
path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key]
|
||||
}
|
||||
path = path instanceof String ? path : ''
|
||||
path_list.add(path)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ioptions.publish_files instanceof Map) {
|
||||
for (ext in ioptions.publish_files) {
|
||||
if (args.filename.endsWith(ext.key)) {
|
||||
def ext_list = path_list.collect()
|
||||
ext_list.add(ext.value)
|
||||
return "${getPathFromList(ext_list)}/$args.filename"
|
||||
}
|
||||
}
|
||||
} else if (ioptions.publish_files == null) {
|
||||
return "${getPathFromList(path_list)}/$args.filename"
|
||||
}
|
||||
}
|
54
modules/gatk4/genotypegvcfs/main.nf
Normal file
54
modules/gatk4/genotypegvcfs/main.nf
Normal file
|
@ -0,0 +1,54 @@
|
|||
// Import generic module functions
|
||||
include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
|
||||
|
||||
params.options = [:]
|
||||
options = initOptions(params.options)
|
||||
|
||||
process GATK4_GENOTYPEGVCFS {
|
||||
tag "$meta.id"
|
||||
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::gatk4=4.2.0.0" : null)
|
||||
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
|
||||
container "https://depot.galaxyproject.org/singularity/gatk4:4.2.0.0--0"
|
||||
} else {
|
||||
container "quay.io/biocontainers/gatk4:4.2.0.0--0"
|
||||
}
|
||||
|
||||
input:
|
||||
tuple val(meta), path(gvcf), path(gvcf_index)
|
||||
path fasta
|
||||
path fasta_index
|
||||
path fasta_dict
|
||||
path dbsnp
|
||||
path dbsnp_index
|
||||
path intervals_bed
|
||||
|
||||
output:
|
||||
tuple val(meta), path("*.vcf.gz"), emit: vcf
|
||||
path "versions.yml" , emit: versions
|
||||
|
||||
script:
|
||||
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
|
||||
def dbsnp_options = dbsnp ? "-D ${dbsnp}" : ""
|
||||
def interval_options = intervals_bed ? "-L ${intervals_bed}" : ""
|
||||
def gvcf_options = gvcf.name.endsWith(".vcf") || gvcf.name.endsWith(".vcf.gz") ? "$gvcf" : "gendb://$gvcf"
|
||||
"""
|
||||
gatk \\
|
||||
GenotypeGVCFs \\
|
||||
$options.args \\
|
||||
$interval_options \\
|
||||
$dbsnp_options \\
|
||||
-R $fasta \\
|
||||
-V $gvcf_options \\
|
||||
-O ${prefix}.vcf.gz
|
||||
|
||||
cat <<-END_VERSIONS > versions.yml
|
||||
${getProcessName(task.process)}:
|
||||
${getSoftwareName(task.process)}: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
|
||||
END_VERSIONS
|
||||
"""
|
||||
}
|
69
modules/gatk4/genotypegvcfs/meta.yml
Normal file
69
modules/gatk4/genotypegvcfs/meta.yml
Normal file
|
@ -0,0 +1,69 @@
|
|||
name: gatk4_genotypegvcfs
|
||||
description: |
|
||||
Perform joint genotyping on one or more samples pre-called with HaplotypeCaller.
|
||||
keywords:
|
||||
- joint genotyping
|
||||
- genotype
|
||||
- gvcf
|
||||
tools:
|
||||
- gatk4:
|
||||
description: Genome Analysis Toolkit (GATK4)
|
||||
homepage: https://gatk.broadinstitute.org/hc/en-us
|
||||
documentation: https://gatk.broadinstitute.org/hc/en-us/categories/360002369672s
|
||||
tool_dev_url: https://github.com/broadinstitute/gatk
|
||||
doi: "10.1158/1538-7445.AM2017-3590"
|
||||
licence: ['BSD-3-clause']
|
||||
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
description: |
|
||||
Groovy Map containing sample information
|
||||
e.g. [ id:'test', single_end:false ]
|
||||
- gvcf:
|
||||
type: tuple of files
|
||||
description: |
|
||||
Tuple of gVCF(.gz) file (first) and its index (second) or the path to a GenomicsDB (and empty)
|
||||
pattern: ["*.{vcf,vcf.gz}", "*.{idx,tbi}"]
|
||||
- fasta:
|
||||
type: file
|
||||
description: Reference fasta file
|
||||
pattern: "*.fasta"
|
||||
- fasta_index:
|
||||
type: file
|
||||
description: Reference fasta index file
|
||||
pattern: "*.fai"
|
||||
- fasta_dict:
|
||||
type: file
|
||||
description: Reference fasta sequence dict file
|
||||
pattern: "*.dict"
|
||||
- dbsnp:
|
||||
type: file
|
||||
description: dbSNP VCF file
|
||||
pattern: "*.vcf.gz"
|
||||
- dbsnp_index:
|
||||
type: tuple of files
|
||||
description: dbSNP VCF index file
|
||||
pattern: "*.tbi"
|
||||
- intervals_bed:
|
||||
type: file
|
||||
description: An intevals BED file
|
||||
pattern: "*.bed"
|
||||
|
||||
output:
|
||||
- meta:
|
||||
type: map
|
||||
description: |
|
||||
Groovy Map containing sample information
|
||||
e.g. [ id:'test', single_end:false ]
|
||||
- vcf:
|
||||
type: file
|
||||
description: Genotyped VCF file
|
||||
pattern: "*.vcf.gz"
|
||||
- versions:
|
||||
type: file
|
||||
description: File containing software versions
|
||||
pattern: "versions.yml"
|
||||
|
||||
authors:
|
||||
- "@santiagorevale"
|
78
modules/gatk4/indexfeaturefile/functions.nf
Normal file
78
modules/gatk4/indexfeaturefile/functions.nf
Normal file
|
@ -0,0 +1,78 @@
|
|||
//
|
||||
// Utility functions used in nf-core DSL2 module files
|
||||
//
|
||||
|
||||
//
|
||||
// Extract name of software tool from process name using $task.process
|
||||
//
|
||||
def getSoftwareName(task_process) {
|
||||
return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()
|
||||
}
|
||||
|
||||
//
|
||||
// Extract name of module from process name using $task.process
|
||||
//
|
||||
def getProcessName(task_process) {
|
||||
return task_process.tokenize(':')[-1]
|
||||
}
|
||||
|
||||
//
|
||||
// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules
|
||||
//
|
||||
def initOptions(Map args) {
|
||||
def Map options = [:]
|
||||
options.args = args.args ?: ''
|
||||
options.args2 = args.args2 ?: ''
|
||||
options.args3 = args.args3 ?: ''
|
||||
options.publish_by_meta = args.publish_by_meta ?: []
|
||||
options.publish_dir = args.publish_dir ?: ''
|
||||
options.publish_files = args.publish_files
|
||||
options.suffix = args.suffix ?: ''
|
||||
return options
|
||||
}
|
||||
|
||||
//
|
||||
// Tidy up and join elements of a list to return a path string
|
||||
//
|
||||
def getPathFromList(path_list) {
|
||||
def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries
|
||||
paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes
|
||||
return paths.join('/')
|
||||
}
|
||||
|
||||
//
|
||||
// Function to save/publish module results
|
||||
//
|
||||
def saveFiles(Map args) {
|
||||
def ioptions = initOptions(args.options)
|
||||
def path_list = [ ioptions.publish_dir ?: args.publish_dir ]
|
||||
|
||||
// Do not publish versions.yml unless running from pytest workflow
|
||||
if (args.filename.equals('versions.yml') && !System.getenv("NF_CORE_MODULES_TEST")) {
|
||||
return null
|
||||
}
|
||||
if (ioptions.publish_by_meta) {
|
||||
def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta
|
||||
for (key in key_list) {
|
||||
if (args.meta && key instanceof String) {
|
||||
def path = key
|
||||
if (args.meta.containsKey(key)) {
|
||||
path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key]
|
||||
}
|
||||
path = path instanceof String ? path : ''
|
||||
path_list.add(path)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ioptions.publish_files instanceof Map) {
|
||||
for (ext in ioptions.publish_files) {
|
||||
if (args.filename.endsWith(ext.key)) {
|
||||
def ext_list = path_list.collect()
|
||||
ext_list.add(ext.value)
|
||||
return "${getPathFromList(ext_list)}/$args.filename"
|
||||
}
|
||||
}
|
||||
} else if (ioptions.publish_files == null) {
|
||||
return "${getPathFromList(path_list)}/$args.filename"
|
||||
}
|
||||
}
|
40
modules/gatk4/indexfeaturefile/main.nf
Normal file
40
modules/gatk4/indexfeaturefile/main.nf
Normal file
|
@ -0,0 +1,40 @@
|
|||
// Import generic module functions
|
||||
include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
|
||||
|
||||
params.options = [:]
|
||||
options = initOptions(params.options)
|
||||
|
||||
process GATK4_INDEXFEATUREFILE {
|
||||
tag "$meta.id"
|
||||
label 'process_low'
|
||||
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::gatk4=4.2.0.0" : null)
|
||||
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
|
||||
container "https://depot.galaxyproject.org/singularity/gatk4:4.2.0.0--0"
|
||||
} else {
|
||||
container "quay.io/biocontainers/gatk4:4.2.0.0--0"
|
||||
}
|
||||
|
||||
input:
|
||||
tuple val(meta), path(feature_file)
|
||||
|
||||
output:
|
||||
tuple val(meta), path("*.{tbi,idx}"), emit: index
|
||||
path "versions.yml" , emit: versions
|
||||
|
||||
script:
|
||||
"""
|
||||
gatk \\
|
||||
IndexFeatureFile \\
|
||||
$options.args \\
|
||||
-I $feature_file
|
||||
|
||||
cat <<-END_VERSIONS > versions.yml
|
||||
${getProcessName(task.process)}:
|
||||
${getSoftwareName(task.process)}: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
|
||||
END_VERSIONS
|
||||
"""
|
||||
}
|
42
modules/gatk4/indexfeaturefile/meta.yml
Normal file
42
modules/gatk4/indexfeaturefile/meta.yml
Normal file
|
@ -0,0 +1,42 @@
|
|||
name: gatk4_indexfeaturefile
|
||||
description: Creates an index for a feature file, e.g. VCF or BED file.
|
||||
keywords:
|
||||
- index
|
||||
- feature
|
||||
tools:
|
||||
- gatk4:
|
||||
description: Genome Analysis Toolkit (GATK4)
|
||||
homepage: https://gatk.broadinstitute.org/hc/en-us
|
||||
documentation: https://gatk.broadinstitute.org/hc/en-us/categories/360002369672s
|
||||
tool_dev_url: https://github.com/broadinstitute/gatk
|
||||
doi: "10.1158/1538-7445.AM2017-3590"
|
||||
licence: ['BSD-3-clause']
|
||||
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
description: |
|
||||
Groovy Map containing sample information
|
||||
e.g. [ id:'test', single_end:false ]
|
||||
- feature_file:
|
||||
type: file
|
||||
description: VCF/BED file
|
||||
pattern: "*.{vcf,vcf.gz,bed,bed.gz}"
|
||||
|
||||
output:
|
||||
- meta:
|
||||
type: map
|
||||
description: |
|
||||
Groovy Map containing sample information
|
||||
e.g. [ id:'test', single_end:false ]
|
||||
- index:
|
||||
type: file
|
||||
description: Index for VCF/BED file
|
||||
pattern: "*.{tbi,idx}"
|
||||
- versions:
|
||||
type: file
|
||||
description: File containing software versions
|
||||
pattern: "versions.yml"
|
||||
|
||||
authors:
|
||||
- "@santiagorevale"
|
|
@ -474,6 +474,10 @@ gatk4/genomicsdbimport:
|
|||
- modules/gatk4/genomicsdbimport/**
|
||||
- tests/modules/gatk4/genomicsdbimport/**
|
||||
|
||||
gatk4/genotypegvcfs:
|
||||
- modules/gatk4/genotypegvcfs/**
|
||||
- tests/modules/gatk4/genotypegvcfs/**
|
||||
|
||||
gatk4/getpileupsummaries:
|
||||
- modules/gatk4/getpileupsummaries/**
|
||||
- tests/modules/gatk4/getpileupsummaries/**
|
||||
|
@ -482,6 +486,10 @@ gatk4/haplotypecaller:
|
|||
- modules/gatk4/haplotypecaller/**
|
||||
- tests/modules/gatk4/haplotypecaller/**
|
||||
|
||||
gatk4/indexfeaturefile:
|
||||
- modules/gatk4/indexfeaturefile/**
|
||||
- tests/modules/gatk4/indexfeaturefile/**
|
||||
|
||||
gatk4/intervallisttools:
|
||||
- modules/gatk4/intervallisttools/**
|
||||
- tests/modules/gatk4/intervallisttools/**
|
||||
|
|
|
@ -191,6 +191,8 @@ params {
|
|||
test2_pileups_table = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/test2.pileups.table"
|
||||
test_genomicsdb_tar_gz = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/test_genomicsdb.tar.gz"
|
||||
|
||||
test_genomicsdb_tar_gz = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/test_genomicsdb.tar.gz"
|
||||
|
||||
test_test2_paired_mutect2_calls_vcf_gz = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/paired_mutect2_calls/test_test2_paired_mutect2_calls.vcf.gz"
|
||||
test_test2_paired_mutect2_calls_vcf_gz_tbi = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/paired_mutect2_calls/test_test2_paired_mutect2_calls.vcf.gz.tbi"
|
||||
test_test2_paired_mutect2_calls_vcf_gz_stats = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/paired_mutect2_calls/test_test2_paired_mutect2_calls.vcf.gz.stats"
|
||||
|
|
180
tests/modules/gatk4/genotypegvcfs/main.nf
Normal file
180
tests/modules/gatk4/genotypegvcfs/main.nf
Normal file
|
@ -0,0 +1,180 @@
|
|||
#!/usr/bin/env nextflow
|
||||
|
||||
nextflow.enable.dsl = 2
|
||||
|
||||
include { GATK4_GENOTYPEGVCFS } from '../../../../modules/gatk4/genotypegvcfs/main.nf' addParams( options: [suffix:'.genotyped'] )
|
||||
include { UNTAR } from '../../../../modules/untar/main.nf' addParams( options: [:] )
|
||||
|
||||
// Basic parameters with uncompressed VCF input
|
||||
workflow test_gatk4_genotypegvcfs_vcf_input {
|
||||
|
||||
input = [ [ id:'test' ], // meta map
|
||||
file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf'], checkIfExists: true),
|
||||
file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_idx'], checkIfExists: true) ]
|
||||
|
||||
fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)
|
||||
fastaIndex = file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true)
|
||||
fastaDict = file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true)
|
||||
|
||||
GATK4_GENOTYPEGVCFS ( input, fasta, fastaIndex, fastaDict, [], [], [] )
|
||||
}
|
||||
|
||||
// Basic parameters with compressed VCF input
|
||||
workflow test_gatk4_genotypegvcfs_gz_input {
|
||||
|
||||
input = [ [ id:'test' ], // meta map
|
||||
file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz'], checkIfExists: true),
|
||||
file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz_tbi'], checkIfExists: true) ]
|
||||
|
||||
fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)
|
||||
fastaIndex = file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true)
|
||||
fastaDict = file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true)
|
||||
|
||||
GATK4_GENOTYPEGVCFS ( input, fasta, fastaIndex, fastaDict, [], [], [] )
|
||||
}
|
||||
|
||||
// Basic parameters + optional dbSNP
|
||||
workflow test_gatk4_genotypegvcfs_gz_input_dbsnp {
|
||||
|
||||
input = [ [ id:'test' ], // meta map
|
||||
file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz'], checkIfExists: true),
|
||||
file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz_tbi'], checkIfExists: true) ]
|
||||
|
||||
fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)
|
||||
fastaIndex = file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true)
|
||||
fastaDict = file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true)
|
||||
|
||||
dbsnp = file(params.test_data['homo_sapiens']['genome']['dbsnp_146_hg38_vcf_gz'], checkIfExists: true)
|
||||
dbsnpIndex = file(params.test_data['homo_sapiens']['genome']['dbsnp_146_hg38_vcf_gz_tbi'], checkIfExists: true)
|
||||
|
||||
GATK4_GENOTYPEGVCFS ( input, fasta, fastaIndex, fastaDict, dbsnp, dbsnpIndex, [] )
|
||||
}
|
||||
|
||||
// Basic parameters + optional intervals
|
||||
workflow test_gatk4_genotypegvcfs_gz_input_intervals {
|
||||
|
||||
input = [ [ id:'test' ], // meta map
|
||||
file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz'], checkIfExists: true),
|
||||
file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz_tbi'], checkIfExists: true) ]
|
||||
|
||||
fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)
|
||||
fastaIndex = file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true)
|
||||
fastaDict = file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true)
|
||||
|
||||
intervalsBed = file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true)
|
||||
|
||||
GATK4_GENOTYPEGVCFS ( input, fasta, fastaIndex, fastaDict, [], [], intervalsBed )
|
||||
}
|
||||
|
||||
// Basic parameters + optional dbSNP + optional intervals
|
||||
workflow test_gatk4_genotypegvcfs_gz_input_dbsnp_intervals {
|
||||
|
||||
input = [ [ id:'test' ], // meta map
|
||||
file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz'], checkIfExists: true),
|
||||
file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz_tbi'], checkIfExists: true) ]
|
||||
|
||||
fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)
|
||||
fastaIndex = file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true)
|
||||
fastaDict = file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true)
|
||||
|
||||
dbsnp = file(params.test_data['homo_sapiens']['genome']['dbsnp_146_hg38_vcf_gz'], checkIfExists: true)
|
||||
dbsnpIndex = file(params.test_data['homo_sapiens']['genome']['dbsnp_146_hg38_vcf_gz_tbi'], checkIfExists: true)
|
||||
|
||||
intervalsBed = file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true)
|
||||
|
||||
GATK4_GENOTYPEGVCFS ( input, fasta, fastaIndex, fastaDict, dbsnp, dbsnpIndex, intervalsBed )
|
||||
}
|
||||
|
||||
// Basic parameters with GenomicsDB input
|
||||
workflow test_gatk4_genotypegvcfs_gendb_input {
|
||||
|
||||
fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)
|
||||
fastaIndex = file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true)
|
||||
fastaDict = file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true)
|
||||
|
||||
test_genomicsdb = file(params.test_data['homo_sapiens']['illumina']['test_genomicsdb_tar_gz'], checkIfExists: true)
|
||||
|
||||
UNTAR ( test_genomicsdb )
|
||||
|
||||
Channel.of(file("mock_gvcf_index.txt")).set{mock_gvcf_index}
|
||||
Channel
|
||||
.of([ id:'test' ])
|
||||
.combine(UNTAR.out.untar)
|
||||
.combine(mock_gvcf_index)
|
||||
.set{ input }
|
||||
|
||||
GATK4_GENOTYPEGVCFS ( input, fasta, fastaIndex, fastaDict, [], [], [] )
|
||||
}
|
||||
|
||||
// Basic parameters with GenomicsDB + optional dbSNP
|
||||
workflow test_gatk4_genotypegvcfs_gendb_input_dbsnp {
|
||||
|
||||
fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)
|
||||
fastaIndex = file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true)
|
||||
fastaDict = file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true)
|
||||
|
||||
dbsnp = file(params.test_data['homo_sapiens']['genome']['dbsnp_146_hg38_vcf_gz'], checkIfExists: true)
|
||||
dbsnpIndex = file(params.test_data['homo_sapiens']['genome']['dbsnp_146_hg38_vcf_gz_tbi'], checkIfExists: true)
|
||||
|
||||
test_genomicsdb = file(params.test_data['homo_sapiens']['illumina']['test_genomicsdb_tar_gz'], checkIfExists: true)
|
||||
|
||||
UNTAR ( test_genomicsdb )
|
||||
|
||||
Channel.of(file("mock_gvcf_index.txt")).set{mock_gvcf_index}
|
||||
Channel
|
||||
.of([ id:'test' ])
|
||||
.combine(UNTAR.out.untar)
|
||||
.combine(mock_gvcf_index)
|
||||
.set{ input }
|
||||
|
||||
GATK4_GENOTYPEGVCFS ( input, fasta, fastaIndex, fastaDict, dbsnp, dbsnpIndex, [] )
|
||||
}
|
||||
|
||||
// Basic parameters with GenomicsDB + optional intervals
|
||||
workflow test_gatk4_genotypegvcfs_gendb_input_intervals {
|
||||
|
||||
fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)
|
||||
fastaIndex = file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true)
|
||||
fastaDict = file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true)
|
||||
|
||||
intervalsBed = file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true)
|
||||
|
||||
test_genomicsdb = file(params.test_data['homo_sapiens']['illumina']['test_genomicsdb_tar_gz'], checkIfExists: true)
|
||||
|
||||
UNTAR ( test_genomicsdb )
|
||||
|
||||
Channel.of(file("mock_gvcf_index.txt")).set{mock_gvcf_index}
|
||||
Channel
|
||||
.of([ id:'test' ])
|
||||
.combine(UNTAR.out.untar)
|
||||
.combine(mock_gvcf_index)
|
||||
.set{ input }
|
||||
|
||||
GATK4_GENOTYPEGVCFS ( input, fasta, fastaIndex, fastaDict, [], [], intervalsBed )
|
||||
}
|
||||
|
||||
// Basic parameters with GenomicsDB + optional dbSNP + optional intervals
|
||||
workflow test_gatk4_genotypegvcfs_gendb_input_dbsnp_intervals {
|
||||
|
||||
fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)
|
||||
fastaIndex = file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true)
|
||||
fastaDict = file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true)
|
||||
|
||||
dbsnp = file(params.test_data['homo_sapiens']['genome']['dbsnp_146_hg38_vcf_gz'], checkIfExists: true)
|
||||
dbsnpIndex = file(params.test_data['homo_sapiens']['genome']['dbsnp_146_hg38_vcf_gz_tbi'], checkIfExists: true)
|
||||
|
||||
intervalsBed = file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true)
|
||||
|
||||
test_genomicsdb = file(params.test_data['homo_sapiens']['illumina']['test_genomicsdb_tar_gz'], checkIfExists: true)
|
||||
|
||||
UNTAR ( test_genomicsdb )
|
||||
|
||||
Channel.of(file("mock_gvcf_index.txt")).set{mock_gvcf_index}
|
||||
Channel
|
||||
.of([ id:'test' ])
|
||||
.combine(UNTAR.out.untar)
|
||||
.combine(mock_gvcf_index)
|
||||
.set{ input }
|
||||
|
||||
GATK4_GENOTYPEGVCFS ( input, fasta, fastaIndex, fastaDict, dbsnp, dbsnpIndex, intervalsBed )
|
||||
}
|
80
tests/modules/gatk4/genotypegvcfs/test.yml
Normal file
80
tests/modules/gatk4/genotypegvcfs/test.yml
Normal file
|
@ -0,0 +1,80 @@
|
|||
- name: gatk4 genotypegvcfs test_gatk4_genotypegvcfs_vcf_input
|
||||
command: nextflow run tests/modules/gatk4/genotypegvcfs -entry test_gatk4_genotypegvcfs_vcf_input -c tests/config/nextflow.config
|
||||
tags:
|
||||
- gatk4
|
||||
- gatk4/genotypegvcfs
|
||||
files:
|
||||
- path: output/gatk4/test.genotyped.vcf.gz
|
||||
contains: ['AC=1;AF=0.500;AN=2;BaseQRankSum=0.00;DP=211;ExcessHet=3.0103;FS=0.000;MLEAC=1;MLEAF=0.500;MQ=60.00;MQRankSum=0.00;QD=0.95;ReadPosRankSum=1.09;SOR=0.680']
|
||||
|
||||
- name: gatk4 genotypegvcfs test_gatk4_genotypegvcfs_gz_input
|
||||
command: nextflow run tests/modules/gatk4/genotypegvcfs -entry test_gatk4_genotypegvcfs_gz_input -c tests/config/nextflow.config
|
||||
tags:
|
||||
- gatk4
|
||||
- gatk4/genotypegvcfs
|
||||
files:
|
||||
- path: output/gatk4/test.genotyped.vcf.gz
|
||||
contains: ['AC=1;AF=0.500;AN=2;BaseQRankSum=0.00;DP=211;ExcessHet=3.0103;FS=0.000;MLEAC=1;MLEAF=0.500;MQ=60.00;MQRankSum=0.00;QD=0.95;ReadPosRankSum=1.09;SOR=0.680']
|
||||
|
||||
- name: gatk4 genotypegvcfs test_gatk4_genotypegvcfs_gz_input_dbsnp
|
||||
command: nextflow run tests/modules/gatk4/genotypegvcfs -entry test_gatk4_genotypegvcfs_gz_input_dbsnp -c tests/config/nextflow.config
|
||||
tags:
|
||||
- gatk4
|
||||
- gatk4/genotypegvcfs
|
||||
files:
|
||||
- path: output/gatk4/test.genotyped.vcf.gz
|
||||
contains: ['AC=1;AF=0.500;AN=2;BaseQRankSum=0.00;DB;DP=211;ExcessHet=3.0103;FS=0.000;MLEAC=1;MLEAF=0.500;MQ=60.00;MQRankSum=0.00;QD=0.95;ReadPosRankSum=1.09;SOR=0.680']
|
||||
|
||||
- name: gatk4 genotypegvcfs test_gatk4_genotypegvcfs_gz_input_intervals
|
||||
command: nextflow run tests/modules/gatk4/genotypegvcfs -entry test_gatk4_genotypegvcfs_gz_input_intervals -c tests/config/nextflow.config
|
||||
tags:
|
||||
- gatk4
|
||||
- gatk4/genotypegvcfs
|
||||
files:
|
||||
- path: output/gatk4/test.genotyped.vcf.gz
|
||||
contains: ['AC=1;AF=0.500;AN=2;BaseQRankSum=0.00;DP=211;ExcessHet=3.0103;FS=0.000;MLEAC=1;MLEAF=0.500;MQ=60.00;MQRankSum=0.00;QD=0.95;ReadPosRankSum=1.09;SOR=0.680']
|
||||
|
||||
- name: gatk4 genotypegvcfs test_gatk4_genotypegvcfs_gz_input_dbsnp_intervals
|
||||
command: nextflow run tests/modules/gatk4/genotypegvcfs -entry test_gatk4_genotypegvcfs_gz_input_dbsnp_intervals -c tests/config/nextflow.config
|
||||
tags:
|
||||
- gatk4
|
||||
- gatk4/genotypegvcfs
|
||||
files:
|
||||
- path: output/gatk4/test.genotyped.vcf.gz
|
||||
contains: ['AC=1;AF=0.500;AN=2;BaseQRankSum=0.00;DB;DP=211;ExcessHet=3.0103;FS=0.000;MLEAC=1;MLEAF=0.500;MQ=60.00;MQRankSum=0.00;QD=0.95;ReadPosRankSum=1.09;SOR=0.680']
|
||||
|
||||
- name: gatk4 genotypegvcfs test_gatk4_genotypegvcfs_gendb_input
|
||||
command: nextflow run tests/modules/gatk4/genotypegvcfs -entry test_gatk4_genotypegvcfs_gendb_input -c tests/config/nextflow.config
|
||||
tags:
|
||||
- gatk4
|
||||
- gatk4/genotypegvcfs
|
||||
files:
|
||||
- path: output/gatk4/test.genotyped.vcf.gz
|
||||
contains: ['AC=1;AF=0.500;AN=2;BaseQRankSum=0.00;DP=211;ExcessHet=3.0103;FS=0.000;MLEAC=1;MLEAF=0.500;MQ=60.00;MQRankSum=0.00;QD=0.95;ReadPosRankSum=1.09;SOR=0.680']
|
||||
|
||||
- name: gatk4 genotypegvcfs test_gatk4_genotypegvcfs_gendb_input_dbsnp
|
||||
command: nextflow run tests/modules/gatk4/genotypegvcfs -entry test_gatk4_genotypegvcfs_gendb_input_dbsnp -c tests/config/nextflow.config
|
||||
tags:
|
||||
- gatk4
|
||||
- gatk4/genotypegvcfs
|
||||
files:
|
||||
- path: output/gatk4/test.genotyped.vcf.gz
|
||||
contains: ['AC=1;AF=0.500;AN=2;BaseQRankSum=0.00;DB;DP=211;ExcessHet=3.0103;FS=0.000;MLEAC=1;MLEAF=0.500;MQ=60.00;MQRankSum=0.00;QD=0.95;ReadPosRankSum=1.09;SOR=0.680']
|
||||
|
||||
- name: gatk4 genotypegvcfs test_gatk4_genotypegvcfs_gendb_input_intervals
|
||||
command: nextflow run tests/modules/gatk4/genotypegvcfs -entry test_gatk4_genotypegvcfs_gendb_input_intervals -c tests/config/nextflow.config
|
||||
tags:
|
||||
- gatk4
|
||||
- gatk4/genotypegvcfs
|
||||
files:
|
||||
- path: output/gatk4/test.genotyped.vcf.gz
|
||||
contains: ['AC=1;AF=0.500;AN=2;BaseQRankSum=0.00;DP=211;ExcessHet=3.0103;FS=0.000;MLEAC=1;MLEAF=0.500;MQ=60.00;MQRankSum=0.00;QD=0.95;ReadPosRankSum=1.09;SOR=0.680']
|
||||
|
||||
- name: gatk4 genotypegvcfs test_gatk4_genotypegvcfs_gendb_input_dbsnp_intervals
|
||||
command: nextflow run tests/modules/gatk4/genotypegvcfs -entry test_gatk4_genotypegvcfs_gendb_input_dbsnp_intervals -c tests/config/nextflow.config
|
||||
tags:
|
||||
- gatk4
|
||||
- gatk4/genotypegvcfs
|
||||
files:
|
||||
- path: output/gatk4/test.genotyped.vcf.gz
|
||||
contains: ['AC=1;AF=0.500;AN=2;BaseQRankSum=0.00;DB;DP=211;ExcessHet=3.0103;FS=0.000;MLEAC=1;MLEAF=0.500;MQ=60.00;MQRankSum=0.00;QD=0.95;ReadPosRankSum=1.09;SOR=0.680']
|
45
tests/modules/gatk4/indexfeaturefile/main.nf
Normal file
45
tests/modules/gatk4/indexfeaturefile/main.nf
Normal file
|
@ -0,0 +1,45 @@
|
|||
#!/usr/bin/env nextflow
|
||||
|
||||
nextflow.enable.dsl = 2
|
||||
|
||||
include { GATK4_INDEXFEATUREFILE } from '../../../../modules/gatk4/indexfeaturefile/main.nf' addParams( options: [:] )
|
||||
|
||||
workflow test_gatk4_indexfeaturefile_bed {
|
||||
|
||||
input = [
|
||||
[ id:'test' ], // meta map
|
||||
file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true)
|
||||
]
|
||||
|
||||
GATK4_INDEXFEATUREFILE ( input )
|
||||
}
|
||||
|
||||
workflow test_gatk4_indexfeaturefile_bed_gz {
|
||||
|
||||
input = [
|
||||
[ id:'test' ], // meta map
|
||||
file(params.test_data['homo_sapiens']['genome']['genome_bed_gz'], checkIfExists: true)
|
||||
]
|
||||
|
||||
GATK4_INDEXFEATUREFILE ( input )
|
||||
}
|
||||
|
||||
workflow test_gatk4_indexfeaturefile_vcf {
|
||||
|
||||
input = [
|
||||
[ id:'test' ], // meta map
|
||||
file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf'], checkIfExists: true)
|
||||
]
|
||||
|
||||
GATK4_INDEXFEATUREFILE ( input )
|
||||
}
|
||||
|
||||
workflow test_gatk4_indexfeaturefile_vcf_gz {
|
||||
|
||||
input = [
|
||||
[ id:'test' ], // meta map
|
||||
file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz'], checkIfExists: true)
|
||||
]
|
||||
|
||||
GATK4_INDEXFEATUREFILE ( input )
|
||||
}
|
39
tests/modules/gatk4/indexfeaturefile/test.yml
Normal file
39
tests/modules/gatk4/indexfeaturefile/test.yml
Normal file
|
@ -0,0 +1,39 @@
|
|||
# We can't use an md5sum or check file contents because:
|
||||
# a) the path to the file is embedded inside it,
|
||||
# b) the file is binary so we can't check for text inside it.
|
||||
- name: gatk4 indexfeaturefile test_gatk4_indexfeaturefile_bed
|
||||
command: nextflow run tests/modules/gatk4/indexfeaturefile -entry test_gatk4_indexfeaturefile_bed -c tests/config/nextflow.config
|
||||
tags:
|
||||
- gatk4
|
||||
- gatk4/indexfeaturefile
|
||||
files:
|
||||
- path: output/gatk4/genome.bed.idx
|
||||
|
||||
- name: gatk4 indexfeaturefile test_gatk4_indexfeaturefile_bed_gz
|
||||
command: nextflow run tests/modules/gatk4/indexfeaturefile -entry test_gatk4_indexfeaturefile_bed_gz -c tests/config/nextflow.config
|
||||
tags:
|
||||
- gatk4
|
||||
- gatk4/indexfeaturefile
|
||||
files:
|
||||
- path: output/gatk4/genome.bed.gz.tbi
|
||||
md5sum: 2eb6ed0a0b049efe4caa1413089dcd74
|
||||
|
||||
# We can't use an md5sum or check file contents because:
|
||||
# a) the path to the file is embedded inside it,
|
||||
# b) the file is binary so we can't check for text inside it.
|
||||
- name: gatk4 indexfeaturefile test_gatk4_indexfeaturefile_vcf
|
||||
command: nextflow run tests/modules/gatk4/indexfeaturefile -entry test_gatk4_indexfeaturefile_vcf -c tests/config/nextflow.config
|
||||
tags:
|
||||
- gatk4
|
||||
- gatk4/indexfeaturefile
|
||||
files:
|
||||
- path: output/gatk4/test.genome.vcf.idx
|
||||
|
||||
- name: gatk4 indexfeaturefile test_gatk4_indexfeaturefile_vcf_gz
|
||||
command: nextflow run tests/modules/gatk4/indexfeaturefile -entry test_gatk4_indexfeaturefile_vcf_gz -c tests/config/nextflow.config
|
||||
tags:
|
||||
- gatk4
|
||||
- gatk4/indexfeaturefile
|
||||
files:
|
||||
- path: output/gatk4/test.genome.vcf.gz.tbi
|
||||
md5sum: ea03cd1d1f178eefa656787537053c37
|
Loading…
Reference in a new issue