mirror of
https://github.com/MillironX/taxprofiler.git
synced 2024-11-10 23:33:09 +00:00
Add kaiju2table to taxprofiler
This commit is contained in:
parent
bc84afe80d
commit
d082d67bcb
7 changed files with 135 additions and 7 deletions
|
@ -289,4 +289,14 @@ process {
|
||||||
ext.args = { "${meta.db_params}" }
|
ext.args = { "${meta.db_params}" }
|
||||||
ext.prefix = params.perform_runmerging ? { "${meta.id}-${meta.db_name}" } : { "${meta.id}-${meta.run_accession}-${meta.db_name}" }
|
ext.prefix = params.perform_runmerging ? { "${meta.id}-${meta.db_name}" } : { "${meta.id}-${meta.run_accession}-${meta.db_name}" }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
withName: KAIJU_KAIJU2TABLE {
|
||||||
|
ext.args = { "${meta.db_params}" }
|
||||||
|
ext.prefix = params.perform_runmerging ? { "${meta.id}-${meta.db_name}" } : { "${meta.id}-${meta.run_accession}-${meta.db_name}" }
|
||||||
|
publishDir = [
|
||||||
|
path: { "${params.outdir}/kaiju/${meta.db_name}" },
|
||||||
|
mode: params.publish_dir_mode,
|
||||||
|
pattern: '*.{txt}'
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,9 @@
|
||||||
"kaiju/kaiju": {
|
"kaiju/kaiju": {
|
||||||
"git_sha": "8856f127c58f6af479128be8b8df4d42e442ddbe"
|
"git_sha": "8856f127c58f6af479128be8b8df4d42e442ddbe"
|
||||||
},
|
},
|
||||||
|
"kaiju/kaiju2table": {
|
||||||
|
"git_sha": "538dbac98ba9c8f799536cd5a617195501439457"
|
||||||
|
},
|
||||||
"kraken2/kraken2": {
|
"kraken2/kraken2": {
|
||||||
"git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d"
|
"git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d"
|
||||||
},
|
},
|
||||||
|
|
40
modules/nf-core/modules/kaiju/kaiju2table/main.nf
generated
Normal file
40
modules/nf-core/modules/kaiju/kaiju2table/main.nf
generated
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
process KAIJU_KAIJU2TABLE {
|
||||||
|
tag "$meta.id"
|
||||||
|
label 'process_low'
|
||||||
|
|
||||||
|
conda (params.enable_conda ? "bioconda::kaiju=1.8.2" : null)
|
||||||
|
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
||||||
|
'https://depot.galaxyproject.org/singularity/kaiju:1.8.2--h5b5514e_1':
|
||||||
|
'quay.io/biocontainers/kaiju:1.8.2--h2e03b76_0' }"
|
||||||
|
|
||||||
|
input:
|
||||||
|
tuple val(meta), path(results)
|
||||||
|
path db
|
||||||
|
val taxon_rank
|
||||||
|
|
||||||
|
output:
|
||||||
|
tuple val(meta), path('*.txt'), emit: 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}"
|
||||||
|
"""
|
||||||
|
dbnodes=`find -L ${db} -name "*nodes.dmp"`
|
||||||
|
dbname=`find -L ${db} -name "*.fmi" -not -name "._*"`
|
||||||
|
kaiju2table $args \\
|
||||||
|
-t \$dbnodes \\
|
||||||
|
-n \$dbname \\
|
||||||
|
-r ${taxon_rank} \\
|
||||||
|
-o ${prefix}.txt \\
|
||||||
|
${results}
|
||||||
|
|
||||||
|
cat <<-END_VERSIONS > versions.yml
|
||||||
|
"${task.process}":
|
||||||
|
kaiju: \$(echo \$( kaiju -h 2>&1 | sed -n 1p | sed 's/^.*Kaiju //' ))
|
||||||
|
END_VERSIONS
|
||||||
|
"""
|
||||||
|
}
|
50
modules/nf-core/modules/kaiju/kaiju2table/meta.yml
generated
Normal file
50
modules/nf-core/modules/kaiju/kaiju2table/meta.yml
generated
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
name: "kaiju_kaiju2table"
|
||||||
|
description: write your description here
|
||||||
|
keywords:
|
||||||
|
- classify
|
||||||
|
- metagenomics
|
||||||
|
tools:
|
||||||
|
- kaiju:
|
||||||
|
description: Fast and sensitive taxonomic classification for metagenomics
|
||||||
|
homepage: https://kaiju.binf.ku.dk/
|
||||||
|
documentation: https://github.com/bioinformatics-centre/kaiju/blob/master/README.md
|
||||||
|
tool_dev_url: https://github.com/bioinformatics-centre/kaiju
|
||||||
|
doi: "10.1038/ncomms11257"
|
||||||
|
licence: ["GNU GPL v3"]
|
||||||
|
|
||||||
|
input:
|
||||||
|
- meta:
|
||||||
|
type: map
|
||||||
|
description: |
|
||||||
|
Groovy Map containing sample information
|
||||||
|
e.g. [ id:'test', single_end:false ]
|
||||||
|
- results:
|
||||||
|
type: file
|
||||||
|
description: File containing the kaiju classification results
|
||||||
|
pattern: "*.{txt}"
|
||||||
|
- taxon_rank:
|
||||||
|
type: string
|
||||||
|
description: |
|
||||||
|
Taxonomic rank to display in report
|
||||||
|
pattern: "phylum|class|order|family|genus|species"
|
||||||
|
|
||||||
|
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"
|
||||||
|
- results:
|
||||||
|
type: file
|
||||||
|
description: |
|
||||||
|
Summary table for a given taxonomic rank
|
||||||
|
pattern: "*.{tsv}"
|
||||||
|
|
||||||
|
authors:
|
||||||
|
- "@sofstam"
|
||||||
|
- "@talnor"
|
||||||
|
- "@jfy133"
|
|
@ -107,6 +107,7 @@ params {
|
||||||
|
|
||||||
// kaiju
|
// kaiju
|
||||||
run_kaiju = false
|
run_kaiju = false
|
||||||
|
kaiju_taxon_name = 'species'
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load base.config by default for all pipelines
|
// Load base.config by default for all pipelines
|
||||||
|
|
|
@ -10,7 +10,10 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"fa_icon": "fas fa-terminal",
|
"fa_icon": "fas fa-terminal",
|
||||||
"description": "Define where the pipeline should find input data and save output data.",
|
"description": "Define where the pipeline should find input data and save output data.",
|
||||||
"required": ["input", "outdir"],
|
"required": [
|
||||||
|
"input",
|
||||||
|
"outdir"
|
||||||
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"input": {
|
"input": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
@ -173,7 +176,14 @@
|
||||||
"description": "Method used to save pipeline results to output directory.",
|
"description": "Method used to save pipeline results to output directory.",
|
||||||
"help_text": "The Nextflow `publishDir` option specifies which intermediate files should be saved to the output directory. This option tells the pipeline what method should be used to move these files. See [Nextflow docs](https://www.nextflow.io/docs/latest/process.html#publishdir) for details.",
|
"help_text": "The Nextflow `publishDir` option specifies which intermediate files should be saved to the output directory. This option tells the pipeline what method should be used to move these files. See [Nextflow docs](https://www.nextflow.io/docs/latest/process.html#publishdir) for details.",
|
||||||
"fa_icon": "fas fa-copy",
|
"fa_icon": "fas fa-copy",
|
||||||
"enum": ["symlink", "rellink", "link", "copy", "copyNoFollow", "move"],
|
"enum": [
|
||||||
|
"symlink",
|
||||||
|
"rellink",
|
||||||
|
"link",
|
||||||
|
"copy",
|
||||||
|
"copyNoFollow",
|
||||||
|
"move"
|
||||||
|
],
|
||||||
"hidden": true
|
"hidden": true
|
||||||
},
|
},
|
||||||
"email_on_fail": {
|
"email_on_fail": {
|
||||||
|
@ -294,7 +304,10 @@
|
||||||
"shortread_clipmerge_tool": {
|
"shortread_clipmerge_tool": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": "fastp",
|
"default": "fastp",
|
||||||
"enum": ["fastp", "adapterremoval"]
|
"enum": [
|
||||||
|
"fastp",
|
||||||
|
"adapterremoval"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"shortread_clipmerge_skipadaptertrim": {
|
"shortread_clipmerge_skipadaptertrim": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
|
@ -335,7 +348,10 @@
|
||||||
"shortread_complexityfilter_prinseqplusplus_mode": {
|
"shortread_complexityfilter_prinseqplusplus_mode": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": "entropy",
|
"default": "entropy",
|
||||||
"enum": ["entropy", "dust"]
|
"enum": [
|
||||||
|
"entropy",
|
||||||
|
"dust"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"shortread_complexityfilter_prinseqplusplus_dustscore": {
|
"shortread_complexityfilter_prinseqplusplus_dustscore": {
|
||||||
"type": "number",
|
"type": "number",
|
||||||
|
@ -384,6 +400,10 @@
|
||||||
},
|
},
|
||||||
"malt_generatemegansummary": {
|
"malt_generatemegansummary": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"kaiju_taxon_name": {
|
||||||
|
"type": "string",
|
||||||
|
"default": "species"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -9,6 +9,7 @@ include { CENTRIFUGE_CENTRIFUGE } from '../../modules/nf-core/modules/cent
|
||||||
include { CENTRIFUGE_KREPORT } from '../../modules/nf-core/modules/centrifuge/kreport/main'
|
include { CENTRIFUGE_KREPORT } from '../../modules/nf-core/modules/centrifuge/kreport/main'
|
||||||
include { METAPHLAN3 } from '../../modules/nf-core/modules/metaphlan3/main'
|
include { METAPHLAN3 } from '../../modules/nf-core/modules/metaphlan3/main'
|
||||||
include { KAIJU_KAIJU } from '../../modules/nf-core/modules/kaiju/kaiju/main'
|
include { KAIJU_KAIJU } from '../../modules/nf-core/modules/kaiju/kaiju/main'
|
||||||
|
include { KAIJU_KAIJU2TABLE } from '../../modules/nf-core/modules/kaiju/kaiju2table/main'
|
||||||
|
|
||||||
workflow PROFILING {
|
workflow PROFILING {
|
||||||
take:
|
take:
|
||||||
|
@ -155,8 +156,11 @@ workflow PROFILING {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( params.run_kaiju ) {
|
if ( params.run_kaiju ) {
|
||||||
KAIJU_KAIJU ( ch_input_for_kaiju.reads, ch_input_for_kaiju.db )
|
KAIJU_KAIJU ( ch_input_for_kaiju.reads, ch_input_for_kaiju.db)
|
||||||
|
KAIJU_KAIJU2TABLE (KAIJU_KAIJU.out.results, ch_input_for_kaiju.db, params.kaiju_taxon_name)
|
||||||
|
ch_multiqc_files = ch_multiqc_files.mix( KAIJU_KAIJU2TABLE.out.summary.collect{it[1]}.ifEmpty([]) )
|
||||||
ch_versions = ch_versions.mix( KAIJU_KAIJU.out.versions.first() )
|
ch_versions = ch_versions.mix( KAIJU_KAIJU.out.versions.first() )
|
||||||
|
ch_raw_profiles = ch_raw_profiles.mix( KAIJU_KAIJU2TABLE.out.summary )
|
||||||
}
|
}
|
||||||
|
|
||||||
emit:
|
emit:
|
||||||
|
|
Loading…
Reference in a new issue