forked from joyceyiyiwang/Portability_Questions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
10a_compare_heritability.sh
53 lines (44 loc) · 1.41 KB
/
10a_compare_heritability.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
45
46
47
48
49
50
51
52
53
#!/bin/bash
#SBATCH -J compare_genetic_variance
#SBATCH -o compare_genetic_variance.o%j
#SBATCH -e compare_genetic_variance.o%j
#SBATCH -p normal
#SBATCH -N 1
#SBATCH -n 1
#SBATCH -t 4:00:00
#SBATCH -A OTH21148
#SBATCH [email protected]
#SBATCH --mail-type=begin
#SBATCH --mail-type=end
set -e
source /work2/06568/joyce_w/stampede2/software/anaconda3/etc/profile.d/conda.sh
conda init bash
conda activate pgs
plink='/work2/06568/joyce_w/stampede2/software/plink/plink/plink'
plink2='/work2/06568/joyce_w/stampede2/software/plink/plink2/plink2'
# Directory
scratch='/scratch/06568/joyce_w/pgs_portability_questions/data'
# Calculate heterozygosity in the GWAS group
$plink \
--bfile ${scratch}/ukb_merged/ukb_merged \
--keep data/ukb_populations/wb_gwas_id.txt \
--extract data/pgs/all_pgs_snps.txt \
--freqx \
--out data/heterozygosity/heterozygosity_wb
# Calculate heterozygosity in the "close" group
$plink \
--bfile ${scratch}/ukb_merged/ukb_merged \
--keep data/ukb_populations/close_id.txt \
--extract data/pgs/all_pgs_snps.txt \
--freqx \
--out data/heterozygosity/heterozygosity_close
# Calculate heterozygosity in the "far" group
$plink \
--bfile ${scratch}/ukb_merged/ukb_merged \
--keep data/ukb_populations/far_id.txt \
--extract data/pgs/all_pgs_snps.txt \
--freqx \
--out data/heterozygosity/heterozygosity_far
# Make the plots
Rscript 10b_heritability_plots.R
conda deactivate