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 MetaPlAn subworkflow #5356

Merged
merged 17 commits into from
Mar 25, 2024
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
29 changes: 29 additions & 0 deletions subworkflows/nf-core/fastq_taxonomic_profile_metaphlan/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
include { METAPHLAN_MAKEDB } from '../../../modules/nf-core/metaphlan/makedb/main'
include { METAPHLAN_METAPHLAN } from '../../../modules/nf-core/metaphlan/metaphlan/main'
include { METAPHLAN_MERGEMETAPHLANTABLES } from '../../../modules/nf-core/metaphlan/mergemetaphlantables/main'


workflow FASTQ_TAXONOMIC_PROFILE_METAPHLAN {

take:
ch_fastq

main:

ch_versions = Channel.empty()

METAPHLAN_MAKEDB ( )
ch_versions = ch_versions.mix(METAPHLAN_MAKEDB.out.versions.first())

METAPHLAN_METAPHLAN ( ch_fastq, METAPHLAN_MAKEDB.out.db )
ch_versions = ch_versions.mix(METAPHLAN_METAPHLAN.out.versions.first())

metaphlan_merged_profiles_txt = METAPHLAN_MERGEMETAPHLANTABLES ( METAPHLAN_METAPHLAN.out.profile.map{ [ [id:'all_samples'], it[1] ] }.groupTuple( sort: { it.getName() } ) ).txt
ch_versions = ch_versions.mix(METAPHLAN_MERGEMETAPHLANTABLES.out.versions.first())

emit:
merged_taxa = metaphlan_merged_profiles_txt

versions = ch_versions
}

54 changes: 54 additions & 0 deletions subworkflows/nf-core/fastq_taxonomic_profile_metaphlan/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: "fastq_taxonomic_profile_metaphlan"
description: Subworkflow to taxonomically classify metagenomic sequencing data using MetaPhlAn
keywords:
- metaphlan
- metagenomics
- database
- classification
- merge
- profiles
components:
- metaphlan/makedb
- metaphlan/metaphlan
- metaphlan/mergemetaphlantables

input:
LaurenGonsalves marked this conversation as resolved.
Show resolved Hide resolved
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:‘test’, single_end:false ]
- ch_fastq:
type: file
description: |
The input channel containing the FASTQ files
Structure: [ val(meta), path(fastqs) ]
pattern: "*.{fastq/fastq.gz}"

output:
LaurenGonsalves marked this conversation as resolved.
Show resolved Hide resolved
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:‘test’, single_end:false ]
- versions:
type: file
description: |
File containing software versions
Structure: [ path(versions.yml) ]
pattern: "versions.yml"
- txt:
type: file
description: |
Combined MetaPhlAn table
Structure: [ val(meta), path(txt) ]
pattern: "*.txt"

authors:
- "@LaurenGonsalves"
- "@hhayden01"
- "@ErikLHendrickson"
- "@CarsonJM"
maintainers:
- "@LaurenGonsalves"
- "@CarsonJM"
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
nextflow_workflow {

name "Test Subworkflow FASTQ_TAXONOMIC_PROFILE_METAPHLAN"
script "../main.nf"
workflow "FASTQ_TAXONOMIC_PROFILE_METAPHLAN"
config "./nextflow.config"

tag "subworkflows"
tag "subworkflows_nfcore"
tag "subworkflows/fastq_taxonomic_profile_metaphlan"
tag "metaphlan/makedb"
tag "metaphlan/metaphlan"
tag "metaphlan/mergemetaphlantables"


test("sarscov2 - fastq - paired_end") {

when {
workflow {
"""
input[0] = Channel.of (
[
[ id:'test1', 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)
]
],
[
[ id:'test2', single_end:false ], // meta map
[
file(params.modules_testdata_base_path + 'genomics/prokaryotes/bacteroides_fragilis/illumina/fastq/test1_1.fastq.gz', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/prokaryotes/bacteroides_fragilis/illumina/fastq/test1_2.fastq.gz', checkIfExists: true)
]
]
)
"""
}
}

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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {
withName: METAPHLAN_MAKEDB {
ext.args = '--index mpa_vJan21_TOY_CHOCOPhlAnSGB_202103'
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
subworkflows/fastq_taxonomic_profile_metaphlan:
- subworkflows/nf-core/fastq_taxonomic_profile_metaphlan/**
Loading