Add deeptools bamcoverage (#1316)

* Add deeptools bamcoverage

* remove todo string

* Add in when

* fix c&p version format error

* Fix md5sums

Co-authored-by: Maxime U. Garcia <max.u.garcia@gmail.com>
This commit is contained in:
FriederikeHanssen 2022-02-18 09:35:41 +01:00 committed by GitHub
parent 9e9ff6a86d
commit fdb1664885
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 143 additions and 0 deletions

View file

@ -0,0 +1,37 @@
process DEEPTOOLS_BAMCOVERAGE {
tag "$meta.id"
label 'process_low'
conda (params.enable_conda ? "bioconda::deeptools=3.5.1" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/deeptools:3.5.1--py_0':
'quay.io/biocontainers/deeptools:3.5.1--py_0' }"
input:
tuple val(meta), path(input), path(input_index)
output:
tuple val(meta), path("*.bigWig") , emit: bigwig, optional: true
tuple val(meta), path("*.bedgraph") , emit: bedgraph, optional: true
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}.bigWig"
"""
bamCoverage \
--bam $input \
$args \
--numberOfProcessors ${task.cpus} \
--outFileName ${prefix}
cat <<-END_VERSIONS > versions.yml
"${task.process}":
deeptools: \$(bamCoverage --version | sed -e "s/bamCoverage //g")
END_VERSIONS
"""
}

View file

@ -0,0 +1,49 @@
name: deeptools_bamcoverage
description: This tool takes an alignment of reads or fragments as input (BAM file) and generates a coverage track (bigWig or bedGraph) as output.
keywords:
- sort
tools:
- deeptools:
description: A set of user-friendly tools for normalization and visualzation of deep-sequencing data
homepage: https://deeptools.readthedocs.io/en/develop/content/tools/bamCoverage.html
documentation: https://deeptools.readthedocs.io/en/develop/content/tools/bamCoverage.html
tool_dev_url: https://github.com/deeptools/deepTools/
doi: "https://doi.org/10.1093/nar/gkw257"
licence: ['GPL v3']
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- input:
type: file
description: BAM/CRAM file
pattern: "*.{bam,cram}"
- input_index:
type: file
description: BAM/CRAM index file
pattern: "*.{bai,crai}"
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"
- bigWig:
type: file
description: BigWig file
pattern: "*.bigWig"
- bedgraph:
type: file
description: Bedgraph file
pattern: "*.bedgraph"
authors:
- "@FriederikeHanssen"

View file

@ -400,6 +400,10 @@ deeparg/predict:
- modules/deeparg/predict/** - modules/deeparg/predict/**
- tests/modules/deeparg/predict/** - tests/modules/deeparg/predict/**
deeptools/bamcoverage:
- modules/deeptools/bamcoverage/**
- tests/modules/deeptools/bamcoverage/**
deeptools/computematrix: deeptools/computematrix:
- modules/deeptools/computematrix/** - modules/deeptools/computematrix/**
- tests/modules/deeptools/computematrix/** - tests/modules/deeptools/computematrix/**

View file

@ -0,0 +1,27 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { DEEPTOOLS_BAMCOVERAGE } from '../../../../modules/deeptools/bamcoverage/main.nf'
workflow test_deeptools_bamcoverage_bam {
input = [
[ id:'test', single_end:false ], // meta map
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true),
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true)
]
DEEPTOOLS_BAMCOVERAGE ( input )
}
workflow test_deeptools_bamcoverage_cram {
input = [
[ id:'test', single_end:false ], // meta map
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true),
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram_crai'], checkIfExists: true)
]
DEEPTOOLS_BAMCOVERAGE ( input )
}

View file

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

View file

@ -0,0 +1,21 @@
- name: deeptools bamcoverage test_deeptools_bamcoverage_bam
command: nextflow run tests/modules/deeptools/bamcoverage -entry test_deeptools_bamcoverage_bam -c tests/config/nextflow.config
tags:
- deeptools
- deeptools/bamcoverage
files:
- path: output/deeptools/test.bigWig
md5sum: 95fe9383a9e6c02aea6b785cf074274f
- path: output/deeptools/versions.yml
md5sum: 68c94e73b7a8c0935578bad61fea54c1
- name: deeptools bamcoverage test_deeptools_bamcoverage_cram
command: nextflow run tests/modules/deeptools/bamcoverage -entry test_deeptools_bamcoverage_cram -c tests/config/nextflow.config
tags:
- deeptools
- deeptools/bamcoverage
files:
- path: output/deeptools/test.bigWig
md5sum: 95fe9383a9e6c02aea6b785cf074274f
- path: output/deeptools/versions.yml
md5sum: 665bbd2979c49bf3974a24bd44a88e94