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

Newmodule ngmerge #3626

Merged
merged 11 commits into from
Jul 12, 2023
Merged
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
52 changes: 52 additions & 0 deletions modules/nf-core/ngmerge/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
process NGMERGE {
tag "$meta.id"
label 'process_medium'

conda "bioconda::ngmerge=0.3"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/ngmerge:0.3--ha92aebf_1':
'biocontainers/ngmerge:0.3--ha92aebf_1' }"

input:
tuple val(meta), path(reads1), path(reads2)

output:
tuple val(meta), path("*.merged.fq.gz"), emit: merged_reads
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}"

"""
NGmerge \\
-1 $reads1 \\
-2 $reads2 \\
-o ${prefix}.merged.fq.gz \\
-z \\
-n $task.cpus \\
$args
cat <<-END_VERSIONS > versions.yml
"${task.process}":
NGmerge: \$(echo \$(NGmerge --version 2>&1) | sed 's/^.*NGmerge, version //; s/ Copyright.*// ; s/: //g' ))
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"

"""
touch ${prefix}.merged.fq.gz
cat <<-END_VERSIONS > versions.yml
"${task.process}":
NGmerge: \$(echo \$(NGmerge --version 2>&1) | sed 's/^.*NGmerge, version //; s/ Copyright.*// ; s/: //g' ))
END_VERSIONS
"""
}
54 changes: 54 additions & 0 deletions modules/nf-core/ngmerge/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
name: "ngmerge"

description: Merging paired-end reads and removing sequencing adapters.
keywords:
- sort
- reads merging
- merge mate pairs
tools:
- "ngmerge":
description: "Merging paired-end reads and removing sequencing adapters."
homepage: "https://github.com/jsh58/NGmerge"
documentation: "https://github.com/jsh58/NGmerge"
tool_dev_url: "https://github.com/jsh58/NGmerge"
doi: "10.1186/s12859-018-2579-2"
licence: "['MIT']"

input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'test', single_end:false ]`
- reads1:
type: file
description: fastq file paired end read 1
pattern: "*.{fa,fasta,fastq,fq,fa.gz,fasta.gz,fastq.gz,fq.gz}"

- reads2:
type: file
description: fastq file paired end read 2
pattern: "*.{fa,fasta,fastq,fq,fa.gz,fasta.gz,fastq.gz,fq.gz}"

output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'test', single_end:false ]`
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"

- merged_reads:
type: file
description: fastq file paired end read 2
pattern: "*.{fa,fasta,fastq,fq,fa.gz,fasta.gz,fastq.gz,fq.gz}"

authors:
- "@charlotteanne"
- "@jsh58"
4 changes: 4 additions & 0 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2527,6 +2527,10 @@ ngmaster:
- modules/nf-core/ngmaster/**
- tests/modules/nf-core/ngmaster/**

ngmerge:
- modules/nf-core/ngmerge/**
- tests/modules/nf-core/ngmerge/**

ngsbits/samplegender:
- modules/nf-core/ngsbits/samplegender/**
- tests/modules/nf-core/ngsbits/samplegender/**
Expand Down
15 changes: 15 additions & 0 deletions tests/modules/nf-core/ngmerge/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env nextflow

nextflow.enable.dsl = 2

include { NGMERGE } from '../../../../modules/nf-core/ngmerge/main.nf'

workflow test_ngmerge {
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)]
]

NGMERGE ( input )
}
5 changes: 5 additions & 0 deletions tests/modules/nf-core/ngmerge/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {

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

}
7 changes: 7 additions & 0 deletions tests/modules/nf-core/ngmerge/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- name: ngmerge test_ngmerge
command: nextflow run ./tests/modules/nf-core/ngmerge -entry test_ngmerge -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/ngmerge/nextflow.config
tags:
- ngmerge
files:
- path: output/ngmerge/test.merged.fq.gz
- path: output/ngmerge/versions.yml