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

fix and bump gfastats #7320

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion modules/nf-core/gfastats/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ channels:
- conda-forge
- bioconda
dependencies:
- bioconda::gfastats=1.3.6
- bioconda::gfastats=1.3.9
24 changes: 12 additions & 12 deletions modules/nf-core/gfastats/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ process GFASTATS {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/gfastats:1.3.6--hdcf5f25_3':
'biocontainers/gfastats:1.3.6--hdcf5f25_3' }"
'https://depot.galaxyproject.org/singularity/gfastats:1.3.9--h077b44d_1':
'biocontainers/gfastats:1.3.9--h077b44d_1' }"

input:
tuple val(meta), path(assembly) // input.[fasta|fastq|gfa][.gz]
val out_fmt // output format (fasta/fastq/gfa)
val genome_size // estimated genome size for NG* statistics (optional).
val target // target specific sequence by header, optionally with coordinates (optional).
path agpfile // -a --agp-to-path <file> converts input agp to path and replaces existing paths.
path include_bed // -i --include-bed <file> generates output on a subset list of headers or coordinates in 0-based bed format.
path exclude_bed // -e --exclude-bed <file> opposite of --include-bed. They can be combined (no coordinates).
path instructions // -k --swiss-army-knife <file> set of instructions provided as an ordered list.
tuple val(meta), path(assembly)
val out_fmt
val genome_size
val target
path agpfile
path include_bed
path exclude_bed
path instructions

output:
tuple val(meta), path("*.assembly_summary"), emit: assembly_summary
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
tuple val(meta), path("*.assembly_summary"), emit: assembly_summary
tuple val(meta), path("*.assembly_summary"), emit: assembly_summary
tuple val(meta), path("*.${out_fmt}.gz") , emit: assembly, optional: true

something like this

Expand All @@ -28,7 +28,7 @@ process GFASTATS {
script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def agp = agpfile ? "--agp-to-path $agp" : ""
def agp = agpfile ? "--agp-to-path $agpfile" : ""
def ibed = include_bed ? "--include-bed $include_bed" : ""
def ebed = exclude_bed ? "--exclude-bed $exclude_bed" : ""
def sak = instructions ? "--swiss-army-knife $instructions" : ""
Expand All @@ -55,7 +55,7 @@ process GFASTATS {
stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.${out_fmt}.gz
echo | gzip > ${prefix}.${out_fmt}.gz
touch ${prefix}.assembly_summary

cat <<-END_VERSIONS > versions.yml
Expand Down
314 changes: 314 additions & 0 deletions modules/nf-core/gfastats/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,314 @@
nextflow_process {

name "Test Process GFASTATS"
script "../main.nf"
process "GFASTATS"

tag "modules"
tag "modules_nfcore"
tag "gfastats"

test("test_gfastats_fasta_gfa") {

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
]
input[1] = 'gfa' // GFA output format
input[2] = '' // No genome size
input[3] = '' // No target
input[4] = [] // No agp file
input[5] = [] // No include bed file
input[6] = [] // No exclude bed file
input[7] = [] // No swiss army knife instructions
"""
}
}

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

}

test("test_gfastats_gfa_fasta") {

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
]
input[1] = 'fasta' // Fasta output format
input[2] = '' // No genome size
input[3] = '' // No target
input[4] = [] // No agp file
input[5] = [] // No include bed file
input[6] = [] // No exclude bed file
input[7] = [] // No swiss army knife instructions
"""
}
}

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

}

test("test_gfastats_include_bed") {

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
]
input[1] = 'fastq' // Fastq output format
input[2] = '' // No genome size
input[3] = '' // No target
input[4] = [] // No agp file
input[5] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true)
input[6] = [] // No exclude bed file
input[7] = [] // No swiss army knife instructions
"""
}
}

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

}

test("test_gfastats_exclude_bed") {

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
]
input[1] = 'fasta' // Fasta output format
input[2] = '' // No genome size
input[3] = '' // No target
input[4] = [] // No agp file
input[5] = [] // No include bed file
input[6] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true)
input[7] = [] // No swiss army knife instructions
"""
}
}

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

}

test("test_gfastats_sak") {

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
]
input[1] = 'fasta' // Fasta output format
input[2] = '' // No genome size
input[3] = '' // No target
input[4] = [] // No agp file
input[5] = [] // No include bed file
input[6] = [] // No exclude bed file
input[7] = Channel.of(
'RVCP\tMT192765.1'
).collectFile(name:'assembly.sak')
"""
}
}

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

}

test("test_gfastats_fasta_gfa - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
]
input[1] = 'gfa' // GFA output format
input[2] = '' // No genome size
input[3] = '' // No target
input[4] = [] // No agp file
input[5] = [] // No include bed file
input[6] = [] // No exclude bed file
input[7] = [] // No swiss army knife instructions
"""
}
}

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

}

test("test_gfastats_gfa_fasta - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
]
input[1] = 'fasta' // Fasta output format
input[2] = '' // No genome size
input[3] = '' // No target
input[4] = [] // No agp file
input[5] = [] // No include bed file
input[6] = [] // No exclude bed file
input[7] = [] // No swiss army knife instructions
"""
}
}

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

}

test("test_gfastats_include_bed - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
]
input[1] = 'fastq' // Fastq output format
input[2] = '' // No genome size
input[3] = '' // No target
input[4] = [] // No agp file
input[5] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true)
input[6] = [] // No exclude bed file
input[7] = [] // No swiss army knife instructions
"""
}
}

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

}

test("test_gfastats_exclude_bed - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
]
input[1] = 'fasta' // Fasta output format
input[2] = '' // No genome size
input[3] = '' // No target
input[4] = [] // No agp file
input[5] = [] // No include bed file
input[6] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true)
input[7] = [] // No swiss army knife instructions
"""
}
}

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

}

test("test_gfastats_sak - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
]
input[1] = 'fasta' // Fasta output format
input[2] = '' // No genome size
input[3] = '' // No target
input[4] = [] // No agp file
input[5] = [] // No include bed file
input[6] = [] // No exclude bed file
input[7] = Channel.of(
'RVCP\tMT192765.1'
).collectFile(name:'assembly.sak')
"""
}
}

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

}
}
Loading
Loading