GNU parallel is a shell tool for executing jobs in parallel using one or more computers. A job can be a single command or a small script that has to be run for each of the lines in the input. The typical input is a list of files, a list of hosts, a list of users, a list of URLs, or a list of tables. A job can also be a command that reads from a pipe. GNU parallel can then split the input and pipe it into commands in parallel.
安装
- 可以使用一行简单的命令进行安装
(wget -O - pi.dk/3 || curl pi.dk/3/ || fetch -o - [http://pi.dk/3)](http://pi.dk/3)) | bash
- 也可以这样安装
wget http://ftpmirror.gnu.org/parallel/parallel-20160422.tar.bz2
tar -jxvf parallel-20160422.tar.bz2
cd parallel-20160422
./configure && make && sudo make install
简单的使用
- 在这之前我们都这么用:
for i in `ls *fq`; do
fastqc $i
done
- 现在我们可以这么用:
parallel 'fastqc {}' ::: *fq
- :
parallel 'zcat {} > {.}.unpacked' ::: *.gz
find *bam | parallel 'bedtools coverage -hist -abam {} -b target_regions.bed | grep ^all > {}.hist.all.txt'
man parallel