Skip to content

Commit

Permalink
allow fastq.gz and fq.gz as file input, add meta.yml and test
Browse files Browse the repository at this point in the history
  • Loading branch information
mashehu committed Feb 9, 2022
1 parent 54687c8 commit 34002d7
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/sortmerna/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ process SORTMERNA {
--other non_rRNA_reads \\
$args
mv non_rRNA_reads.fq.gz ${prefix}.fastq.gz
mv non_rRNA_reads.f*q.gz ${prefix}.fastq.gz
mv rRNA_reads.log ${prefix}.sortmerna.log
cat <<-END_VERSIONS > versions.yml
Expand All @@ -55,8 +55,8 @@ process SORTMERNA {
--out2 \\
$args
mv non_rRNA_reads_fwd.fq.gz ${prefix}_1.fastq.gz
mv non_rRNA_reads_rev.fq.gz ${prefix}_2.fastq.gz
mv non_rRNA_reads_fwd.f*q.gz ${prefix}_1.fastq.gz
mv non_rRNA_reads_rev.f*q.gz ${prefix}_2.fastq.gz
mv rRNA_reads.log ${prefix}.sortmerna.log
cat <<-END_VERSIONS > versions.yml
Expand Down
50 changes: 50 additions & 0 deletions modules/sortmerna/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: sortmerna
description: Local sequence alignment tool for filtering, mapping and clustering.
keywords:
- filtering
- mapping
- clustering
- rRNA
- ribosomal RNA
tools:
- SortMeRNA:
description: The core algorithm is based on approximate seeds and allows for sensitive analysis of NGS reads. The main application of SortMeRNA is filtering rRNA from metatranscriptomic data. SortMeRNA takes as input files of reads (fasta, fastq, fasta.gz, fastq.gz) and one or multiple rRNA database file(s), and sorts apart aligned and rejected reads into two files. Additional applications include clustering and taxonomy assignation available through QIIME v1.9.1. SortMeRNA works with Illumina, Ion Torrent and PacBio data, and can produce SAM and BLAST-like alignments.
homepage: https://hpc.nih.gov/apps/sortmeRNA.html
documentation: https://github.com/biocore/sortmerna/wiki/
licence: ['GPL-3.0-or-later']
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- reads:
type: file
description: |
List of input FastQ files of size 1 and 2 for single-end and paired-end data,
respectively.
- fastas:
type: file
description: |
Path to reference file(s)
output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- reads:
type: file
description: The filtered fastq reads
pattern: "*fastq.gz"
- log:
type: file
description: SortMeRNA log file
pattern: "*sortmerna.log"
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@drpatelh"
- "@mashehu"
4 changes: 4 additions & 0 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1397,6 +1397,10 @@ snpsites:
- modules/snpsites/**
- tests/modules/snpsites/**

sortmerna:
- modules/sortmerna/**
- tests/modules/sortmerna/**

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

nextflow.enable.dsl = 2

include { SORTMERNA } from '../../../modules/sortmerna/main.nf'

//
// Test with single-end data
//
workflow test_sortmerna_single_end {
input = [ [ id:'test', single_end:true ], // meta map
[ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ]
]
fasta = [ file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ]
SORTMERNA ( input, fasta )
}

//
// Test with paired-end data
//
workflow test_sortmerna_paired_end {
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) ]
]
fasta = [ file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ]
SORTMERNA ( input, fasta )
}

5 changes: 5 additions & 0 deletions tests/modules/sortmerna/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()}" }

}
9 changes: 9 additions & 0 deletions tests/modules/sortmerna/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## TODO nf-core: Please run the following command to build this file:
# nf-core modules create-test-yml sortmerna
- name: sortmerna
command: nextflow run ./tests/modules/sortmerna -entry test_sortmerna -c ./tests/config/nextflow.config -c ./tests/modules/sortmerna/nextflow.config
tags:
- sortmerna
files:
- path: output/sortmerna/test.bam
md5sum: e667c7caad0bc4b7ac383fd023c654fc

0 comments on commit 34002d7

Please sign in to comment.