-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprepare_cv_datasets.sh
70 lines (63 loc) · 1.85 KB
/
prepare_cv_datasets.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
source constants_.sh
source parse_args.sh "$@"
source init_args_cv.sh
if [[ ! -f ${imp_path}ds_${pheno}_${pop}${train_suffix}.bed ]]; then
plink2 \
--bfile ${base_imp_path}ds \
--keep ${target_path}pheno_${pheno}_${pop}${train_suffix} \
--maf 0.05 \
--geno 0.1 \
--mind 0.1 \
--make-bed \
--memory 20000 \
--threads 5 \
--out ${imp_path}ds_${pheno}_${pop}${train_suffix}
fi
if [[ ! -f ${imp_path}ds_${pheno}_${pop}${test_suffix}.bed ]]; then
plink2 \
--bfile ${base_imp_path}ds \
--keep ${target_path}pheno_${pheno}_${pop}${test_suffix} \
--maf 0.05 \
--geno 0.1 \
--mind 0.1 \
--make-bed \
--memory 20000 \
--threads 5 \
--out ${imp_path}ds_${pheno}_${pop}${test_suffix}
fi
if [[ ! -f ${imp_path}ds_${pheno}_${pop}${train_suffix}.eigenvec ]]; then
echo '### calculate the first 6 PCs for train set###'
plink \
--bfile ${imp_path}ds_${pheno}_${pop}${train_suffix} \
--indep-pairwise 200 50 0.25 \
--memory 20000 \
--threads 5 \
--out ${imp_path}ds_${pheno}_${pop}${train_suffix}
plink \
--bfile ${imp_path}ds_${pheno}_${pop}${train_suffix} \
--extract ${imp_path}ds_${pheno}_${pop}${train_suffix}.prune.in \
--pca 6 \
--mind 1 \
--memory 20000 \
--threads 5 \
--out ${imp_path}ds_${pheno}_${pop}${train_suffix} \
--geno 1
fi
if [[ ! -f ${imp_path}ds_${pheno}_${pop}${test_suffix}.eigenvec ]]; then
echo '### calculate the first 6 PCs for train set###'
plink \
--bfile ${imp_path}ds_${pheno}_${pop}${test_suffix} \
--indep-pairwise 200 50 0.25 \
--memory 20000 \
--threads 5 \
--out ${imp_path}ds_${pheno}_${pop}${test_suffix}
plink \
--bfile ${imp_path}ds_${pheno}_${pop}${test_suffix} \
--extract ${imp_path}ds_${pheno}_${pop}${test_suffix}.prune.in \
--pca 6 \
--mind 1 \
--out ${imp_path}ds_${pheno}_${pop}${test_suffix} \
--geno 1 \
--memory 20000 \
--threads 5
fi