Fix bedtools slip module

This commit is contained in:
drpatelh 2021-02-07 21:32:20 +00:00
parent 38964ecfc0
commit f3b5af4ed5
4 changed files with 62 additions and 79 deletions

View file

@ -11,20 +11,20 @@ process BEDTOOLS_SLOP {
mode: params.publish_dir_mode, mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
conda (params.enable_conda ? "bioconda::bedtools=2.30.0" : null) conda (params.enable_conda ? "bioconda::bedtools=2.30.0=hc088bd4_0" : null)
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/bedtools:2.30.0--hc088bd4_0" container "https://depot.galaxyproject.org/singularity/bedtools:2.30.0--hc088bd4_0"
} else { } else {
container "quay.io/biocontainers/bedtools:2.30.0--hc088bd4_0" container "quay.io/biocontainers/bedtools:2.30.0--hc088bd4_0"
} }
input: input:
tuple val(meta), path(beds), path (sizes) tuple val(meta), path(bed)
path sizes
output: output:
tuple val(meta), path("*.slop.bed"), emit: bed tuple val(meta), path("*.bed"), emit: bed
path "*.version.txt", emit: version path "*.version.txt" , emit: version
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
@ -32,10 +32,10 @@ process BEDTOOLS_SLOP {
""" """
bedtools \\ bedtools \\
slop \\ slop \\
-i $beds \\ -i $bed \\
-g $sizes \\ -g $sizes \\
$options.args \\ $options.args \\
> ${prefix}.slop.bed > ${prefix}.bed
bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt
""" """

View file

@ -1,75 +1,59 @@
name: bedtools_slop name: bedtools_slop
description: Adds a specified number of bases in each direction (unique values may be specified for either -l or -r) description: Adds a specified number of bases in each direction (unique values may be specified for either -l or -r)
keywords: keywords:
- bed - bed
- slopBed - slopBed
tools: tools:
- bedtools: - bedtools:
description: | description: |
A set of tools for genomic analysis tasks, specifically enabling genome arithmetic (merge, count, complement) on various file types. A set of tools for genomic analysis tasks, specifically enabling genome arithmetic (merge, count, complement) on various file types.
documentation: https://bedtools.readthedocs.io/en/latest/content/tools/slop.html documentation: https://bedtools.readthedocs.io/en/latest/content/tools/slop.html
params: params:
- l: - outdir:
type: integer type: string
description: The number of base pairs to subtract from the start coordinate description: |
- r: The pipeline's output directory. By default, the module will
type: integer output files into `$params.outdir/<SOFTWARE>`
description: The number of base pairs to add to the end coordinate - publish_dir_mode:
- b: type: string
type: integer description: |
description: Increases the entry by the same number base pairs in each direction Value for the Nextflow `publishDir` mode parameter.
- pct: Available: symlink, rellink, link, copy, copyNoFollow, move.
type: boolean - enable_conda:
description: | type: boolean
Define -l and -r as a fraction of the features length. E.g. if used on a 1000bp feature, -l 0.50, will add 500 bp “upstream”. By default this is set to false. description: |
Run the module with Conda using the software specified
- header: via the `conda` directive
type: boolean - singularity_pull_docker_container:
description: | type: boolean
Print the header from the input file prior to results. description: |
Instead of directly downloading Singularity images for use with Singularity,
- outdir: force the workflow to pull and convert Docker containers instead.
type: string
description: |
The pipeline's output directory. By default, the module will
output files into `$params.outdir/<SOFTWARE>`
- publish_dir_mode:
type: string
description: |
Value for the Nextflow `publishDir` mode parameter.
Available: symlink, rellink, link, copy, copyNoFollow, move.
- enable_conda:
type: boolean
description: |
Run the module with Conda using the software specified
via the `conda` directive
input: input:
- meta: - meta:
type: map type: map
description: | description: |
Groovy Map containing sample information Groovy Map containing sample information
e.g. [ id:'test', single_end:false ] e.g. [ id:'test', single_end:false ]
- bed: - bed:
type: file type: file
description: List of bed files description: Input BED file
pattern: "*.{bed}" pattern: "*.{bed}"
output: output:
- meta: - meta:
type: map type: map
description: | description: |
Groovy Map containing sample information Groovy Map containing sample information
e.g. [ id:'test', single_end:false ] e.g. [ id:'test', single_end:false ]
- bed: - bed:
type: file type: file
description: Edited bed file description: Slopped BED file
pattern: "*.{slop.bed}" pattern: "*.{bed}"
- version:
- version: type: file
type: file description: File containing software version
description: File containing software version pattern: "*.{version.txt}"
pattern: "*.{version.txt}" authors:
- "@Emiller88"
authors: -"@Emiller88" - "@sruthipsuresh"
-"@sruthipsuresh" - "@drpatelh"

View file

@ -7,9 +7,8 @@ include { BEDTOOLS_SLOP } from '../../../../software/bedtools/slop/main.nf' addP
workflow test_bedtools_slop { workflow test_bedtools_slop {
def input = [] def input = []
input = [ [ id:'test'], input = [ [ id:'test'],
file("${launchDir}/tests/data/bed/A.bed", checkIfExists: true), file("${launchDir}/tests/data/bed/A.bed", checkIfExists: true) ]
file("${launchDir}/tests/data/bed/genome.sizes", checkIfExists: true) ]
BEDTOOLS_SLOP( input ) BEDTOOLS_SLOP ( input, file("${launchDir}/tests/data/bed/genome.sizes", checkIfExists: true) )
} }

View file

@ -4,5 +4,5 @@
- bedtools - bedtools
- bedtools_slop - bedtools_slop
files: files:
- path: output/bedtools/test.slop.bed - path: output/bedtools/test.bed
md5sum: 5f6ecc3e3cc6cee9537a1d088b02abec md5sum: 5f6ecc3e3cc6cee9537a1d088b02abec