mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-22 02:58:17 +00:00
first commit
This commit is contained in:
parent
409af2f27c
commit
0f7c046477
6 changed files with 125 additions and 0 deletions
44
modules/elprep/merge/main.nf
Normal file
44
modules/elprep/merge/main.nf
Normal 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
|
||||
"""
|
||||
}
|
44
modules/elprep/merge/meta.yml
Normal file
44
modules/elprep/merge/meta.yml
Normal 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"
|
|
@ -587,6 +587,10 @@ ectyper:
|
|||
- modules/ectyper/**
|
||||
- tests/modules/ectyper/**
|
||||
|
||||
elprep/merge:
|
||||
- modules/elprep/merge/**
|
||||
- tests/modules/elprep/merge/**
|
||||
|
||||
emmtyper:
|
||||
- modules/emmtyper/**
|
||||
- tests/modules/emmtyper/**
|
||||
|
|
17
tests/modules/elprep/merge/main.nf
Normal file
17
tests/modules/elprep/merge/main.nf
Normal 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 )
|
||||
}
|
5
tests/modules/elprep/merge/nextflow.config
Normal file
5
tests/modules/elprep/merge/nextflow.config
Normal file
|
@ -0,0 +1,5 @@
|
|||
process {
|
||||
|
||||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
||||
|
||||
}
|
11
tests/modules/elprep/merge/test.yml
Normal file
11
tests/modules/elprep/merge/test.yml
Normal 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
|
Loading…
Reference in a new issue