mirror of
https://github.com/MillironX/taxprofiler.git
synced 2024-11-22 07:09:56 +00:00
Merge pull request #65 from genomic-medicine-sweden/classification_kreport
Add centrifuge kreport in taxprofiler
This commit is contained in:
commit
1c694145d4
5 changed files with 93 additions and 4 deletions
|
@ -254,6 +254,16 @@ process {
|
|||
ext.prefix = params.perform_runmerging ? { "${meta.id}-${meta.db_name}" } : { "${meta.id}-${meta.run_accession}-${meta.db_name}" }
|
||||
}
|
||||
|
||||
withName: CENTRIFUGE_KREPORT {
|
||||
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}/centrifuge/${meta.db_name}" },
|
||||
mode: params.publish_dir_mode,
|
||||
pattern: '*.{txt}'
|
||||
]
|
||||
}
|
||||
|
||||
withName: CUSTOM_DUMPSOFTWAREVERSIONS {
|
||||
publishDir = [
|
||||
path: { "${params.outdir}/pipeline_info" },
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
"centrifuge/centrifuge": {
|
||||
"git_sha": "d2726fcf75063960f06b36d2229a4c0966614108"
|
||||
},
|
||||
"centrifuge/kreport": {
|
||||
"git_sha": "be4ae28c3c95b3c4047a7d9fb4cb0ed749631cea"
|
||||
},
|
||||
"custom/dumpsoftwareversions": {
|
||||
"git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d"
|
||||
},
|
||||
|
@ -30,6 +33,9 @@
|
|||
"fastqc": {
|
||||
"git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d"
|
||||
},
|
||||
"kaiju/kaiju": {
|
||||
"git_sha": "8856f127c58f6af479128be8b8df4d42e442ddbe"
|
||||
},
|
||||
"kraken2/kraken2": {
|
||||
"git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d"
|
||||
},
|
||||
|
@ -53,9 +59,6 @@
|
|||
},
|
||||
"untar": {
|
||||
"git_sha": "e080f4c8acf5760039ed12ec1f206170f3f9a918"
|
||||
},
|
||||
"kaiju/kaiju": {
|
||||
"git_sha": "8856f127c58f6af479128be8b8df4d42e442ddbe"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
33
modules/nf-core/modules/centrifuge/kreport/main.nf
generated
Normal file
33
modules/nf-core/modules/centrifuge/kreport/main.nf
generated
Normal file
|
@ -0,0 +1,33 @@
|
|||
process CENTRIFUGE_KREPORT {
|
||||
tag "$meta.id"
|
||||
label 'process_low'
|
||||
|
||||
conda (params.enable_conda ? "bioconda::centrifuge=1.0.4_beta" : null)
|
||||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
||||
'https://depot.galaxyproject.org/singularity/centrifuge:1.0.4_beta--h9a82719_6':
|
||||
'quay.io/biocontainers/centrifuge:1.0.4_beta--h9a82719_6' }"
|
||||
|
||||
input:
|
||||
tuple val(meta), path(results)
|
||||
path db
|
||||
|
||||
output:
|
||||
tuple val(meta), path('*.txt') , emit: kreport
|
||||
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}"
|
||||
"""
|
||||
db_name=`find -L ${db} -name "*.1.cf" -not -name "._*" | sed 's/.1.cf//'`
|
||||
centrifuge-kreport -x \$db_name ${results} > ${prefix}.txt
|
||||
|
||||
cat <<-END_VERSIONS > versions.yml
|
||||
"${task.process}":
|
||||
centrifuge: \$( centrifuge --version | sed -n 1p | sed 's/^.*centrifuge-class version //')
|
||||
END_VERSIONS
|
||||
"""
|
||||
}
|
41
modules/nf-core/modules/centrifuge/kreport/meta.yml
generated
Normal file
41
modules/nf-core/modules/centrifuge/kreport/meta.yml
generated
Normal file
|
@ -0,0 +1,41 @@
|
|||
name: "centrifuge_kreport"
|
||||
description: Creates Kraken-style reports from centrifuge out files
|
||||
keywords:
|
||||
- metagenomics
|
||||
tools:
|
||||
- centrifuge:
|
||||
description: Centrifuge is a classifier for metagenomic sequences.
|
||||
homepage: https://ccb.jhu.edu/software/centrifuge/
|
||||
documentation: https://ccb.jhu.edu/software/centrifuge/manual.shtml
|
||||
doi: 10.1101/gr.210641.116
|
||||
licence: ["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 centrifuge classification results
|
||||
pattern: "*.{txt}"
|
||||
|
||||
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"
|
||||
- kreport:
|
||||
type: file
|
||||
description: |
|
||||
File containing kraken-style report from centrifuge
|
||||
out files.
|
||||
pattern: "*.{txt}"
|
||||
authors:
|
||||
- "@sofstam"
|
||||
- "@jfy133"
|
|
@ -6,6 +6,7 @@ include { MALT_RUN } from '../../modules/nf-core/modules/malt
|
|||
include { MEGAN_RMA2INFO } from '../../modules/nf-core/modules/megan/rma2info/main'
|
||||
include { KRAKEN2_KRAKEN2 } from '../../modules/nf-core/modules/kraken2/kraken2/main'
|
||||
include { CENTRIFUGE_CENTRIFUGE } from '../../modules/nf-core/modules/centrifuge/centrifuge/main'
|
||||
include { CENTRIFUGE_KREPORT } from '../../modules/nf-core/modules/centrifuge/kreport/main'
|
||||
include { METAPHLAN3 } from '../../modules/nf-core/modules/metaphlan3/main'
|
||||
include { KAIJU_KAIJU } from '../../modules/nf-core/modules/kaiju/kaiju/main'
|
||||
|
||||
|
@ -142,8 +143,9 @@ workflow PROFILING {
|
|||
|
||||
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_KREPORT (CENTRIFUGE_CENTRIFUGE.out.results, ch_input_for_centrifuge.db)
|
||||
ch_versions = ch_versions.mix( CENTRIFUGE_CENTRIFUGE.out.versions.first() )
|
||||
ch_raw_profiles = ch_raw_profiles.mix( CENTRIFUGE_CENTRIFUGE.out.report )
|
||||
ch_raw_profiles = ch_raw_profiles.mix( CENTRIFUGE_KREPORT.out.kreport )
|
||||
}
|
||||
|
||||
if ( params.run_metaphlan3 ) {
|
||||
|
|
Loading…
Reference in a new issue