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

Added delly/filter, changed delly/call - this time with up-to-date fork #5384

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 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
6 changes: 4 additions & 2 deletions modules/nf-core/delly/call/environment.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: delly_call
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
name: "delly_call"
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- bioconda::delly=1.1.6
- "bioconda::delly=1.2.6"
22 changes: 12 additions & 10 deletions modules/nf-core/delly/call/main.nf
Original file line number Diff line number Diff line change
@@ -1,35 +1,37 @@
process DELLY_CALL {
tag "$meta.id"
label 'process_medium'
label 'process_single'
SPPearce marked this conversation as resolved.
Show resolved Hide resolved

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/delly:1.1.6--ha41ced6_0' :
'biocontainers/delly:1.1.6--ha41ced6_0' }"
'https://depot.galaxyproject.org/singularity/delly:1.2.6--hb7e2ac5_0':
'biocontainers/delly:1.2.6--hb7e2ac5_0' }"

input:
tuple val(meta), path(input), path(input_index), path(vcf), path(vcf_index), path(exclude_bed)
path fasta
path fai
tuple val(meta), path(input_1), path(input_1_idx), path(input_ctrl), path(input_ctrl_idx), path(exclude_bed)
tuple val(ref_meta), path(fasta), path(fai)
tuple val(vcf_meta), path(vcf), path(vcf_index)
SPPearce marked this conversation as resolved.
Show resolved Hide resolved

output:
tuple val(meta), path("*.{bcf,vcf.gz}") , emit: bcf
tuple val(meta), path("*.{csi,tbi}") , emit: csi
path "versions.yml" , emit: versions
tuple val(meta), path("*.{bcf,vcf.gz}"), emit: bcf
tuple val(meta), path("*.{csi,tbi}") , emit: csi
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
def args2 = task.ext.args2 ?: ''
def args3 = task.ext.args3 ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def suffix = task.ext.suffix ?: "bcf"

def input = input_ctrl ? "${input_1} ${input_ctrl}" : "${input_1}"
def exclude = exclude_bed ? "--exclude ${exclude_bed}" : ""

def bcf_output = suffix == "bcf" ? "--outfile ${prefix}.bcf" : ""
def vcf_output = suffix == "vcf" ? "| bgzip ${args2} --threads ${task.cpus} --stdout > ${prefix}.vcf.gz && tabix ${prefix}.vcf.gz" : ""
def vcf_output = suffix == "vcf" ? "| bgzip ${args2} --threads ${task.cpus} --stdout > ${prefix}.vcf.gz && tabix ${args3} ${prefix}.vcf.gz" : ""

def genotype = vcf ? "--vcffile ${vcf}" : ""

Expand Down
53 changes: 45 additions & 8 deletions modules/nf-core/delly/call/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,54 @@ tools:
documentation: https://github.com/dellytools/delly/blob/master/README.md
doi: "10.1093/bioinformatics/bts378"
licence: ["BSD-3-Clause"]
args_id: "$args"
- bgzip:
description: Bgzip compresses or decompresses files in a similar manner to, and compatible with, gzip.
homepage: https://www.htslib.org/doc/tabix.html
documentation: http://www.htslib.org/doc/bgzip.html
doi: 10.1093/bioinformatics/btp352
licence: ["MIT"]
args_id: "$args2"
- tabix:
description: Generic indexer for TAB-delimited genome position files.
homepage: https://www.htslib.org/doc/tabix.html
documentation: https://www.htslib.org/doc/tabix.1.html
doi: 10.1093/bioinformatics/btq671
licence: ["MIT"]
args_id: "$args3"
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- input:
- input_1:
type: file
description: BAM/CRAM file from alignment must be sorted, indexed, and duplicate marked
pattern: "*.{bam,cram}"
- input_index:
- input_1_idx:
type: file
description: Index of the BAM/CRAM file
pattern: "*.{bai,crai}"
- vcf:
- input_ctrl:
type: file
description: A BCF/VCF file to genotype with Delly. If this is supplied, the variant calling will be skipped
pattern: "*.{vcf.gz,bcf}"
- vcf_index:
description: |
Optional BAM/CRAM file of matched control sample for somatic variant calling.
Must be sorted, indexed, and duplicate marked.
pattern: "*.{bam,cram}"
- input_ctrl_idx:
type: file
description: The index of the BCF/VCF file
pattern: "*.{tbi,csi}"
description: Optional index of the control BAM/CRAM file
pattern: "*.{bai,crai}"
- exclude_bed:
type: file
description: An optional bed file containing regions to exclude from the called VCF
pattern: "*.bed"
- ref_meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- fasta:
type: file
description: The reference fasta file
Expand All @@ -46,6 +68,19 @@ input:
type: file
description: Index of reference fasta file to identify split-reads
pattern: "*.fai"
- vcf_meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- vcf:
type: file
description: A BCF/VCF file to genotype with Delly. If this is supplied, the variant calling will be skipped
pattern: "*.{vcf.gz,bcf}"
- vcf_index:
type: file
description: The index of the BCF/VCF file
pattern: "*.{tbi,csi}"
output:
- meta:
type: map
Expand All @@ -67,6 +102,8 @@ output:
authors:
- "@projectoriented"
- "@nvnieuwk"
- "@alexnater"
maintainers:
- "@projectoriented"
- "@nvnieuwk"
- "@alexnater"
208 changes: 208 additions & 0 deletions modules/nf-core/delly/call/tests/main.nf.test
nvnieuwk marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
nextflow_process {

name "Test Process DELLY_CALL"
script "../main.nf"
process "DELLY_CALL"
config "./nextflow.config"

tag "modules"
tag "modules_nfcore"
tag "delly"
tag "delly/call"

test("germline - bcf") {
when {
params {
suffix = 'bcf'
}
process {
"""
input[0] = [
[ id:'control' ], // meta map
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true),
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true),
[],
[],
[]
]
input[1] = [
[ id:'human' ],
file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true),
file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true)
]
input[2] = [
[:],
[],
[]
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() },
{ assert process.out.versions }
)
}
}

test("germline - vcf") {
when {
params {
suffix = 'vcf'
}

process {
"""
input[0] = [
[ id:'control' ], // meta map
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true),
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true),
[],
[],
[]
]
input[1] = [
[ id:'human' ],
file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true),
file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true)
]
input[2] = [
[:],
[],
[]
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() },
{ assert process.out.versions }
)
}
}

test("germline - stub") {

options "-stub"

when {
params {
suffix = 'bcf'
}
process {
"""
input[0] = [
[ id:'test' ], // meta map
[],
[],
[],
[],
[]
]
input[1] = [
[:],
[],
[]
]
input[2] = [
[:],
[],
[]
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() },
{ assert process.out.versions }
)
}

}

test("somatic - bcf") {
when {
params {
suffix = 'bcf'
}
process {
"""
input[0] = [
[ id:'tumor_control' ], // meta map
file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true),
file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true),
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true),
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true),
[]
]
input[1] = [
[ id:'human' ],
file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true),
file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true)
]
input[2] = [
[:],
[],
[]
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() },
{ assert process.out.versions }
)
}
}

test("somatic - vcf") {
when {
params {
suffix = 'vcf'
}

process {
"""
input[0] = [
[ id:'tumor_control' ], // meta map
file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true),
file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true),
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true),
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true),
[]
]
input[1] = [
[ id:'human' ],
file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true),
file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true)
]
input[2] = [
[:],
[],
[]
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() },
{ assert process.out.versions }
)
}
}
}
Loading
Loading