Update main.nf

This commit is contained in:
Harshil Patel 2021-11-15 17:57:39 +00:00 committed by GitHub
parent 572e71c881
commit 4ba67a97fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,23 +1,6 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions' include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
// TODO nf-core: If in doubt look at other nf-core/modules to see how we are doing things! :)
// https://github.com/nf-core/modules/tree/master/software
// You can also ask for help via your pull request or on the #modules channel on the nf-core Slack workspace:
// https://nf-co.re/join
// TODO nf-core: A module file SHOULD only define input and output files as command-line parameters.
// All other parameters MUST be provided as a string i.e. "options.args"
// where "params.options" is a Groovy Map that MUST be provided via the addParams section of the including workflow.
// Any parameters that need to be evaluated in the context of a particular sample
// e.g. single-end/paired-end data MUST also be defined and evaluated appropriately.
// TODO nf-core: Software that can be piped together SHOULD be added to separate module files
// unless there is a run-time, storage advantage in implementing in this way
// e.g. it's ok to have a single module for bwa to output BAM instead of SAM:
// bwa mem | samtools view -B -T ref.fasta
// TODO nf-core: Optional inputs are not currently supported by Nextflow. However, using an empty
// list (`[]`) instead of a file can be used to work around this issue.
params.options = [:] params.options = [:]
options = initOptions(params.options) options = initOptions(params.options)
@ -39,14 +22,14 @@ process BUSTOOLS_SORT {
tuple val(meta), path(bus) tuple val(meta), path(bus)
output: output:
tuple val(meta), path("${prefix}.sorted.bus"), emit: bus tuple val(meta), path("*.bus"), emit: bus
path "versions.yml" , emit: versions path "versions.yml" , emit: versions
script: script:
prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
""" """
bustools sort \\ bustools sort \\
-o ${prefix}.sorted.bus \\ -o ${prefix}.bus \\
-t $task.cpus \\ -t $task.cpus \\
-m ${task.memory.toGiga()}G \\ -m ${task.memory.toGiga()}G \\
$options.args \\ $options.args \\