mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-11-10 20:23:10 +00:00
Apply suggestions from code review
Add all initial suggestions from review (syntax issues) Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>
This commit is contained in:
parent
e5c21d15a3
commit
fc8cdde2b4
6 changed files with 41 additions and 29 deletions
|
@ -32,7 +32,7 @@ input:
|
|||
description: |
|
||||
Groovy Map containing sample information
|
||||
e.g. [ id:'test', single_end:false ]
|
||||
- bed:
|
||||
- beds:
|
||||
type: file
|
||||
description: List of bed files
|
||||
pattern: "*.{bed}"
|
||||
|
@ -46,7 +46,6 @@ output:
|
|||
type: file
|
||||
description: Edited bed file
|
||||
pattern: "*.{complement.bed}"
|
||||
|
||||
- version:
|
||||
type: file
|
||||
description: File containing software version
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// Import generic module functions
|
||||
include { initOptions; saveFiles; getSoftwareName } from './functions'
|
||||
|
||||
params.options = [:]
|
||||
def options = initOptions(params.options)
|
||||
|
||||
process BEDTOOLS_GENOMECOV {
|
||||
|
@ -10,11 +11,11 @@ process BEDTOOLS_GENOMECOV {
|
|||
mode: params.publish_dir_mode,
|
||||
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
|
||||
|
||||
conda (params.enable_conda ? "bioconda::bedtools =2.29.2" : null)
|
||||
conda (params.enable_conda ? "bioconda::bedtools=2.30.0" : null)
|
||||
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
|
||||
container "https://depot.galaxyproject.org/singularity/bedtools:2.29.2--hc088bd4_0"
|
||||
container "https://depot.galaxyproject.org/singularity/bedtools:bedtools:2.30.0--hc088bd4_0"
|
||||
} else {
|
||||
container "quay.io/biocontainers/bedtools:2.29.2--hc088bd4_0"
|
||||
container "quay.io/biocontainers/bedtools:bedtools:2.30.0--hc088bd4_0"
|
||||
}
|
||||
|
||||
input:
|
||||
|
@ -29,6 +30,6 @@ process BEDTOOLS_GENOMECOV {
|
|||
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
|
||||
"""
|
||||
bedtools genomecov -ibam $bams -g $sizes ${options.args} > ${prefix}.bed
|
||||
bedtools --version | sed -e "s/Bedtools v//g" > ${software}.version.txt
|
||||
bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt
|
||||
"""
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// Import generic module functions
|
||||
include { initOptions; saveFiles; getSoftwareName } from './functions'
|
||||
|
||||
params.options = [:]
|
||||
def options = initOptions(params.options)
|
||||
|
||||
process BEDTOOLS_INTERSECT {
|
||||
|
@ -10,24 +11,31 @@ process BEDTOOLS_INTERSECT {
|
|||
mode: params.publish_dir_mode,
|
||||
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
|
||||
|
||||
conda (params.enable_conda ? "bioconda::bedtools =2.29.2" : null)
|
||||
conda (params.enable_conda ? "bioconda::bedtools=2.30.0" : null)
|
||||
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
|
||||
container "https://depot.galaxyproject.org/singularity/bedtools:2.29.2--hc088bd4_0"
|
||||
container "https://depot.galaxyproject.org/singularity/bedtools:bedtools:2.30.0--hc088bd4_0"
|
||||
} else {
|
||||
container "quay.io/biocontainers/bedtools:2.29.2--hc088bd4_0"
|
||||
container "quay.io/biocontainers/bedtools:bedtools:2.30.0--hc088bd4_0"
|
||||
}
|
||||
|
||||
input:
|
||||
tuple val(meta), path(bedfile1), path(bedfile2)
|
||||
tuple val(meta), path(bed1), path(bed2)
|
||||
|
||||
output:
|
||||
tuple val(meta), path("*.intersect.bed"), emit: intersect
|
||||
tuple val(meta), path("*.intersect.bed"), emit: bed
|
||||
path "*.version.txt", emit: version
|
||||
|
||||
script: // TODO change script to account for multiple possible intersections
|
||||
def software = getSoftwareName(task.process)
|
||||
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
|
||||
"""
|
||||
bedtools intersect -a ${bedfile1} -b ${bedfile2} ${options.args} > ${prefix}.intersect.bed
|
||||
bedtools --version | sed -e "s/Bedtools v//g" > ${software}.version.txt
|
||||
bedtools \\
|
||||
intersect \\
|
||||
-a ${bed1} \\
|
||||
-b ${bed2} \\
|
||||
$options.args \\
|
||||
> ${prefix}.intersect.bed
|
||||
|
||||
bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt
|
||||
"""
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// Import generic module functions
|
||||
include { initOptions; saveFiles; getSoftwareName } from './functions'
|
||||
|
||||
params.options = [:]
|
||||
def options = initOptions(params.options)
|
||||
|
||||
process BEDTOOLS_MERGE {
|
||||
|
@ -10,23 +11,24 @@ process BEDTOOLS_MERGE {
|
|||
mode: params.publish_dir_mode,
|
||||
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:'') }
|
||||
|
||||
conda (params.enable_conda ? "bioconda::bedtools =2.29.2" : null)
|
||||
conda (params.enable_conda ? "bioconda::bedtools=2.30.0" : null)
|
||||
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
|
||||
container "https://depot.galaxyproject.org/singularity/bedtools:2.29.2--hc088bd4_0"
|
||||
container "https://depot.galaxyproject.org/singularity/bedtools:bedtools:2.30.0--hc088bd4_0"
|
||||
} else {
|
||||
container "quay.io/biocontainers/bedtools:2.29.2--hc088bd4_0"
|
||||
container "quay.io/biocontainers/bedtools:bedtools:2.30.0--hc088bd4_0"
|
||||
}
|
||||
|
||||
input:
|
||||
tuple val(meta), path(sort)
|
||||
tuple val(meta), path(bed)
|
||||
|
||||
output:
|
||||
path("*.merged.bed"), emit: merge
|
||||
path("*.merged.bed"), emit: bed
|
||||
path "*.version.txt", emit: version
|
||||
script:
|
||||
def software = getSoftwareName(task.process)
|
||||
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
|
||||
"""
|
||||
bedtools merge -i ${sort} ${options.args} > ${prefix}.merged.bed
|
||||
bedtools --version | sed -e "s/Bedtools v//g" > ${software}.version.txt
|
||||
bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt
|
||||
"""
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
// Import generic module functions
|
||||
include { initOptions; saveFiles; getSoftwareName } from './functions'
|
||||
|
||||
params.options = [:]
|
||||
def options = initOptions(params.options)
|
||||
|
||||
|
@ -10,11 +11,11 @@ process BEDTOOLS_SLOP {
|
|||
mode: params.publish_dir_mode,
|
||||
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
|
||||
|
||||
conda (params.enable_conda ? "bioconda::bedtools =2.29.2" : null)
|
||||
conda (params.enable_conda ? "bioconda::bedtools=2.30.0" : null)
|
||||
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
|
||||
container "https://depot.galaxyproject.org/singularity/bedtools:2.29.2--hc088bd4_0"
|
||||
container "https://depot.galaxyproject.org/singularity/bedtools:bedtools:2.30.0--hc088bd4_0"
|
||||
} else {
|
||||
container "quay.io/biocontainers/bedtools:2.29.2--hc088bd4_0"
|
||||
container "quay.io/biocontainers/bedtools:bedtools:2.30.0--hc088bd4_0"
|
||||
}
|
||||
|
||||
|
||||
|
@ -22,7 +23,7 @@ process BEDTOOLS_SLOP {
|
|||
tuple val(meta), path(beds), path (sizes)
|
||||
|
||||
output:
|
||||
tuple val(meta), path("*.slop.bed"), emit: slopbed
|
||||
tuple val(meta), path("*.slop.bed"), emit: bed
|
||||
path "*.version.txt", emit: version
|
||||
|
||||
script:
|
||||
|
@ -41,7 +42,7 @@ process BEDTOOLS_SLOP {
|
|||
} else {
|
||||
"""
|
||||
slopBed -i $beds -g $sizes -l $params.l -r $params.r $header $pct $options.args> ${prefix}.slop.bed
|
||||
bedtools --version | sed -e "s/Bedtools v//g" > ${software}.version.txt
|
||||
bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt
|
||||
"""
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// Import generic module functions
|
||||
include { initOptions; saveFiles; getSoftwareName } from './functions'
|
||||
|
||||
params.options = [:]
|
||||
def options = initOptions(params.options)
|
||||
|
||||
process BEDTOOLS_SORT {
|
||||
|
@ -10,18 +11,18 @@ process BEDTOOLS_SORT {
|
|||
mode: params.publish_dir_mode,
|
||||
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
|
||||
|
||||
conda (params.enable_conda ? "bioconda::bedtools =2.29.2" : null)
|
||||
conda (params.enable_conda ? "bioconda::bedtools=2.30.0" : null)
|
||||
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
|
||||
container "https://depot.galaxyproject.org/singularity/bedtools:2.29.2--hc088bd4_0"
|
||||
container "https://depot.galaxyproject.org/singularity/bedtools:bedtools:2.30.0--hc088bd4_0"
|
||||
} else {
|
||||
container "quay.io/biocontainers/bedtools:2.29.2--hc088bd4_0"
|
||||
container "quay.io/biocontainers/bedtools:bedtools:2.30.0--hc088bd4_0"
|
||||
}
|
||||
|
||||
input:
|
||||
tuple val(meta), path(beds)
|
||||
|
||||
output:
|
||||
tuple val(meta), path("*.sort.bed"), emit: sort
|
||||
tuple val(meta), path("*.sort.bed"), emit: bed
|
||||
path "*.version.txt", emit: version
|
||||
|
||||
script:
|
||||
|
@ -29,6 +30,6 @@ process BEDTOOLS_SORT {
|
|||
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
|
||||
"""
|
||||
bedtools sort -i $beds ${options.args} > ${prefix}.sort.bed
|
||||
bedtools --version | sed -e "s/Bedtools v//g" > ${software}.version.txt
|
||||
bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt
|
||||
"""
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue