mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2025-01-10 15:49:37 -05:00
Replace remaining task.ext.suffix with task.ext.prefix (#1117)
* Replace remaining task.ext.suffix with task.ext.prefix
This commit is contained in:
parent
3b366c7c6a
commit
d473a247d2
31 changed files with 60 additions and 61 deletions
modules
artic/minion
bakta
bcftools
bedtools/getfasta
checkm/lineagewf
csvtk/concat
damageprofiler
dedup
fargene
gatk4/genomicsdbimport
gffread
leehom
msisensor/msi
nextclade
optitype
plasmidid
prodigal
prokka
qualimap
quast
rsem/calculateexpression
salmon/quant
samtools/merge
seqkit/split2
seqtk/subseq
tbprofiler/profile
tests/modules
|
@ -33,7 +33,7 @@ process ARTIC_MINION {
|
||||||
|
|
||||||
script:
|
script:
|
||||||
def args = task.ext.args ?: ''
|
def args = task.ext.args ?: ''
|
||||||
prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}"
|
prefix = task.ext.prefix ?: "${meta.id}"
|
||||||
def version = scheme_version.toString().toLowerCase().replaceAll('v','')
|
def version = scheme_version.toString().toLowerCase().replaceAll('v','')
|
||||||
def fast5 = fast5_dir ? "--fast5-directory $fast5_dir" : ""
|
def fast5 = fast5_dir ? "--fast5-directory $fast5_dir" : ""
|
||||||
def summary = sequencing_summary ? "--sequencing-summary $sequencing_summary" : ""
|
def summary = sequencing_summary ? "--sequencing-summary $sequencing_summary" : ""
|
||||||
|
|
|
@ -27,7 +27,7 @@ process BAKTA {
|
||||||
|
|
||||||
script:
|
script:
|
||||||
def args = task.ext.args ?: ''
|
def args = task.ext.args ?: ''
|
||||||
prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}"
|
prefix = task.ext.prefix ?: "${meta.id}"
|
||||||
def proteins_opt = proteins ? "--proteins ${proteins[0]}" : ""
|
def proteins_opt = proteins ? "--proteins ${proteins[0]}" : ""
|
||||||
def prodigal_opt = prodigal_tf ? "--prodigal-tf ${prodigal_tf[0]}" : ""
|
def prodigal_opt = prodigal_tf ? "--prodigal-tf ${prodigal_tf[0]}" : ""
|
||||||
"""
|
"""
|
||||||
|
@ -47,7 +47,7 @@ process BAKTA {
|
||||||
"""
|
"""
|
||||||
|
|
||||||
stub:
|
stub:
|
||||||
prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}"
|
prefix = task.ext.prefix ?: "${meta.id}"
|
||||||
"""
|
"""
|
||||||
touch ${prefix}.embl
|
touch ${prefix}.embl
|
||||||
touch ${prefix}.faa
|
touch ${prefix}.faa
|
||||||
|
|
|
@ -16,7 +16,7 @@ process BCFTOOLS_CONCAT {
|
||||||
|
|
||||||
script:
|
script:
|
||||||
def args = task.ext.args ?: ''
|
def args = task.ext.args ?: ''
|
||||||
prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}"
|
prefix = task.ext.prefix ?: "${meta.id}"
|
||||||
"""
|
"""
|
||||||
bcftools concat \\
|
bcftools concat \\
|
||||||
--output ${prefix}.vcf.gz \\
|
--output ${prefix}.vcf.gz \\
|
||||||
|
|
|
@ -16,7 +16,7 @@ process BCFTOOLS_ISEC {
|
||||||
|
|
||||||
script:
|
script:
|
||||||
def args = task.ext.args ?: ''
|
def args = task.ext.args ?: ''
|
||||||
prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}"
|
prefix = task.ext.prefix ?: "${meta.id}"
|
||||||
"""
|
"""
|
||||||
bcftools isec \\
|
bcftools isec \\
|
||||||
$args \\
|
$args \\
|
||||||
|
|
|
@ -16,7 +16,7 @@ process BCFTOOLS_MERGE {
|
||||||
|
|
||||||
script:
|
script:
|
||||||
def args = task.ext.args ?: ''
|
def args = task.ext.args ?: ''
|
||||||
prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}"
|
prefix = task.ext.prefix ?: "${meta.id}"
|
||||||
"""
|
"""
|
||||||
bcftools merge -Oz \\
|
bcftools merge -Oz \\
|
||||||
--output ${prefix}.vcf.gz \\
|
--output ${prefix}.vcf.gz \\
|
||||||
|
|
|
@ -17,7 +17,7 @@ process BEDTOOLS_GETFASTA {
|
||||||
|
|
||||||
script:
|
script:
|
||||||
def args = task.ext.args ?: ''
|
def args = task.ext.args ?: ''
|
||||||
def prefix = task.ext.suffix ? "${bed.baseName}${task.ext.suffix}" : "${bed.baseName}"
|
def prefix = task.ext.prefix ?: "${bed.baseName}"
|
||||||
"""
|
"""
|
||||||
bedtools \\
|
bedtools \\
|
||||||
getfasta \\
|
getfasta \\
|
||||||
|
|
|
@ -18,7 +18,7 @@ process CHECKM_LINEAGEWF {
|
||||||
|
|
||||||
script:
|
script:
|
||||||
def args = task.ext.args ?: ''
|
def args = task.ext.args ?: ''
|
||||||
prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}"
|
prefix = task.ext.prefix ?: "${meta.id}"
|
||||||
"""
|
"""
|
||||||
checkm \\
|
checkm \\
|
||||||
lineage_wf \\
|
lineage_wf \\
|
||||||
|
|
|
@ -18,7 +18,7 @@ process CSVTK_CONCAT {
|
||||||
|
|
||||||
script:
|
script:
|
||||||
def args = task.ext.args ?: ''
|
def args = task.ext.args ?: ''
|
||||||
prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}"
|
prefix = task.ext.prefix ?: "${meta.id}"
|
||||||
def delimiter = in_format == "tsv" ? "\t" : (in_format == "csv" ? "," : in_format)
|
def delimiter = in_format == "tsv" ? "\t" : (in_format == "csv" ? "," : in_format)
|
||||||
def out_delimiter = out_format == "tsv" ? "\t" : (out_format == "csv" ? "," : out_format)
|
def out_delimiter = out_format == "tsv" ? "\t" : (out_format == "csv" ? "," : out_format)
|
||||||
out_extension = out_format == "tsv" ? 'tsv' : 'csv'
|
out_extension = out_format == "tsv" ? 'tsv' : 'csv'
|
||||||
|
|
|
@ -19,7 +19,7 @@ process DAMAGEPROFILER {
|
||||||
|
|
||||||
script:
|
script:
|
||||||
def args = task.ext.args ?: ''
|
def args = task.ext.args ?: ''
|
||||||
prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}"
|
prefix = task.ext.prefix ?: "${meta.id}"
|
||||||
def reference = fasta ? "-r $fasta" : ""
|
def reference = fasta ? "-r $fasta" : ""
|
||||||
def species_list = specieslist ? "-sf $specieslist" : ""
|
def species_list = specieslist ? "-sf $specieslist" : ""
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -19,7 +19,7 @@ process DEDUP {
|
||||||
|
|
||||||
script:
|
script:
|
||||||
def args = task.ext.args ?: ''
|
def args = task.ext.args ?: ''
|
||||||
prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}"
|
prefix = task.ext.prefix ?: "${meta.id}"
|
||||||
|
|
||||||
"""
|
"""
|
||||||
dedup \\
|
dedup \\
|
||||||
|
|
|
@ -33,7 +33,7 @@ process FARGENE {
|
||||||
|
|
||||||
script:
|
script:
|
||||||
def args = task.ext.args ?: ''
|
def args = task.ext.args ?: ''
|
||||||
prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}"
|
prefix = task.ext.prefix ?: "${meta.id}"
|
||||||
"""
|
"""
|
||||||
fargene \\
|
fargene \\
|
||||||
$args \\
|
$args \\
|
||||||
|
|
|
@ -21,7 +21,7 @@ process GATK4_GENOMICSDBIMPORT {
|
||||||
|
|
||||||
script:
|
script:
|
||||||
def args = task.ext.args ?: ''
|
def args = task.ext.args ?: ''
|
||||||
prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}"
|
prefix = task.ext.prefix ?: "${meta.id}"
|
||||||
|
|
||||||
// settings for running default create gendb mode
|
// settings for running default create gendb mode
|
||||||
inputs_command = input_map ? "--sample-name-map ${vcf[0]}" : "${'-V ' + vcf.join(' -V ')}"
|
inputs_command = input_map ? "--sample-name-map ${vcf[0]}" : "${'-V ' + vcf.join(' -V ')}"
|
||||||
|
|
|
@ -16,7 +16,7 @@ process GFFREAD {
|
||||||
|
|
||||||
script:
|
script:
|
||||||
def args = task.ext.args ?: ''
|
def args = task.ext.args ?: ''
|
||||||
def prefix = task.ext.suffix ? "${gff.baseName}${task.ext.suffix}" : "${gff.baseName}"
|
def prefix = task.ext.prefix ?: "${gff.baseName}"
|
||||||
"""
|
"""
|
||||||
gffread \\
|
gffread \\
|
||||||
$gff \\
|
$gff \\
|
||||||
|
|
|
@ -25,7 +25,7 @@ process LEEHOM {
|
||||||
|
|
||||||
script:
|
script:
|
||||||
def args = task.ext.args ?: ''
|
def args = task.ext.args ?: ''
|
||||||
prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}"
|
prefix = task.ext.prefix ?: "${meta.id}"
|
||||||
|
|
||||||
if (reads.toString().endsWith('.bam')) {
|
if (reads.toString().endsWith('.bam')) {
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -19,7 +19,7 @@ process MSISENSOR_MSI {
|
||||||
|
|
||||||
script:
|
script:
|
||||||
def args = task.ext.args ?: ''
|
def args = task.ext.args ?: ''
|
||||||
prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}"
|
prefix = task.ext.prefix ?: "${meta.id}"
|
||||||
"""
|
"""
|
||||||
msisensor \\
|
msisensor \\
|
||||||
msi \\
|
msi \\
|
||||||
|
|
|
@ -20,7 +20,7 @@ process NEXTCLADE {
|
||||||
|
|
||||||
script:
|
script:
|
||||||
def args = task.ext.args ?: ''
|
def args = task.ext.args ?: ''
|
||||||
prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}"
|
prefix = task.ext.prefix ?: "${meta.id}"
|
||||||
"""
|
"""
|
||||||
nextclade \\
|
nextclade \\
|
||||||
$args \\
|
$args \\
|
||||||
|
|
|
@ -17,7 +17,7 @@ process OPTITYPE {
|
||||||
script:
|
script:
|
||||||
def args = task.ext.args ?: ''
|
def args = task.ext.args ?: ''
|
||||||
def args2 = task.ext.args2 ?: ''
|
def args2 = task.ext.args2 ?: ''
|
||||||
prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}"
|
prefix = task.ext.prefix ?: "${meta.id}"
|
||||||
|
|
||||||
"""
|
"""
|
||||||
# Create a config for OptiType on a per sample basis with task.ext.args2
|
# Create a config for OptiType on a per sample basis with task.ext.args2
|
||||||
|
|
|
@ -24,7 +24,7 @@ process PLASMIDID {
|
||||||
|
|
||||||
script:
|
script:
|
||||||
def args = task.ext.args ?: ''
|
def args = task.ext.args ?: ''
|
||||||
prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}"
|
prefix = task.ext.prefix ?: "${meta.id}"
|
||||||
"""
|
"""
|
||||||
plasmidID \\
|
plasmidID \\
|
||||||
-d $fasta \\
|
-d $fasta \\
|
||||||
|
|
|
@ -20,7 +20,7 @@ process PRODIGAL {
|
||||||
|
|
||||||
script:
|
script:
|
||||||
def args = task.ext.args ?: ''
|
def args = task.ext.args ?: ''
|
||||||
prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}"
|
prefix = task.ext.prefix ?: "${meta.id}"
|
||||||
"""
|
"""
|
||||||
prodigal -i "${genome}" \\
|
prodigal -i "${genome}" \\
|
||||||
$args \\
|
$args \\
|
||||||
|
|
|
@ -29,7 +29,7 @@ process PROKKA {
|
||||||
|
|
||||||
script:
|
script:
|
||||||
def args = task.ext.args ?: ''
|
def args = task.ext.args ?: ''
|
||||||
prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}"
|
prefix = task.ext.prefix ?: "${meta.id}"
|
||||||
def proteins_opt = proteins ? "--proteins ${proteins[0]}" : ""
|
def proteins_opt = proteins ? "--proteins ${proteins[0]}" : ""
|
||||||
def prodigal_opt = prodigal_tf ? "--prodigaltf ${prodigal_tf[0]}" : ""
|
def prodigal_opt = prodigal_tf ? "--prodigaltf ${prodigal_tf[0]}" : ""
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -18,7 +18,7 @@ process QUALIMAP_BAMQC {
|
||||||
|
|
||||||
script:
|
script:
|
||||||
def args = task.ext.args ?: ''
|
def args = task.ext.args ?: ''
|
||||||
prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}"
|
prefix = task.ext.prefix ?: "${meta.id}"
|
||||||
|
|
||||||
def collect_pairs = meta.single_end ? '' : '--collect-overlap-pairs'
|
def collect_pairs = meta.single_end ? '' : '--collect-overlap-pairs'
|
||||||
def memory = task.memory.toGiga() + "G"
|
def memory = task.memory.toGiga() + "G"
|
||||||
|
|
|
@ -17,7 +17,7 @@ process QUALIMAP_RNASEQ {
|
||||||
|
|
||||||
script:
|
script:
|
||||||
def args = task.ext.args ?: ''
|
def args = task.ext.args ?: ''
|
||||||
prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}"
|
prefix = task.ext.prefix ?: "${meta.id}"
|
||||||
def paired_end = meta.single_end ? '' : '-pe'
|
def paired_end = meta.single_end ? '' : '-pe'
|
||||||
def memory = task.memory.toGiga() + "G"
|
def memory = task.memory.toGiga() + "G"
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ process QUAST {
|
||||||
|
|
||||||
script:
|
script:
|
||||||
def args = task.ext.args ?: ''
|
def args = task.ext.args ?: ''
|
||||||
prefix = task.ext.suffix ?: 'quast'
|
prefix = task.ext.prefix ?: 'quast'
|
||||||
def features = use_gff ? "--features $gff" : ''
|
def features = use_gff ? "--features $gff" : ''
|
||||||
def reference = use_fasta ? "-r $fasta" : ''
|
def reference = use_fasta ? "-r $fasta" : ''
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -24,7 +24,7 @@ process RSEM_CALCULATEEXPRESSION {
|
||||||
|
|
||||||
script:
|
script:
|
||||||
def args = task.ext.args ?: ''
|
def args = task.ext.args ?: ''
|
||||||
prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}"
|
prefix = task.ext.prefix ?: "${meta.id}"
|
||||||
|
|
||||||
def strandedness = ''
|
def strandedness = ''
|
||||||
if (meta.strandedness == 'forward') {
|
if (meta.strandedness == 'forward') {
|
||||||
|
|
|
@ -21,7 +21,7 @@ process SALMON_QUANT {
|
||||||
|
|
||||||
script:
|
script:
|
||||||
def args = task.ext.args ?: ''
|
def args = task.ext.args ?: ''
|
||||||
prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}"
|
prefix = task.ext.prefix ?: "${meta.id}"
|
||||||
|
|
||||||
def reference = "--index $index"
|
def reference = "--index $index"
|
||||||
def input_reads = meta.single_end ? "-r $reads" : "-1 ${reads[0]} -2 ${reads[1]}"
|
def input_reads = meta.single_end ? "-r $reads" : "-1 ${reads[0]} -2 ${reads[1]}"
|
||||||
|
|
|
@ -18,7 +18,7 @@ process SAMTOOLS_MERGE {
|
||||||
|
|
||||||
script:
|
script:
|
||||||
def args = task.ext.args ?: ''
|
def args = task.ext.args ?: ''
|
||||||
prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}"
|
prefix = task.ext.prefix ?: "${meta.id}"
|
||||||
def file_type = input_files[0].getExtension()
|
def file_type = input_files[0].getExtension()
|
||||||
def reference = fasta ? "--reference ${fasta}" : ""
|
def reference = fasta ? "--reference ${fasta}" : ""
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -17,7 +17,6 @@ process SEQKIT_SPLIT2 {
|
||||||
script:
|
script:
|
||||||
def args = task.ext.args ?: ''
|
def args = task.ext.args ?: ''
|
||||||
def prefix = task.ext.prefix ?: "${meta.id}"
|
def prefix = task.ext.prefix ?: "${meta.id}"
|
||||||
|
|
||||||
if(meta.single_end){
|
if(meta.single_end){
|
||||||
"""
|
"""
|
||||||
seqkit \\
|
seqkit \\
|
||||||
|
|
|
@ -17,7 +17,7 @@ process SEQTK_SUBSEQ {
|
||||||
|
|
||||||
script:
|
script:
|
||||||
def args = task.ext.args ?: ''
|
def args = task.ext.args ?: ''
|
||||||
def prefix = task.ext.suffix ?: ''
|
def prefix = task.ext.prefix ?: ''
|
||||||
def ext = "fa"
|
def ext = "fa"
|
||||||
if ("$sequences" ==~ /.+\.fq|.+\.fq.gz|.+\.fastq|.+\.fastq.gz/) {
|
if ("$sequences" ==~ /.+\.fq|.+\.fq.gz|.+\.fastq|.+\.fastq.gz/) {
|
||||||
ext = "fq"
|
ext = "fq"
|
||||||
|
|
|
@ -20,7 +20,7 @@ process TBPROFILER_PROFILE {
|
||||||
|
|
||||||
script:
|
script:
|
||||||
def args = task.ext.args ?: ''
|
def args = task.ext.args ?: ''
|
||||||
prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}"
|
prefix = task.ext.prefix ?: "${meta.id}"
|
||||||
def input_reads = meta.single_end ? "--read1 $reads" : "--read1 ${reads[0]} --read2 ${reads[1]}"
|
def input_reads = meta.single_end ? "--read1 $reads" : "--read1 ${reads[0]} --read2 ${reads[1]}"
|
||||||
"""
|
"""
|
||||||
tb-profiler \\
|
tb-profiler \\
|
||||||
|
|
|
@ -3,7 +3,7 @@ process {
|
||||||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
||||||
|
|
||||||
withName: GFFREAD {
|
withName: GFFREAD {
|
||||||
ext.prefix = { "${meta.id}.out" }
|
ext.prefix = { "${gff.baseName}.out" }
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ process {
|
||||||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
||||||
|
|
||||||
withName: SEQTK_SUBSEQ {
|
withName: SEQTK_SUBSEQ {
|
||||||
ext.prefix = { "${meta.id}.filtered" }
|
ext.prefix = { ".filtered" }
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue