-
Notifications
You must be signed in to change notification settings - Fork 15
/
gwas_pairs.html
1202 lines (1095 loc) · 45.9 KB
/
gwas_pairs.html
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="pandoc" />
<meta name="author" content="Jean Morrison" />
<meta name="date" content="2019-06-25" />
<title>Analyze Pairs of GWAS Traits</title>
<script src="site_libs/jquery-1.11.3/jquery.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="site_libs/bootstrap-3.3.5/css/cosmo.min.css" rel="stylesheet" />
<script src="site_libs/bootstrap-3.3.5/js/bootstrap.min.js"></script>
<script src="site_libs/bootstrap-3.3.5/shim/html5shiv.min.js"></script>
<script src="site_libs/bootstrap-3.3.5/shim/respond.min.js"></script>
<script src="site_libs/jqueryui-1.11.4/jquery-ui.min.js"></script>
<link href="site_libs/tocify-1.9.1/jquery.tocify.css" rel="stylesheet" />
<script src="site_libs/tocify-1.9.1/jquery.tocify.js"></script>
<script src="site_libs/navigation-1.1/tabsets.js"></script>
<link href="site_libs/highlightjs-9.12.0/textmate.css" rel="stylesheet" />
<script src="site_libs/highlightjs-9.12.0/highlight.js"></script>
<link href="site_libs/font-awesome-5.1.0/css/all.css" rel="stylesheet" />
<link href="site_libs/font-awesome-5.1.0/css/v4-shims.css" rel="stylesheet" />
<style type="text/css">code{white-space: pre;}</style>
<style type="text/css">
pre:not([class]) {
background-color: white;
}
</style>
<script type="text/javascript">
if (window.hljs) {
hljs.configure({languages: []});
hljs.initHighlightingOnLoad();
if (document.readyState && document.readyState === "complete") {
window.setTimeout(function() { hljs.initHighlighting(); }, 0);
}
}
</script>
<style type="text/css">
h1 {
font-size: 34px;
}
h1.title {
font-size: 38px;
}
h2 {
font-size: 30px;
}
h3 {
font-size: 24px;
}
h4 {
font-size: 18px;
}
h5 {
font-size: 16px;
}
h6 {
font-size: 12px;
}
.table th:not([align]) {
text-align: left;
}
</style>
<style type = "text/css">
.main-container {
max-width: 940px;
margin-left: auto;
margin-right: auto;
}
code {
color: inherit;
background-color: rgba(0, 0, 0, 0.04);
}
img {
max-width:100%;
height: auto;
}
.tabbed-pane {
padding-top: 12px;
}
.html-widget {
margin-bottom: 20px;
}
button.code-folding-btn:focus {
outline: none;
}
summary {
display: list-item;
}
</style>
<style type="text/css">
/* padding for bootstrap navbar */
body {
padding-top: 51px;
padding-bottom: 40px;
}
/* offset scroll position for anchor links (for fixed navbar) */
.section h1 {
padding-top: 56px;
margin-top: -56px;
}
.section h2 {
padding-top: 56px;
margin-top: -56px;
}
.section h3 {
padding-top: 56px;
margin-top: -56px;
}
.section h4 {
padding-top: 56px;
margin-top: -56px;
}
.section h5 {
padding-top: 56px;
margin-top: -56px;
}
.section h6 {
padding-top: 56px;
margin-top: -56px;
}
.dropdown-submenu {
position: relative;
}
.dropdown-submenu>.dropdown-menu {
top: 0;
left: 100%;
margin-top: -6px;
margin-left: -1px;
border-radius: 0 6px 6px 6px;
}
.dropdown-submenu:hover>.dropdown-menu {
display: block;
}
.dropdown-submenu>a:after {
display: block;
content: " ";
float: right;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
border-width: 5px 0 5px 5px;
border-left-color: #cccccc;
margin-top: 5px;
margin-right: -10px;
}
.dropdown-submenu:hover>a:after {
border-left-color: #ffffff;
}
.dropdown-submenu.pull-left {
float: none;
}
.dropdown-submenu.pull-left>.dropdown-menu {
left: -100%;
margin-left: 10px;
border-radius: 6px 0 6px 6px;
}
</style>
<script>
// manage active state of menu based on current page
$(document).ready(function () {
// active menu anchor
href = window.location.pathname
href = href.substr(href.lastIndexOf('/') + 1)
if (href === "")
href = "index.html";
var menuAnchor = $('a[href="' + href + '"]');
// mark it active
menuAnchor.parent().addClass('active');
// if it's got a parent navbar menu mark it active as well
menuAnchor.closest('li.dropdown').addClass('active');
});
</script>
<!-- tabsets -->
<style type="text/css">
.tabset-dropdown > .nav-tabs {
display: inline-table;
max-height: 500px;
min-height: 44px;
overflow-y: auto;
background: white;
border: 1px solid #ddd;
border-radius: 4px;
}
.tabset-dropdown > .nav-tabs > li.active:before {
content: "";
font-family: 'Glyphicons Halflings';
display: inline-block;
padding: 10px;
border-right: 1px solid #ddd;
}
.tabset-dropdown > .nav-tabs.nav-tabs-open > li.active:before {
content: "";
border: none;
}
.tabset-dropdown > .nav-tabs.nav-tabs-open:before {
content: "";
font-family: 'Glyphicons Halflings';
display: inline-block;
padding: 10px;
border-right: 1px solid #ddd;
}
.tabset-dropdown > .nav-tabs > li.active {
display: block;
}
.tabset-dropdown > .nav-tabs > li > a,
.tabset-dropdown > .nav-tabs > li > a:focus,
.tabset-dropdown > .nav-tabs > li > a:hover {
border: none;
display: inline-block;
border-radius: 4px;
}
.tabset-dropdown > .nav-tabs.nav-tabs-open > li {
display: block;
float: none;
}
.tabset-dropdown > .nav-tabs > li {
display: none;
}
</style>
<script>
$(document).ready(function () {
window.buildTabsets("TOC");
});
$(document).ready(function () {
$('.tabset-dropdown > .nav-tabs > li').click(function () {
$(this).parent().toggleClass('nav-tabs-open')
});
});
</script>
<!-- code folding -->
<script>
$(document).ready(function () {
// move toc-ignore selectors from section div to header
$('div.section.toc-ignore')
.removeClass('toc-ignore')
.children('h1,h2,h3,h4,h5').addClass('toc-ignore');
// establish options
var options = {
selectors: "h1,h2,h3",
theme: "bootstrap3",
context: '.toc-content',
hashGenerator: function (text) {
return text.replace(/[.\\/?&!#<>]/g, '').replace(/\s/g, '_').toLowerCase();
},
ignoreSelector: ".toc-ignore",
scrollTo: 0
};
options.showAndHide = true;
options.smoothScroll = true;
// tocify
var toc = $("#TOC").tocify(options).data("toc-tocify");
});
</script>
<style type="text/css">
#TOC {
margin: 25px 0px 20px 0px;
}
@media (max-width: 768px) {
#TOC {
position: relative;
width: 100%;
}
}
.toc-content {
padding-left: 30px;
padding-right: 40px;
}
div.main-container {
max-width: 1200px;
}
div.tocify {
width: 20%;
max-width: 260px;
max-height: 85%;
}
@media (min-width: 768px) and (max-width: 991px) {
div.tocify {
width: 25%;
}
}
@media (max-width: 767px) {
div.tocify {
width: 100%;
max-width: none;
}
}
.tocify ul, .tocify li {
line-height: 20px;
}
.tocify-subheader .tocify-item {
font-size: 0.90em;
}
.tocify .list-group-item {
border-radius: 0px;
}
</style>
</head>
<body>
<div class="container-fluid main-container">
<!-- setup 3col/9col grid for toc_float and main content -->
<div class="row-fluid">
<div class="col-xs-12 col-sm-4 col-md-3">
<div id="TOC" class="tocify">
</div>
</div>
<div class="toc-content col-xs-12 col-sm-8 col-md-9">
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">CAUSE: Cauasl Analysis Using Summary Effects</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="index.html">Introduction</a>
</li>
<li>
<a href="ldl_cad.html">Software Tutorial</a>
</li>
<li>
<a href="simulations.html">Simulations</a>
</li>
<li>
<a href="gwas_pairs.html">Analyze Pairs of GWAS Traits</a>
</li>
<li>
<a href="license.html">License</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/jean997/cause">
<span class="fa fa-github"></span>
</a>
</li>
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
<!-- Add a small amount of space between sections. -->
<style type="text/css">
div.section {
padding-top: 12px;
}
</style>
<div class="fluid-row" id="header">
<h1 class="title toc-ignore">Analyze Pairs of GWAS Traits</h1>
<h4 class="author">Jean Morrison</h4>
<h4 class="date">2019-06-25</h4>
</div>
<p>
<button type="button" class="btn btn-default btn-workflowr btn-workflowr-report" data-toggle="collapse" data-target="#workflowr-report">
<span class="glyphicon glyphicon-list" aria-hidden="true"></span> workflowr <span class="glyphicon glyphicon-exclamation-sign text-danger" aria-hidden="true"></span>
</button>
</p>
<div id="workflowr-report" class="collapse">
<ul class="nav nav-tabs">
<li class="active">
<a data-toggle="tab" href="#summary">Summary</a>
</li>
<li>
<a data-toggle="tab" href="#checks"> Checks <span class="glyphicon glyphicon-exclamation-sign text-danger" aria-hidden="true"></span> </a>
</li>
<li>
<a data-toggle="tab" href="#versions">Past versions</a>
</li>
</ul>
<div class="tab-content">
<div id="summary" class="tab-pane fade in active">
<p>
<strong>Last updated:</strong> 2019-07-29
</p>
<p>
<strong>Checks:</strong> <span class="glyphicon glyphicon-ok text-success" aria-hidden="true"></span> 6 <span class="glyphicon glyphicon-exclamation-sign text-danger" aria-hidden="true"></span> 1
</p>
<p>
<strong>Knit directory:</strong> <code>cause/gwas_data/</code> <span class="glyphicon glyphicon-question-sign" aria-hidden="true" title="This is the local directory in which the code in this file was executed."> </span>
</p>
<p>
This reproducible <a href="http://rmarkdown.rstudio.com">R Markdown</a> analysis was created with <a
href="https://github.com/jdblischak/workflowr">workflowr</a> (version 1.4.0.9000). The <em>Checks</em> tab describes the reproducibility checks that were applied when the results were created. The <em>Past versions</em> tab lists the development history.
</p>
<hr>
</div>
<div id="checks" class="tab-pane fade">
<div id="workflowr-checks" class="panel-group">
<div class="panel panel-default">
<div class="panel-heading">
<p class="panel-title">
<a data-toggle="collapse" data-parent="#workflowr-checks" href="#strongRMarkdownfilestronguptodate"> <span class="glyphicon glyphicon-ok text-success" aria-hidden="true"></span> <strong>R Markdown file:</strong> up-to-date </a>
</p>
</div>
<div id="strongRMarkdownfilestronguptodate" class="panel-collapse collapse">
<div class="panel-body">
<p>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.</p>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<p class="panel-title">
<a data-toggle="collapse" data-parent="#workflowr-checks" href="#strongEnvironmentstrongobjectspresent"> <span class="glyphicon glyphicon-exclamation-sign text-danger" aria-hidden="true"></span> <strong>Environment:</strong> objects present </a>
</p>
</div>
<div id="strongEnvironmentstrongobjectspresent" class="panel-collapse collapse">
<div class="panel-body">
<p>
The global environment had objects present when the code in the R Markdown file was run. These objects 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. Use <code>wflow_publish</code> or <code>wflow_build</code> to ensure that the code is always run in an empty environment.
</p>
<p>
The following objects were defined in the global environment when these results were created:
</p>
<table class="table table-condensed table-hover">
<thead>
<tr>
<th style="text-align:left;">
Name
</th>
<th style="text-align:left;">
Class
</th>
<th style="text-align:left;">
Size
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left;">
data
</td>
<td style="text-align:left;">
environment
</td>
<td style="text-align:left;">
56 bytes
</td>
</tr>
<tr>
<td style="text-align:left;">
env
</td>
<td style="text-align:left;">
environment
</td>
<td style="text-align:left;">
56 bytes
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<p class="panel-title">
<a data-toggle="collapse" data-parent="#workflowr-checks" href="#strongSeedstrongcodesetseed20181014code"> <span class="glyphicon glyphicon-ok text-success" aria-hidden="true"></span> <strong>Seed:</strong> <code>set.seed(20181014)</code> </a>
</p>
</div>
<div id="strongSeedstrongcodesetseed20181014code" class="panel-collapse collapse">
<div class="panel-body">
<p>The command <code>set.seed(20181014)</code> 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.</p>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<p class="panel-title">
<a data-toggle="collapse" data-parent="#workflowr-checks" href="#strongSessioninformationstrongrecorded"> <span class="glyphicon glyphicon-ok text-success" aria-hidden="true"></span> <strong>Session information:</strong> recorded </a>
</p>
</div>
<div id="strongSessioninformationstrongrecorded" class="panel-collapse collapse">
<div class="panel-body">
<p>Great job! Recording the operating system, R version, and package versions is critical for reproducibility.</p>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<p class="panel-title">
<a data-toggle="collapse" data-parent="#workflowr-checks" href="#strongCachestrongnone"> <span class="glyphicon glyphicon-ok text-success" aria-hidden="true"></span> <strong>Cache:</strong> none </a>
</p>
</div>
<div id="strongCachestrongnone" class="panel-collapse collapse">
<div class="panel-body">
<p>Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.</p>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<p class="panel-title">
<a data-toggle="collapse" data-parent="#workflowr-checks" href="#strongFilepathsstrongrelative"> <span class="glyphicon glyphicon-ok text-success" aria-hidden="true"></span> <strong>File paths:</strong> relative </a>
</p>
</div>
<div id="strongFilepathsstrongrelative" class="panel-collapse collapse">
<div class="panel-body">
<p>Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.</p>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<p class="panel-title">
<a data-toggle="collapse" data-parent="#workflowr-checks" href="#strongRepositoryversionstrongahrefhttpsgithubcomjean997causetreeded169320dba625535002b37986d526ba2f94daetargetblankded1693a"> <span class="glyphicon glyphicon-ok text-success" aria-hidden="true"></span> <strong>Repository version:</strong> <a href="https://github.com/jean997/cause/tree/ded169320dba625535002b37986d526ba2f94dae" target="_blank">ded1693</a> </a>
</p>
</div>
<div id="strongRepositoryversionstrongahrefhttpsgithubcomjean997causetreeded169320dba625535002b37986d526ba2f94daetargetblankded1693a" class="panel-collapse collapse">
<div class="panel-body">
<p>
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. <br><br> 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 <code>wflow_publish</code> or <code>wflow_git_commit</code>). 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:
</p>
<pre><code>
Ignored files:
Ignored: .Rhistory
Ignored: .Rproj.user/
Ignored: sim_results/
Ignored: src/RcppExports.o
Ignored: src/cause.so
Ignored: src/log_likelihood_functions.o
Untracked files:
Untracked: analysis/figure/ldl_cad.Rmd/
Untracked: analysis/figure/little_test.Rmd/
Untracked: cause.Rcheck/
Untracked: docs/cause.bib
Untracked: docs/figure/cause_figure_1_standalone.pdf
Untracked: gwas_data/
Untracked: ll_v7_notes.Rmd
Untracked: tests/
</code></pre>
<p>
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.
</p>
</div>
</div>
</div>
</div>
<hr>
</div>
<div id="versions" class="tab-pane fade">
<p>
These are the previous versions of the R Markdown and HTML files. If you’ve configured a remote Git repository (see <code>?wflow_git_remote</code>), click on the hyperlinks in the table below to view them.
</p>
<div class="table-responsive">
<table class="table table-condensed table-hover">
<thead>
<tr>
<th>
File
</th>
<th>
Version
</th>
<th>
Author
</th>
<th>
Date
</th>
<th>
Message
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Rmd
</td>
<td>
<a href="https://github.com/jean997/cause/blob/ded169320dba625535002b37986d526ba2f94dae/analysis/gwas_pairs.Rmd" target="_blank">ded1693</a>
</td>
<td>
Jean Morrison
</td>
<td>
2019-07-30
</td>
<td>
wflow_publish(“analysis/gwas_pairs.Rmd”)
</td>
</tr>
<tr>
<td>
Rmd
</td>
<td>
<a href="https://github.com/jean997/cause/blob/ff51b982cfe73959bdf419b3f60d3da88b7fd554/analysis/gwas_pairs.Rmd" target="_blank">ff51b98</a>
</td>
<td>
Jean Morrison
</td>
<td>
2019-07-29
</td>
<td>
Working on GWAS pairs documenation
</td>
</tr>
<tr>
<td>
Rmd
</td>
<td>
<a href="https://github.com/jean997/cause/blob/e8c10f62a80fdf384bbc684f0ce328cdc0021b36/analysis/gwas_pairs.Rmd" target="_blank">e8c10f6</a>
</td>
<td>
Jean Morrison
</td>
<td>
2019-07-26
</td>
<td>
Start writing instructions
</td>
</tr>
<tr>
<td>
html
</td>
<td>
<a href="https://rawcdn.githack.com/jean997/cause/3b42836e19e6d6802cdd7aa7bc55b3c9b7703852/docs/gwas_pairs.html" target="_blank">3b42836</a>
</td>
<td>
Jean Morrison
</td>
<td>
2019-07-10
</td>
<td>
Build site.
</td>
</tr>
<tr>
<td>
Rmd
</td>
<td>
<a href="https://github.com/jean997/cause/blob/e9682b2190ef2cd7fa17814deafa80656994f89d/analysis/gwas_pairs.Rmd" target="_blank">e9682b2</a>
</td>
<td>
Jean Morrison
</td>
<td>
2019-07-10
</td>
<td>
wflow_publish(“analysis/gwas_pairs.Rmd”)
</td>
</tr>
<tr>
<td>
html
</td>
<td>
<a href="https://rawcdn.githack.com/jean997/cause/286f4e9e0a432565b96c38bba3a1b155c02f9a78/docs/gwas_pairs.html" target="_blank">286f4e9</a>
</td>
<td>
Jean Morrison
</td>
<td>
2019-06-25
</td>
<td>
Build site.
</td>
</tr>
<tr>
<td>
Rmd
</td>
<td>
<a href="https://github.com/jean997/cause/blob/8f3b82e734b124b6d4d9d28b9defcce8d3726410/analysis/gwas_pairs.Rmd" target="_blank">8f3b82e</a>
</td>
<td>
Jean Morrison
</td>
<td>
2019-06-25
</td>
<td>
wflow_publish(files = c(“analysis/about.Rmd”, “analysis/index.Rmd”, “analysis/ldl_cad.Rmd”, “analysis/license.Rmd”,
</td>
</tr>
</tbody>
</table>
</div>
<hr>
</div>
</div>
</div>
<div id="introduction" class="section level1">
<h1>Introduction</h1>
<p>In this page we walk through an analysis of pairs of 16 traits with publicly available GWAS data using CAUSE. These results are also presented in <a href="https://www.biorxiv.org/content/10.1101/682237v3">the paper</a> (Section 2.3) so this page will serve two functions. The first is that it allows an interested person to replicate those results. The second is that it is an example of how to set up a larger scale anlaysis using CAUSE and explains some of the technical differences from an analysis of a single pair of traits. In the paper, we present results for pairs of 20 traits. However, blood pressure results from Eheret et al (2011) (PMID: 21909115) must be obtained <a href="https://www.ncbi.nlm.nih.gov/projects/gap/cgi-bin/study.cgi?study_id=phs000585.v2.p1">through dbGAP</a> and so aren’t included here.</p>
</div>
<div id="set-up" class="section level1">
<h1>Set Up</h1>
<p>We are using <a href="https://snakemake.readthedocs.io/en/stable/">Snakemake</a> and a conda environment to run this analysis. If you don’t have Miniconda or Anaconda installed you can either install one of them (recomended) or just make sure that you have Python3, pandas and Snakemake installed. We have chosen to not include R in the conda environment so you will need to have R installed outside the environment and also have the <code>cause</code> and <code>tidyverse</code> R packages installed and running. If you were able to work through the <a href="ldl_cad.html">package tutorial</a> you should be in good shape.</p>
<p>Snakemake is a tool for creating scalable workflows. In our case we are using it to perform the same set of data processing and analysis steps for all pairs of traits. We will walk through exactly what the Snakemake analysis is doing in the next sections.</p>
<p>The first set up step is to create the conda environment</p>
<pre><code>conda create -n cause_large python=3.6 snakemake</code></pre>
<p>Next create a working directory that you would like to analyze the data in. Change to that directory using <code>cd</code> in Mac or Linux. For example</p>
<pre><code>mkdir gwas_pairs
cd gwas_pairs</code></pre>
<p>The last step is to download the data and code that we will use. Inside of R, run</p>
<pre><code>cause::setup_gwas_pairs()</code></pre>
<p>This function sets up the analysis directory and is a shortcut to downloading all the data and code we will use in this analysis. Downloading the data might take up to half an hour depending on your network speed. Here is what the function downloads.</p>
<ol style="list-style-type: decimal">
<li><p>GWAS summary statistics, cleaned and formatted. We will talk about these more later on. These files go in the <code>data/</code> subdirectory.</p></li>
<li><p>LD data estimated from 1000 Genomes CEU populatoin. This goes in the <code>ld/</code> subdirectory.</p></li>
<li><p>Some R scripts that will be used to run the analysis. These are in the <code>R/</code> subdirectory.</p></li>
<li><p>A Snakemake file called <code>pairs_snakemake.py</code>.</p></li>
</ol>
<p>In the rest of this document we will go through the Snakemake file in detail and explore the scripts that it calls. The analysis is designed to be run on a cluster and can be executed with a single command. First activate the conda environment.</p>
<pre><code>source activate cause_large</code></pre>
<p>The Snakemake command below assumes you are using a cluster with a Slurm workload manager. If your cluster uses something else you should edit the value that is given to the <code>--cluster</code> argument. You may need to edit this anyway to include necessary information. For example, if you are working on the University of Chicago Research Computing Center you will need to add <code>--account</code> and <code>--partition</code> arguments.</p>
<pre><code>nohup snakemake -s pairs_snakemake.py --keep-going --jobs 96 --cluster "sbatch --output={params.log}_%A.out --error={params.log}_%A.err --cpus-per-task={params.cpus} --ntasks=1 --mem-per-cpu={params.mem} --time=1:00:00 --job-name={params.jobname}" > pairs.out &</code></pre>
</div>
<div id="data-format" class="section level1">
<h1>Data format</h1>
<p>Currently there is no standard format for GWAS summary statistics so when you are downloading summary statistics from different sources they are likely to have different formats and may not have effect alleles oriented the same way. Many analysis steps are faster and simpler if all the data files are in the same format and have effect alleles oriented consistently.</p>
<p>The data files downloaded by <code>setup_gwas_pairs()</code> have been pre-formatted so they are ready to use. After running <code>setup_gwas_pairs()</code> you will find a file <code>data/gwas_info.csv</code> that gives information about each study and the original download source. Open up the file and take a look.</p>
<pre class="r"><code>library(tidyverse)
library(cause)</code></pre>
<pre class="r"><code>info <- read_csv("data/gwas_info.csv")</code></pre>
<pre><code>Parsed with column specification:
cols(
consortium = col_character(),
trait = col_character(),
full_trait_name = col_character(),
PMID = col_double(),
pub_sample_size = col_double(),
pub_cases = col_double(),
pub_controls = col_double(),
first_author = col_character(),
pub_year = col_double(),
summary_statistics_link = col_character(),
snp = col_character(),
a1 = col_character(),
a2 = col_character(),
beta_hat = col_character(),
se = col_character(),
p_value = col_character(),
sample_size = col_character(),
regression_type = col_character()
)</code></pre>
<pre class="r"><code>head(info) %>% print(width = Inf)</code></pre>
<pre><code># A tibble: 6 x 18
consortium trait full_trait_name PMID pub_sample_size pub_cases
<chr> <chr> <chr> <dbl> <dbl> <dbl>
1 glg tg triglycerides 24097068 188577 NA
2 glg ldl ldl 24097068 188577 NA
3 glg hdl hdl 24097068 188577 NA
4 glg tc total_cholesterol 24097068 188577 NA
5 giant height height 25282103 253288 NA
6 giant bmi body_mass_index 25673413 339224 NA
pub_controls first_author pub_year
<dbl> <chr> <dbl>
1 NA Willer 2013
2 NA Willer 2013
3 NA Willer 2013
4 NA Willer 2013
5 NA Wood 2014
6 NA Locke 2015
summary_statistics_link
<chr>
1 http://csg.sph.umich.edu/abecasis/public/lipids2013/jointGwasMc_TG.txt.gz
2 http://csg.sph.umich.edu/abecasis/public/lipids2013/jointGwasMc_LDL.txt.…
3 http://csg.sph.umich.edu/abecasis/public/lipids2013/jointGwasMc_HDL.txt.…
4 http://csg.sph.umich.edu/abecasis/public/lipids2013/jointGwasMc_TC.txt.gz
5 http://portals.broadinstitute.org/collaboration/giant/images/0/01/GIANT_…
6 http://portals.broadinstitute.org/collaboration/giant/images/1/15/SNP_gw…
snp a1 a2 beta_hat se p_value sample_size
<chr> <chr> <chr> <chr> <chr> <chr> <chr>
1 rsid A1 A2 beta se P.value N
2 rsid A1 A2 beta se P-value N
3 rsid A1 A2 beta se P-value N
4 rsid A1 A2 beta se P-value N
5 MarkerName Allele1 Allele2 b SE P.value N
6 SNP A1 A2 b se P.value N
regression_type
<chr>
1 linear
2 linear
3 linear
4 linear
5 linear
6 linear </code></pre>
<p>For each study we have recorded a short string to indicate the consortium or data set used (eg. <code>glg</code> = Global Lipid Genetics Consortium), a short string to inidicate the trait, the full trait name, information about the source publication (PMID, first author, and publication year), the total sample size from the publication and number of cases and controls if relevant and the original download link. The remaining columns give the column name in the original data of important fields. We don’t need this information for our analysis here. All of the formatted data files that have been downloaded are named <code>data/{consortium}_{trait}_summary_statistics.tsv.gz</code>. To convert the data from their original formats to a standard format, we used <a href="https://github.com/jhmarcus/gwass">a summary statistics processing tool</a> created by Joseph Marcus. This tool is a little more complicated than is required for CAUSE and uses a large external data reference. We hope to include a simpler data formatting function in the <code>cause</code> R package soon. Lets take a look at some of the formatted data. Use the following R commands</p>
<pre class="r"><code>dat <- read_tsv("data/ckdgen_egfrcrea_summary_statistics.tsv.gz",
col_type=list(col_character(),col_integer(),
col_character(),col_character(),
col_character(),col_double(),col_double(),
col_double(),col_double(),
col_double()))
head(dat) %>% print(width = Inf)</code></pre>
<pre><code># A tibble: 6 x 10
chrom pos snp ref_allele alt_allele beta_hat se p_value
<chr> <int> <chr> <chr> <chr> <dbl> <dbl> <dbl>
1 1 752566 rs3094315 G A -0.0013 0.0015 0.38
2 1 754192 rs3131968 A G -0.0013 0.0019 0.5
3 1 768448 rs12562034 G A -0.0014 0.0023 0.55
4 1 775659 rs2905035 A G -0.0022 0.0019 0.24
5 1 776546 rs12124819 A G -0.003 0.0018 0.092
6 1 779322 rs4040617 A G 0.0019 0.0019 0.33
sample_size f_eur
<dbl> <dbl>
1 114684 0.16
2 102660 0.128
3 106355 0.908
4 104963 0.128
5 109251 0.771
6 99471 0.882</code></pre>
<p>In our analysis we will exploit the following features of the data format:</p>
<ol style="list-style-type: decimal">
<li><p>All the files have the same information fields in the same order and with the same column names.</p></li>
<li><p>All of the alleles are oriented the same way. This means, for example, that if rs3094315 appears in another study, it will also have reference allele G and alternative allele A in that study.</p></li>
</ol>
<p>In the future, we will update this section with instructions on how to achieve this using CAUSE functions. If your data are formatted with the same columns we have used (and also saved as a tsv) then you will be able to analyze it using our code making only minimal changes to the <code>paires_snakemake.py</code> file.</p>
</div>
<div id="analysis-steps" class="section level1">
<h1>Analysis Steps</h1>
<p>We will now walk through all the steps in the Snakemake file and explain what they do in detail. If your data is formatted in the same way as ours (see above) you should be able to use all of this code and will only need to change the preamble portion so that your file names match. It will be helpful to familiarize yourself with Snakemake syntax a little before you begin.</p>
<div id="preamble" class="section level2">
<h2>Preamble</h2>
<p>In the preamble section we set up the analysis we want to do. First we list some directories.</p>
<pre><code>import pandas as pd
data_dir = "data/" #where the data is
ld_dir = "ld/" #where the ld data is
cause_dir = "cause/" #where CAUSE results will go
mr_dir = "mr/" #where other MR method results will go</code></pre>
<p>Next we create a table of all the trait pairs we’d like to analyze.</p>
<pre><code>consortia = ["giant", "giant", "lu",
"glg", "glg", "glg", "glg",
"ckdgen", "gefos",
"egg", "egg", "egg",
"vanderHarst", "diagram",
"megastroke", "magic"]
traits = ["height", "bmi", "bfp",
"tg", "ldl", "hdl", "tc",
"egfrcrea", "bone",
"bl", "bw", "hc",
"cad", "t2d",
"as", "fg"]
tags = [consortia[i] + "_" + traits[i] for i in range(len(traits))]
tag_pairs = [(tag1, tag2) for tag1 in tags for tag2 in tags if tag1!=tag2]
</code></pre>
<p>We will refer to the string <code>{consortium}_{trait}</code> as a “tag” in the rest of this analysis. Finally, in Snakemake, the rule <code>all</code> lists all the files we should have at the end of the analysis. The rest of the file will explain how to produce these.</p>
<pre><code>rule all:
input: expand(mr_dir + '{tp[0]}__{tp[1]}_mr.RDS', tp = tag_pairs),
expand(mr_dir + '{tp[0]}__{tp[1]}_mrpresso.RDS', tp = tag_pairs),
expand(mr_dir + '{tp[0]}__{tp[1]}_mregger.RDS', tp = tag_pairs),
expand(cause_dir + '{tp[0]}__{tp[1]}_cause.RDS', tp = tag_pairs)
</code></pre>
</div>
<div id="data-overlap-with-awk" class="section level2">
<h2>Data overlap with Awk</h2>
<p>We use Awk to write out temporary files that will speed up some of the later analysis steps</p>
<pre><code>rule data_overlap:
input: file1 = data_dir + '{tag1}_summary_statistics.tsv.gz',
file2 = data_dir + '{tag2}_summary_statistics.tsv.gz'
output: out= temp(data_dir + "{tag1}__{tag2}_overlap.tsv.gz")
params: log="tempov", mem="20G", cpus="1",
jobname='dataov'
shell: """
snps() {{ gzip -cd "$@" | awk '{{ if ($7!="NA" && $7 > 0 && $6!="NA") print $3 }}' ;}}
full() {{ gzip -cd "$@" | awk '{{ if ($7!="NA" && $7 > 0 && $6!="NA") print $0 }}' ;}}
snps {input.file2} | awk 'NR==FNR{{F1[$0];next}}$3 in F1{{print}}' - <(full {input.file1}) | gzip > {output.out}
"""</code></pre>
<p>This step takes as input two data files, one for tag1 (trait <span class="math inline">\(M\)</span>) and one for tag2 (trait <span class="math inline">\(Y\)</span>). It outputs a file that is simply the subset of the tag1 data for SNPs that are in both tag1 and tag2 GWAS. The <code>temp()</code> in the <code>output:</code> line tells Snakemake to delete these files when we are done with them. This step also filters out SNPs that have missing effect estimates or standard errors or who’s standard errors are non-positive.</p>
</div>
<div id="ld-pruning" class="section level2">
<h2>LD Pruning</h2>
<p>CAUSE estimates posteriors using a set of LD pruned variants. To maximize power, we LD prune preferentially choosing variants with low tarit <span class="math inline">\(M\)</span> <span class="math inline">\(p\)</span>-values. The next two rules in the Snakemake file write a list of LD pruned variants for each trait pair.</p>
<p>First there is a rule that LD prunes a single chromosome:</p>
<pre><code>rule ld_prune_one_chrom:
input: data = data_dir + '{tag1}__{tag2}_overlap.tsv.gz',
ld1 = ld_dir + 'chr{chrom}_AF0.05_0.1.RDS',
ld2 = ld_dir + 'chr{chrom}_AF0.05_snpdata.RDS'
output: out=temp(data_dir + "snps_{tag1}__{tag2}.pruned.{chrom}.RDS")
params: log="ldprune", mem="10G", cpus="4",
pval_thresh = "1e-3", r2_thresh = 0.1 ,
jobname='ldprune_{chrom}', partition="broadwl"
shell: 'Rscript R/ld_prune_one_chrom.R {input.data} {wildcards.chrom} \
{params.pval_thresh} {params.r2_thresh} {input.ld1} {input.ld2} {output.out}'
</code></pre>
<p>This rule takes as input the overlap data set for trait <span class="math inline">\(M\)</span> that we created previously and LD data. The output is a pruned list of SNPs on a given chromosome. The rule calls an R scirpt <code>R/ld_prune_one_chrom.R</code> that reads in the data, removes duplicated SNPs and then LD prunes using the function <code>cause::ld_prune</code>.</p>
<p>The next rule concatonates pruned lists for all chromosomes for a single pair into one file.</p>
<pre><code>rule ld_prune_combine:
input: fls = expand( data_dir + "snps_{{tag1}}__{{tag2}}.pruned.{chr}.RDS", chr = range(1, 23))
output: out1 = data_dir + "snps_{tag1}__{tag2}.pruned.txt"
params: log="ld_comb", mem="2G", cpus="1",
jobname='combine', partition="broadwl"
shell: "Rscript R/ld_cat.R {output.out1} {input.fls}"</code></pre>
</div>
<div id="cause" class="section level2">
<h2>CAUSE</h2>
<p>The next step is to run CAUSE</p>
<pre><code>rule cause:
input: file1 = data_dir + "{tag1}__{tag2}_overlap.tsv.gz",
file2 = data_dir + '{tag2}__{tag1}_overlap.tsv.gz',
snps = data_dir + 'snps_{tag1}__{tag2}.pruned.txt'
output: params = cause_dir + '{tag1}__{tag2}_params.RDS',
cause = cause_dir + '{tag1}__{tag2}_cause.RDS',
data = data_dir + '{tag1}__{tag2}_data.RDS'
params: log="cause", mem="5G", cpus="8",
jobname='cause', seed = 100
shell: 'Rscript R/cause.R {input.file1} {input.file2} \
{input.snps} {output.params} \
{output.cause} {output.data} {params.seed}'</code></pre>