Skip to content

Commit

Permalink
🔀 Merge pull request #31 from cnr-ibba/issue-30
Browse files Browse the repository at this point in the history
pass *meta* information for genome input in freebayes modules
  • Loading branch information
bunop authored Dec 20, 2023
2 parents 9c8b0ee + 7dd9ff0 commit 10aac07
Show file tree
Hide file tree
Showing 16 changed files with 83 additions and 27 deletions.
12 changes: 6 additions & 6 deletions modules/cnr-ibba/freebayes/chunk/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ process FREEBAYES_CHUNK {
'biocontainers/freebayes:1.3.6--hb089aa1_0' }"

input:
tuple val(meta), val(region)
tuple val(sample_meta), path(bam)
tuple val(sample_meta), path(bai)
tuple val(sample_meta), path(bam_list)
path(genome_fasta)
path(genome_fasta_fai)
tuple val(meta), val(region)
tuple val(meta2), path(bam)
tuple val(meta2), path(bai)
tuple val(meta2), path(bam_list)
tuple val(meta3), path(genome_fasta)
tuple val(meta3), path(genome_fasta_fai)

output:
tuple val(meta), path("*.vcf.gz") , emit: vcf
Expand Down
9 changes: 7 additions & 2 deletions modules/cnr-ibba/freebayes/chunk/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ input:
description: |
Groovy Map containing information on a region
e.g. [ id:'test', single_end:false ]
- sample_meta:
- meta2:
type: map
description: |
Groovy Map containing sample information
Expand All @@ -42,6 +42,11 @@ input:
type: file
description: A txt file in which all bam file names are described
pattern: "*.list.txt"
- meta3:
type: map
description: |
Groovy Map containing reference information
e.g. [ id:'genome' ]
- genome_fasta:
type: file
description: The genome fasta file (not compressed)
Expand All @@ -55,7 +60,7 @@ output:
- meta:
type: map
description: |
Groovy Map containing sample information
Groovy Map containing information on a region
e.g. [ id:'test', single_end:false ]
- vcf:
type: file
Expand Down
4 changes: 2 additions & 2 deletions modules/cnr-ibba/freebayes/multi/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ process FREEBAYES_MULTI {
input:
tuple val(meta), path(bam)
tuple val(meta), path(bai)
path(genome_fasta)
path(genome_fasta_fai)
tuple val(meta2), path(genome_fasta)
tuple val(meta2), path(genome_fasta_fai)

output:
tuple val(meta), path("*.vcf.gz") , emit: vcf
Expand Down
5 changes: 5 additions & 0 deletions modules/cnr-ibba/freebayes/multi/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ input:
type: file
description: A list of BAM index files
pattern: "*.{bai}"
- meta2:
type: map
description: |
Groovy Map containing reference information
e.g. [ id:'genome' ]
- genome_fasta:
type: file
description: The genome fasta file (not compressed)
Expand Down
4 changes: 2 additions & 2 deletions modules/cnr-ibba/freebayes/single/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ process FREEBAYES_SINGLE {
input:
tuple val(meta), path(bam), path(bai)
tuple val(meta), path(coverage)
path(genome_fasta)
path(genome_fasta_fai)
tuple val(meta2), path(genome_fasta)
tuple val(meta2), path(genome_fasta_fai)
val(num_regions)

output:
Expand Down
5 changes: 5 additions & 0 deletions modules/cnr-ibba/freebayes/single/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ input:
type: file
description: Bamtools coverage output
pattern: "*.{txt}"
- meta2:
type: map
description: |
Groovy Map containing reference information
e.g. [ id:'genome' ]
- genome_fasta:
type: file
description: The genome fasta file (not compressed)
Expand Down
4 changes: 2 additions & 2 deletions modules/cnr-ibba/freebayes/splitbam/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ process FREEBAYES_SPLITBAM {
input:
tuple val(meta), path(bam)
tuple val(meta), path(bai)
path(genome_fasta)
path(genome_fasta_fai)
tuple val(meta2), path(genome_fasta)
tuple val(meta2), path(genome_fasta_fai)

output:
tuple val(meta), path("*.list.txt"), emit: bam_list
Expand Down
5 changes: 5 additions & 0 deletions modules/cnr-ibba/freebayes/splitbam/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ input:
type: file
description: A list of BAM index files
pattern: "*.{bai}"
- meta2:
type: map
description: |
Groovy Map containing reference information
e.g. [ id:'genome' ]
- genome_fasta:
type: file
description: The genome fasta file (not compressed)
Expand Down
4 changes: 2 additions & 2 deletions subworkflows/cnr-ibba/freebayes_parallel/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ workflow FREEBAYES_PARALLEL {
take:
bam // channel: [ val(meta), [ bam/cram ]]
bai // channel: [ val(meta), [ bai/crai ]]
fasta // channel: [ fasta ]
fai // channel: [ fai ]
fasta // channel: [ val(meta2), fasta ]
fai // channel: [ val(meta2), fai ]

main:
ch_versions = Channel.empty()
Expand Down
5 changes: 5 additions & 0 deletions subworkflows/cnr-ibba/freebayes_parallel/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ input:
type: path
description: A list of BAM index files
pattern: "*.{bai}"
- meta2:
type: map
description: |
Groovy Map containing reference information
e.g. [ id:'genome' ]
- genome_fasta:
type: path
description: The genome fasta file (not compressed)
Expand Down
10 changes: 8 additions & 2 deletions tests/modules/cnr-ibba/freebayes/chunk/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,15 @@ workflow test_freebayes_chunk {
bam_ch = Channel.of(bam).map{ it -> [[id: "all.fb"], it]}
bai_ch = Channel.of(bai).map{ it -> [[id: "all.fb"], it]}

genome_fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)
genome_fasta = [
[ id:'genome' ],
file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)
]

genome_fasta_fai = file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true)
genome_fasta_fai = [
[ id:'genome' ],
file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true)
]

FREEBAYES_SPLITBAM ( bam_ch, bai_ch, genome_fasta, genome_fasta_fai )

Expand Down
2 changes: 1 addition & 1 deletion tests/modules/cnr-ibba/freebayes/chunk/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
- path: output/freebayes/all.fb.regions.txt
md5sum: e4cd6cbdb91d5205fcefcc7bc068d3e5
- path: output/freebayes/chr22:0-40001.vcf.gz
md5sum: fba544980eebf86c66460c40f48d7809
md5sum: 8727d6512d790382b39e9ff13ac26ef0
- path: output/freebayes/chr22:0-40001.vcf.gz.tbi
md5sum: 83b1d5e5b36d61529d9d2d69cd4babc5
10 changes: 8 additions & 2 deletions tests/modules/cnr-ibba/freebayes/multi/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,15 @@ workflow test_freebayes_multi {
bam_ch = Channel.of(bam).map{ it -> [[id: "all.fb"], it]}
bai_ch = Channel.of(bai).map{ it -> [[id: "all.fb"], it]}

genome_fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)
genome_fasta = [
[ id:'genome' ],
file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)
]

genome_fasta_fai = file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true)
genome_fasta_fai = [
[ id:'genome' ],
file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true)
]

FREEBAYES_MULTI ( bam_ch, bai_ch, genome_fasta, genome_fasta_fai )
}
11 changes: 9 additions & 2 deletions tests/modules/cnr-ibba/freebayes/single/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,15 @@ workflow test_freebayes_single {
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true),
]

genome_fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)
genome_fasta_fai = file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true)
genome_fasta = [
[ id:'genome' ],
file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)
]

genome_fasta_fai = [
[ id:'genome' ],
file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true)
]

FREEBAYES_SINGLE ( input, BAMTOOLS_COVERAGE.out.data, genome_fasta, genome_fasta_fai, [] )
}
10 changes: 8 additions & 2 deletions tests/modules/cnr-ibba/freebayes/splitbam/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,15 @@ workflow test_freebayes_splitbam {
bam_ch = Channel.of(bam).map{ it -> [[id: "all.fb"], it]}
bai_ch = Channel.of(bai).map{ it -> [[id: "all.fb"], it]}

genome_fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)
genome_fasta = [
[ id:'genome' ],
file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)
]

genome_fasta_fai = file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true)
genome_fasta_fai = [
[ id:'genome' ],
file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true)
]

FREEBAYES_SPLITBAM ( bam_ch, bai_ch, genome_fasta, genome_fasta_fai )
}
10 changes: 8 additions & 2 deletions tests/subworkflows/cnr-ibba/freebayes_parallel/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,15 @@ workflow test_freebayes_parallel {
bam_ch = Channel.of(bam).map{ it -> [[id: "all.fb"], it]}
bai_ch = Channel.of(bai).map{ it -> [[id: "all.fb"], it]}

genome_fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)
genome_fasta = [
[ id:'genome' ],
file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)
]

genome_fasta_fai = file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true)
genome_fasta_fai = [
[ id:'genome' ],
file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true)
]

FREEBAYES_PARALLEL ( bam_ch, bai_ch, genome_fasta, genome_fasta_fai )
}

0 comments on commit 10aac07

Please sign in to comment.