Parallel

2016-04-24  本文已影响109人  6有才

Parallel是一个shell工具,可以在一台或者多台计算机上并行执行任务。和xargs有相似的使用方法,能代替shell中的大部分循环操作并且使任务变得更快,更多详细内容请自己慢慢看~

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
上一篇下一篇

猜你喜欢

热点阅读