Skip to content

Commit

Permalink
Update lofreq call & lofreq callparallel modules (#3812)
Browse files Browse the repository at this point in the history
* Update lofreq call module & tests.
Now it takes intervals input.

* Update lofreq callparallel module.
Now it takes intervals as input. Also updated tests.

* Fix linting where entry for keywords was too short in meta.yml.
  • Loading branch information
nevinwu authored Sep 5, 2023
1 parent d5a509c commit c825b14
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 5 deletions.
4 changes: 3 additions & 1 deletion modules/nf-core/lofreq/call/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ process LOFREQ_CALL {
'biocontainers/lofreq:2.1.5--py38h588ecb2_4' }"

input:
tuple val(meta), path(bam)
tuple val(meta), path(bam), path(intervals)
path fasta

output:
Expand All @@ -21,10 +21,12 @@ process LOFREQ_CALL {
script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def options_intervals = intervals ? "-l ${intervals}" : ""
"""
lofreq \\
call \\
$args \\
$options_intervals \\
-f $fasta \\
-o ${prefix}.vcf.gz \\
$bam
Expand Down
4 changes: 4 additions & 0 deletions modules/nf-core/lofreq/call/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ input:
type: file
description: BAM input file
pattern: "*.{bam}"
- intervals:
type: file
description: BED file containing target regions for variant calling
pattern: "*.{bed}"
- fasta:
type: file
description: The reference fasta file
Expand Down
4 changes: 3 additions & 1 deletion modules/nf-core/lofreq/callparallel/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ process LOFREQ_CALLPARALLEL {
'biocontainers/lofreq:2.1.5--py38h588ecb2_4' }"

input:
tuple val(meta), path(bam), path(bai)
tuple val(meta), path(bam), path(bai), path(intervals)
path fasta
path fai

Expand All @@ -22,11 +22,13 @@ process LOFREQ_CALLPARALLEL {
script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def options_intervals = intervals ? "-l ${intervals}" : ""
"""
lofreq \\
call-parallel \\
--pp-threads $task.cpus \\
$args \\
$options_intervals \\
-f $fasta \\
-o ${prefix}.vcf.gz \\
$bam
Expand Down
6 changes: 6 additions & 0 deletions modules/nf-core/lofreq/callparallel/meta.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: lofreq_callparallel
description: It predicts variants using multiple processors
keywords:
- variant calling
- low frequency variant calling
- call
- variants
tools:
Expand All @@ -25,6 +27,10 @@ input:
type: file
description: BAM index file
pattern: "*.{bai}"
- intervals:
type: file
description: BED file containing target regions for variant calling
pattern: "*.{bed}"
- fasta:
type: file
description: Reference genome FASTA file
Expand Down
13 changes: 12 additions & 1 deletion tests/modules/nf-core/lofreq/call/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,18 @@ include { LOFREQ_CALL } from '../../../../../modules/nf-core/lofreq/call/main.nf
workflow test_lofreq_call {

input = [ [ id:'test', single_end:false ], // meta map
file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true) ]
file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true),
[] ]
fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)

LOFREQ_CALL ( input, fasta )
}

workflow test_lofreq_call_intervals {

input = [ [ id:'test', single_end:false ], // meta map
file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true),
file(params.test_data['sarscov2']['genome']['test_bed']) ]
fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)

LOFREQ_CALL ( input, fasta )
Expand Down
12 changes: 12 additions & 0 deletions tests/modules/nf-core/lofreq/call/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,15 @@
[
'##INFO=<ID=CONSVAR,Number=0,Type=Flag,Description="Indicates that the variant is a consensus variant (as opposed to a low frequency variant).">',
]

- name: lofreq call test_lofreq_call_intervals
command: nextflow run ./tests/modules/nf-core/lofreq/call -entry test_lofreq_call_intervals -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/lofreq/call/nextflow.config
tags:
- lofreq
- lofreq/call
files:
- path: output/lofreq/test.vcf.gz
contains:
[
'##INFO=<ID=CONSVAR,Number=0,Type=Flag,Description="Indicates that the variant is a consensus variant (as opposed to a low frequency variant).">',
]
19 changes: 17 additions & 2 deletions tests/modules/nf-core/lofreq/callparallel/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,29 @@ nextflow.enable.dsl = 2
include { LOFREQ_CALLPARALLEL } from '../../../../../modules/nf-core/lofreq/callparallel/main.nf'

workflow test_lofreq_callparallel {

input = [ [ 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)
file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true),
[]
]

fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
fai = file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true)

LOFREQ_CALLPARALLEL ( input, fasta, fai )
}

workflow test_lofreq_callparallel_intervals {

input = [ [ 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),
file(params.test_data['sarscov2']['genome']['test_bed'])
]

fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
fai = file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true)

LOFREQ_CALLPARALLEL ( input, fasta, fai )
}
12 changes: 12 additions & 0 deletions tests/modules/nf-core/lofreq/callparallel/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,15 @@
[
'##INFO=<ID=CONSVAR,Number=0,Type=Flag,Description="Indicates that the variant is a consensus variant (as opposed to a low frequency variant).">',
]

- name: lofreq callparallel test_lofreq_callparallel_intervals
command: nextflow run ./tests/modules/nf-core/lofreq/callparallel -entry test_lofreq_callparallel_intervals -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/lofreq/callparallel/nextflow.config
tags:
- lofreq/callparallel
- lofreq
files:
- path: output/lofreq/test.vcf.gz
contains:
[
'##INFO=<ID=CONSVAR,Number=0,Type=Flag,Description="Indicates that the variant is a consensus variant (as opposed to a low frequency variant).">',
]

0 comments on commit c825b14

Please sign in to comment.