nf-core_modules/modules/isoseq3/refine/main.nf
Sébastien Guizard 79d38a306b
New module: isoseq3/refine (#748)
* 📦 NEW: Add isoseq3/refine module

* 👌 IMPROVE: Add some pacbio test files

* 🐛 FIX: Add Pacbio index to test_data.config

* 👌 IMPROVE: Re add 10000 data test

* 👌 IMPROVE: Add parallelization

* 🐛 FIX: Correct Typo

* 👌 IMPROVE: Add some pbindex

* 🐛 FIX: Add pbi extension to files

* 👌 IMPROVE: The module accept one channel (primers moved into the first channel)

* 👌 IMPROVE: Assign a value channel to primers input 

Improve workflow code readability

* 👌 IMPROVE: Update to the version of templates

* 👌 IMPROVE: Update module to last template version

* 👌 IMPROVE: Remove pbi from input files

* 👌 IMPROVE: Update test file

* 👌 IMPROVE: Final version of test datasets config

* 👌 IMPROVE: Remove useless index + Fix Typos

* 👌 IMPROVE: Fill contains args

* 📦 NEW: Add isoseq3/refine module

* 👌 IMPROVE: Add parallelization

* 🐛 FIX: Correct Typo

* 👌 IMPROVE: Add some pacbio test files

* 🐛 FIX: Add Pacbio index to test_data.config

* 👌 IMPROVE: Re add 10000 data test

* 👌 IMPROVE: Add some pbindex

* 🐛 FIX: Add pbi extension to files

* 👌 IMPROVE: The module accept one channel (primers moved into the first channel)

* 👌 IMPROVE: Assign a value channel to primers input 

Improve workflow code readability

* 👌 IMPROVE: Update to the version of templates

* 👌 IMPROVE: Update module to last template version

* 👌 IMPROVE: Remove pbi from input files

* 👌 IMPROVE: Update test file

* 👌 IMPROVE: Final version of test datasets config

* 👌 IMPROVE: Remove useless index + Fix Typos

* 👌 IMPROVE: Fill contains args

* 👌 IMPROVE: Add one channel per output file

* 👌 IMPROVE: Minor updates

* 👌 IMPROVE: Minors Update

- Remove TODO from test.yml
- Remove useless piece of code

* 📦 NEW: Add isoseq3/refine module

* 👌 IMPROVE: Add parallelization

* 🐛 FIX: Correct Typo

* 👌 IMPROVE: Add some pacbio test files

* 🐛 FIX: Add Pacbio index to test_data.config

* 👌 IMPROVE: Re add 10000 data test

* 👌 IMPROVE: Add some pbindex

* 🐛 FIX: Add pbi extension to files

* 👌 IMPROVE: The module accept one channel (primers moved into the first channel)

* 👌 IMPROVE: Assign a value channel to primers input 

Improve workflow code readability

* 👌 IMPROVE: Update to the version of templates

* 👌 IMPROVE: Update module to last template version

* 👌 IMPROVE: Remove pbi from input files

* 👌 IMPROVE: Update test file

* 👌 IMPROVE: Fill contains args

* 📦 NEW: Add isoseq3/refine module

* 👌 IMPROVE: Add parallelization

* 🐛 FIX: Correct Typo

* 👌 IMPROVE: Add some pacbio test files

* 🐛 FIX: Add Pacbio index to test_data.config

* 👌 IMPROVE: Re add 10000 data test

* 👌 IMPROVE: Add some pbindex

* 🐛 FIX: Add pbi extension to files

* 👌 IMPROVE: The module accept one channel (primers moved into the first channel)

* 👌 IMPROVE: Assign a value channel to primers input 

Improve workflow code readability

* 👌 IMPROVE: Update to the version of templates

* 👌 IMPROVE: Update module to last template version

* 👌 IMPROVE: Remove pbi from input files

* 👌 IMPROVE: Update test file

* 👌 IMPROVE: Add one channel per output file

* 👌 IMPROVE: Minor updates

* 👌 IMPROVE: Minors Update

- Remove TODO from test.yml
- Remove useless piece of code

* 🐛 FIX: Remove unwanted files

* 🐛 FIX: Protect \

* 🐛 FIX: Remove test files

* Apply suggestions from code review

* Apply suggestions from code review

* Update tests/modules/isoseq3/refine/test.yml

Co-authored-by: Gregor Sturm <mail@gregor-sturm.de>
Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>
2021-10-06 11:13:48 +01:00

49 lines
1.7 KiB
Text

// Import generic module functions
include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
params.options = [:]
options = initOptions(params.options)
process ISOSEQ3_REFINE {
tag "$meta.id"
label 'process_medium'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) }
conda (params.enable_conda ? "bioconda::isoseq3=3.4.0" : null)
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/isoseq3:3.4.0--0"
} else {
container "quay.io/biocontainers/isoseq3:3.4.0--0"
}
input:
tuple val(meta), path(bam)
path primers
output:
tuple val(meta), path("*.bam") , emit: bam
tuple val(meta), path("*.bam.pbi") , emit: pbi
tuple val(meta), path("*.consensusreadset.xml"), emit: consensusreadset
tuple val(meta), path("*.filter_summary.json") , emit: summary
tuple val(meta), path("*.report.csv") , emit: report
path "versions.yml" , emit: versions
script:
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
"""
isoseq3 \\
refine \\
-j $task.cpus \\
$options.args \\
$bam \\
$primers \\
${prefix}.bam
cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$( isoseq3 refine --version|sed 's/isoseq refine //'|sed 's/ (commit.\\+//' )
END_VERSIONS
"""
}