First version of the biobambam/bammarkduplicates2 module (#1247)

* First version of the biobambam/bammarkduplicates2 module

* Fixed the path of versions.yml

* Regenerated the checksums as the previous files were generated with a single core

* Added the `when:` block, as per #1261

Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>

Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>
This commit is contained in:
Matthieu Muffato 2022-02-14 16:30:48 +00:00 committed by GitHub
parent 6a9aa977ef
commit 04e82ec61a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 118 additions and 0 deletions

View file

@ -0,0 +1,38 @@
process BIOBAMBAM_BAMMARKDUPLICATES2 {
tag "$meta.id"
label 'process_medium'
conda (params.enable_conda ? "bioconda::biobambam=2.0.182" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/biobambam:2.0.182--h7d875b9_0':
'quay.io/biocontainers/biobambam:2.0.182--h7d875b9_0' }"
input:
tuple val(meta), path(bam)
output:
tuple val(meta), path("*.bam") , emit: bam
tuple val(meta), path("*.metrics.txt"), emit: metrics
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}"
"""
bammarkduplicates2 \\
$args \\
I=$bam \\
O=${prefix}.bam \\
M=${prefix}.metrics.txt \\
tmpfile=$prefix \\
markthreads=$task.cpus
cat <<-END_VERSIONS > versions.yml
"${task.process}":
bammarkduplicates2: \$(echo \$(bammarkduplicates2 --version 2>&1) | sed 's/^This is biobambam2 version //; s/..biobambam2 is .*\$//' )
END_VERSIONS
"""
}

View file

@ -0,0 +1,44 @@
name: biobambam_bammarkduplicates2
description: Locate and tag duplicate reads in a BAM file
keywords:
- markduplicates
- bam
- cram
tools:
- biobambam:
description: |
biobambam is a set of tools for early stage alignment file processing.
homepage: https://gitlab.com/german.tischler/biobambam2
documentation: https://gitlab.com/german.tischler/biobambam2/-/blob/master/README.md
doi: 10.1186/1751-0473-9-13
licence: ['GPL v3']
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- bam:
type: file
description: BAM/CRAM file
pattern: "*.{bam,cram}"
output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- bam:
type: file
description: BAM file with duplicate reads marked/removed
pattern: "*.{bam}"
- metrics:
type: file
description: Duplicate metrics file generated by biobambam
pattern: "*.{metrics.txt}"
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@muffato"

View file

@ -178,6 +178,10 @@ bedtools/subtract:
- modules/bedtools/subtract/**
- tests/modules/bedtools/subtract/**
biobambam/bammarkduplicates2:
- modules/biobambam/bammarkduplicates2/**
- tests/modules/biobambam/bammarkduplicates2/**
bismark/align:
- modules/bismark/align/**
- modules/bismark/genomepreparation/**

View file

@ -0,0 +1,15 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { BIOBAMBAM_BAMMARKDUPLICATES2 } from '../../../../modules/biobambam/bammarkduplicates2/main.nf'
workflow test_biobambam_bammarkduplicates2 {
input = [
[ id:'test', single_end:false ], // meta map
file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true)
]
BIOBAMBAM_BAMMARKDUPLICATES2 ( input )
}

View file

@ -0,0 +1,5 @@
process {
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
}

View file

@ -0,0 +1,12 @@
- name: biobambam bammarkduplicates2 test_biobambam_bammarkduplicates2
command: nextflow run tests/modules/biobambam/bammarkduplicates2 -entry test_biobambam_bammarkduplicates2 -c tests/config/nextflow.config
tags:
- biobambam/bammarkduplicates2
- biobambam
files:
- path: output/biobambam/test.bam
md5sum: 1cf7f957eb20b4ace9f10d0cf0a0649a
- path: output/biobambam/test.metrics.txt
md5sum: 30d6e7d90bb5df46329d4bc0144ce927
- path: output/biobambam/versions.yml
md5sum: 0d6f3137ed4515333d73c779f2c24445