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: |
|
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:
|
- beds:
|
||||||
type: file
|
type: file
|
||||||
description: List of bed files
|
description: List of bed files
|
||||||
pattern: "*.{bed}"
|
pattern: "*.{bed}"
|
||||||
|
@ -46,7 +46,6 @@ output:
|
||||||
type: file
|
type: file
|
||||||
description: Edited bed file
|
description: Edited bed file
|
||||||
pattern: "*.{complement.bed}"
|
pattern: "*.{complement.bed}"
|
||||||
|
|
||||||
- version:
|
- version:
|
||||||
type: file
|
type: file
|
||||||
description: File containing software version
|
description: File containing software version
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Import generic module functions
|
// Import generic module functions
|
||||||
include { initOptions; saveFiles; getSoftwareName } from './functions'
|
include { initOptions; saveFiles; getSoftwareName } from './functions'
|
||||||
|
|
||||||
|
params.options = [:]
|
||||||
def options = initOptions(params.options)
|
def options = initOptions(params.options)
|
||||||
|
|
||||||
process BEDTOOLS_GENOMECOV {
|
process BEDTOOLS_GENOMECOV {
|
||||||
|
@ -10,11 +11,11 @@ process BEDTOOLS_GENOMECOV {
|
||||||
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.29.2" : null)
|
conda (params.enable_conda ? "bioconda::bedtools=2.30.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.29.2--hc088bd4_0"
|
container "https://depot.galaxyproject.org/singularity/bedtools:bedtools:2.30.0--hc088bd4_0"
|
||||||
} else {
|
} else {
|
||||||
container "quay.io/biocontainers/bedtools:2.29.2--hc088bd4_0"
|
container "quay.io/biocontainers/bedtools:bedtools:2.30.0--hc088bd4_0"
|
||||||
}
|
}
|
||||||
|
|
||||||
input:
|
input:
|
||||||
|
@ -29,6 +30,6 @@ process BEDTOOLS_GENOMECOV {
|
||||||
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
|
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
|
||||||
"""
|
"""
|
||||||
bedtools genomecov -ibam $bams -g $sizes ${options.args} > ${prefix}.bed
|
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
|
// Import generic module functions
|
||||||
include { initOptions; saveFiles; getSoftwareName } from './functions'
|
include { initOptions; saveFiles; getSoftwareName } from './functions'
|
||||||
|
|
||||||
|
params.options = [:]
|
||||||
def options = initOptions(params.options)
|
def options = initOptions(params.options)
|
||||||
|
|
||||||
process BEDTOOLS_INTERSECT {
|
process BEDTOOLS_INTERSECT {
|
||||||
|
@ -10,24 +11,31 @@ process BEDTOOLS_INTERSECT {
|
||||||
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.29.2" : null)
|
conda (params.enable_conda ? "bioconda::bedtools=2.30.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.29.2--hc088bd4_0"
|
container "https://depot.galaxyproject.org/singularity/bedtools:bedtools:2.30.0--hc088bd4_0"
|
||||||
} else {
|
} else {
|
||||||
container "quay.io/biocontainers/bedtools:2.29.2--hc088bd4_0"
|
container "quay.io/biocontainers/bedtools:bedtools:2.30.0--hc088bd4_0"
|
||||||
}
|
}
|
||||||
|
|
||||||
input:
|
input:
|
||||||
tuple val(meta), path(bedfile1), path(bedfile2)
|
tuple val(meta), path(bed1), path(bed2)
|
||||||
|
|
||||||
output:
|
output:
|
||||||
tuple val(meta), path("*.intersect.bed"), emit: intersect
|
tuple val(meta), path("*.intersect.bed"), emit: bed
|
||||||
path "*.version.txt", emit: version
|
path "*.version.txt", emit: version
|
||||||
|
|
||||||
script: // TODO change script to account for multiple possible intersections
|
script: // TODO change script to account for multiple possible intersections
|
||||||
def software = getSoftwareName(task.process)
|
def software = getSoftwareName(task.process)
|
||||||
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
|
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
|
||||||
"""
|
"""
|
||||||
bedtools intersect -a ${bedfile1} -b ${bedfile2} ${options.args} > ${prefix}.intersect.bed
|
bedtools \\
|
||||||
bedtools --version | sed -e "s/Bedtools v//g" > ${software}.version.txt
|
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
|
// Import generic module functions
|
||||||
include { initOptions; saveFiles; getSoftwareName } from './functions'
|
include { initOptions; saveFiles; getSoftwareName } from './functions'
|
||||||
|
|
||||||
|
params.options = [:]
|
||||||
def options = initOptions(params.options)
|
def options = initOptions(params.options)
|
||||||
|
|
||||||
process BEDTOOLS_MERGE {
|
process BEDTOOLS_MERGE {
|
||||||
|
@ -10,23 +11,24 @@ process BEDTOOLS_MERGE {
|
||||||
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:'') }
|
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) {
|
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 {
|
} else {
|
||||||
container "quay.io/biocontainers/bedtools:2.29.2--hc088bd4_0"
|
container "quay.io/biocontainers/bedtools:bedtools:2.30.0--hc088bd4_0"
|
||||||
}
|
}
|
||||||
|
|
||||||
input:
|
input:
|
||||||
tuple val(meta), path(sort)
|
tuple val(meta), path(bed)
|
||||||
|
|
||||||
output:
|
output:
|
||||||
path("*.merged.bed"), emit: merge
|
path("*.merged.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)
|
||||||
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
|
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
|
||||||
"""
|
"""
|
||||||
bedtools merge -i ${sort} ${options.args} > ${prefix}.merged.bed
|
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
|
// Import generic module functions
|
||||||
include { initOptions; saveFiles; getSoftwareName } from './functions'
|
include { initOptions; saveFiles; getSoftwareName } from './functions'
|
||||||
|
|
||||||
params.options = [:]
|
params.options = [:]
|
||||||
def options = initOptions(params.options)
|
def options = initOptions(params.options)
|
||||||
|
|
||||||
|
@ -10,11 +11,11 @@ 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.29.2" : null)
|
conda (params.enable_conda ? "bioconda::bedtools=2.30.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.29.2--hc088bd4_0"
|
container "https://depot.galaxyproject.org/singularity/bedtools:bedtools:2.30.0--hc088bd4_0"
|
||||||
} else {
|
} 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)
|
tuple val(meta), path(beds), path (sizes)
|
||||||
|
|
||||||
output:
|
output:
|
||||||
tuple val(meta), path("*.slop.bed"), emit: slopbed
|
tuple val(meta), path("*.slop.bed"), emit: bed
|
||||||
path "*.version.txt", emit: version
|
path "*.version.txt", emit: version
|
||||||
|
|
||||||
script:
|
script:
|
||||||
|
@ -41,7 +42,7 @@ process BEDTOOLS_SLOP {
|
||||||
} else {
|
} else {
|
||||||
"""
|
"""
|
||||||
slopBed -i $beds -g $sizes -l $params.l -r $params.r $header $pct $options.args> ${prefix}.slop.bed
|
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
|
// Import generic module functions
|
||||||
include { initOptions; saveFiles; getSoftwareName } from './functions'
|
include { initOptions; saveFiles; getSoftwareName } from './functions'
|
||||||
|
|
||||||
|
params.options = [:]
|
||||||
def options = initOptions(params.options)
|
def options = initOptions(params.options)
|
||||||
|
|
||||||
process BEDTOOLS_SORT {
|
process BEDTOOLS_SORT {
|
||||||
|
@ -10,18 +11,18 @@ process BEDTOOLS_SORT {
|
||||||
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.29.2" : null)
|
conda (params.enable_conda ? "bioconda::bedtools=2.30.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.29.2--hc088bd4_0"
|
container "https://depot.galaxyproject.org/singularity/bedtools:bedtools:2.30.0--hc088bd4_0"
|
||||||
} else {
|
} else {
|
||||||
container "quay.io/biocontainers/bedtools:2.29.2--hc088bd4_0"
|
container "quay.io/biocontainers/bedtools:bedtools:2.30.0--hc088bd4_0"
|
||||||
}
|
}
|
||||||
|
|
||||||
input:
|
input:
|
||||||
tuple val(meta), path(beds)
|
tuple val(meta), path(beds)
|
||||||
|
|
||||||
output:
|
output:
|
||||||
tuple val(meta), path("*.sort.bed"), emit: sort
|
tuple val(meta), path("*.sort.bed"), emit: bed
|
||||||
path "*.version.txt", emit: version
|
path "*.version.txt", emit: version
|
||||||
|
|
||||||
script:
|
script:
|
||||||
|
@ -29,6 +30,6 @@ process BEDTOOLS_SORT {
|
||||||
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
|
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
|
||||||
"""
|
"""
|
||||||
bedtools sort -i $beds ${options.args} > ${prefix}.sort.bed
|
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