Added fq/lint module (#1968)

* Added fq/lint module

Additions:
 - fq/lint module, which checks paired end FASTQ files and confirms they
 are valid.

Relates to #1967

* fq/lint linting

* Correct Singularity image

Co-authored-by: Maxime U. Garcia <maxime.garcia@scilifelab.se>

Co-authored-by: Maxime U. Garcia <maxime.garcia@scilifelab.se>
This commit is contained in:
Adam Talbot 2022-08-24 09:20:39 +01:00 committed by GitHub
parent 11cf45043c
commit 7bfbce94b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 127 additions and 4 deletions

33
modules/fq/lint/main.nf Normal file
View file

@ -0,0 +1,33 @@
process FQ_LINT {
tag "$meta.id"
label 'process_low'
conda (params.enable_conda ? "bioconda::fq=0.9.1" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/fq:0.9.1--h9ee0642_0':
'quay.io/biocontainers/fq:0.9.1--h9ee0642_0' }"
input:
tuple val(meta), path(fastq)
output:
tuple val(meta), path("*.fq_lint.txt"), emit: lint
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}"
"""
fq lint \\
$args \\
$fastq > ${prefix}.fq_lint.txt
cat <<-END_VERSIONS > versions.yml
"${task.process}":
fq: \$(echo \$(fq lint --version | sed 's/fq-lint //g'))
END_VERSIONS
"""
}

32
modules/fq/lint/meta.yml Normal file
View file

@ -0,0 +1,32 @@
name: "fq_lint"
description: write your description here
keywords:
- sort
tools:
- "fq":
description: "fq is a library to generate and validate FASTQ file pairs."
homepage: "https://github.com/stjude-rust-labs/fq"
documentation: "https://github.com/stjude-rust-labs/fq"
tool_dev_url: "https://github.com/stjude-rust-labs/fq"
doi: ""
licence: "['MIT']"
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- fastq:
type: file
description: FASTQ file list
pattern: "*.fastq{,.gz}"
output:
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@adamrtalbot"

View file

@ -779,6 +779,10 @@ flye:
- modules/flye/** - modules/flye/**
- tests/modules/flye/** - tests/modules/flye/**
fq/lint:
- modules/fq/lint/**
- tests/modules/fq/lint/**
freebayes: freebayes:
- modules/freebayes/** - modules/freebayes/**
- tests/modules/freebayes/** - tests/modules/freebayes/**
@ -2223,10 +2227,6 @@ trimmomatic:
- modules/trimmomatic/** - modules/trimmomatic/**
- tests/modules/trimmomatic/** - tests/modules/trimmomatic/**
ucsc/bedtobigbed:
- modules/ucsc/bedtobigbed/**
- tests/modules/ucsc/bedtobigbed/**
ucsc/bedclip: ucsc/bedclip:
- modules/ucsc/bedclip/** - modules/ucsc/bedclip/**
- tests/modules/ucsc/bedclip/** - tests/modules/ucsc/bedclip/**
@ -2235,6 +2235,10 @@ ucsc/bedgraphtobigwig:
- modules/ucsc/bedgraphtobigwig/** - modules/ucsc/bedgraphtobigwig/**
- tests/modules/ucsc/bedgraphtobigwig/** - tests/modules/ucsc/bedgraphtobigwig/**
ucsc/bedtobigbed:
- modules/ucsc/bedtobigbed/**
- tests/modules/ucsc/bedtobigbed/**
ucsc/bigwigaverageoverbed: ucsc/bigwigaverageoverbed:
- modules/ucsc/bigwigaverageoverbed/** - modules/ucsc/bigwigaverageoverbed/**
- tests/modules/ucsc/bigwigaverageoverbed/** - tests/modules/ucsc/bigwigaverageoverbed/**

View file

@ -0,0 +1,31 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { FQ_LINT } from '../../../../modules/fq/lint/main.nf'
workflow test_fq_lint_success {
input = [
[ id:'test', single_end:false ], // meta map
[
file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true),
file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true)
]
]
FQ_LINT ( input )
}
workflow test_fq_lint_fail {
input = [
[ id:'test', single_end:false ], // meta map
[
file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true),
file(params.test_data['candidatus_portiera_aleyrodidarum']['illumina']['test_2_fastq_gz'], checkIfExists: true)
]
]
FQ_LINT ( input )
}

View file

@ -0,0 +1,5 @@
process {
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
}

View file

@ -0,0 +1,18 @@
- name: fq lint test_fq_lint_success
command: nextflow run ./tests/modules/fq/lint -entry test_fq_lint_success -c ./tests/config/nextflow.config -c ./tests/modules/fq/lint/nextflow.config
tags:
- fq
- fq/lint
files:
- path: output/fq/test.fq_lint.txt
contains:
- "fq-lint start"
- "read 100 records"
- "fq-lint end"
- name: fq lint test_fq_lint_fail
command: nextflow run ./tests/modules/fq/lint -entry test_fq_lint_fail -c ./tests/config/nextflow.config -c ./tests/modules/fq/lint/nextflow.config
tags:
- fq
- fq/lint
exit_code: 1