Specify in guidelines one should split CPUs when module has n > 1 tool (#660)

* Specify more guidelines on input channels

* Linting

* Updates based on code review

* Update README.md

* Fix broken sentence

* Describe CPU splitting

* Update README.md

Co-authored-by: Gregor Sturm <mail@gregor-sturm.de>

* More CPU examples

Co-authored-by: Gregor Sturm <mail@gregor-sturm.de>
This commit is contained in:
James A. Fellows Yates 2021-08-17 15:43:25 +02:00 committed by GitHub
parent 69b21f0dc0
commit 6c633ef305
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -457,6 +457,10 @@ using a combination of `bwa` and `samtools` to output a BAM file instead of a SA
- If the tool supports multi-threading then you MUST provide the appropriate parameter using the Nextflow `task` variable e.g. `--threads $task.cpus`.
- If a module contains _multiple_ tools that supports multi-threading (e.g. [piping output into a samtools command](https://github.com/nf-core/modules/blob/28b023e6f4d0d2745406d9dc6e38006882804e67/modules/bowtie2/align/main.nf#L32-L46)), you MUST assign cpus per tool such that the total number of used CPUs does not exceed `task.cpus`.
- For example, combining two (or more) tools that both (all) have multi-threading, this can be assigned to the variable [`split_cpus`](https://github.com/nf-core/modules/blob/28b023e6f4d0d2745406d9dc6e38006882804e67/modules/bowtie2/align/main.nf#L32)
- If one tool is multi-threaded and another uses a single thread, you can specify directly in the command itself e.g. with [`${task.cpus - 1}`](https://github.com/nf-core/modules/blob/6e68c1af9a514bb056c0513ebba6764efd6750fc/modules/bwa/sampe/main.nf#L42-L43)
#### Software requirements
[BioContainers](https://biocontainers.pro/#/) is a registry of Docker and Singularity containers automatically created from all of the software packages on [Bioconda](https://bioconda.github.io/). Where possible we will use BioContainers to fetch pre-built software containers and Bioconda to install software using Conda.