mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-22 11:08:17 +00:00
feat: update dragmap to follow new bwa/mem + bwamem2/mem logic (#1146)
This commit is contained in:
parent
1765225042
commit
ca3ae9ff4f
4 changed files with 58 additions and 7 deletions
|
@ -10,6 +10,7 @@ process DRAGMAP_ALIGN {
|
||||||
input:
|
input:
|
||||||
tuple val(meta), path(reads)
|
tuple val(meta), path(reads)
|
||||||
path hashmap
|
path hashmap
|
||||||
|
val sort_bam
|
||||||
|
|
||||||
output:
|
output:
|
||||||
tuple val(meta), path("*.bam"), emit: bam
|
tuple val(meta), path("*.bam"), emit: bam
|
||||||
|
@ -20,6 +21,7 @@ process DRAGMAP_ALIGN {
|
||||||
def args = task.ext.args ?: ''
|
def args = task.ext.args ?: ''
|
||||||
def args2 = task.ext.args2 ?: ''
|
def args2 = task.ext.args2 ?: ''
|
||||||
def prefix = task.ext.prefix ?: "${meta.id}"
|
def prefix = task.ext.prefix ?: "${meta.id}"
|
||||||
|
def samtools_command = sort_bam ? 'sort' : 'view'
|
||||||
if (meta.single_end) {
|
if (meta.single_end) {
|
||||||
"""
|
"""
|
||||||
dragen-os \\
|
dragen-os \\
|
||||||
|
@ -28,7 +30,7 @@ process DRAGMAP_ALIGN {
|
||||||
--num-threads $task.cpus \\
|
--num-threads $task.cpus \\
|
||||||
$args \\
|
$args \\
|
||||||
2> ${prefix}.dragmap.log \\
|
2> ${prefix}.dragmap.log \\
|
||||||
| samtools view -@ $task.cpus $args2 -bhS -o ${prefix}.bam -
|
| samtools $samtools_command -@ $task.cpus $args2 -o ${prefix}.bam -
|
||||||
|
|
||||||
cat <<-END_VERSIONS > versions.yml
|
cat <<-END_VERSIONS > versions.yml
|
||||||
"${task.process}":
|
"${task.process}":
|
||||||
|
@ -46,7 +48,7 @@ process DRAGMAP_ALIGN {
|
||||||
--num-threads $task.cpus \\
|
--num-threads $task.cpus \\
|
||||||
$args \\
|
$args \\
|
||||||
2> ${prefix}.dragmap.log \\
|
2> ${prefix}.dragmap.log \\
|
||||||
| samtools view -@ $task.cpus $args2 -bhS -o ${prefix}.bam -
|
| samtools $samtools_command -@ $task.cpus $args2 -o ${prefix}.bam -
|
||||||
|
|
||||||
cat <<-END_VERSIONS > versions.yml
|
cat <<-END_VERSIONS > versions.yml
|
||||||
"${task.process}":
|
"${task.process}":
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
nextflow.enable.dsl = 2
|
nextflow.enable.dsl = 2
|
||||||
|
|
||||||
include { DRAGMAP_HASHTABLE } from '../../../../modules/dragmap/hashtable/main.nf'
|
include { DRAGMAP_HASHTABLE } from '../../../../modules/dragmap/hashtable/main.nf'
|
||||||
include { DRAGMAP_ALIGN } from '../../../../modules/dragmap/align/main.nf'
|
include { DRAGMAP_ALIGN } from '../../../../modules/dragmap/align/main.nf'
|
||||||
|
|
||||||
workflow test_dragmap_align_single_end {
|
workflow test_dragmap_align_single_end {
|
||||||
input = [
|
input = [
|
||||||
|
@ -15,7 +15,20 @@ workflow test_dragmap_align_single_end {
|
||||||
fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
|
fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
|
||||||
|
|
||||||
DRAGMAP_HASHTABLE ( fasta )
|
DRAGMAP_HASHTABLE ( fasta )
|
||||||
DRAGMAP_ALIGN ( input, DRAGMAP_HASHTABLE.out.hashmap )
|
DRAGMAP_ALIGN ( input, DRAGMAP_HASHTABLE.out.hashmap, false )
|
||||||
|
}
|
||||||
|
|
||||||
|
workflow test_dragmap_align_single_end_sort {
|
||||||
|
input = [
|
||||||
|
[ id:'test', single_end:true ], // meta map
|
||||||
|
[
|
||||||
|
file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true)
|
||||||
|
]
|
||||||
|
]
|
||||||
|
fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
|
||||||
|
|
||||||
|
DRAGMAP_HASHTABLE ( fasta )
|
||||||
|
DRAGMAP_ALIGN ( input, DRAGMAP_HASHTABLE.out.hashmap, true )
|
||||||
}
|
}
|
||||||
|
|
||||||
workflow test_dragmap_align_paired_end {
|
workflow test_dragmap_align_paired_end {
|
||||||
|
@ -29,5 +42,19 @@ workflow test_dragmap_align_paired_end {
|
||||||
fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
|
fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
|
||||||
|
|
||||||
DRAGMAP_HASHTABLE ( fasta )
|
DRAGMAP_HASHTABLE ( fasta )
|
||||||
DRAGMAP_ALIGN ( input, DRAGMAP_HASHTABLE.out.hashmap )
|
DRAGMAP_ALIGN ( input, DRAGMAP_HASHTABLE.out.hashmap, false )
|
||||||
|
}
|
||||||
|
|
||||||
|
workflow test_dragmap_align_paired_end_sort {
|
||||||
|
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)
|
||||||
|
]
|
||||||
|
]
|
||||||
|
fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
|
||||||
|
|
||||||
|
DRAGMAP_HASHTABLE ( fasta )
|
||||||
|
DRAGMAP_ALIGN ( input, DRAGMAP_HASHTABLE.out.hashmap, true )
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
process {
|
process {
|
||||||
|
|
||||||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
||||||
|
|
||||||
}
|
withName: DRAGMAP_ALIGN {
|
||||||
|
ext.args2 = { sort_bam ? "" : "-bh" }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -7,6 +7,15 @@
|
||||||
- path: output/dragmap/test.bam
|
- path: output/dragmap/test.bam
|
||||||
- path: output/dragmap/test.dragmap.log
|
- path: output/dragmap/test.dragmap.log
|
||||||
|
|
||||||
|
- name: dragmap align single-end_sort
|
||||||
|
command: nextflow run ./tests/modules/dragmap/align -entry test_dragmap_align_single_end_sort -c ./tests/config/nextflow.config -c ./tests/modules/dragmap/align/nextflow.config
|
||||||
|
tags:
|
||||||
|
- dragmap
|
||||||
|
- dragmap/align
|
||||||
|
files:
|
||||||
|
- path: output/dragmap/test.bam
|
||||||
|
- path: output/dragmap/test.dragmap.log
|
||||||
|
|
||||||
- name: dragmap align paired-end
|
- name: dragmap align paired-end
|
||||||
command: nextflow run ./tests/modules/dragmap/align -entry test_dragmap_align_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/dragmap/align/nextflow.config
|
command: nextflow run ./tests/modules/dragmap/align -entry test_dragmap_align_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/dragmap/align/nextflow.config
|
||||||
tags:
|
tags:
|
||||||
|
@ -15,3 +24,12 @@
|
||||||
files:
|
files:
|
||||||
- path: output/dragmap/test.bam
|
- path: output/dragmap/test.bam
|
||||||
- path: output/dragmap/test.dragmap.log
|
- path: output/dragmap/test.dragmap.log
|
||||||
|
|
||||||
|
- name: dragmap align paired-end_sort
|
||||||
|
command: nextflow run ./tests/modules/dragmap/align -entry test_dragmap_align_paired_end_sort -c ./tests/config/nextflow.config -c ./tests/modules/dragmap/align/nextflow.config
|
||||||
|
tags:
|
||||||
|
- dragmap
|
||||||
|
- dragmap/align
|
||||||
|
files:
|
||||||
|
- path: output/dragmap/test.bam
|
||||||
|
- path: output/dragmap/test.dragmap.log
|
||||||
|
|
Loading…
Reference in a new issue