Skip to content

Commit

Permalink
Changed inputs to delly/call
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Nater committed Mar 20, 2024
1 parent 01e0d3a commit 77747ea
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 78 deletions.
23 changes: 10 additions & 13 deletions modules/nf-core/delly/call/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,30 @@ process DELLY_CALL {
'biocontainers/delly:1.2.6--hb7e2ac5_0' }"

input:
tuple val(meta) , path(input) , path(input_index)
tuple val(meta2), path(input_control), path(control_index)
tuple val(meta3), path(fasta) , path(fai)
tuple val(meta4), path(vcf) , path(vcf_index), path(exclude_bed)
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)

output:
tuple val(new_meta), path("*.{bcf,vcf.gz}") , emit: bcf
tuple val(new_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 ?: ''
new_meta = meta2?.id ? meta + [ id:"${meta.id}_${meta2.id}" ] : meta
def prefix = task.ext.prefix ?: "${new_meta.id}"
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 inputs = input_control ? "${input} ${input_control}" : "${input}"
def genotype = vcf ? "--vcffile ${vcf}" : ""

"""
Expand All @@ -44,7 +42,7 @@ process DELLY_CALL {
--genome ${fasta} \\
${genotype} \\
${exclude} \\
${inputs} \\
${input} \\
${vcf_output}
cat <<-END_VERSIONS > versions.yml
Expand All @@ -54,8 +52,7 @@ process DELLY_CALL {
"""

stub:
new_meta = meta2?.id ? meta + [ id:"${meta.id}_${meta2.id}" ] : meta
def prefix = task.ext.prefix ?: "${new_meta.id}"
def prefix = task.ext.prefix ?: "${meta.id}"
def suffix = task.ext.suffix ?: "bcf"

def bcf_output = suffix == "bcf" ? "touch ${prefix}.bcf && touch ${prefix}.bcf.csi" : ""
Expand Down
26 changes: 18 additions & 8 deletions modules/nf-core/delly/call/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,33 @@ input:
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}"
- input_control:
- input_ctrl:
type: file
description: |
Optional BAM/CRAM file of matched control sample for somatic variant calling.
Must be sorted, indexed, and duplicate marked.
pattern: "*.{bam,cram}"
- control_index:
- input_ctrl_idx:
type: file
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 @@ -44,6 +53,11 @@ 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
Expand All @@ -52,10 +66,6 @@ input:
type: file
description: The index of the BCF/VCF file
pattern: "*.{tbi,csi}"
- exclude_bed:
type: file
description: An optional bed file containing regions to exclude from the called VCF
pattern: "*.bed"
output:
- meta:
type: map
Expand Down
37 changes: 14 additions & 23 deletions modules/nf-core/delly/call/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,19 @@ nextflow_process {
input[0] = [
[ id:'tumor' ], // 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] = [
[:], // meta map
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true),
[],
[],
[]
]
input[2] = [
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[3] = [
input[2] = [
[:],
[],
[],
[]
]
"""
Expand All @@ -57,22 +54,19 @@ nextflow_process {
input[0] = [
[ id:'test' ], // meta map
[],
[]
]
input[1] = [
[:], // meta map
[],
[],
[],
[]
]
input[2] = [
input[1] = [
[:],
[],
[]
]
input[3] = [
input[2] = [
[:],
[],
[],
[]
]
"""
Expand All @@ -94,24 +88,21 @@ nextflow_process {
process {
"""
input[0] = [
[ id:'tumor' ], // meta map
[ 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)
]
input[1] = [
[ id:'control' ], // meta map
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)
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true),
[]
]
input[2] = [
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[3] = [
input[2] = [
[:],
[],
[],
[]
]
"""
Expand Down
6 changes: 3 additions & 3 deletions modules/nf-core/delly/call/tests/main.nf.test.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 10 additions & 16 deletions modules/nf-core/delly/filter/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,19 @@ nextflow_process {
input[0] = [
[ id:'tumor' ], // 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] = [
[:], // meta map
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true),
[],
[],
[]
]
input[2] = [
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[3] = [
input[2] = [
[:],
[],
[],
[]
]
"""
Expand Down Expand Up @@ -96,24 +93,21 @@ nextflow_process {
process {
"""
input[0] = [
[ id:'tumor' ], // meta map
[ 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)
]
input[1] = [
[ id:'control' ], // meta map
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)
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true),
[]
]
input[2] = [
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[3] = [
input[2] = [
[:],
[],
[],
[]
]
"""
Expand Down
26 changes: 11 additions & 15 deletions modules/nf-core/delly/filter/tests/main.nf.test.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 77747ea

Please sign in to comment.