This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to parallel task in bash elegantly?

Are there any elegant way to parallel processing in bash? Something like R packages "parallel" or Python module "multiprocessing"! Thanks!

bash parallel

Hello wang.yiguan!

Questions similar to yours can already be found at:

We have closed your question to allow us to keep similar content in the same thread.

If you disagree with this please tell us why in a reply below. We'll be happy to talk about it.

Cheers!

PS: many duplicate on biostars.search for gnu parallel, Makefile , snakemake, cwl, xargs ...

1 answer

GNU parallel is a very flexible tool for this, e.g.

ls *.fastq | parallel -j 8 'bwa mem ref.fa {} > {.}.sam'

Use 8 jobs, do alignment for each file in *.fastq, output is input without extension (+ .sam).

Log in to answer this question.