-
Notifications
You must be signed in to change notification settings - Fork 0
/
Coloc2_parallel
executable file
·60 lines (44 loc) · 1.5 KB
/
Coloc2_parallel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
#########################################################################
# File Name: Coloc2_parallel
# Author: CJB
# mail: johnlcd@stu.xjtu.edu.cn
# Created Time: Thu Jun 6 18:12:50 CST 2019
#########################################################################
if [ $# == "12" ] && [ ${1} == "-g" ] && [ ${3} == "-e" ] && [ ${5} == "-o" ] && [ ${7} == "-t" ] && [ ${9} == "-n" ] && [ ${11} == "-c" ]
then
gwas_file=${2}
eqtl_file=${4}
outfile=${6}
TP=${8}
NT=${10}
cores=${12}
DAT=`date | sed 's/ /_/g'`
log=${outfile}_${DAT}.run.COLOC2.log
echo ">>> Start to run COLOC2 ==> ==> ==> " > ${log}
echo " Time is: ${DAT}" >> ${log}
CMD="nohup Rcmd BATCH --slave \"--args ${gwas_file} ${eqtl_file} ${outfile} ${TP} ${NT} ${cores}\" /home/chenjiabin/tools/COLOC2/run_Coloc2.R ${log}"
echo ">>> Command: " >> ${log}
echo " ${CMD}" | sed 's/nohup //g' >> ${log}
echo ${CMD} | parallel -j 1
echo ">>> Runing of COLOC2 finished, output result: " >> ${log}
echo " ${outfile}" >> ${log}
else \
echo ======================================
echo " "
echo USAGE:
echo " "
echo " $0 -g <gwas_file> -e <eqtl_file> -o <outfile prefix> -t <type of phenotype (\"cc\", \"quangt\")> -n <sample number> -c <cores> "
echo " "
echo --------------------------------------
echo " "
echo EXAMPLEs:
echo " "
echo " $0 -g GWAS.anno -e eQTL.anno -o result -t quant -n 10000 -c 20 "
echo " "
echo ======================================
echo " "
echo Command is: $0 $*
echo " "
fi
## END