nf-core_modules/modules/fastawindows/main.nf
Matthieu Muffato 4f78d40b11
New module: fasta_windows (#1956)
* New module for fasta_windows

* Upgraded the code and the test to v2.4

* Standard list of Fasta file extensions

Co-authored-by: James A. Fellows Yates <jfy133@gmail.com>

* Output file (and/or directory) names SHOULD just consist of only ${prefix}

Co-authored-by: James A. Fellows Yates <jfy133@gmail.com>
2022-09-09 08:41:38 +01:00

40 lines
1.3 KiB
Text

process FASTAWINDOWS {
tag "$meta.id"
label 'process_low'
conda (params.enable_conda ? "bioconda::fasta_windows=0.2.4" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/fasta_windows:0.2.4--hec16e2b_0':
'quay.io/biocontainers/fasta_windows:0.2.4--hec16e2b_0' }"
input:
tuple val(meta), path(fasta)
output:
tuple val(meta), path("fw_out/*_freq_windows.tsv") , emit: freq
tuple val(meta), path("fw_out/*_mononuc_windows.tsv") , emit: mononuc
tuple val(meta), path("fw_out/*_dinuc_windows.tsv") , emit: dinuc
tuple val(meta), path("fw_out/*_trinuc_windows.tsv") , emit: trinuc
tuple val(meta), path("fw_out/*_tetranuc_windows.tsv"), emit: tetranuc
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}"
"""
rm -rf fw_out
env RAYON_NUM_THREADS=$task.cpus \\
fasta_windows \\
$args \\
--fasta $fasta \\
--output ${prefix}
cat <<-END_VERSIONS > versions.yml
"${task.process}":
fasta_windows: \$(fasta_windows --version | cut -d' ' -f3)
END_VERSIONS
"""
}