forked from joyceyiyiwang/Portability_Questions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
04e_after_clumping.sh
44 lines (36 loc) · 1.18 KB
/
04e_after_clumping.sh
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
#!/bin/bash
#SBATCH -J post-clump
#SBATCH -o post-clump.o%j
#SBATCH -e post-clump.o%j
#SBATCH -p normal
#SBATCH -N 3
#SBATCH -n 10
#SBATCH -t 48:00:00
#SBATCH -A OTH21148
#SBATCH [email protected]
#SBATCH --mail-type=begin
#SBATCH --mail-type=end
set -e
plink="/work2/06568/joyce_w/stampede2/software/plink/plink/plink"
# Directory
scratch='/scratch/06568/joyce_w/pgs_portability_questions/data'
cat data/pgs/*_threshold_4.txt | uniq > data/pgs/all_pgs_snps.txt
for chromosome in $(seq 1 22);
do
$plink \
--bfile ${scratch}/ukb_filtered/chr${chromosome}_filtered \
--extract data/pgs/all_pgs_snps.txt \
--remove data/ukb_populations/wb_gwas_id.txt \
--memory 70000 \
--make-bed \
--out ${scratch}/pgs/chr${chromosome}_temp
printf "/scratch/06568/joyce_w/pgs_portability_questions/data/pgs/chr%s_temp\n" $chromosome >> data/pgs/pgs_merged_list.txt
done
# Combine extracted SNPs across chromosomes into a single Plink 1 file of all
# SNPs that meet the least extreme level of significance for any of the traits.
$plink \
--merge-list data/pgs/pgs_merged_list.txt \
--make-bed \
--memory 70000 \
--out ${scratch}/pgs/CT_merged
rm ${scratch}/pgs/chr*_temp*