mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-22 11:08:17 +00:00
Update version & add intervals usage (#1214)
* Update version & add intervals usage * Fix config when passing intervals as file * Use proper paths
This commit is contained in:
parent
796dbb573e
commit
1287ba48fe
5 changed files with 60 additions and 19 deletions
|
@ -8,11 +8,11 @@ process DEEPVARIANT {
|
||||||
}
|
}
|
||||||
|
|
||||||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
||||||
'google/deepvariant:1.2.0' :
|
'google/deepvariant:1.3.0' :
|
||||||
'google/deepvariant:1.2.0' }"
|
'google/deepvariant:1.3.0' }"
|
||||||
|
|
||||||
input:
|
input:
|
||||||
tuple val(meta), path(bam), path(bai)
|
tuple val(meta), path(input), path(index), path(intervals)
|
||||||
path(fasta)
|
path(fasta)
|
||||||
path(fai)
|
path(fai)
|
||||||
|
|
||||||
|
@ -24,14 +24,16 @@ process DEEPVARIANT {
|
||||||
script:
|
script:
|
||||||
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 regions = intervals ? "--regions ${intervals}" : ""
|
||||||
|
|
||||||
"""
|
"""
|
||||||
/opt/deepvariant/bin/run_deepvariant \\
|
/opt/deepvariant/bin/run_deepvariant \\
|
||||||
--ref=${fasta} \\
|
--ref=${fasta} \\
|
||||||
--reads=${bam} \\
|
--reads=${input} \\
|
||||||
--output_vcf=${prefix}.vcf.gz \\
|
--output_vcf=${prefix}.vcf.gz \\
|
||||||
--output_gvcf=${prefix}.g.vcf.gz \\
|
--output_gvcf=${prefix}.g.vcf.gz \\
|
||||||
${args} \\
|
${args} \\
|
||||||
|
${regions} \\
|
||||||
--num_shards=${task.cpus}
|
--num_shards=${task.cpus}
|
||||||
|
|
||||||
cat <<-END_VERSIONS > versions.yml
|
cat <<-END_VERSIONS > versions.yml
|
||||||
|
@ -39,5 +41,4 @@ process DEEPVARIANT {
|
||||||
deepvariant: \$(echo \$(/opt/deepvariant/bin/run_deepvariant --version) | sed 's/^.*version //; s/ .*\$//' )
|
deepvariant: \$(echo \$(/opt/deepvariant/bin/run_deepvariant --version) | sed 's/^.*version //; s/ .*\$//' )
|
||||||
END_VERSIONS
|
END_VERSIONS
|
||||||
"""
|
"""
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,14 +18,18 @@ input:
|
||||||
description: |
|
description: |
|
||||||
Groovy Map containing sample information
|
Groovy Map containing sample information
|
||||||
e.g. [ id:'test', single_end:false ]
|
e.g. [ id:'test', single_end:false ]
|
||||||
- bam:
|
- input:
|
||||||
type: file
|
type: file
|
||||||
description: BAM file
|
description: BAM/CRAM file
|
||||||
pattern: "*.bam"
|
pattern: "*.bam/cram"
|
||||||
- bai:
|
- index:
|
||||||
type: file
|
type: file
|
||||||
description: Index of BAM file
|
description: Index of BAM/CRAM file
|
||||||
pattern: "*.bai"
|
pattern: "*.bai/crai"
|
||||||
|
- interval:
|
||||||
|
type: file
|
||||||
|
description: Interval file for targeted regions
|
||||||
|
pattern: "*.bed"
|
||||||
- fasta:
|
- fasta:
|
||||||
type: file
|
type: file
|
||||||
description: The reference fasta file
|
description: The reference fasta file
|
||||||
|
|
|
@ -2,13 +2,16 @@
|
||||||
|
|
||||||
nextflow.enable.dsl = 2
|
nextflow.enable.dsl = 2
|
||||||
|
|
||||||
include { DEEPVARIANT } from '../../../modules/deepvariant/main.nf'
|
include { DEEPVARIANT } from '../../../modules/deepvariant/main.nf'
|
||||||
|
include { DEEPVARIANT as DEEPVARIANT_INTERVALS } from '../../../modules/deepvariant/main.nf'
|
||||||
|
|
||||||
workflow test_deepvariant {
|
workflow test_deepvariant {
|
||||||
|
|
||||||
bam_tuple_ch = Channel.of([[ id:'test', single_end:false ], // meta map
|
bam_tuple_ch = Channel.of([ [ id:'test', single_end:false ], // meta map
|
||||||
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true),
|
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true),
|
||||||
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true)])
|
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true),
|
||||||
|
[]
|
||||||
|
])
|
||||||
|
|
||||||
fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)
|
fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)
|
||||||
|
|
||||||
|
@ -16,3 +19,18 @@ workflow test_deepvariant {
|
||||||
|
|
||||||
DEEPVARIANT ( bam_tuple_ch, fasta, fai)
|
DEEPVARIANT ( bam_tuple_ch, fasta, fai)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
workflow test_deepvariant_cram_intervals {
|
||||||
|
|
||||||
|
cram_tuple_ch = Channel.of([[ id:'test', single_end:false ], // meta map
|
||||||
|
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true),
|
||||||
|
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram_crai'], checkIfExists: true),
|
||||||
|
file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true)
|
||||||
|
])
|
||||||
|
|
||||||
|
fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)
|
||||||
|
|
||||||
|
fai = file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true)
|
||||||
|
|
||||||
|
DEEPVARIANT_INTERVALS ( cram_tuple_ch, fasta, fai)
|
||||||
|
}
|
||||||
|
|
|
@ -6,5 +6,9 @@ process {
|
||||||
ext.args = ' --regions=\"chr22:0-40001\" --model_type=WGS '
|
ext.args = ' --regions=\"chr22:0-40001\" --model_type=WGS '
|
||||||
ext.prefix = { "${meta.id}_out" }
|
ext.prefix = { "${meta.id}_out" }
|
||||||
}
|
}
|
||||||
|
withName: DEEPVARIANT_INTERVALS {
|
||||||
|
ext.args = '--model_type=WGS '
|
||||||
|
ext.prefix = { "${meta.id}_out" }
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,23 @@
|
||||||
- name: deepvariant
|
- name: deepvariant test_deepvariant
|
||||||
command: nextflow run ./tests/modules/deepvariant -entry test_deepvariant -c tests/config/nextflow.config
|
command: nextflow run tests/modules/deepvariant -entry test_deepvariant -c tests/config/nextflow.config
|
||||||
tags:
|
tags:
|
||||||
- deepvariant
|
- deepvariant
|
||||||
files:
|
files:
|
||||||
- path: output/deepvariant/test_out.vcf.gz
|
|
||||||
md5sum: 66d86be7a9bafe1f5c6304ebee18ee20
|
|
||||||
- path: output/deepvariant/test_out.g.vcf.gz
|
- path: output/deepvariant/test_out.g.vcf.gz
|
||||||
md5sum: 4ca868f0a4fdb17a280c3ed083d228e0
|
md5sum: c4c65a3eaf62d6fbe0aba0a414318c8d
|
||||||
|
- path: output/deepvariant/test_out.vcf.gz
|
||||||
|
md5sum: ad964f68ac1d1b2720a9a4e0b6a3a389
|
||||||
|
- path: output/deepvariant/versions.yml
|
||||||
|
md5sum: 51572055ca5c07fc4001b25a9c273bf8
|
||||||
|
|
||||||
|
- name: deepvariant test_deepvariant_cram_intervals
|
||||||
|
command: nextflow run tests/modules/deepvariant -entry test_deepvariant_cram_intervals -c tests/config/nextflow.config
|
||||||
|
tags:
|
||||||
|
- deepvariant
|
||||||
|
files:
|
||||||
|
- path: output/deepvariant/test_out.g.vcf.gz
|
||||||
|
md5sum: c4c65a3eaf62d6fbe0aba0a414318c8d
|
||||||
|
- path: output/deepvariant/test_out.vcf.gz
|
||||||
|
md5sum: ad964f68ac1d1b2720a9a4e0b6a3a389
|
||||||
|
- path: output/deepvariant/versions.yml
|
||||||
|
md5sum: 7d9293db0d44423b114abc7116feb967
|
||||||
|
|
Loading…
Reference in a new issue