mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-21 18:58:16 +00:00
Update centrifuge/centrifuge (#1495)
This commit is contained in:
parent
dc95e67e15
commit
d2726fcf75
6 changed files with 22 additions and 35 deletions
|
@ -1,4 +1,4 @@
|
|||
process CENTRIFUGE {
|
||||
process CENTRIFUGE_CENTRIFUGE {
|
||||
tag "$meta.id"
|
||||
label 'process_high'
|
||||
|
||||
|
@ -10,7 +10,6 @@ process CENTRIFUGE {
|
|||
input:
|
||||
tuple val(meta), path(reads)
|
||||
path db
|
||||
val db_name
|
||||
val save_unaligned
|
||||
val save_aligned
|
||||
val sam_format
|
||||
|
@ -18,7 +17,6 @@ process CENTRIFUGE {
|
|||
output:
|
||||
tuple val(meta), path('*report.txt') , emit: report
|
||||
tuple val(meta), path('*results.txt') , emit: results
|
||||
tuple val(meta), path('*kreport.txt') , emit: kreport
|
||||
tuple val(meta), path('*.sam') , optional: true, emit: sam
|
||||
tuple val(meta), path('*.mapped.fastq{,.1,.2}.gz') , optional: true, emit: fastq_mapped
|
||||
tuple val(meta), path('*.unmapped.fastq{,.1,.2}.gz') , optional: true, emit: fastq_unmapped
|
||||
|
@ -31,7 +29,6 @@ process CENTRIFUGE {
|
|||
def args = task.ext.args ?: ''
|
||||
def prefix = task.ext.prefix ?: "${meta.id}"
|
||||
def paired = meta.single_end ? "-U ${reads}" : "-1 ${reads[0]} -2 ${reads[1]}"
|
||||
def db_name = db.toString().replace(".tar.gz","")
|
||||
def unaligned = ''
|
||||
def aligned = ''
|
||||
if (meta.single_end) {
|
||||
|
@ -43,8 +40,10 @@ process CENTRIFUGE {
|
|||
}
|
||||
def sam_output = sam_format ? "--out-fmt 'sam'" : ''
|
||||
"""
|
||||
## we add "-no-name ._" to ensure silly Mac OSX metafiles files aren't included
|
||||
db_name=`find -L ${db} -name "*.1.cf" -not -name "._*" | sed 's/.1.cf//'`
|
||||
centrifuge \\
|
||||
-x ${db}/${db_name} \\
|
||||
-x \$db_name \\
|
||||
-p $task.cpus \\
|
||||
$paired \\
|
||||
--report-file ${prefix}.report.txt \\
|
||||
|
@ -53,7 +52,6 @@ process CENTRIFUGE {
|
|||
$aligned \\
|
||||
$sam_output \\
|
||||
$args
|
||||
centrifuge-kreport -x $db_name ${prefix}.results.txt > ${prefix}.kreport.txt
|
||||
|
||||
cat <<-END_VERSIONS > versions.yml
|
||||
"${task.process}":
|
|
@ -1,4 +1,4 @@
|
|||
name: centrifuge
|
||||
name: centrifuge_centrifuge
|
||||
description: Classifies metagenomic sequence data
|
||||
keywords:
|
||||
- classify
|
||||
|
@ -25,11 +25,7 @@ input:
|
|||
respectively.
|
||||
- db:
|
||||
type: directory
|
||||
description: Centrifuge database in .tar.gz format
|
||||
pattern: "*.tar.gz"
|
||||
- db_name:
|
||||
type: string
|
||||
description: Centrifuge database filenames without the suffix ".cf"
|
||||
description: Path to directory containing centrifuge database files
|
||||
- save_unaligned:
|
||||
type: value
|
||||
description: If true unmapped fastq files are saved
|
||||
|
@ -52,12 +48,6 @@ output:
|
|||
description: |
|
||||
File containing classification results
|
||||
pattern: "*.{results.txt}"
|
||||
- kreport:
|
||||
type: file
|
||||
description: |
|
||||
File containing kraken-style report from centrifuge
|
||||
out files.
|
||||
pattern: "*.{kreport.txt}"
|
||||
- fastq_unmapped:
|
||||
type: file
|
||||
description: Unmapped fastq files
|
|
@ -395,9 +395,9 @@ cellranger/mkref:
|
|||
- modules/cellranger/gtf/**
|
||||
- tests/modules/cellranger/gtf/**
|
||||
|
||||
centrifuge:
|
||||
- modules/centrifuge/**
|
||||
- tests/modules/centrifuge/**
|
||||
centrifuge/centrifuge:
|
||||
- modules/centrifuge/centrifuge/**
|
||||
- tests/modules/centrifuge/centrifuge/**
|
||||
|
||||
checkm/lineagewf:
|
||||
- modules/checkm/lineagewf/**
|
||||
|
|
|
@ -2,37 +2,36 @@
|
|||
|
||||
nextflow.enable.dsl = 2
|
||||
|
||||
include { UNTAR } from '../../../modules/untar/main.nf'
|
||||
include { CENTRIFUGE } from '../../../modules/centrifuge/main.nf'
|
||||
include { UNTAR } from '../../../../modules/untar/main.nf'
|
||||
include { CENTRIFUGE_CENTRIFUGE } from '../../../../modules/centrifuge/centrifuge/main.nf'
|
||||
|
||||
workflow test_centrifuge_single_end {
|
||||
workflow test_centrifuge_centrifuge_single_end {
|
||||
input = [ [ id:'test', single_end:true ], // meta map
|
||||
[ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ]
|
||||
]
|
||||
db = [ [], file('https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/minigut_cf.tar.gz', checkIfExists: true) ]
|
||||
db_name = "minigut_cf"
|
||||
save_unaligned = true
|
||||
save_aligned = false
|
||||
sam_format = false
|
||||
|
||||
UNTAR ( db )
|
||||
CENTRIFUGE ( input, UNTAR.out.untar.map{ it[1] },db_name, save_unaligned, save_aligned, sam_format )
|
||||
CENTRIFUGE_CENTRIFUGE ( input, UNTAR.out.untar.map{ it[1] }, save_unaligned, save_aligned, sam_format )
|
||||
|
||||
}
|
||||
|
||||
workflow test_centrifuge_paired_end {
|
||||
workflow test_centrifuge_centrifuge_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) ]
|
||||
]
|
||||
db = [ [], file('https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/minigut_cf.tar.gz', checkIfExists: true) ]
|
||||
db_name = "minigut_cf"
|
||||
//db_name = "minigut_cf"
|
||||
save_unaligned = true
|
||||
save_aligned = false
|
||||
sam_format = false
|
||||
|
||||
UNTAR ( db )
|
||||
CENTRIFUGE ( input, UNTAR.out.untar.map{ it[1] }, db_name, save_unaligned, save_aligned, sam_format )
|
||||
CENTRIFUGE_CENTRIFUGE ( input, UNTAR.out.untar.map{ it[1] }, save_unaligned, save_aligned, sam_format )
|
||||
|
||||
|
||||
}
|
|
@ -1,20 +1,20 @@
|
|||
- name: centrifuge test_centrifuge_single_end
|
||||
command: nextflow run tests/modules/centrifuge -entry test_centrifuge_single_end -c tests/config/nextflow.config
|
||||
- name: centrifuge centrifuge test_centrifuge_centrifuge_single_end
|
||||
command: nextflow run tests/modules/centrifuge/centrifuge -entry test_centrifuge_centrifuge_single_end -c tests/config/nextflow.config
|
||||
tags:
|
||||
- centrifuge
|
||||
- centrifuge/centrifuge
|
||||
files:
|
||||
- path: output/centrifuge/test.kreport.txt
|
||||
- path: output/centrifuge/test.report.txt
|
||||
- path: output/centrifuge/test.results.txt
|
||||
- path: output/centrifuge/test.unmapped.fastq.gz
|
||||
- path: output/centrifuge/versions.yml
|
||||
|
||||
- name: centrifuge test_centrifuge_paired_end
|
||||
command: nextflow run tests/modules/centrifuge -entry test_centrifuge_paired_end -c tests/config/nextflow.config
|
||||
- name: centrifuge centrifuge test_centrifuge_centrifuge_paired_end
|
||||
command: nextflow run tests/modules/centrifuge/centrifuge -entry test_centrifuge_centrifuge_paired_end -c tests/config/nextflow.config
|
||||
tags:
|
||||
- centrifuge
|
||||
- centrifuge/centrifuge
|
||||
files:
|
||||
- path: output/centrifuge/test.kreport.txt
|
||||
- path: output/centrifuge/test.report.txt
|
||||
- path: output/centrifuge/test.results.txt
|
||||
- path: output/centrifuge/test.unmapped.fastq.1.gz
|
Loading…
Reference in a new issue