-
Notifications
You must be signed in to change notification settings - Fork 9
/
gcta-slct.ini
54 lines (49 loc) · 2.2 KB
/
gcta-slct.ini
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
#!/bin/bash
# 26-10-2018 MRC-Epid JHZ
export PATH=/genetics/bin:/usr/local/bin:$PATH
export rt=/gen_omics/data/EPIC-Norfolk/HRC/binary_ped
export bfile=$rt/HRC
export idfile=$rt/id3.txt.gz
export remove_sample=$rt/exclude.id
export exclude_snp=$rt/exclude.snps
export threads=10
export region=0
how_to_setup() {
stata <<END
gzuse /gen_omics/data/EPIC-Norfolk/HRC/SNPinfo
gen snpid=string(chr)+":"+string(pos,"%12.0f")+cond(A1<A2,"_"+A1+"_"+A2,"_"+A2+"_"+A1)
sort snpid
gen maf=cond(FreqA2<=0.5, FreqA2, 1-FreqA2)
gen MAC=2*21044*maf
outsheet snpid if (MAC<3 | info<0.4) using exclude.snps, noname noquote replace
keep snpid rsid RSnum
order snpid rsid RSnum
outsheet using /gen_omics/data/EPIC-Norfolk/HRC/binary_ped/id3.txt, delim(" ") noname noquote replace
!gzip -f /gen_omics/data/EPIC-Norfolk/HRC/binary_ped/id3.txt
END
export GEN=/gen_omics/data/EPIC-Norfolk/HRC
export sample=/gen_omics/data/EPIC-Norfolk/HRC/EPIC-Norfolk.sample
cd /gen_omics/data/EPIC-Norfolk/HRC/binary_ped
seq 22 | \
parallel --env GEN --env sample -C' ' '
sge "/genetics/bin/plink2 --bgen $GEN/chr{}.bgen --sample $sample --chr {} --make-bed --out chr{}"'
rm -f merge-list
touch merge-list
for i in $(seq 22); do echo chr${i} >> merge-list; done
/genetics/bin/plink-1.9 --merge-list merge-list --make-bed --out HRC
}
# Additional notes on regional GCTA analysis (Courtesy of Prof Jian Yang on 9 January 2018)
## http://cnsgenomics.com/software/gcta/#Datamanagement
## --extract-snp rs123678
## Specify a SNP to be included in the analysis.
## --exclude-snp rs123678
## Specify a single SNP to be excluded from the analysis.
## --extract-region-snp rs123678 1000
## Extract a region centred around a specified SNP, e.g. +-1000Kb region centred around rs123678.
## --exclude-region-snp rs123678 1000
## Exclude a region centred around a specified SNP, e.g. +-1000Kb region centred around rs123678.
## --extract-region-bp 1 120000 1000
## Extract a region centred around a specified bp, e.g. +-1000Kb region centred around 120,000bp of chr 1.
## --exclude-region-bp 1 120000 1000
## Exclude a region centred around a specified bp, e.g. +-1000Kb region centred around 120,000bp of chr 1.
## This option is particularly useful for a analysis excluding the MHC region.