Fix untar for centrifuge (#1472)

This commit is contained in:
Sofia Stamouli 2022-04-04 10:18:11 +02:00 committed by GitHub
parent f1c5384c31
commit 6a11c5a222
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 6 deletions

View file

@ -10,6 +10,7 @@ process CENTRIFUGE {
input:
tuple val(meta), path(reads)
path db
val db_name
val save_unaligned
val save_aligned
val sam_format
@ -42,9 +43,8 @@ process CENTRIFUGE {
}
def sam_output = sam_format ? "--out-fmt 'sam'" : ''
"""
tar -xf $db
centrifuge \\
-x $db_name \\
-x ${db}/${db_name} \\
-p $task.cpus \\
$paired \\
--report-file ${prefix}.report.txt \\

View file

@ -27,6 +27,9 @@ input:
type: directory
description: Centrifuge database in .tar.gz format
pattern: "*.tar.gz"
- db_name:
type: string
description: Centrifuge database filenames without the suffix ".cf"
- save_unaligned:
type: value
description: If true unmapped fastq files are saved

View file

@ -2,18 +2,21 @@
nextflow.enable.dsl = 2
include { UNTAR } from '../../../modules/untar/main.nf'
include { CENTRIFUGE } from '../../../modules/centrifuge/main.nf'
workflow test_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 = [ [], 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
CENTRIFUGE ( input, db, save_unaligned, save_aligned, sam_format )
UNTAR ( db )
CENTRIFUGE ( input, UNTAR.out.untar.map{ it[1] },db_name, save_unaligned, save_aligned, sam_format )
}
@ -22,12 +25,14 @@ workflow test_centrifuge_paired_end {
[ 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 = [ [], 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
CENTRIFUGE ( input, db, save_unaligned, save_aligned, sam_format )
UNTAR ( db )
CENTRIFUGE ( input, UNTAR.out.untar.map{ it[1] }, db_name, save_unaligned, save_aligned, sam_format )
}