-
Notifications
You must be signed in to change notification settings - Fork 1
/
master.sh
79 lines (64 loc) · 1.55 KB
/
master.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
71
72
73
74
75
76
77
78
79
#!/usr/bin/env bash
#
#
# Extract genotypes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
cd 1_extract_instruments
mkdir -p output
qsub run_education.sh
qsub run_myopia.sh
cd ..
#
# Derive variables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
cd 2_derive_variables
mkdir -p output
Rscript 1_derive_allele_scores.R
Rscript 2_derive_phenotypes.R
Rscript 3_merge_phenotypes_allelescores.R
Rscript 4_make_snptest_sample.R
cd ..
#
# Generate descriptives ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
cd 3_descriptives
mkdir -p output
Rscript 1_describe_data.R
cd ..
#
# Run MR ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
cd 4_MR
mkdir -p output
Rscript 1_MR.R
cd ..
#
# Produce variant plots ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
cd 5_variant_plots
mkdir -p output
Rscript eduAttainInstruments.R
Rscript myopiaInstruments.R
cd ..
#
# Run bias analysis ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
cd 6_bias-analysis
Stata -s do ds_1_bias_plots.do
cd ..
#
# Run MR-base ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Calculate split sample weights
cd 8_MRBase/using_split_sample/1_split_sample_weights
mkdir -p output
Rscript eduAttainInstruments_sampleA.R
Rscript eduAttainInstruments_sampleB.R
Rscript myopiaInstruments_sampleA.R
Rscript myopiaInstruments_sampleB.R
cd ..
# Run MR-base (check which samples used)
mkdir -p output
Rscript EducationA_RefractiveErrorB_MRBase.R
Rscript RefractiveErrorA_EducationB_MRBase.R
cd ../..