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

Added new module for Toulligqc #5131

Merged
merged 27 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
54d98e9
ADD: working toulligqc as module
Salome-Brunon Mar 13, 2024
f8b0e5e
ToulligQC module passed tests
Salome-Brunon Mar 15, 2024
d2f56a1
[automated] Fix linting with Prettier
nf-core-bot Mar 15, 2024
06bab25
Remove whitespaces
Salome-Brunon Mar 18, 2024
85f8598
Update main.nf
Salome-Brunon Mar 18, 2024
c09b0a8
Update main.nf
Salome-Brunon Mar 18, 2024
fc83273
Merge branch 'master' into toulligqc
pinin4fjords Mar 18, 2024
1b07601
Update modules/nf-core/toulligqc/meta.yml
Salome-Brunon Mar 19, 2024
d3e6d86
Update modules/nf-core/toulligqc/meta.yml
Salome-Brunon Mar 19, 2024
8f78d86
Update modules/nf-core/toulligqc/meta.yml
Salome-Brunon Mar 19, 2024
4310cd3
Update modules/nf-core/toulligqc/main.nf
Salome-Brunon Mar 19, 2024
f8e3db5
Merge branch 'toulligqc' of github.com:Salome-Brunon/modules into tou…
Salome-Brunon Mar 19, 2024
67eaf13
UPDATE: added fastq as input option
Salome-Brunon Mar 21, 2024
f891afb
Merge branch 'master' into toulligqc
Salome-Brunon Mar 21, 2024
f2bc6d1
Update environment.yml
Salome-Brunon Mar 21, 2024
939aa63
UPDATE: moved to ToulligQC v2.5.4 and added BAM as input file option
Salome-Brunon Mar 25, 2024
2190de6
Merge branch 'master' into toulligqc
Salome-Brunon Mar 25, 2024
486a54c
Update modules/nf-core/toulligqc/meta.yml
Salome-Brunon Mar 26, 2024
4557e5d
Update modules/nf-core/toulligqc/meta.yml
Salome-Brunon Mar 26, 2024
c5f24db
UPDATE: added meta map to module
Salome-Brunon Mar 26, 2024
8680dc5
Merge branch 'master' into toulligqc
Salome-Brunon Mar 26, 2024
9bbc2b7
UPDATE: added stub section to module
Salome-Brunon Mar 27, 2024
2281f51
Merge branch 'master' into toulligqc
Salome-Brunon Mar 27, 2024
efdd607
Update modules/nf-core/toulligqc/main.nf
Salome-Brunon Mar 28, 2024
d61ddd9
FIX: pass seq_summarry, fastq, bam as one tuple
Salome-Brunon Mar 28, 2024
c64f776
Merge branch 'master' into toulligqc
Salome-Brunon Mar 28, 2024
47eb172
Merge branch 'master' into toulligqc
Salome-Brunon Mar 28, 2024
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
9 changes: 9 additions & 0 deletions modules/nf-core/toulligqc/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
name: "toulligqc"
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- "bioconda::toulligqc=2.5.4"
45 changes: 45 additions & 0 deletions modules/nf-core/toulligqc/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
process TOULLIGQC {
label 'process_low'
tag "$meta.id"

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

input:
tuple val(meta), path(seq_summary)
tuple val(meta), path(fastq)
tuple val(meta), path(bam)
Copy link
Member

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(seq_summary)
tuple val(meta), path(fastq)
tuple val(meta), path(bam)
tuple val(meta), path(seq_summary), path(fastq), path(bam)


output:
tuple val(meta), path("*/*.data") , emit: report_data
path "*/*.html" , emit: report_html, optional: true
path "*/images/*.html" , emit: plots_html
path "*/images/plotly.min.js" , emit: plotly_js

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}"

def seq_summary_input = seq_summary ? "--sequencing-summary-source ${seq_summary}" : ""
jfy133 marked this conversation as resolved.
Show resolved Hide resolved
def fastq_input = fastq ? "--fastq ${fastq}" : ""
def bam_input = bam ? "--bam ${bam}" : ""

"""
toulligqc ${seq_summary_input} \\
${fastq_input} \\
${bam_input} \\
$args

cat <<-END_VERSIONS > versions.yml
"${task.process}":
toulligqc: \$(toulligqc --version 2>&1)
END_VERSIONS
Salome-Brunon marked this conversation as resolved.
Show resolved Hide resolved
"""
}
66 changes: 66 additions & 0 deletions modules/nf-core/toulligqc/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "toulligqc"
description: "A post sequencing QC tool for Oxford Nanopore sequencers"
keywords:
- nanopore sequencing
- quality control
- genomics
tools:
- "toulligqc":
description: "A post sequencing QC tool for Oxford Nanopore sequencers"
homepage: https://github.com/GenomiqueENS/toulligQC
documentation: https://github.com/GenomiqueENS/toulligQC
tool_dev_url: https://github.com/GenomiqueENS/toulligQC
licence: ["CECILL-2.1"]

input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- seq_summary:
type: file
description: Basecaller sequencing summary source
pattern: "*.txt"
- fastq:
type: file
description: FASTQ file (necessary if no sequencing summary file)
pattern: "*.{fq,fastq,fq.gz,fastq.gz}"
- bam:
type: file
description: BAM file (necessary if no sequencing summary file)
pattern: "*.bam"

output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- report_data:
type: file
description: Report data emitted from toulligqc
pattern: "*.data"
- report_html:
type: file
description: Report data in html format
pattern: "*.html"
- plots_html:
type: file
description: Plots emitted in html format
pattern: "*.html"
- plotly_js:
type: file
description: Plots emitted from toulligqc
pattern: "plotly.min.js"
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"

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

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

tag "modules"
tag "modules_nfcore"
tag "toulligqc"

test("sarscov2 - nanopore sequencing_summary") {
when {
process {
"""
input[0] = [
[ id:'test' ], // meta map
file(params.test_data['sarscov2']['nanopore']['test2_sequencing_summary'], checkIfExists: true)
]
input[1] = [
Salome-Brunon marked this conversation as resolved.
Show resolved Hide resolved
[],
[]
]
input[2] = [
[],
[]
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(file(process.out.report_data.get(0).get(1)).readLines()[11..74]).match() },
{ assert process.out.report_html[0] ==~ ".*/report.html"}
)
}

}

test("sarscov2 - nanopore fastq") {
when {
process {
"""
input[0] = [
[],
[]
]
input[1] = [
[ id:'test' ], // meta map
file(params.test_data['sarscov2']['nanopore']['test_fastq_gz'], checkIfExists: true)
]
input[2] = [
[],
[]
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(file(process.out.report_data.get(0).get(1)).readLines()[11..67]).match() },
{ assert process.out.report_html[0] ==~ ".*/report.html"}
)
}

}

test("sarscov2 - nanopore bam") {
Copy link
Member

Choose a reason for hiding this comment

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

Can you add one test with all three if they are not mutually exclusive

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can do but I will need to upload new data to the nf-core/tets-datasets repo as I don't think the sequencing summary, FASTQ and BAM files come from the same run..

Copy link
Member

Choose a reason for hiding this comment

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

Ah ok, that would be a bit awkward... maybe you could do a local test and otherwise I avert my eyes ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay thank you! I'll do a local test this afternoon and will let you know the outcome :)

Copy link
Contributor Author

@Salome-Brunon Salome-Brunon Mar 28, 2024

Choose a reason for hiding this comment

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

I have done a test with a sequencing summary and fastq file and it worked!
I don't have access to a bam file right now but there is no reason for it not to work :)
local_test_seq_summary_fastq

when {
process {
"""
input[0] = [
[],
[]
]
input[1] = [
[],
[]
]
input[2] = [
[ id:'test' ], // meta map
file(params.test_data['sarscov2']['nanopore']['test_sorted_bam'], checkIfExists: true)
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(file(process.out.report_data.get(0).get(1)).readLines()[11..74]).match() },
{ assert process.out.report_html[0] ==~ ".*/report.html"}
)
}

}
}
Loading
Loading