Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
4 changes: 3 additions & 1 deletion modules/nf-core/sniffles/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ process SNIFFLES {
: 'community.wave.seqera.io/library/htslib_sniffles:14a95caca8d8452b' }"

input:
tuple val(meta), path(input), path(index), path(genotype_vcf)
tuple val(meta), path(input), path(index), path(genotype_vcf), path(regions)
tuple val(meta2), path(fasta)
tuple val(meta3), path(tandem_file)
val(vcf_output)
Expand All @@ -32,6 +32,7 @@ process SNIFFLES {
def prefix = task.ext.prefix ?: "${meta.id}"
def reference = fasta ? "--reference ${fasta}" : ""
def tandem_repeats = tandem_file ? "--tandem-repeats ${tandem_file}" : ''
def regions_bed = regions ? "--regions ${regions}" : ''
def vcf = vcf_output ? "--vcf ${prefix}.vcf.gz": ''
def snf = snf_output ? "--snf ${prefix}.snf": ''
// Sniffles reads the sites file as plain text, so a compressed one is decompressed first (fritzsedlazeck/Sniffles#613)
Expand All @@ -45,6 +46,7 @@ process SNIFFLES {
$reference \\
-t $task.cpus \\
$tandem_repeats \\
$regions_bed \\
$genotype \\
$vcf \\
$snf \\
Expand Down
6 changes: 6 additions & 0 deletions modules/nf-core/sniffles/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ input:
pattern: "*.{vcf,vcf.gz}"
ontologies:
- edam: http://edamontology.org/format_3016
- regions:
type: file
description: Optional BED file of regions to process. Sniffles only processes reads in these regions. Use an empty list (`[]`) to process all regions.
pattern: "*.bed"
ontologies:
- edam: http://edamontology.org/format_3003
- - meta2:
type: map
description: |
Expand Down
50 changes: 47 additions & 3 deletions modules/nf-core/sniffles/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ nextflow_process {
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/nanopore/bam/test.sorted.bam', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/nanopore/bam/test.sorted.bam.bai', checkIfExists: true),
[],
[]
]
input[1] = [
Expand Down Expand Up @@ -55,6 +56,7 @@ nextflow_process {
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/nanopore/bam/test.sorted.bam', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/nanopore/bam/test.sorted.bam.bai', checkIfExists: true),
[],
[]
]
input[1] = [
Expand Down Expand Up @@ -89,6 +91,7 @@ nextflow_process {
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/nanopore/bam/test.sorted.bam', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/nanopore/bam/test.sorted.bam.bai', checkIfExists: true),
[],
[]
]
input[1] = [
Expand Down Expand Up @@ -126,6 +129,7 @@ nextflow_process {
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/nanopore/bam/test.sorted.bam', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/nanopore/bam/test.sorted.bam.bai', checkIfExists: true),
[],
[]
]
input[1] = [
Expand Down Expand Up @@ -168,6 +172,7 @@ nextflow_process {
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/nanopore/bam/test.sorted.bam', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/nanopore/bam/test.sorted.bam.bai', checkIfExists: true),
[],
[]
]
input[1] = [
Expand Down Expand Up @@ -201,6 +206,7 @@ nextflow_process {
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/nanopore/bam/test.sorted.bam', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/nanopore/bam/test.sorted.bam.bai', checkIfExists: true),
[],
[]
]
input[1] = [
Expand Down Expand Up @@ -234,6 +240,7 @@ nextflow_process {
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/nanopore/bam/test.sorted.bam', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/nanopore/bam/test.sorted.bam.bai', checkIfExists: true),
[],
[]
]
input[1] = [
Expand Down Expand Up @@ -267,6 +274,7 @@ nextflow_process {
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/nanopore/bam/test.sorted.bam', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/nanopore/bam/test.sorted.bam.bai', checkIfExists: true),
[],
[]
]
input[1] = [
Expand Down Expand Up @@ -301,7 +309,8 @@ nextflow_process {
[ id:'hg002' ],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/nanopore/bam/HG002_ont_sv_genotype/HG002_ont_sv_genotype.bam', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/nanopore/bam/HG002_ont_sv_genotype/HG002_ont_sv_genotype.bam.bai', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/nanopore/bam/HG002_ont_sv_genotype/HG002_ont_sv_sites.vcf.gz', checkIfExists: true)
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/nanopore/bam/HG002_ont_sv_genotype/HG002_ont_sv_sites.vcf.gz', checkIfExists: true),
[]
]
input[1] = [[], []]
input[2] = [[], []]
Expand Down Expand Up @@ -347,7 +356,7 @@ nextflow_process {
[ id:'hg002' ],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/nanopore/bam/HG002_ont_sv_genotype/HG002_ont_sv_genotype.bam', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/nanopore/bam/HG002_ont_sv_genotype/HG002_ont_sv_genotype.bam.bai', checkIfExists: true)
]).combine(GUNZIP.out.gunzip.map { _meta, vcf -> vcf })
]).combine(GUNZIP.out.gunzip.map { _meta, vcf -> [vcf, []] })
input[1] = [[], []]
input[2] = [[], []]
input[3] = true
Expand Down Expand Up @@ -380,7 +389,8 @@ nextflow_process {
[ id:'hg002' ],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/nanopore/bam/HG002_ont_sv_genotype/HG002_ont_sv_genotype.bam', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/nanopore/bam/HG002_ont_sv_genotype/HG002_ont_sv_genotype.bam.bai', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/nanopore/bam/HG002_ont_sv_genotype/HG002_ont_sv_sites.vcf.gz', checkIfExists: true)
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/nanopore/bam/HG002_ont_sv_genotype/HG002_ont_sv_sites.vcf.gz', checkIfExists: true),
[]
]
input[1] = [[], []]
input[2] = [[], []]
Expand All @@ -399,4 +409,38 @@ nextflow_process {

}

test("homo_sapiens - nanopore [bam, bai, [], bed], [], [], true, false - regions") {

when {
process {
"""
input[0] = channel.of([
[ id:'hg002' ],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/nanopore/bam/HG002_ont_sv_genotype/HG002_ont_sv_genotype.bam', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/nanopore/bam/HG002_ont_sv_genotype/HG002_ont_sv_genotype.bam.bai', checkIfExists: true),
[]
]).combine(channel.of("chr2\t71600000\t71700000").collectFile(name: 'regions.bed', newLine: true))
input[1] = [[], []]
input[2] = [[], []]
input[3] = true
input[4] = false
"""
}
}

then {
def records = path(process.out.vcf.get(0).get(1)).linesGzip.findAll { line -> !line.startsWith("#") }
assertAll(
{ assert process.success },
{ assert records.every { line -> line.startsWith("chr2\t") } },
{ assert snapshot(
process.out.findAll { key, val -> key.startsWith("versions") },
file(process.out.tbi.get(0).get(1)).name,
records,
).match() }
)
}

}

}
Loading
Loading