first commit

This commit is contained in:
Matthias De Smet 2022-04-13 12:51:17 +02:00
parent 409af2f27c
commit 0f7c046477
6 changed files with 125 additions and 0 deletions

View file

@ -0,0 +1,44 @@
process ELPREP_MERGE {
tag "$meta.id"
label 'process_medium'
conda (params.enable_conda ? "bioconda::elprep=5.1.2" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/elprep:5.1.2--he881be0_0':
'quay.io/biocontainers/elprep:5.1.2--he881be0_0' }"
input:
tuple val(meta), path(bam)
output:
tuple val(meta), path("**.{bam,sam}"), emit: bam
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}"
if (meta.single_end) {
args += " --single-end"
}
def suffix = args.contains("--output-type sam") ? "sam" : "bam"
"""
# create directory and move all input so elprep can find and merge them before splitting
mkdir input
mv ${bam} input/
elprep merge \\
input \\
${prefix}.${suffix} \\
$args \\
--nr-of-threads $task.cpus
cat <<-END_VERSIONS > versions.yml
"${task.process}":
elprep: \$(elprep 2>&1 | head -n2 | tail -n1 |sed 's/^.*version //;s/ compiled.*\$//')
END_VERSIONS
"""
}

View file

@ -0,0 +1,44 @@
name: "elprep_merge"
description: Merge split bam/sam chunks in one file
keywords:
- bam
- sam
- merge
tools:
- "elprep":
description: "elPrep is a high-performance tool for preparing .sam/.bam files for variant calling in sequencing pipelines. It can be used as a drop-in replacement for SAMtools/Picard/GATK4."
homepage: "None"
documentation: "None"
tool_dev_url: "None"
doi: ""
licence: "['AGPL v3']"
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- bam:
type: file
description: List of BAM/SAM chunks to merge
pattern: "*.{bam,sam}"
output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
#
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
- bam:
type: file
description: Merged BAM/SAM file
pattern: "*.{bam,sam}"
authors:
- "@matthdsm"

View file

@ -587,6 +587,10 @@ ectyper:
- modules/ectyper/** - modules/ectyper/**
- tests/modules/ectyper/** - tests/modules/ectyper/**
elprep/merge:
- modules/elprep/merge/**
- tests/modules/elprep/merge/**
emmtyper: emmtyper:
- modules/emmtyper/** - modules/emmtyper/**
- tests/modules/emmtyper/** - tests/modules/emmtyper/**

View file

@ -0,0 +1,17 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { ELPREP_SPLIT } from '../../../../modules/elprep/split/main.nf'
include { ELPREP_MERGE } from '../../../../modules/elprep/merge/main.nf'
workflow test_elprep_merge {
input = [
[ id:'test', single_end:false ], // meta map
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true)
]
ELPREP_SPLIT ( input )
ELPREP_MERGE ( ELPREP_SPLIT.out.bam )
}

View file

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

View file

@ -0,0 +1,11 @@
- name: "elprep merge"
command: nextflow run ./tests/modules/elprep/merge -entry test_elprep_merge -c ./tests/config/nextflow.config -c ./tests/modules/elprep/merge/nextflow.config
tags:
- "elprep"
#
- "elprep/merge"
#
files:
- path: "output/elprep/test.bam"
md5sum: e667c7caad0bc4b7ac383fd023c654fc
- path: output/elprep/versions.yml