好使的方法就是能让你省时,省力,爽!
看着这滚动的屏,一个一个蹦出来,爽吗?
#!/bin/bash
start=`date +%s`
for file in `ls tot_*_sort_dss`;do
{
awk '{print $1"\t"$2}' $file > /data/amao/DSS/result/samplepos/$file.pos
echo 'success '$file;
}&
done
wait
end=`date +%s`
echo "TIME:`expr $end - $start`"
比如我要同时对3个样本进行fastqc,我可以写下面的shell脚本,同时批量进行:
ls *.sra
vi cmd2_sra2fq.sh
#!/bin/bash
fastq-dump EV1.sra & #&表示并行处理
fastq-dump EV2.sra &
fastq-dump EV3.sra &
wait
#利用多核优势,同时挂起,然后继续
fastqc EV1.sra &
fastqc EV2.sra &
fastqc EV3.sra &
wait
sh cmd2_sra2fq.sh
网友评论