bedtools

bedtools maskfasta

bedtools maskfasta

Version:
2.29.x
Identifier: TL_43392c_4c.c8
Tool
1// nf-core DSL2 modules are provided by Truwl to teach internal Nextflow process mechanics. See https://github.com/nf-core/modules for instructions on how to use these in your recipes
2// Import generic module functions
3include { initOptions; saveFiles; getSoftwareName } from './functions'
4
5params.options = [:]
6options        = initOptions(params.options)
7
8process BEDTOOLS_MASKFASTA {
9    tag "$meta.id"
10    label 'process_medium'
11    publishDir "${params.outdir}",
12        mode: params.publish_dir_mode,
13        saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) }
14
15    conda (params.enable_conda ? "bioconda::bedtools=2.30.0" : null)
16    if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
17        container "https://depot.galaxyproject.org/singularity/bedtools:2.30.0--hc088bd4_0"
18    } else {
19        container "quay.io/biocontainers/bedtools:2.30.0--hc088bd4_0"
20    }
21
22    input:
23    tuple val(meta), path(bed)
24    path  fasta
25
26    output:
27    tuple val(meta), path("*.fa"), emit: fasta
28    path "*.version.txt"         , emit: version
29
30    script:
31    def software = getSoftwareName(task.process)
32    def prefix   = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
33    """
34    bedtools \\
35        maskfasta \\
36        $options.args \\
37        -fi $fasta \\
38        -bed $bed \\
39        -fo ${prefix}.fa
40    bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt
41    """
42}
43