mirror of
https://github.com/MillironX/taxprofiler.git
synced 2024-11-22 15:39:55 +00:00
Start work
This commit is contained in:
parent
1ac5a129a8
commit
de57340526
6 changed files with 146 additions and 10 deletions
|
@ -30,6 +30,9 @@
|
||||||
"malt/run": {
|
"malt/run": {
|
||||||
"git_sha": "72b96f4e504eef673f2b5c13560a9d90b669129b"
|
"git_sha": "72b96f4e504eef673f2b5c13560a9d90b669129b"
|
||||||
},
|
},
|
||||||
|
"megan/rma2info": {
|
||||||
|
"git_sha": "2d38566eca4cc15142b2ffa7c11837569b39aece"
|
||||||
|
},
|
||||||
"metaphlan3": {
|
"metaphlan3": {
|
||||||
"git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d"
|
"git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d"
|
||||||
},
|
},
|
||||||
|
|
38
modules/nf-core/modules/megan/rma2info/main.nf
generated
Normal file
38
modules/nf-core/modules/megan/rma2info/main.nf
generated
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
process MEGAN_RMA2INFO {
|
||||||
|
tag "$meta.id"
|
||||||
|
label 'process_low'
|
||||||
|
|
||||||
|
conda (params.enable_conda ? "bioconda::megan=6.21.7" : null)
|
||||||
|
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
||||||
|
'https://depot.galaxyproject.org/singularity/megan:6.21.7--h9ee0642_0':
|
||||||
|
'quay.io/biocontainers/megan:6.21.7--h9ee0642_0' }"
|
||||||
|
|
||||||
|
input:
|
||||||
|
tuple val(meta), path(rma6)
|
||||||
|
val(megan_summary)
|
||||||
|
|
||||||
|
output:
|
||||||
|
tuple val(meta), path("*.txt.gz") , emit: txt
|
||||||
|
tuple val(meta), path("*.megan"), optional: true, emit: megan_summary
|
||||||
|
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 summary = megan_summary ? "-es ${prefix}.megan" : ""
|
||||||
|
"""
|
||||||
|
rma2info \\
|
||||||
|
-i ${rma6} \\
|
||||||
|
-o ${prefix}.txt.gz \\
|
||||||
|
${summary} \\
|
||||||
|
$args
|
||||||
|
|
||||||
|
cat <<-END_VERSIONS > versions.yml
|
||||||
|
"${task.process}":
|
||||||
|
megan: \$(echo \$(rma2info 2>&1) | grep version | sed 's/.*version //g;s/, built.*//g')
|
||||||
|
END_VERSIONS
|
||||||
|
"""
|
||||||
|
}
|
51
modules/nf-core/modules/megan/rma2info/meta.yml
generated
Normal file
51
modules/nf-core/modules/megan/rma2info/meta.yml
generated
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
name: "megan_rma2info"
|
||||||
|
description: Analyses an RMA file and exports information in text format
|
||||||
|
keywords:
|
||||||
|
- megan
|
||||||
|
- rma6
|
||||||
|
- classification
|
||||||
|
- conversion
|
||||||
|
tools:
|
||||||
|
- "megan":
|
||||||
|
description: "A tool for studying the taxonomic content of a set of DNA reads"
|
||||||
|
homepage: "https://uni-tuebingen.de/fakultaeten/mathematisch-naturwissenschaftliche-fakultaet/fachbereiche/informatik/lehrstuehle/algorithms-in-bioinformatics/software/megan6/"
|
||||||
|
documentation: "https://software-ab.informatik.uni-tuebingen.de/download/megan6/welcome.html"
|
||||||
|
tool_dev_url: "https://github.com/husonlab/megan-ce"
|
||||||
|
doi: "10.1371/journal.pcbi.1004957"
|
||||||
|
licence: "['GPL >=3']"
|
||||||
|
|
||||||
|
input:
|
||||||
|
- meta:
|
||||||
|
type: map
|
||||||
|
description: |
|
||||||
|
Groovy Map containing sample information
|
||||||
|
e.g. [ id:'test', single_end:false ]
|
||||||
|
- rma6:
|
||||||
|
type: file
|
||||||
|
description: RMA6 file from MEGAN or MALT
|
||||||
|
pattern: "*.rma6"
|
||||||
|
- megan_summary:
|
||||||
|
type: boolean
|
||||||
|
description: Specify whether to generate an MEGAN summary file
|
||||||
|
|
||||||
|
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"
|
||||||
|
- txt:
|
||||||
|
type: file
|
||||||
|
description: Compressed text file
|
||||||
|
pattern: "*.txt.gz"
|
||||||
|
- megan_summary:
|
||||||
|
type: file
|
||||||
|
description: Optionally generated MEGAN summary file
|
||||||
|
pattern: "*.megan"
|
||||||
|
|
||||||
|
authors:
|
||||||
|
- "@jfy133"
|
|
@ -89,6 +89,7 @@ params {
|
||||||
centrifuge_save_unaligned = false
|
centrifuge_save_unaligned = false
|
||||||
centrifuge_save_aligned = false
|
centrifuge_save_aligned = false
|
||||||
centrifuge_sam_format = false
|
centrifuge_sam_format = false
|
||||||
|
|
||||||
// metaphlan3
|
// metaphlan3
|
||||||
run_metaphlan3 = false
|
run_metaphlan3 = false
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@ workflow PROFILING {
|
||||||
main:
|
main:
|
||||||
ch_versions = Channel.empty()
|
ch_versions = Channel.empty()
|
||||||
ch_multiqc_files = Channel.empty()
|
ch_multiqc_files = Channel.empty()
|
||||||
|
ch_raw_profiles = Channel.empty()
|
||||||
|
|
||||||
/*
|
/*
|
||||||
COMBINE READS WITH POSSIBLE DATABASES
|
COMBINE READS WITH POSSIBLE DATABASES
|
||||||
|
@ -91,28 +92,31 @@ workflow PROFILING {
|
||||||
MALT_RUN ( ch_input_for_malt.reads, params.malt_mode, ch_input_for_malt.db )
|
MALT_RUN ( ch_input_for_malt.reads, params.malt_mode, ch_input_for_malt.db )
|
||||||
ch_multiqc_files = ch_multiqc_files.mix( MALT_RUN.out.log.collect{it[1]}.ifEmpty([]) )
|
ch_multiqc_files = ch_multiqc_files.mix( MALT_RUN.out.log.collect{it[1]}.ifEmpty([]) )
|
||||||
ch_versions = ch_versions.mix( MALT_RUN.out.versions.first() )
|
ch_versions = ch_versions.mix( MALT_RUN.out.versions.first() )
|
||||||
|
ch_raw_profiles = ch_raw_profiles.mix( MALT_RUN.out.rma6 )
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( params.run_kraken2 ) {
|
if ( params.run_kraken2 ) {
|
||||||
KRAKEN2_KRAKEN2 ( ch_input_for_kraken2.reads, ch_input_for_kraken2.db )
|
KRAKEN2_KRAKEN2 ( ch_input_for_kraken2.reads, ch_input_for_kraken2.db )
|
||||||
ch_multiqc_files = ch_multiqc_files.mix( KRAKEN2_KRAKEN2.out.txt.collect{it[1]}.ifEmpty([]) )
|
ch_multiqc_files = ch_multiqc_files.mix( KRAKEN2_KRAKEN2.out.txt.collect{it[1]}.ifEmpty([]) )
|
||||||
ch_versions = ch_versions.mix( KRAKEN2_KRAKEN2.out.versions.first() )
|
ch_versions = ch_versions.mix( KRAKEN2_KRAKEN2.out.versions.first() )
|
||||||
|
ch_raw_profiles = ch_raw_profiles.mix( KRAKEN2_KRAKEN2.out.txt )
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( params.run_centrifuge ) {
|
if ( params.run_centrifuge ) {
|
||||||
CENTRIFUGE_CENTRIFUGE ( ch_input_for_centrifuge.reads, ch_input_for_centrifuge.db, params.centrifuge_save_unaligned, params.centrifuge_save_aligned, params.centrifuge_sam_format )
|
CENTRIFUGE_CENTRIFUGE ( ch_input_for_centrifuge.reads, ch_input_for_centrifuge.db, params.centrifuge_save_unaligned, params.centrifuge_save_aligned, params.centrifuge_sam_format )
|
||||||
ch_versions = ch_versions.mix( CENTRIFUGE_CENTRIFUGE.out.versions.first() )
|
ch_versions = ch_versions.mix( CENTRIFUGE_CENTRIFUGE.out.versions.first() )
|
||||||
|
ch_raw_profiles = ch_raw_profiles.mix( CENTRIFUGE_CENTRIFUGE.out.report )
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( params.run_metaphlan3 ) {
|
if ( params.run_metaphlan3 ) {
|
||||||
METAPHLAN3 ( ch_input_for_metaphlan3.reads, ch_input_for_metaphlan3.db )
|
METAPHLAN3 ( ch_input_for_metaphlan3.reads, ch_input_for_metaphlan3.db )
|
||||||
ch_versions = ch_versions.mix( METAPHLAN3.out.versions.first() )
|
ch_versions = ch_versions.mix( METAPHLAN3.out.versions.first() )
|
||||||
|
ch_raw_profiles = ch_raw_profiles.mix( METAPHLAN3.out.biom )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
emit:
|
emit:
|
||||||
// TODO work out if there is enough standardisation of output to export as one?
|
profiles = ch_raw_profiles // channel: [ val(meta), [ reads ] ]
|
||||||
//output = ch_filtered_reads // channel: [ val(meta), [ reads ] ]
|
|
||||||
versions = ch_versions // channel: [ versions.yml ]
|
versions = ch_versions // channel: [ versions.yml ]
|
||||||
mqc = ch_multiqc_files
|
mqc = ch_multiqc_files
|
||||||
}
|
}
|
||||||
|
|
39
subworkflows/local/shortread_postprocessing.nf
Normal file
39
subworkflows/local/shortread_postprocessing.nf
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
//
|
||||||
|
// Perform read trimming and merging
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
include { SHORTREAD_FASTP } from './shortread_fastp'
|
||||||
|
include { SHORTREAD_ADAPTERREMOVAL } from './shortread_adapterremoval'
|
||||||
|
include { FASTQC as FASTQC_PROCESSED } from '../../modules/nf-core/modules/fastqc/main'
|
||||||
|
|
||||||
|
workflow SHORTREAD_POSTPROCESSING {
|
||||||
|
take:
|
||||||
|
input // [ [ meta ], [ taxon_table/file ] ]
|
||||||
|
|
||||||
|
main:
|
||||||
|
ch_versions = Channel.empty()
|
||||||
|
ch_multiqc_files = Channel.empty()
|
||||||
|
|
||||||
|
if ( params.shortread_clipmerge_tool == "fastp" ) {
|
||||||
|
ch_processed_reads = SHORTREAD_FASTP ( reads ).reads
|
||||||
|
ch_versions = ch_versions.mix( SHORTREAD_FASTP.out.versions )
|
||||||
|
ch_multiqc_files = ch_multiqc_files.mix( SHORTREAD_FASTP.out.mqc )
|
||||||
|
} else if ( params.shortread_clipmerge_tool == "adapterremoval" ) {
|
||||||
|
ch_processed_reads = SHORTREAD_ADAPTERREMOVAL ( reads ).reads
|
||||||
|
ch_versions = ch_versions.mix( SHORTREAD_ADAPTERREMOVAL.out.versions )
|
||||||
|
ch_multiqc_files = ch_multiqc_files.mix( SHORTREAD_ADAPTERREMOVAL.out.mqc )
|
||||||
|
} else {
|
||||||
|
ch_processed_reads = reads
|
||||||
|
}
|
||||||
|
|
||||||
|
FASTQC_PROCESSED ( ch_processed_reads )
|
||||||
|
ch_versions = ch_versions.mix( FASTQC_PROCESSED.out.versions )
|
||||||
|
ch_multiqc_files = ch_multiqc_files.mix( FASTQC_PROCESSED.out.zip )
|
||||||
|
|
||||||
|
emit:
|
||||||
|
output = output // channel: [ val(meta), taxon_table ]
|
||||||
|
versions = ch_versions // channel: [ versions.yml ]
|
||||||
|
mqc = ch_multiqc_files
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue