nf-core_modules/software/seqtk/subseq/main.nf
Svyatoslav Sidorov 01dc6a289d
Feat seqtk update (#503)
* hifiasm copied from fastqc

* hifiasm tests init from fastqc

* meta.yml init; test.yml and main.nf for printing version

* Add hifiasm version printing

* Removed spaced on an empty line

* Reverted hifiasm from main

* hifiasm copied from fastqc

* hifiasm tests init from fastqc

* meta.yml init; test.yml and main.nf for printing version

* Add hifiasm version printing

* Removed spaced on an empty line

* Reverted hifiasm from main

* Added seqtk/subseq and checking for seed in seqtk/sample

* Separate authors in software/seqtk/sample/meta.yml

Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>

* Align commans in output channesl software/seqtk/subseq/main.nf

Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>

* Define prefix in software/seqtk/subseq/main.nf

Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>

* Use prefix in output file name software/seqtk/subseq/main.nf

Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>

* Define suffix in options in tests/software/seqtk/subseq/main.nf

Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>

* Change output file name in tests/software/seqtk/subseq/test.yml

Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>

* Remove a to-do point from tests/software/seqtk/subseq/test.yml

Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>

* Added --no-name into gzip commands

* Update samtools from 1.10 to 1.12 (#530)

* feat: remove social preview image to use GitHub OpenGraph

* feat: update samtools from 1.10 to 1.12

* fix: CI tests

* fix: add meta.yml file for samtools/merge

* Update software/samtools/merge/meta.yml

Co-authored-by: Jose Espinosa-Carrasco <kadomu@gmail.com>

* Update software/samtools/merge/meta.yml

Co-authored-by: Jose Espinosa-Carrasco <kadomu@gmail.com>

* hifiasm copied from fastqc

* hifiasm tests init from fastqc

* meta.yml init; test.yml and main.nf for printing version

* Add hifiasm version printing

* Removed spaced on an empty line

* Reverted hifiasm from main

* Added seqtk/subseq and checking for seed in seqtk/sample

* hifiasm copied from fastqc

* hifiasm tests init from fastqc

* meta.yml init; test.yml and main.nf for printing version

* Add hifiasm version printing

* Removed spaced on an empty line

* Reverted hifiasm from main

* Separate authors in software/seqtk/sample/meta.yml

Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>

* Align commans in output channesl software/seqtk/subseq/main.nf

Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>

* Define prefix in software/seqtk/subseq/main.nf

Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>

* Use prefix in output file name software/seqtk/subseq/main.nf

Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>

* Define suffix in options in tests/software/seqtk/subseq/main.nf

Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>

* Change output file name in tests/software/seqtk/subseq/test.yml

Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>

* Remove a to-do point from tests/software/seqtk/subseq/test.yml

Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>

* Added --no-name into gzip commands

* Replaced functions.nf in seqtk/subseq

* Refreshed tests for sample and subseq

* Corrected paired-end test and YAML description for sample

Co-authored-by: Sviatoslav Sidorov <sviatoslav.sidorov@crick.ac.uk>
Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>
Co-authored-by: Maxime U. Garcia <max.u.garcia@gmail.com>
Co-authored-by: Jose Espinosa-Carrasco <kadomu@gmail.com>
2021-06-14 12:23:15 +01:00

46 lines
1.4 KiB
Text

// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
options = initOptions(params.options)
process SEQTK_SUBSEQ {
tag '$sequences'
label 'process_low'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:[:], publish_by_meta:[]) }
conda (params.enable_conda ? "bioconda::seqtk=1.3" : null)
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/seqtk:1.3--h5bf99c6_3"
} else {
container "quay.io/biocontainers/seqtk:1.3--h5bf99c6_3"
}
input:
path sequences
path filter_list
output:
path "*.gz" , emit: sequences
path "*.version.txt", emit: version
script:
def software = getSoftwareName(task.process)
def prefix = options.suffix ?: ''
def ext = "fa"
if ("$sequences" ==~ /.+\.fq|.+\.fq.gz|.+\.fastq|.+\.fastq.gz/) {
ext = "fq"
}
"""
seqtk \\
subseq \\
$options.args \\
$sequences \\
$filter_list | \\
gzip --no-name > ${sequences}${prefix}.${ext}.gz
echo \$(seqtk 2>&1) | sed 's/^.*Version: //; s/ .*\$//' > ${software}.version.txt
"""
}