mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-11-10 20:23:10 +00:00
Seqtk seq (#1340)
* Initial commit of seqtk/seq module files * pytest.yml * updated module and tests code, need to finish modules/main.nf * Initial commit of seqtk/seq module files * pytest.yml * updated module and tests code, need to finish modules/main.nf * Adding code and configs for seqtk/seq module * Re-tested module following minor code update * removed trailing whitespace errors * Changed variable name to following reviewer suggestions Co-authored-by: Sateesh <33637490+sateeshperi@users.noreply.github.com>
This commit is contained in:
parent
f144171ddc
commit
1016c9bd1a
6 changed files with 133 additions and 0 deletions
40
modules/seqtk/seq/main.nf
Normal file
40
modules/seqtk/seq/main.nf
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
process SEQTK_SEQ {
|
||||||
|
tag "$meta.id"
|
||||||
|
label 'process_low'
|
||||||
|
|
||||||
|
conda (params.enable_conda ? "bioconda::seqtk=1.3" : null)
|
||||||
|
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
||||||
|
'https://depot.galaxyproject.org/singularity/seqtk:1.3--h5bf99c6_3' :
|
||||||
|
'quay.io/biocontainers/seqtk:1.3--h5bf99c6_3' }"
|
||||||
|
|
||||||
|
input:
|
||||||
|
tuple val(meta), path(fastx)
|
||||||
|
|
||||||
|
output:
|
||||||
|
tuple val(meta), path("*.gz") , emit: fastx
|
||||||
|
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 extension = "fastq"
|
||||||
|
if ("$fastx" ==~ /.+\.fasta|.+\.fasta.gz|.+\.fa|.+\.fa.gz|.+\.fas|.+\.fas.gz|.+\.fna|.+\.fna.gz/ || "$args" ==~ /\-[aA]/ ) {
|
||||||
|
extension = "fasta"
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
seqtk \\
|
||||||
|
seq \\
|
||||||
|
$args \\
|
||||||
|
$fastx | \\
|
||||||
|
gzip -c > ${prefix}.seqtk-seq.${extension}.gz
|
||||||
|
|
||||||
|
cat <<-END_VERSIONS > versions.yml
|
||||||
|
"${task.process}":
|
||||||
|
seqtk: \$(echo \$(seqtk 2>&1) | sed 's/^.*Version: //; s/ .*\$//')
|
||||||
|
END_VERSIONS
|
||||||
|
"""
|
||||||
|
}
|
42
modules/seqtk/seq/meta.yml
Normal file
42
modules/seqtk/seq/meta.yml
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
name: seqtk_seq
|
||||||
|
description: Common transformation operations on FASTA or FASTQ files.
|
||||||
|
keywords:
|
||||||
|
- seq
|
||||||
|
tools:
|
||||||
|
- seqtk:
|
||||||
|
description: Seqtk is a fast and lightweight tool for processing sequences in the FASTA or FASTQ format. The seqtk seq command enables common transformation operations on FASTA or FASTQ files.
|
||||||
|
homepage: https://github.com/lh3/seqtk
|
||||||
|
documentation: https://docs.csc.fi/apps/seqtk/
|
||||||
|
tool_dev_url: https://github.com/lh3/seqtk
|
||||||
|
licence: ['MIT']
|
||||||
|
|
||||||
|
input:
|
||||||
|
- meta:
|
||||||
|
type: map
|
||||||
|
description: |
|
||||||
|
Groovy Map containing sample information
|
||||||
|
e.g. [ id:'test' ]
|
||||||
|
- sequences:
|
||||||
|
type: file
|
||||||
|
description: A FASTQ or FASTA file
|
||||||
|
pattern: "*.{fastq.gz, fastq, fq, fq.gz, fasta, fastq.gz, fa, fa.gz, fas, fas.gz, fna, fna.gz}"
|
||||||
|
|
||||||
|
output:
|
||||||
|
- meta:
|
||||||
|
type: map
|
||||||
|
description: |
|
||||||
|
Groovy Map containing sample information
|
||||||
|
e.g. [ id:'test' ]
|
||||||
|
- versions:
|
||||||
|
type: file
|
||||||
|
description: File containing software versions
|
||||||
|
pattern: "versions.yml"
|
||||||
|
- sequences:
|
||||||
|
type: file
|
||||||
|
description: FASTQ/FASTA file containing renamed sequences
|
||||||
|
pattern: "*.{fastq.gz, fasta.gz}"
|
||||||
|
|
||||||
|
authors:
|
||||||
|
- "@hseabolt"
|
||||||
|
- "@mjcipriano"
|
||||||
|
- "@sateeshperi"
|
|
@ -1461,6 +1461,10 @@ seqtk/sample:
|
||||||
- modules/seqtk/sample/**
|
- modules/seqtk/sample/**
|
||||||
- tests/modules/seqtk/sample/**
|
- tests/modules/seqtk/sample/**
|
||||||
|
|
||||||
|
seqtk/seq:
|
||||||
|
- modules/seqtk/seq/**
|
||||||
|
- tests/modules/seqtk/seq/**
|
||||||
|
|
||||||
seqtk/subseq:
|
seqtk/subseq:
|
||||||
- modules/seqtk/subseq/**
|
- modules/seqtk/subseq/**
|
||||||
- tests/modules/seqtk/subseq/**
|
- tests/modules/seqtk/subseq/**
|
||||||
|
|
19
tests/modules/seqtk/seq/main.nf
Normal file
19
tests/modules/seqtk/seq/main.nf
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
#!/usr/bin/env nextflow
|
||||||
|
|
||||||
|
nextflow.enable.dsl = 2
|
||||||
|
|
||||||
|
include { SEQTK_SEQ } from '../../../../modules/seqtk/seq/main.nf'
|
||||||
|
|
||||||
|
workflow test_seqtk_seq {
|
||||||
|
input = [ [ id:'test' ], // meta map
|
||||||
|
[ file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ]
|
||||||
|
]
|
||||||
|
SEQTK_SEQ ( input )
|
||||||
|
}
|
||||||
|
|
||||||
|
workflow test_seqtk_seq_fq {
|
||||||
|
input = [ [ id:'test' ], // meta map
|
||||||
|
[ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ]
|
||||||
|
]
|
||||||
|
SEQTK_SEQ ( input )
|
||||||
|
}
|
7
tests/modules/seqtk/seq/nextflow.config
Normal file
7
tests/modules/seqtk/seq/nextflow.config
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
process {
|
||||||
|
// Testing ext.args for passing arguments into seqtk seq
|
||||||
|
withName: 'SEQTK_SEQ' {
|
||||||
|
ext.args = '-A'
|
||||||
|
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
||||||
|
}
|
||||||
|
}
|
21
tests/modules/seqtk/seq/test.yml
Normal file
21
tests/modules/seqtk/seq/test.yml
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
- name: seqtk seq test_seqtk_seq
|
||||||
|
command: nextflow run tests/modules/seqtk/seq -entry test_seqtk_seq -c tests/config/nextflow.config
|
||||||
|
tags:
|
||||||
|
- seqtk/seq
|
||||||
|
- seqtk
|
||||||
|
files:
|
||||||
|
- path: output/seqtk/test.seqtk-seq.fasta.gz
|
||||||
|
md5sum: 50d73992c8c7e56dc095ef47ec52a754
|
||||||
|
- path: output/seqtk/versions.yml
|
||||||
|
md5sum: 2b89cd4a6e28f35fcfbbd2188384f944
|
||||||
|
|
||||||
|
- name: seqtk seq test_seqtk_seq_fq
|
||||||
|
command: nextflow run tests/modules/seqtk/seq -entry test_seqtk_seq_fq -c tests/config/nextflow.config
|
||||||
|
tags:
|
||||||
|
- seqtk/seq
|
||||||
|
- seqtk
|
||||||
|
files:
|
||||||
|
- path: output/seqtk/test.seqtk-seq.fasta.gz
|
||||||
|
md5sum: 2f009f1647971a97b4edec726a99dc1a
|
||||||
|
- path: output/seqtk/versions.yml
|
||||||
|
md5sum: 3467a76d3540bee8f58de050512bddaa
|
Loading…
Reference in a new issue