Merge branch 'master' into vardict-java

This commit is contained in:
nvnieuwk 2022-04-27 11:17:33 +02:00 committed by GitHub
commit dc62de1a78
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 63 additions and 21 deletions

View file

@ -2,17 +2,21 @@ process MINIMAP2_ALIGN {
tag "$meta.id"
label 'process_medium'
conda (params.enable_conda ? 'bioconda::minimap2=2.21' : null)
conda (params.enable_conda ? 'bioconda::minimap2=2.21 bioconda::samtools=1.12' : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/minimap2:2.21--h5bf99c6_0' :
'quay.io/biocontainers/minimap2:2.21--h5bf99c6_0' }"
'https://depot.galaxyproject.org/singularity/mulled-v2-66534bcbb7031a148b13e2ad42583020b9cd25c4:1679e915ddb9d6b4abda91880c4b48857d471bd8-0' :
'quay.io/biocontainers/mulled-v2-66534bcbb7031a148b13e2ad42583020b9cd25c4:1679e915ddb9d6b4abda91880c4b48857d471bd8-0' }"
input:
tuple val(meta), path(reads)
path reference
val bam_format
val cigar_paf_format
val cigar_bam
output:
tuple val(meta), path("*.paf"), emit: paf
tuple val(meta), path("*.paf"), optional: true, emit: paf
tuple val(meta), path("*.bam"), optional: true, emit: bam
path "versions.yml" , emit: versions
when:
@ -22,13 +26,19 @@ process MINIMAP2_ALIGN {
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def input_reads = meta.single_end ? "$reads" : "${reads[0]} ${reads[1]}"
def bam_output = bam_format ? "-a | samtools sort | samtools view -@ ${task.cpus} -b -h -o ${prefix}.bam" : "-o ${prefix}.paf"
def cigar_paf = cigar_paf_format && !sam_format ? "-c" : ''
def set_cigar_bam = cigar_bam && sam_format ? "-L" : ''
"""
minimap2 \\
$args \\
-t $task.cpus \\
$reference \\
$input_reads \\
> ${prefix}.paf
$cigar_paf \\
$set_cigar_bam \\
$bam_output
cat <<-END_VERSIONS > versions.yml
"${task.process}":

View file

@ -29,6 +29,17 @@ input:
type: file
description: |
Reference database in FASTA format.
- bam_format:
type: boolean
description: Specify that output should be in BAM format
- cigar_paf_format:
type: boolean
description: Specify that output CIGAR should be in PAF format
- cigar_bam:
type: boolean
description: |
Write CIGAR with >65535 ops at the CG tag. This is recommended when
doing XYZ (https://github.com/lh3/minimap2#working-with-65535-cigar-operations)
output:
- meta:
type: map
@ -39,9 +50,16 @@ output:
type: file
description: Alignment in PAF format
pattern: "*.paf"
- bam:
type: file
description: Alignment in BAM format
pattern: "*.bam"
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@heuermh"
- "@sofstam"
- "@sateeshperi"
- "@jfy133"

View file

@ -11,12 +11,13 @@ process TRIMGALORE {
tuple val(meta), path(reads)
output:
tuple val(meta), path("*.fq.gz") , emit: reads
tuple val(meta), path("*report.txt"), emit: log
tuple val(meta), path("*{trimmed,val}*.fq.gz"), emit: reads
tuple val(meta), path("*report.txt") , emit: log
path "versions.yml" , emit: versions
tuple val(meta), path("*.html"), emit: html optional true
tuple val(meta), path("*.zip") , emit: zip optional true
tuple val(meta), path("*unpaired*.fq.gz") , emit: unpaired, optional: true
tuple val(meta), path("*.html") , emit: html , optional: true
tuple val(meta), path("*.zip") , emit: zip , optional: true
when:
task.ext.when == null || task.ext.when
@ -52,6 +53,7 @@ process TRIMGALORE {
$c_r1 \\
$tpc_r1 \\
${prefix}.fastq.gz
cat <<-END_VERSIONS > versions.yml
"${task.process}":
trimgalore: \$(echo \$(trim_galore --version 2>&1) | sed 's/^.*version //; s/Last.*\$//')
@ -73,6 +75,7 @@ process TRIMGALORE {
$tpc_r2 \\
${prefix}_1.fastq.gz \\
${prefix}_2.fastq.gz
cat <<-END_VERSIONS > versions.yml
"${task.process}":
trimgalore: \$(echo \$(trim_galore --version 2>&1) | sed 's/^.*version //; s/Last.*\$//')

View file

@ -37,6 +37,11 @@ output:
List of input adapter trimmed FastQ files of size 1 and 2 for
single-end and paired-end data, respectively.
pattern: "*.{fq.gz}"
- unpaired:
type: file
description: |
FastQ files containing unpaired reads from read 1 or read 2
pattern: "*unpaired*.fq.gz"
- html:
type: file
description: FastQC report (optional)

View file

@ -9,8 +9,11 @@ workflow test_minimap2_align_single_end {
[ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true)]
]
fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
bam_format = true
cigar_paf_format = false
cigar_bam = false
MINIMAP2_ALIGN ( input, fasta )
MINIMAP2_ALIGN ( input, fasta, bam_format, cigar_paf_format, cigar_bam)
}
workflow test_minimap2_align_paired_end {
@ -19,6 +22,9 @@ workflow test_minimap2_align_paired_end {
file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ]
]
fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
bam_format = true
cigar_paf_format = false
cigar_bam = false
MINIMAP2_ALIGN ( input, fasta )
MINIMAP2_ALIGN ( input, fasta, bam_format, cigar_paf_format, cigar_bam )
}

View file

@ -1,17 +1,17 @@
- name: minimap2 align single-end
command: nextflow run ./tests/modules/minimap2/align -entry test_minimap2_align_single_end -c ./tests/config/nextflow.config -c ./tests/modules/minimap2/align/nextflow.config
- name: minimap2 align test_minimap2_align_single_end
command: nextflow run tests/modules/minimap2/align -entry test_minimap2_align_single_end -c tests/config/nextflow.config
tags:
- minimap2
- minimap2/align
files:
- path: ./output/minimap2/test.paf
md5sum: 70e8cf299ee3ecd33e629d10c1f588ce
- path: output/minimap2/test.bam
- path: output/minimap2/versions.yml
- name: minimap2 align paired-end
command: nextflow run ./tests/modules/minimap2/align -entry test_minimap2_align_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/minimap2/align/nextflow.config
- name: minimap2 align test_minimap2_align_paired_end
command: nextflow run tests/modules/minimap2/align -entry test_minimap2_align_paired_end -c tests/config/nextflow.config
tags:
- minimap2
- minimap2/align
files:
- path: ./output/minimap2/test.paf
md5sum: 5e7b55a26bf0ea3a2843423d3e0b9a28
- path: output/minimap2/test.bam
- path: output/minimap2/versions.yml