Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions modules/nf-core/bedtools/shuffle/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
channels:
- conda-forge
- bioconda
dependencies:
- bioconda::bedtools=2.31.1
56 changes: 56 additions & 0 deletions modules/nf-core/bedtools/shuffle/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
process BEDTOOLS_SHUFFLE {
tag "$meta.id"
label 'process_low'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/bedtools:2.31.1--h13024bc_3':
'biocontainers/bedtools:2.31.1--h13024bc_3' }"

input:
tuple val(meta) , path(intervals)
tuple val(meta2), path(chrom_sizes)
path exclude_file
path include_file

output:
tuple val(meta), path("*.bed"), emit: bed
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}"
def exclude_arg = exclude_file ? "-excl $exclude_file" : ''
def include_arg = include_file ? "-incl $include_file" : ''
if ("$intervals" == "${prefix}.bed") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!"
"""
bedtools \\
shuffle \\
$args \\
-i $intervals \\
-g $chrom_sizes \\
$exclude_arg \\
$include_arg \\
> ${prefix}.bed

cat <<-END_VERSIONS > versions.yml
"${task.process}":
bedtools: \$(bedtools --version |& sed '1!d ; s/bedtools //')
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
if ("$intervals" == "${prefix}.bed") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!"
"""
touch ${prefix}.bed

cat <<-END_VERSIONS > versions.yml
"${task.process}":
bedtools: \$(bedtools --version |& sed '1!d ; s/bedtools //')
END_VERSIONS
"""
}
80 changes: 80 additions & 0 deletions modules/nf-core/bedtools/shuffle/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "bedtools_shuffle"
description: bedtools shuffle will randomly permute the genomic locations of a feature file among a genome defined in a genome file
keywords:
- bed
- shuffleBed
- region
- fai
- sizes
- genome
- bases
tools:
- bedtools:
description: |
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
licence: ["MIT"]
identifier: biotools:bedtools

input:
- - meta:
type: map
description: |
Groovy Map containing interval information
e.g. [ id:'test' ]
- intervals:
type: file
description: Input interval (BED/GFF/VCF) file
pattern: "*.{bed,gff,gff3,vcf}"
ontologies:
- edam: "http://edamontology.org/format_3003"
- edam: "http://edamontology.org/format_2305"
- edam: "http://edamontology.org/format_3016"
- - meta2:
type: map
description: |
Groovy Map containing genome information
e.g. [ id:'test' ]
- chrom_sizes:
type: file
description: Chromosome sizes file
pattern: "*{.genome,.sizes,.txt,.fai}"
- - exclude_file:
type: file
description: BED file containing regions to exclude
pattern: "*.{bed}"
ontologies:
- edam: "http://edamontology.org/format_3003"
- - include_file:
type: file
description: BED file containing regions to include
pattern: "*.{bed}"
ontologies:
- edam: "http://edamontology.org/format_3003"

output:
- bed:
- meta:
type: map
description: |
Groovy Map containing interval information
e.g. `[ id:'sample1' ]`
- "*.bed":
type: file
description: BED file with shuffled intervals
pattern: "*.{bed}"
ontologies:
- edam: "http://edamontology.org/format_3003"

- versions:
- "versions.yml":
type: file
description: File containing software versions
pattern: "versions.yml"

authors:
- "@itrujnara"
maintainers:
- "@itrujnara"
Loading
Loading