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

fastqe #6909

Closed
wants to merge 2 commits into from
Closed

fastqe #6909

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
7 changes: 7 additions & 0 deletions modules/nf-core/fastqe/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
channels:
- conda-forge
- bioconda
dependencies:
- "bioconda::fastqe=0.3.3"
45 changes: 45 additions & 0 deletions modules/nf-core/fastqe/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
process FASTQE {
tag "$meta.id"
label 'process_low'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/fastqe:0.3.3--pyhdfd78af_0':
'biocontainers/fastqe:0.3.3--pyhdfd78af_0' }"

input:
tuple val(meta), path(reads)

output:
tuple val(meta), path("*.txt"), emit: report
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
fastqe \\
$reads \\
$args \\
--output ${prefix}.txt

cat <<-END_VERSIONS > versions.yml
"${task.process}":
fastqe: \$(fastqe --version 2>&1 | sed 's/fastqe, version //')
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.txt

cat <<-END_VERSIONS > versions.yml
"${task.process}":
fastqe: \$(fastqe --version 2>&1 | sed 's/fastqe, version //')
END_VERSIONS
"""
}
46 changes: 46 additions & 0 deletions modules/nf-core/fastqe/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "fastqe"
description: Compute quality stats for FASTQ files and print those stats as emoji
keywords:
- fastq
- quality
- emoji
- qc
tools:
- "fastqe":
description: "A tool that converts FASTQ quality scores to emoji for visualization"
homepage: "https://github.com/fastqe/fastqe"
documentation: "https://github.com/fastqe/fastqe"
licence: ['BSD-3-clause']

input:
- meta:
type: [ "map" ]
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- reads:
type: [ "file" ]
description: FASTQ file(s)
pattern: "*.{fastq,fq,fastq.gz,fq.gz}"

output:
- meta:
type: [ "map" ]
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- report:
type: [ "file" ]
description: Text file containing emoji representation of quality scores
pattern: "*.txt"
- versions:
type: [ "file" ]
description: File containing software versions
pattern: "versions.yml"

authors:
- "@edmundmiller"
maintainers:
- "@edmundmiller"
78 changes: 78 additions & 0 deletions modules/nf-core/fastqe/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "fastqe"

test("fastq - single_end") {
when {
process {
"""
input[0] = [
[ id:'test', single_end:true ], // meta map
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true)
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() },
{ assert path(process.out.report[0][1]).readLines().size() > 0 }
)
}
}

test("fastq - paired_end") {
when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
[
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true)
]
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() },
{ assert path(process.out.report[0][1]).readLines().size() > 0 }
)
}
}

test("fastq - single_end - stub") {
options "-stub"

when {
process {
"""
input[0] = [
[ id:'test', single_end:true ], // meta map
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true)
]
"""
}
}

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

}
Loading