mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-11-10 20:23:10 +00:00
Add GATK indelrealigner tests
This commit is contained in:
parent
e9c29656e6
commit
4d7afa21e2
4 changed files with 35 additions and 26 deletions
|
@ -22,11 +22,12 @@ process GATK_INDELREALIGNER {
|
||||||
task.ext.when == null || task.ext.when
|
task.ext.when == null || task.ext.when
|
||||||
|
|
||||||
script:
|
script:
|
||||||
if ("$input" == "${prefix}.bam") error "Input and output names are the same, set prefix in module configuration to disambiguate!"
|
|
||||||
def args = task.ext.args ?: ''
|
def args = task.ext.args ?: ''
|
||||||
def prefix = task.ext.prefix ?: "${meta.id}"
|
def prefix = task.ext.prefix ?: "${meta.id}"
|
||||||
def known = known_vcf ? "-known ${known_vcf}" : ""
|
def known = known_vcf ? "-known ${known_vcf}" : ""
|
||||||
|
|
||||||
|
if ("$input" == "${prefix}.bam") error "Input and output names are the same, set prefix in module configuration to disambiguate!"
|
||||||
|
|
||||||
def avail_mem = 3
|
def avail_mem = 3
|
||||||
if (!task.memory) {
|
if (!task.memory) {
|
||||||
log.info '[GATK IndelRealigner] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
|
log.info '[GATK IndelRealigner] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
|
||||||
|
@ -39,9 +40,8 @@ process GATK_INDELREALIGNER {
|
||||||
-Xmx${avail_mem}g \\
|
-Xmx${avail_mem}g \\
|
||||||
-T IndelRealigner \\
|
-T IndelRealigner \\
|
||||||
-R ${fasta} \\
|
-R ${fasta} \\
|
||||||
-nt ${task.cpus}
|
|
||||||
-I ${input} \\
|
-I ${input} \\
|
||||||
-targetIntervals ${intervals} \\
|
--targetIntervals ${intervals} \\
|
||||||
${known} \\
|
${known} \\
|
||||||
-o ${prefix}.bam \\
|
-o ${prefix}.bam \\
|
||||||
$args
|
$args
|
||||||
|
|
|
@ -2,21 +2,32 @@
|
||||||
|
|
||||||
nextflow.enable.dsl = 2
|
nextflow.enable.dsl = 2
|
||||||
|
|
||||||
|
include { GATK_REALIGNERTARGETCREATOR } from '../../../../modules/gatk/realignertargetcreator/main.nf'
|
||||||
include { GATK_INDELREALIGNER } from '../../../../modules/gatk/indelrealigner/main.nf'
|
include { GATK_INDELREALIGNER } from '../../../../modules/gatk/indelrealigner/main.nf'
|
||||||
|
|
||||||
// TODO add REalignerTargetCrator
|
|
||||||
|
|
||||||
|
|
||||||
workflow test_gatk_indelrealigner {
|
workflow test_gatk_indelrealigner {
|
||||||
|
|
||||||
input = [
|
|
||||||
[ id:'test', single_end:false ], // meta map
|
fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
|
||||||
file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true),
|
fai = file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true)
|
||||||
file(params.test_data['sarscov2']['illumina']['test_paired_end_bai'], checkIfExists: true),
|
dict = file(params.test_data['sarscov2']['genome']['genome_dict'], checkIfExists: true)
|
||||||
GATK_REALIGNERTARGETCREATOR.out.intervals
|
|
||||||
|
input_realignertargetcreator = [ [ id:'test' ], // meta map
|
||||||
|
file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true),
|
||||||
|
file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true),
|
||||||
]
|
]
|
||||||
|
|
||||||
reference = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
|
GATK_REALIGNERTARGETCREATOR ( input_realignertargetcreator, fasta, fai, dict, [] )
|
||||||
|
|
||||||
GATK_INDELREALIGNER ( input, reference, [] )
|
ch_intervals = GATK_REALIGNERTARGETCREATOR.out.intervals
|
||||||
|
|
||||||
|
ch_bams_indelrealigner = Channel.of([ [ id:'test' ], // meta map
|
||||||
|
file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true),
|
||||||
|
file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true)
|
||||||
|
])
|
||||||
|
|
||||||
|
ch_input_indelrealigner = ch_bams_indelrealigner.mix(ch_intervals).groupTuple(by: 0).map{ [it[0], it[1][0], it[2], it[1][1] ] }.dump(tag: "input")
|
||||||
|
|
||||||
|
GATK_INDELREALIGNER ( ch_input_indelrealigner, fasta, fai, dict, [] )
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
process {
|
process {
|
||||||
|
|
||||||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
||||||
ext.prefix = "${meta.id}.realigned"
|
ext.prefix = { "${meta.id}.realigned" }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,12 @@
|
||||||
## TODO nf-core: Please run the following command to build this file:
|
- name: gatk indelrealigner test_gatk_indelrealigner
|
||||||
# nf-core modules create-test-yml gatk/indelrealigner
|
|
||||||
- name: "gatk indelrealigner"
|
|
||||||
command: nextflow run ./tests/modules/gatk/indelrealigner -entry test_gatk_indelrealigner -c ./tests/config/nextflow.config -c ./tests/modules/gatk/indelrealigner/nextflow.config
|
command: nextflow run ./tests/modules/gatk/indelrealigner -entry test_gatk_indelrealigner -c ./tests/config/nextflow.config -c ./tests/modules/gatk/indelrealigner/nextflow.config
|
||||||
tags:
|
tags:
|
||||||
- "gatk"
|
- gatk/indelrealigner
|
||||||
#
|
- gatk
|
||||||
- "gatk/indelrealigner"
|
|
||||||
#
|
|
||||||
files:
|
files:
|
||||||
- path: "output/gatk/test.bam"
|
- path: output/gatk/test.realigned.bai
|
||||||
md5sum: e667c7caad0bc4b7ac383fd023c654fc
|
md5sum: 85a67df8827fe426e7f3a458134c0551
|
||||||
- path: output/gatk/versions.yml
|
- path: output/gatk/test.realigned.bam
|
||||||
md5sum: a01fe51bc4c6a3a6226fbf77b2c7cf3b
|
md5sum: ea1df6f7fcafc408fae4dc1574813d8a
|
||||||
|
- path: output/gatk/test.realigned.intervals
|
||||||
|
md5sum: 7aa7a1b235a510e6591e262382086bf8
|
||||||
|
|
Loading…
Reference in a new issue