-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path11_gwaslab_ldsc.bsub
109 lines (88 loc) · 2.04 KB
/
11_gwaslab_ldsc.bsub
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/bin/bash
#BSUB -q long
#BSUB -J gwaslab_ldsc[1-15]
#BSUB -n 16
#BSUB -R "span[ptile=8]"
#BSUB -R "rusage[mem=16GB]"
#BSUB -o /your/out/dir/gwaslab_%J_%I.out
#BSUB -e /your/err/dir/gwaslab_%J_%I.out
#This script creates gwaslab_ldsc output
#modules
module load anaconda3/2021.05
# activate env
source ~/.bashrc
conda activate /.conda/envs/gwaslab
# Here put your file path
path0=/your/dir/for/sumstats
path1=${path0}Cell_B
path2=${path0}Cell_P
path3=${path0}CLL
path4=${path0}DLBCL
path5=${path0}Drug_G1
path6=${path0}FL
path7=${path0}HL
path8=${path0}LM
path9=${path0}LPL_WM
path10=${path0}MGUS
path11=${path0}MM_MGUS
path12=${path0}MM
path13=${path0}MZL
path14=${path0}Soma_G1
path15=${path0}Soma_G2
#phenotypes
pheno1=Cell_B
pheno2=Cell_P
pheno3=CLL
pheno4=DLBCL
pheno5=Drug_G1
pheno6=FL
pheno7=HL
pheno8=LM
pheno9=LPL_WM
pheno10=MGUS
pheno11=MM_MGUS
pheno12=MM
pheno13=MZL
pheno14=Soma_G1
pheno15=Soma_G2
# array
combined1=path${LSB_JOBINDEX}
combined2=pheno${LSB_JOBINDEX}
cd ${!combined1}
# run Python code
python3 - "${!combined1}" "${!combined2}" <<EOF
import gwaslab as gl
import sys
combined1 = sys.argv[1]
combined2 = sys.argv[2]
globals()[combined2] = gl.Sumstats(
f"{combined2}_out_A1FREQ0p001_info0p9.txt.gz",
snpid="SNP",
chrom="CHROM",
pos="GENPOS",
ea="ALLELE1",
nea="ALLELE0",
eaf="A1FREQ",
beta="BETA",
se="SE",
mlog10p="LOG10P",
chisq="CHISQ",
info="INFO",
n="N",
other=["EXTRA"],
ncase="N_CASES",
ncontrol="N_CONTROLS",
sep=" "
)
globals()[combined2].basic_check()
import numpy as np
import scipy.stats as ss
globals()[combined2].fill_data(to_fill=["P","Z","OR","OR_95L","OR_95U"])
globals()[combined2].assign_rsid(
ref_rsid_tsv = gl.get_path("1kg_dbsnp151_hg19_auto"),
ref_rsid_vcf = "/./asset/GCF_000001405.25.gz",
chr_dict = gl.get_number_to_NC(build="19"),
n_cores = 16)
globals()[combined2].to_format(f"{combined2}_ldsc",fmt="ldsc")
# Additional Python code if needed
EOF