Last updated: 2021-03-03

Checks: 7 0

Knit directory: PSYMETAB/

This reproducible R Markdown analysis was created with workflowr (version 1.6.0). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(20191126) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility. The version displayed above was the version of the Git repository at the time these results were generated.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    ._docs
    Ignored:    .drake/
    Ignored:    analysis/.Rhistory
    Ignored:    analysis/._GWAS.Rmd
    Ignored:    analysis/._data_processing_in_genomestudio.Rmd
    Ignored:    analysis/._quality_control.Rmd
    Ignored:    analysis/GWAS/
    Ignored:    analysis/PRS/
    Ignored:    analysis/QC/
    Ignored:    analysis/Rlogo2.png
    Ignored:    analysis/rplot.jpg
    Ignored:    data/processed/
    Ignored:    data/raw/
    Ignored:    packrat/lib-R/
    Ignored:    packrat/lib-ext/
    Ignored:    packrat/lib/
    Ignored:    process_init_10_clustermq.out
    Ignored:    process_init_11_clustermq.out
    Ignored:    process_init_12_clustermq.out
    Ignored:    process_init_13_clustermq.out
    Ignored:    process_init_14_clustermq.out
    Ignored:    process_init_15_clustermq.out
    Ignored:    process_init_16_clustermq.out
    Ignored:    process_init_17_clustermq.out
    Ignored:    process_init_18_clustermq.out
    Ignored:    process_init_19_clustermq.out
    Ignored:    process_init_1_clustermq.out
    Ignored:    process_init_20_clustermq.out
    Ignored:    process_init_21_clustermq.out
    Ignored:    process_init_22_clustermq.out
    Ignored:    process_init_2_clustermq.out
    Ignored:    process_init_3_clustermq.out
    Ignored:    process_init_4_clustermq.out
    Ignored:    process_init_5_clustermq.out
    Ignored:    process_init_6_clustermq.out
    Ignored:    process_init_7_clustermq.out
    Ignored:    process_init_8_clustermq.out
    Ignored:    process_init_9_clustermq.out
    Ignored:    prs_1_clustermq.out
    Ignored:    prs_2_clustermq.out
    Ignored:    prs_3_clustermq.out
    Ignored:    prs_4_clustermq.out
    Ignored:    prs_5_clustermq.out
    Ignored:    prs_6_clustermq.out
    Ignored:    prs_7_clustermq.out
    Ignored:    prs_8_clustermq.out
    Ignored:    ukbb_analysis_10_clustermq.out
    Ignored:    ukbb_analysis_11_clustermq.out
    Ignored:    ukbb_analysis_12_clustermq.out
    Ignored:    ukbb_analysis_13_clustermq.out
    Ignored:    ukbb_analysis_14_clustermq.out
    Ignored:    ukbb_analysis_15_clustermq.out
    Ignored:    ukbb_analysis_16_clustermq.out
    Ignored:    ukbb_analysis_17_clustermq.out
    Ignored:    ukbb_analysis_18_clustermq.out
    Ignored:    ukbb_analysis_19_clustermq.out
    Ignored:    ukbb_analysis_1_clustermq.out
    Ignored:    ukbb_analysis_20_clustermq.out
    Ignored:    ukbb_analysis_21_clustermq.out
    Ignored:    ukbb_analysis_22_clustermq.out
    Ignored:    ukbb_analysis_2_clustermq.out
    Ignored:    ukbb_analysis_3_clustermq.out
    Ignored:    ukbb_analysis_4_clustermq.out
    Ignored:    ukbb_analysis_5_clustermq.out
    Ignored:    ukbb_analysis_6_clustermq.out
    Ignored:    ukbb_analysis_7_clustermq.out
    Ignored:    ukbb_analysis_8_clustermq.out
    Ignored:    ukbb_analysis_9_clustermq.out

Untracked files:
    Untracked:  Rlogo.png
    Untracked:  Rlogo2.png
    Untracked:  analysis_prep.log
    Untracked:  download_impute.log
    Untracked:  extract_sig.log
    Untracked:  grs.log
    Untracked:  init_analysis.log
    Untracked:  output/PSYMETAB_GWAS_UKBB_comparison.csv
    Untracked:  output/PSYMETAB_GWAS_UKBB_comparison2.csv
    Untracked:  output/PSYMETAB_GWAS_baseline_CEU_result.csv
    Untracked:  output/PSYMETAB_GWAS_subgroup_CEU_result.csv
    Untracked:  output/coffee_consumed_Neale_UKBB_analysis.csv
    Untracked:  process_init.log
    Untracked:  prs.log
    Untracked:  rplot.jpg
    Untracked:  test
    Untracked:  ukbb_analysis.log

Unstaged changes:
    Modified:   analysis/genetic_quality_control.Rmd
    Modified:   analysis/plans.Rmd
    Modified:   cache_log.csv
    Modified:   post_impute.log

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


These are the previous versions of the R Markdown and HTML files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view them.

File Version Author Date Message
Rmd edcde58 Jenny Sjaarda 2021-03-03 testing genetics_qc
Rmd 941b66d Jenny Sjaarda 2021-03-02 add new Rmd files and respective html files

The following document outlines and summarizes the GWAS results performed in PSYMETAB, for an overview of the method see GWAS Method.

Model counts and distributions.

Parsed with column specification:
cols(
  COUNT = col_double(),
  GPCR = col_character(),
  eth = col_character()
)
Joining, by = "FID"
Joining, by = "FID"
Drug_class Interaction_outcome Sensitivity_Model N Drug_CEU NoDrug_CEU Drug_MIXED NoDrug_MIXED Drug_YRI NoDrug_YRI
all BMI_slope No 1317 273 770 62 176 9 27
all BMI_slope Yes 1317 273 770 62 176 9 27
all LDL_slope No 759 153 453 39 92 8 14
all LDL_slope Yes 759 153 453 39 92 8 14
all BMI_slope_6mo No 1130 228 672 54 147 8 21
all BMI_slope_6mo Yes 1130 228 672 54 147 8 21
all LDL_slope_6mo No 673 138 400 33 81 8 13
all LDL_slope_6mo Yes 673 138 400 33 81 8 13
all BMI_slope_weight No 864 188 499 45 109 3 20
all BMI_slope_weight Yes 864 188 499 45 109 3 20
all LDL_slope_weight No 303 78 173 18 27 3 4
all LDL_slope_weight Yes 303 78 173 18 27 3 4
all BMI_slope_weight_6mo No 687 140 408 37 87 2 13
all BMI_slope_weight_6mo Yes 687 140 408 37 87 2 13
all LDL_slope_weight_6mo No 212 60 122 14 14 1 1
all LDL_slope_weight_6mo Yes 212 60 122 14 14 1 1
all BMI_change No 1317 273 770 62 176 9 27
all BMI_change Yes 1317 273 770 62 176 9 27
all LDL_change No 493 97 296 28 55 8 9
all LDL_change Yes 493 97 296 28 55 8 9
all BMI_change_1mo No 372 71 217 26 45 3 10
all BMI_change_1mo Yes 372 71 217 26 45 3 10
all LDL_change_1mo No 176 39 100 10 19 3 5
all LDL_change_1mo Yes 176 39 100 10 19 3 5
all BMI_change_3mo No 1002 203 592 51 131 7 18
all BMI_change_3mo Yes 1002 203 592 51 131 7 18
all LDL_change_3mo No 441 89 262 20 53 6 11
all LDL_change_3mo Yes 441 89 262 20 53 6 11
all BMI_change_6mo No 1132 228 673 55 147 8 21
all BMI_change_6mo Yes 1132 228 673 55 147 8 21
all LDL_change_6mo No 503 103 303 27 53 7 10
all LDL_change_6mo Yes 503 103 303 27 53 7 10
olanz_cloz BMI_slope No 1361 201 882 47 193 8 30
olanz_cloz BMI_slope Yes 1361 201 882 47 193 8 30
olanz_cloz LDL_slope No 784 111 518 31 100 7 17
olanz_cloz LDL_slope Yes 784 111 518 31 100 7 17
olanz_cloz BMI_slope_6mo No 1168 168 767 40 162 7 24
olanz_cloz BMI_slope_6mo Yes 1168 168 767 40 162 7 24
olanz_cloz LDL_slope_6mo No 693 100 456 26 88 7 16
olanz_cloz LDL_slope_6mo Yes 693 100 456 26 88 7 16
olanz_cloz BMI_slope_weight No 887 133 573 35 121 2 23
olanz_cloz BMI_slope_weight Yes 887 133 573 35 121 2 23
olanz_cloz LDL_slope_weight No 301 56 193 14 30 2 6
olanz_cloz LDL_slope_weight Yes 301 56 193 14 30 2 6
olanz_cloz BMI_slope_weight_6mo No 707 96 468 27 99 1 16
olanz_cloz BMI_slope_weight_6mo Yes 707 96 468 27 99 1 16
olanz_cloz LDL_slope_weight_6mo No 209 41 137 11 17 1 2
olanz_cloz LDL_slope_weight_6mo Yes 209 41 137 11 17 1 2
olanz_cloz BMI_change No 1361 201 882 47 193 8 30
olanz_cloz BMI_change Yes 1361 201 882 47 193 8 30
olanz_cloz LDL_change No 501 69 333 24 59 7 9
olanz_cloz LDL_change Yes 501 69 333 24 59 7 9
olanz_cloz BMI_change_1mo No 391 58 250 18 51 3 11
olanz_cloz BMI_change_1mo Yes 391 58 250 18 51 3 11
olanz_cloz LDL_change_1mo No 188 33 116 8 22 3 6
olanz_cloz LDL_change_1mo Yes 188 33 116 8 22 3 6
olanz_cloz BMI_change_3mo No 1033 153 671 38 145 6 20
olanz_cloz BMI_change_3mo Yes 1033 153 671 38 145 6 20
olanz_cloz LDL_change_3mo No 449 66 292 17 57 5 12
olanz_cloz LDL_change_3mo Yes 449 66 292 17 57 5 12
olanz_cloz BMI_change_6mo No 1170 168 768 41 162 7 24
olanz_cloz BMI_change_6mo Yes 1170 168 768 41 162 7 24
olanz_cloz LDL_change_6mo No 515 76 341 22 58 7 11
olanz_cloz LDL_change_6mo Yes 515 76 341 22 58 7 11
valproate BMI_slope No 1386 83 1006 17 235 1 44
valproate BMI_slope Yes 1386 83 1006 17 235 1 44
valproate LDL_slope No 802 48 594 9 126 1 24
valproate LDL_slope Yes 802 48 594 9 126 1 24
valproate BMI_slope_6mo No 1196 71 872 16 200 1 36
valproate BMI_slope_6mo Yes 1196 71 872 16 200 1 36
valproate LDL_slope_6mo No 708 44 523 8 109 1 23
valproate LDL_slope_6mo Yes 708 44 523 8 109 1 23
valproate BMI_slope_weight No 924 61 663 12 154 1 33
valproate BMI_slope_weight Yes 924 61 663 12 154 1 33
valproate LDL_slope_weight No 322 24 234 4 48 1 11
valproate LDL_slope_weight Yes 322 24 234 4 48 1 11
valproate BMI_slope_weight_6mo No 740 50 528 11 125 1 25
valproate BMI_slope_weight_6mo Yes 740 50 528 11 125 1 25
valproate LDL_slope_weight_6mo No 217 19 164 3 25 0 6
valproate LDL_slope_weight_6mo Yes 217 19 164 3 25 0 6
valproate BMI_change No 1386 83 1006 17 235 1 44
valproate BMI_change Yes 1386 83 1006 17 235 1 44
valproate LDL_change No 514 32 384 4 75 1 18
valproate LDL_change Yes 514 32 384 4 75 1 18
valproate BMI_change_1mo No 380 18 275 8 66 0 13
valproate BMI_change_1mo Yes 380 18 275 8 66 0 13
valproate LDL_change_1mo No 177 8 133 2 28 0 6
valproate LDL_change_1mo Yes 177 8 133 2 28 0 6
valproate BMI_change_3mo No 1054 59 769 15 178 1 32
valproate BMI_change_3mo Yes 1054 59 769 15 178 1 32
valproate LDL_change_3mo No 463 27 345 4 67 1 19
valproate LDL_change_3mo Yes 463 27 345 4 67 1 19
valproate BMI_change_6mo No 1197 71 873 16 200 1 36
valproate BMI_change_6mo Yes 1197 71 873 16 200 1 36
valproate LDL_change_6mo No 523 32 396 6 71 0 18
valproate LDL_change_6mo Yes 523 32 396 6 71 0 18
olanz BMI_slope No 1369 125 967 42 199 6 30
olanz BMI_slope Yes 1369 125 967 42 199 6 30
olanz LDL_slope No 785 72 560 29 102 5 17
olanz LDL_slope Yes 785 72 560 29 102 5 17
olanz BMI_slope_6mo No 1171 107 832 35 168 5 24
olanz BMI_slope_6mo Yes 1171 107 832 35 168 5 24
olanz LDL_slope_6mo No 692 64 493 24 90 5 16
olanz LDL_slope_6mo Yes 692 64 493 24 90 5 16
olanz BMI_slope_weight No 892 75 636 31 125 2 23
olanz BMI_slope_weight Yes 892 75 636 31 125 2 23
olanz LDL_slope_weight No 298 32 214 13 31 2 6
olanz LDL_slope_weight Yes 298 32 214 13 31 2 6
olanz BMI_slope_weight_6mo No 706 56 507 24 102 1 16
olanz BMI_slope_weight_6mo Yes 706 56 507 24 102 1 16
olanz LDL_slope_weight_6mo No 208 26 151 10 18 1 2
olanz LDL_slope_weight_6mo Yes 208 26 151 10 18 1 2
olanz BMI_change No 1369 125 967 42 199 6 30
olanz BMI_change Yes 1369 125 967 42 199 6 30
olanz LDL_change No 504 50 357 22 61 5 9
olanz LDL_change Yes 504 50 357 22 61 5 9
olanz BMI_change_1mo No 392 41 269 16 53 2 11
olanz BMI_change_1mo Yes 392 41 269 16 53 2 11
olanz LDL_change_1mo No 189 24 126 7 24 2 6
olanz LDL_change_1mo Yes 189 24 126 7 24 2 6
olanz BMI_change_3mo No 1035 99 728 34 150 4 20
olanz BMI_change_3mo Yes 1035 99 728 34 150 4 20
olanz LDL_change_3mo No 453 46 317 16 59 3 12
olanz LDL_change_3mo Yes 453 46 317 16 59 3 12
olanz BMI_change_6mo No 1173 107 833 36 168 5 24
olanz BMI_change_6mo Yes 1173 107 833 36 168 5 24
olanz LDL_change_6mo No 516 54 366 20 60 5 11
olanz LDL_change_6mo Yes 516 54 366 20 60 5 11
cloza BMI_slope No 1452 84 1057 7 256 2 46
cloza BMI_slope Yes 1452 84 1057 7 256 2 46
cloza LDL_slope No 845 42 632 4 138 2 27
cloza LDL_slope Yes 845 42 632 4 138 2 27
cloza BMI_slope_6mo No 1257 69 922 7 219 2 38
cloza BMI_slope_6mo Yes 1257 69 922 7 219 2 38
cloza LDL_slope_6mo No 744 39 554 3 120 2 26
cloza LDL_slope_6mo Yes 744 39 554 3 120 2 26
cloza BMI_slope_weight No 966 63 694 5 169 0 35
cloza BMI_slope_weight Yes 966 63 694 5 169 0 35
cloza LDL_slope_weight No 332 26 241 1 51 0 13
cloza LDL_slope_weight Yes 332 26 241 1 51 0 13
cloza BMI_slope_weight_6mo No 778 44 563 3 141 0 27
cloza BMI_slope_weight_6mo Yes 778 44 563 3 141 0 27
cloza LDL_slope_weight_6mo No 222 17 170 1 27 0 7
cloza LDL_slope_weight_6mo Yes 222 17 170 1 27 0 7
cloza BMI_change No 1452 84 1057 7 256 2 46
cloza BMI_change Yes 1452 84 1057 7 256 2 46
cloza LDL_change No 528 20 404 3 81 2 18
cloza LDL_change Yes 528 20 404 3 81 2 18
cloza BMI_change_1mo No 409 23 298 2 71 1 14
cloza BMI_change_1mo Yes 409 23 298 2 71 1 14
cloza LDL_change_1mo No 195 12 144 1 30 1 7
cloza LDL_change_1mo Yes 195 12 144 1 30 1 7
cloza BMI_change_3mo No 1106 61 808 6 196 2 33
cloza BMI_change_3mo Yes 1106 61 808 6 196 2 33
cloza LDL_change_3mo No 474 23 354 2 73 2 20
cloza LDL_change_3mo Yes 474 23 354 2 73 2 20
cloza BMI_change_6mo No 1258 69 923 7 219 2 38
cloza BMI_change_6mo Yes 1258 69 923 7 219 2 38
cloza LDL_change_6mo No 541 24 415 3 78 2 19
cloza LDL_change_6mo Yes 541 24 415 3 78 2 19
risp BMI_slope No 1367 223 855 59 185 17 28
risp BMI_slope Yes 1211 223 724 59 162 17 26
risp LDL_slope No 798 127 507 34 101 13 16
risp LDL_slope Yes 714 127 437 34 88 13 15
risp BMI_slope_6mo No 1178 199 733 53 156 14 23
risp BMI_slope_6mo Yes 1058 199 634 53 136 14 22
risp LDL_slope_6mo No 704 110 448 30 88 13 15
risp LDL_slope_6mo Yes 631 110 386 30 78 13 14
risp BMI_slope_weight No 903 142 570 39 120 11 21
risp BMI_slope_weight Yes 795 142 479 39 104 11 20
risp LDL_slope_weight No 304 44 199 8 39 8 6
risp LDL_slope_weight Yes 268 44 169 8 34 8 5
risp BMI_slope_weight_6mo No 723 115 452 34 98 8 16
risp BMI_slope_weight_6mo Yes 649 115 390 34 86 8 16
risp LDL_slope_weight_6mo No 201 33 136 4 21 4 3
risp LDL_slope_weight_6mo Yes 175 33 114 4 17 4 3
risp BMI_change No 1367 223 855 59 185 17 28
risp BMI_change Yes 1211 223 724 59 162 17 26
risp LDL_change No 503 74 324 21 61 12 11
risp LDL_change Yes 451 74 282 21 52 12 10
risp BMI_change_1mo No 386 64 238 22 46 7 9
risp BMI_change_1mo Yes 352 64 209 22 41 7 9
risp LDL_change_1mo No 183 22 120 13 19 4 5
risp LDL_change_1mo Yes 165 22 104 13 17 4 5
risp BMI_change_3mo No 1043 177 641 51 139 14 21
risp BMI_change_3mo Yes 937 177 553 51 122 14 20
risp LDL_change_3mo No 447 68 285 22 48 13 11
risp LDL_change_3mo Yes 402 68 247 22 42 13 10
risp BMI_change_6mo No 1179 199 734 53 156 14 23
risp BMI_change_6mo Yes 1059 199 635 53 136 14 22
risp LDL_change_6mo No 513 77 337 18 58 12 11
risp LDL_change_6mo Yes 458 77 291 18 50 12 10
quet BMI_slope No 1286 414 596 84 150 13 29
quet BMI_slope Yes 1153 414 484 84 131 13 27
quet LDL_slope No 763 264 346 44 82 10 17
quet LDL_slope Yes 688 264 283 44 71 10 16
quet BMI_slope_6mo No 1100 358 509 66 132 12 23
quet BMI_slope_6mo Yes 998 358 425 66 115 12 22
quet LDL_slope_6mo No 671 232 304 40 69 10 16
quet LDL_slope_6mo Yes 607 232 249 40 61 10 15
quet BMI_slope_weight No 862 285 395 51 101 11 19
quet BMI_slope_weight Yes 771 285 318 51 88 11 18
quet LDL_slope_weight No 312 118 130 21 31 5 7
quet LDL_slope_weight Yes 281 118 105 21 26 5 6
quet BMI_slope_weight_6mo No 698 233 315 47 79 10 14
quet BMI_slope_weight_6mo Yes 636 233 263 47 69 10 14
quet LDL_slope_weight_6mo No 215 77 102 13 14 5 4
quet LDL_slope_weight_6mo Yes 190 77 82 13 9 5 4
quet BMI_change No 1286 414 596 84 150 13 29
quet BMI_change Yes 1153 414 484 84 131 13 27
quet LDL_change No 486 173 220 28 46 7 12
quet LDL_change Yes 438 173 180 28 39 7 11
quet BMI_change_1mo No 352 116 165 18 42 4 7
quet BMI_change_1mo Yes 319 116 137 18 37 4 7
quet LDL_change_1mo No 184 69 81 10 18 3 3
quet LDL_change_1mo Yes 163 69 63 10 15 3 3
quet BMI_change_3mo No 972 316 448 63 116 10 19
quet BMI_change_3mo Yes 882 316 374 63 101 10 18
quet LDL_change_3mo No 433 147 201 25 42 6 12
quet LDL_change_3mo Yes 392 147 166 25 37 6 11
quet BMI_change_6mo No 1101 358 510 66 132 12 23
quet BMI_change_6mo Yes 999 358 426 66 115 12 22
quet LDL_change_6mo No 489 172 228 25 43 9 12
quet LDL_change_6mo Yes 438 172 184 25 37 9 11
ocq BMI_slope No 1263 586 412 120 108 19 18
ocq BMI_slope Yes 1263 586 412 120 108 19 18
ocq LDL_slope No 737 351 237 66 57 15 11
ocq LDL_slope Yes 737 351 237 66 57 15 11
ocq BMI_slope_6mo No 1077 499 354 98 95 17 14
ocq BMI_slope_6mo Yes 1077 499 354 98 95 17 14
ocq LDL_slope_6mo No 650 312 206 58 49 15 10
ocq LDL_slope_6mo Yes 650 312 206 58 49 15 10
ocq BMI_slope_weight No 832 394 265 77 72 12 12
ocq BMI_slope_weight Yes 832 394 265 77 72 12 12
ocq LDL_slope_weight No 295 157 84 27 17 7 3
ocq LDL_slope_weight Yes 295 157 84 27 17 7 3
ocq BMI_slope_weight_6mo No 667 308 219 68 54 10 8
ocq BMI_slope_weight_6mo Yes 667 308 219 68 54 10 8
ocq LDL_slope_weight_6mo No 208 108 65 19 9 6 1
ocq LDL_slope_weight_6mo Yes 208 108 65 19 9 6 1
ocq BMI_change No 1263 586 412 120 108 19 18
ocq BMI_change Yes 1263 586 412 120 108 19 18
ocq LDL_change No 478 227 154 44 34 12 7
ocq LDL_change Yes 478 227 154 44 34 12 7
ocq BMI_change_1mo No 355 164 114 33 30 7 7
ocq BMI_change_1mo Yes 355 164 114 33 30 7 7
ocq LDL_change_1mo No 182 94 51 16 12 6 3
ocq LDL_change_1mo Yes 182 94 51 16 12 6 3
ocq BMI_change_3mo No 957 444 311 93 83 15 11
ocq BMI_change_3mo Yes 957 444 311 93 83 15 11
ocq LDL_change_3mo No 424 201 136 35 34 10 8
ocq LDL_change_3mo Yes 424 201 136 35 34 10 8
ocq BMI_change_6mo No 1078 499 355 98 95 17 14
ocq BMI_change_6mo Yes 1078 499 355 98 95 17 14
ocq LDL_change_6mo No 485 235 155 40 34 14 7
ocq LDL_change_6mo Yes 485 235 155 40 34 14 7
ami BMI_slope No 1403 119 989 45 205 11 34
ami BMI_slope Yes 462 119 209 45 67 11 11
ami LDL_slope No 819 79 583 23 108 7 19
ami LDL_slope Yes 268 79 119 23 37 7 3
ami BMI_slope_6mo No 1205 110 844 42 171 11 27
ami BMI_slope_6mo Yes 417 110 187 42 59 11 8
ami LDL_slope_6mo No 719 66 515 20 93 7 18
ami LDL_slope_6mo Yes 232 66 104 20 32 7 3
ami BMI_slope_weight No 933 86 650 39 124 8 26
ami BMI_slope_weight Yes 321 86 140 39 41 8 7
ami LDL_slope_weight No 315 26 228 11 38 2 10
ami LDL_slope_weight Yes 98 26 44 11 14 2 1
ami BMI_slope_weight_6mo No 746 72 515 31 104 6 18
ami BMI_slope_weight_6mo Yes 257 72 111 31 33 6 4
ami LDL_slope_weight_6mo No 207 21 157 2 22 1 4
ami LDL_slope_weight_6mo Yes 59 21 29 2 6 1 0
ami BMI_change No 1403 119 989 45 205 11 34
ami BMI_change Yes 462 119 209 45 67 11 11
ami LDL_change No 517 51 372 10 66 5 13
ami LDL_change Yes 166 51 78 10 21 5 1
ami BMI_change_1mo No 386 31 277 13 54 1 10
ami BMI_change_1mo Yes 118 31 53 13 17 1 3
ami LDL_change_1mo No 186 12 140 3 25 1 5
ami LDL_change_1mo Yes 50 12 28 3 5 1 1
ami BMI_change_3mo No 1055 97 737 40 150 9 22
ami BMI_change_3mo Yes 362 97 164 40 47 9 5
ami LDL_change_3mo No 459 39 331 13 56 5 15
ami LDL_change_3mo Yes 146 39 71 13 17 5 1
ami BMI_change_6mo No 1206 110 845 42 171 11 27
ami BMI_change_6mo Yes 417 110 187 42 59 11 8
ami LDL_change_6mo No 525 49 388 11 59 5 13
ami LDL_change_6mo Yes 166 49 81 11 19 5 1

GWAS results.

Baseline

Interaction

Subgroup

het_out <-
  fread(
    paste0("analysis/GWAS/subgroup/", eth, "/", output, "_", suffix,
      "_", eth, ".", outcome_var, ".het"),
    header = F,
    data.table = F
  )

sig_list <- which(as.numeric(het_out[, 2]) < 5e-08)
length(sig_list)
colnames(het_out) <- c("ID", "P_HET")
result <- cbind(filter, "P_HET" = het_out$P_HET)
png(
  paste0("analysis/GWAS/subgroup/", eth, "/", output, "_", suffix, "_", eth, ".", outcome_var, ".het.manhattan.png"),
  width = 2000,
  height = 1000,
  pointsize = 18
)
manhattan(result, p = "P_HET", chr = "CHROM")
dev.off()

png(
  paste0(
    "analysis/GWAS/subgroup/", eth, "/", output, "_", suffix, "_", eth, ".", outcome_var, ".het.qq.png"),
  width = 2000,
  height = 1000, 
  pointsize = 18
)
qq(result$P_HET)
dev.off()


#### GWAS
    sig_nodrug <-nodrug[ which(nodrug$P < 5e-08),]
    sig_drug <- drug[which(drug$P < 5e-08),]
    for(data in c("nodrug", "drug"))
    {
      gwas_result <- get(data)
      joint <- reduce(list(gwas_result,freq,info), full_join, by = "ID")
      sig <- joint %>%
              mutate_at("P", as.numeric) %>%
              filter(P < 5e-06) %>%
              filter(ALT_FREQS > maf_threshold & ALT_FREQS < (1 - maf_threshold)) %>%
              filter(R2 > info_threshold)

      joint_maf <- joint %>% filter(ALT_FREQS > maf_threshold & ALT_FREQS < (1- maf_threshold))%>% mutate_at("P", as.numeric)
      sig <- joint_maf  %>% filter(P < gw_sig)
      png("man_interaction.png", width=2000, height=1000, pointsize=18)
      manhattan(joint_maf)
      dev.off()

      png("interaction_qq2.png", width=2000, height=1000, pointsize=18)
      qq(joint_maf$P)
      dev.off()

            qq(gwas_result2$P)
    # sig_nodrug <- sig
    }
    
    gwas_result <- fread(result, data.table=F, stringsAsFactors=F)
  gwas_result2 <- gwas_result %>% rename(CHR = "#CHROM") %>% rename(BP = POS) %>% filter(!is.na(P))


  #### GWAS
  sig_nodrug <-nodrug[ which(nodrug$P < 5e-08),]
  sig_drug <- drug[which(drug$P < 5e-08),]

  for(data in c("nodrug", "drug"))
  {
  gwas_result <- get(data)
  gwas_munge <- gwas_result %>% rename(CHR = "#CHROM") %>% rename(BP = POS) %>% filter(!is.na(P))
  joint <- reduce(list(gwas_munge,freq,info), full_join, by = "ID")
  sig <- joint %>%
          mutate_at("P", as.numeric) %>%
          filter(P < 5e-06) %>%
          filter(ALT_FREQS > maf_threshold & ALT_FREQS < (1 - maf_threshold)) %>%
          filter(R2 > info_threshold)
  # sig_nodrug <- sig
  }

sessionInfo()
R version 3.5.3 (2019-03-11)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS: /data/sgg2/jenny/bin/R-3.5.3/lib64/R/lib/libRblas.so
LAPACK: /data/sgg2/jenny/bin/R-3.5.3/lib64/R/lib/libRlapack.so

locale:
[1] en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] tidyselect_0.2.5        rbgen_0.1               ukbtools_0.11.3        
 [4] hrbrthemes_0.8.0        OpenImageR_1.1.6        fuzzyjoin_0.1.5        
 [7] kableExtra_1.1.0        R.utils_2.9.2           R.oo_1.23.0            
[10] R.methodsS3_1.7.1       TwoSampleMR_0.4.25      reader_1.0.6           
[13] NCmisc_1.1.6            optparse_1.6.4          readxl_1.3.1           
[16] ggthemes_4.2.0          tryCatchLog_1.1.6       futile.logger_1.4.3    
[19] DataExplorer_0.8.0      taRifx_1.0.6.1          qqman_0.1.4            
[22] MASS_7.3-51.5           bit64_0.9-7             bit_1.1-14             
[25] rslurm_0.5.0            rmeta_3.0               devtools_2.2.1         
[28] usethis_1.5.1           data.table_1.12.8       clustermq_0.8.8.1      
[31] future.batchtools_0.8.1 future_1.15.1           rlang_0.4.5            
[34] knitr_1.26              drake_7.12.0.9000       forcats_0.4.0          
[37] stringr_1.4.0           dplyr_0.8.3             purrr_0.3.3            
[40] readr_1.3.1             tidyr_1.0.3             tibble_2.1.3           
[43] ggplot2_3.3.2           tidyverse_1.3.0         pacman_0.5.1           
[46] processx_3.4.1          workflowr_1.6.0        

loaded via a namespace (and not attached):
  [1] backports_1.1.6      systemfonts_0.2.3    plyr_1.8.5          
  [4] igraph_1.2.5         storr_1.2.1          listenv_0.8.0       
  [7] digest_0.6.25        foreach_1.4.7        htmltools_0.4.0     
 [10] tiff_0.1-5           fansi_0.4.1          magrittr_1.5        
 [13] checkmate_1.9.4      memoise_1.1.0        base64url_1.4       
 [16] doParallel_1.0.15    remotes_2.1.0        globals_0.12.5      
 [19] extrafont_0.17       modelr_0.1.5         extrafontdb_1.0     
 [22] prettyunits_1.1.0    jpeg_0.1-8.1         colorspace_1.4-1    
 [25] rvest_0.3.5          rappdirs_0.3.1       haven_2.2.0         
 [28] xfun_0.11            callr_3.4.0          crayon_1.3.4        
 [31] jsonlite_1.6         iterators_1.0.12     brew_1.0-6          
 [34] glue_1.4.0           gtable_0.3.0         webshot_0.5.2       
 [37] pkgbuild_1.0.6       Rttf2pt1_1.3.8       scales_1.1.0        
 [40] futile.options_1.0.1 DBI_1.1.0            Rcpp_1.0.3          
 [43] xtable_1.8-4         viridisLite_0.3.0    progress_1.2.2      
 [46] txtq_0.2.0           htmlwidgets_1.5.1    httr_1.4.1          
 [49] getopt_1.20.3        calibrate_1.7.5      ellipsis_0.3.0      
 [52] XML_3.98-1.20        pkgconfig_2.0.3      dbplyr_1.4.2        
 [55] reshape2_1.4.3       later_1.0.0          munsell_0.5.0       
 [58] cellranger_1.1.0     tools_3.5.3          cli_2.0.1           
 [61] generics_0.0.2       broom_0.5.3          fastmap_1.0.1       
 [64] evaluate_0.14        yaml_2.2.0           fs_1.3.1            
 [67] packrat_0.5.0        nlme_3.1-143         mime_0.8            
 [70] whisker_0.4          formatR_1.7          proftools_0.99-2    
 [73] xml2_1.2.2           compiler_3.5.3       rstudioapi_0.10     
 [76] png_0.1-7            filelock_1.0.2       testthat_2.3.1      
 [79] reprex_0.3.0         stringi_1.4.5        highr_0.8           
 [82] ps_1.3.0             desc_1.2.0           gdtools_0.2.2       
 [85] lattice_0.20-38      vctrs_0.2.4          pillar_1.4.3        
 [88] lifecycle_0.1.0      networkD3_0.4        httpuv_1.5.2        
 [91] R6_2.4.1             promises_1.1.0       gridExtra_2.3       
 [94] sessioninfo_1.1.1    codetools_0.2-16     lambda.r_1.2.4      
 [97] assertthat_0.2.1     pkgload_1.0.2        rprojroot_1.3-2     
[100] withr_2.1.2          batchtools_0.9.12    parallel_3.5.3      
[103] hms_0.5.3            grid_3.5.3           rmarkdown_1.18      
[106] git2r_0.26.1         shiny_1.4.0          lubridate_1.7.4