-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpda_experimentalDesign1.html
More file actions
1247 lines (1142 loc) · 91.3 KB
/
pda_experimentalDesign1.html
File metadata and controls
1247 lines (1142 loc) · 91.3 KB
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>
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
<meta name="author" content="Lieven Clement" />
<title>Experimental Design</title>
<script src="site_libs/jquery-3.6.0/jquery-3.6.0.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="site_libs/bootstrap-3.3.5/css/flatly.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>
<style>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;}
code {color: inherit; background-color: rgba(0, 0, 0, 0.04);}
pre:not([class]) { background-color: white }</style>
<script src="site_libs/jqueryui-1.13.2/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>
<script src="site_libs/navigation-1.1/codefolding.js"></script>
<script src="site_libs/navigation-1.1/sourceembed.js"></script>
<link href="site_libs/pagedtable-1.1/css/pagedtable.css" rel="stylesheet" />
<script src="site_libs/pagedtable-1.1/js/pagedtable.js"></script>
<link href="site_libs/font-awesome-6.4.2/css/all.min.css" rel="stylesheet" />
<link href="site_libs/font-awesome-6.4.2/css/v4-shims.min.css" rel="stylesheet" />
<style type="text/css">
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
</style>
<style type="text/css">
code {
white-space: pre;
}
.sourceCode {
overflow: visible;
}
</style>
<style type="text/css" data-origin="pandoc">
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { display: inline-block; text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
color: #aaaaaa;
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
div.sourceCode
{ background-color: #f8f8f8; }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
code span.al { color: #ef2929; } /* Alert */
code span.an { color: #8f5902; font-weight: bold; font-style: italic; } /* Annotation */
code span.at { color: #204a87; } /* Attribute */
code span.bn { color: #0000cf; } /* BaseN */
code span.cf { color: #204a87; font-weight: bold; } /* ControlFlow */
code span.ch { color: #4e9a06; } /* Char */
code span.cn { color: #8f5902; } /* Constant */
code span.co { color: #8f5902; font-style: italic; } /* Comment */
code span.cv { color: #8f5902; font-weight: bold; font-style: italic; } /* CommentVar */
code span.do { color: #8f5902; font-weight: bold; font-style: italic; } /* Documentation */
code span.dt { color: #204a87; } /* DataType */
code span.dv { color: #0000cf; } /* DecVal */
code span.er { color: #a40000; font-weight: bold; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #0000cf; } /* Float */
code span.fu { color: #204a87; font-weight: bold; } /* Function */
code span.im { } /* Import */
code span.in { color: #8f5902; font-weight: bold; font-style: italic; } /* Information */
code span.kw { color: #204a87; font-weight: bold; } /* Keyword */
code span.op { color: #ce5c00; font-weight: bold; } /* Operator */
code span.ot { color: #8f5902; } /* Other */
code span.pp { color: #8f5902; font-style: italic; } /* Preprocessor */
code span.sc { color: #ce5c00; font-weight: bold; } /* SpecialChar */
code span.ss { color: #4e9a06; } /* SpecialString */
code span.st { color: #4e9a06; } /* String */
code span.va { color: #000000; } /* Variable */
code span.vs { color: #4e9a06; } /* VerbatimString */
code span.wa { color: #8f5902; font-weight: bold; font-style: italic; } /* Warning */
.sourceCode .row {
width: 100%;
}
.sourceCode {
overflow-x: auto;
}
.code-folding-btn {
margin-right: -30px;
}
</style>
<script>
// apply pandoc div.sourceCode style to pre.sourceCode instead
(function() {
var sheets = document.styleSheets;
for (var i = 0; i < sheets.length; i++) {
if (sheets[i].ownerNode.dataset["origin"] !== "pandoc") continue;
try { var rules = sheets[i].cssRules; } catch (e) { continue; }
var j = 0;
while (j < rules.length) {
var rule = rules[j];
// check if there is a div.sourceCode rule
if (rule.type !== rule.STYLE_RULE || rule.selectorText !== "div.sourceCode") {
j++;
continue;
}
var style = rule.style.cssText;
// check if color or background-color is set
if (rule.style.color === '' && rule.style.backgroundColor === '') {
j++;
continue;
}
// replace div.sourceCode by a pre.sourceCode rule
sheets[i].deleteRule(j);
sheets[i].insertRule('pre.sourceCode{' + style + '}', j);
}
}
})();
</script>
<style type="text/css">
#rmd-source-code {
display: none;
}
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
<style type = "text/css">
.main-container {
max-width: 940px;
margin-left: auto;
margin-right: auto;
}
img {
max-width:100%;
}
.tabbed-pane {
padding-top: 12px;
}
.html-widget {
margin-bottom: 20px;
}
button.code-folding-btn:focus {
outline: none;
}
summary {
display: list-item;
}
details > summary > p:only-child {
display: inline;
}
pre code {
padding: 0;
}
</style>
<style type="text/css">
.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: #adb5bd;
}
.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 type="text/javascript">
// 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 the anchor link active (and if it's in a dropdown, also mark that active)
var dropdown = menuAnchor.closest('li.dropdown');
if (window.bootstrap) { // Bootstrap 4+
menuAnchor.addClass('active');
dropdown.find('> .dropdown-toggle').addClass('active');
} else { // Bootstrap 3
menuAnchor.parent().addClass('active');
dropdown.addClass('active');
}
// Navbar adjustments
var navHeight = $(".navbar").first().height() + 15;
var style = document.createElement('style');
var pt = "padding-top: " + navHeight + "px; ";
var mt = "margin-top: -" + navHeight + "px; ";
var css = "";
// offset scroll position for anchor links (for fixed navbar)
for (var i = 1; i <= 6; i++) {
css += ".section h" + i + "{ " + pt + mt + "}\n";
}
style.innerHTML = "body {" + pt + "padding-bottom: 40px; }\n" + css;
document.head.appendChild(style);
});
</script>
<!-- tabsets -->
<style type="text/css">
.tabset-dropdown > .nav-tabs {
display: inline-table;
max-height: 500px;
min-height: 44px;
overflow-y: auto;
border: 1px solid #ddd;
border-radius: 4px;
}
.tabset-dropdown > .nav-tabs > li.active:before, .tabset-dropdown > .nav-tabs.nav-tabs-open:before {
content: "\e259";
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: "\e258";
font-family: 'Glyphicons Halflings';
border: none;
}
.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;
background-color: transparent;
}
.tabset-dropdown > .nav-tabs.nav-tabs-open > li {
display: block;
float: none;
}
.tabset-dropdown > .nav-tabs > li {
display: none;
}
</style>
<!-- code folding -->
<style type="text/css">
.code-folding-btn { margin-bottom: 4px; }
</style>
<style type="text/css">
#TOC {
margin: 25px 0px 20px 0px;
}
@media (max-width: 768px) {
#TOC {
position: relative;
width: 100%;
}
}
@media print {
.toc-content {
/* see https://github.com/w3c/csswg-drafts/issues/4434 */
float: right;
}
}
.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">
<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-bs-toggle="collapse" data-target="#navbar" data-bs-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">PDA25EBI</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="index.html">
<span class="fa fa-home"></span>
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
<span class="fa fa-chalkboard-teacher"></span>
Topics
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="pda_quantification_preprocessing.html">Quantification - Preprocessing</a>
</li>
<li>
<a href="pda_robustSummarisation_peptideModels.html">Wrap-up Preprocessing - Peptide-Level-Models</a>
</li>
<li>
<a href="pda_quantification_inference.html">Quantification - Differential Abundance Analysis</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
<span class="fa fa-laptop"></span>
Exercises
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="pda_tutorialPreprocessing.html">Quantification - Preprocessing</a>
</li>
<li>
<a href="pda_tutorialDesign.html">Quantification - Design</a>
</li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/statOmics/PDA25EBI">
<span class="fab fa-github"></span>
</a>
</li>
<li>
<a href="http://statomics.github.io/">statOmics</a>
</li>
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
<div id="header">
<div class="btn-group pull-right float-right">
<button type="button" class="btn btn-default btn-xs btn-secondary btn-sm dropdown-toggle" data-toggle="dropdown" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span>Code</span> <span class="caret"></span></button>
<ul class="dropdown-menu dropdown-menu-right" style="min-width: 50px;">
<li><a id="rmd-show-all-code" href="#">Show All Code</a></li>
<li><a id="rmd-hide-all-code" href="#">Hide All Code</a></li>
<li role="separator" class="divider"></li>
<li><a id="rmd-download-source" href="#">Download Rmd</a></li>
</ul>
</div>
<h1 class="title toc-ignore">Experimental Design</h1>
<h4 class="author">Lieven Clement</h4>
<h4 class="date"><a href="https://statomics.github.io">statOmics</a>, Ghent University</h4>
</div>
<p><a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png" /></a></p>
<div id="motivating-example-brunner-et-al.-2022" class="section level1" number="1">
<h1><span class="header-section-number">1</span> Motivating example (Brunner et al. 2022)</h1>
<p><img src="figures/brunner2022mainFig.jpg" width="100%"></p>
<p>Brunner et al. 2022. Mol Syst Biol. 18(3): e10798. doi: 10.15252/msb.202110798</p>
<ul>
<li>Single cell study on 231 HeLa cells with drug induced cell cycle arrest for which over 2500 proteins where measured with MS-SCP.</li>
<li>Authors report:</li>
</ul>
<p>“The proteomes of the different cell cycle states grouped together in a principal component analysis (PCA) plot”.</p>
<p>“Our single‐cell data set also highlighted proteins not previously associated with the cell cycle and the G2/M transition”</p>
<div id="reanalysis-of-the-results" class="section level2" number="1.1">
<h2><span class="header-section-number">1.1</span> Reanalysis of the results</h2>
<p>We could reproduce the results:</p>
<p><img src="figures/brunnerPCACellCycle.png" width="100%"></p>
<p>Another way to look at the same plot</p>
<p><img src="figures/brunnerPCABatch.png" width="100%"></p>
<details>
<summary>
What happened
</summary>
<p>
<p>Confounding between acquisition batch and cell cycle arrest!!</p>
<p>To consult the statistician after an experiment is finished is often merely to ask him to conduct a post mortem examination. He can perhaps say what the experiment died of. – Ronald Fisher</p>
</p>
</details>
<p>Thinking about design before your experiment is key!!!!</p>
</div>
</div>
<div id="stages-of-an-experiment" class="section level1" number="2">
<h1><span class="header-section-number">2</span> Stages of an experiment</h1>
<p><img src="pda_experimentalDesign1_files/figure-html/unnamed-chunk-1-1.png" width="80%" style="display: block; margin: auto;" /></p>
<div id="stages" class="section level2" number="2.1">
<h2><span class="header-section-number">2.1</span> Stages</h2>
<ol style="list-style-type: decimal">
<li><p>Define hypothesis</p></li>
<li><p>Experimental design</p>
<ul>
<li>Population</li>
<li>Technology</li>
<li>Lab protocol</li>
<li>Think about sources of variation</li>
<li>Choice of Design</li>
<li>Experimental conditions</li>
<li>Replicates</li>
<li>How will we analyse the data</li>
<li>How can we translate our research question in a quantity that we can measure</li>
<li>Power analysis</li>
</ul></li>
<li><p>Conduct experiment</p></li>
<li><p>Data Analysis</p>
<ul>
<li>QC</li>
<li>Preprocessing & Data exploration</li>
<li>Statistical inference</li>
</ul></li>
<li><p>Optimisation of your experiment (go back to 2)</p></li>
<li><p>Validation</p></li>
<li><p>Report your results</p></li>
</ol>
<p>Always good to discuss with statistician before the experiment!</p>
</div>
</div>
<div id="sources-of-variability" class="section level1" number="3">
<h1><span class="header-section-number">3</span> Sources of variability</h1>
<div id="experimental-unit" class="section level2" number="3.1">
<h2><span class="header-section-number">3.1</span> Experimental unit</h2>
<ul>
<li>Animal, subject, plant, culture, cage to which the treatment is randomized</li>
<li>Colony (B)</li>
<li>Strain (B)</li>
<li>Culture (B)</li>
<li>Treatment / Condition of interest (B)</li>
<li>Cage (T)</li>
<li>Sex (B)</li>
<li>Individual (B)</li>
<li>Life style (B)</li>
<li>…</li>
</ul>
</div>
<div id="sample-prep" class="section level2" number="3.2">
<h2><span class="header-section-number">3.2</span> Sample prep</h2>
<ul>
<li>Organs from sacrificed animal (B)</li>
<li>Single cells (B)</li>
<li>Runs for Dissociation, Extraction and Digestion (T)</li>
<li>Multipipet / pipeting robot (T)</li>
<li>Plate (T)</li>
<li>Position on plate (T)</li>
</ul>
</div>
<div id="proteomics-acquisition" class="section level2" number="3.3">
<h2><span class="header-section-number">3.3</span> Proteomics acquisition</h2>
<ul>
<li>LC column (T)</li>
<li>Run (T)</li>
<li>Technical repeat (T)</li>
<li>Labeling (T)</li>
<li>Acquisition order</li>
<li>…</li>
</ul>
</div>
<div id="observational-unit" class="section level2" number="3.4">
<h2><span class="header-section-number">3.4</span> Observational unit</h2>
<ul>
<li>Unit on which the measurement is conducted</li>
<li>Cell</li>
<li>Cell bulk</li>
<li>Animal</li>
<li>If observational unit <span class="math inline">\(\neq\)</span> experimental unit: pseudoreplication</li>
</ul>
</div>
<div id="avoid-confounding" class="section level2" number="3.5">
<h2><span class="header-section-number">3.5</span> Avoid confounding</h2>
<ul>
<li>Random sampling & Randomisation</li>
<li>Blocking</li>
</ul>
</div>
</div>
<div id="random-sampling-randomisation" class="section level1" number="4">
<h1><span class="header-section-number">4</span> Random Sampling & Randomisation</h1>
<div id="random-sampling" class="section level2" number="4.1">
<h2><span class="header-section-number">4.1</span> Random Sampling</h2>
<ul>
<li><p>Random sampling is closely related to the concept of the population or the scope of the study.</p></li>
<li><p>Based on a sample of subjects, the researchers want to come to conclusions that hold for</p>
<ul>
<li>all kinds of people</li>
<li>only male students</li>
</ul></li>
<li><p>Scope of the study should be well specified before the start of the study.</p></li>
<li><p>Representative sample: For the statistical analysis to be valid, it is required that the subjects are selected completely at random from the population to which we want to generalize our conclusions.</p></li>
<li><p>Selecting completely at random from a population implies:</p>
<ul>
<li>all subjects in the population should have the same probability of being selected in the sample,</li>
<li>the selection of a subject in the sample should be independent from the selection of the other subjects in the sample.</li>
</ul></li>
</ul>
</div>
<div id="randomisation" class="section level2" number="4.2">
<h2><span class="header-section-number">4.2</span> Randomisation</h2>
<ul>
<li>Make sure that groups are comparable / Avoid systematic differences between groups</li>
<li>Randomisation: treatments of interest are attributed at randam to the experimental units</li>
</ul>
</div>
<div id="consequences-of-random-sampling-randomisation" class="section level2" number="4.3">
<h2><span class="header-section-number">4.3</span> Consequences of Random sampling & Randomisation</h2>
<ul>
<li><p>The sample is thus supposed to be representative for the population, but still it is random.</p></li>
<li><p>What does this imply?</p></li>
</ul>
<div id="national-health-nhanes-study" class="section level3" number="4.3.1">
<h3><span class="header-section-number">4.3.1</span> National Health NHanes study</h3>
<ul>
<li>Since 1960 individuals of all ages are interviewed in their homes every year</li>
<li>The health examination component of the survey is conducted in a mobile examination centre (MEC).</li>
<li>We will use this large study to select random subjects from the American population.</li>
<li>This will help us to understand how the results of an analysis and the conclusions vary from sample to sample.</li>
</ul>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1" tabindex="-1"></a>nhanesSub <span class="ot"><-</span> NHANES <span class="sc">%>%</span></span>
<span id="cb1-2"><a href="#cb1-2" tabindex="-1"></a> <span class="fu">filter</span>(Age <span class="sc">>=</span> <span class="dv">18</span> <span class="sc">&</span> <span class="sc">!</span><span class="fu">is.na</span>(Height)) <span class="sc">%>%</span></span>
<span id="cb1-3"><a href="#cb1-3" tabindex="-1"></a> <span class="fu">select</span>(<span class="fu">c</span>(<span class="st">"Gender"</span>,<span class="st">"Height"</span>))</span>
<span id="cb1-4"><a href="#cb1-4" tabindex="-1"></a></span>
<span id="cb1-5"><a href="#cb1-5" tabindex="-1"></a>nhanesSub <span class="sc">%>%</span> </span>
<span id="cb1-6"><a href="#cb1-6" tabindex="-1"></a> <span class="fu">ggplot</span>(<span class="fu">aes</span>(<span class="at">x =</span> Height)) <span class="sc">+</span></span>
<span id="cb1-7"><a href="#cb1-7" tabindex="-1"></a> <span class="fu">geom_histogram</span>() <span class="sc">+</span></span>
<span id="cb1-8"><a href="#cb1-8" tabindex="-1"></a> <span class="fu">facet_grid</span>(Gender <span class="sc">~</span> .) <span class="sc">+</span></span>
<span id="cb1-9"><a href="#cb1-9" tabindex="-1"></a> <span class="fu">xlab</span>(<span class="st">"Height (cm)"</span>)</span></code></pre></div>
<p><img src="pda_experimentalDesign1_files/figure-html/unnamed-chunk-2-1.png" width="672" /></p>
<table>
<thead>
<tr class="header">
<th align="left">Gender</th>
<th align="right">mean</th>
<th align="right">sd</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">female</td>
<td align="right">162.1</td>
<td align="right">7.3</td>
</tr>
<tr class="even">
<td align="left">male</td>
<td align="right">175.9</td>
<td align="right">7.5</td>
</tr>
</tbody>
</table>
<ul>
<li>Data bell-shaped</li>
<li>Allows us to summarize data with two statistics: mean and standard deviation</li>
</ul>
<p>Unfortunately we cannot sample entire population!
We have to draw conclusions based on a small sample.</p>
</div>
<div id="experiment" class="section level3" number="4.3.2">
<h3><span class="header-section-number">4.3.2</span> Experiment</h3>
<ul>
<li>We can simulate an experiment on the American population by sampling from the NHANES study</li>
<li>5 males and 5 females above 18 years.</li>
</ul>
<img src="pda_experimentalDesign1_files/figure-html/unnamed-chunk-4-1.png" width="672" />
<div data-pagedtable="false">
<script data-pagedtable-source type="application/json">
{"columns":[{"label":["Gender"],"name":[1],"type":["fct"],"align":["left"]},{"label":["mean"],"name":[2],"type":["dbl"],"align":["right"]},{"label":["sd"],"name":[3],"type":["dbl"],"align":["right"]},{"label":["n"],"name":[4],"type":["int"],"align":["right"]},{"label":["se"],"name":[5],"type":["dbl"],"align":["right"]}],"data":[{"1":"female","2":"168.72","3":"10.490329","4":"5","5":"4.691418"},{"1":"male","2":"173.54","3":"7.759704","4":"5","5":"3.470245"}],"options":{"columns":{"min":{},"max":[10]},"rows":{"min":[10],"max":[10]},"pages":{}}}
</script>
</div>
<p>Note that the sample mean is different from that of the large experiment (“population”) we sampled from.</p>
<p>We test for the difference between Males and females</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb2-1"><a href="#cb2-1" tabindex="-1"></a><span class="fu">t.test</span>(Height <span class="sc">~</span> Gender, samp, <span class="at">var.equal =</span> <span class="cn">TRUE</span>)</span></code></pre></div>
<pre><code>
Two Sample t-test
data: Height by Gender
t = -0.82599, df = 8, p-value = 0.4327
alternative hypothesis: true difference in means between group female and group male is not equal to 0
95 percent confidence interval:
-18.276478 8.636478
sample estimates:
mean in group female mean in group male
168.72 173.54 </code></pre>
</div>
<div id="repeat-experiment" class="section level3" number="4.3.3">
<h3><span class="header-section-number">4.3.3</span> Repeat experiment</h3>
<p>If we do the experiment again we select other people and we obtain different results.</p>
<img src="pda_experimentalDesign1_files/figure-html/unnamed-chunk-6-1.png" width="672" />
<div data-pagedtable="false">
<script data-pagedtable-source type="application/json">
{"columns":[{"label":["Gender"],"name":[1],"type":["fct"],"align":["left"]},{"label":["mean"],"name":[2],"type":["dbl"],"align":["right"]},{"label":["sd"],"name":[3],"type":["dbl"],"align":["right"]},{"label":["n"],"name":[4],"type":["int"],"align":["right"]},{"label":["se"],"name":[5],"type":["dbl"],"align":["right"]}],"data":[{"1":"female","2":"158.04","3":"4.998800","4":"5","5":"2.235531"},{"1":"male","2":"177.80","3":"7.532264","4":"5","5":"3.368531"}],"options":{"columns":{"min":{},"max":[10]},"rows":{"min":[10],"max":[10]},"pages":{}}}
</script>
</div>
<pre><code>
Two Sample t-test
data: Height by Gender
t = -4.8876, df = 8, p-value = 0.001213
alternative hypothesis: true difference in means between group female and group male is not equal to 0
95 percent confidence interval:
-29.08282 -10.43718
sample estimates:
mean in group female mean in group male
158.04 177.80 </code></pre>
</div>
<div id="and-again" class="section level3" number="4.3.4">
<h3><span class="header-section-number">4.3.4</span> And again</h3>
<img src="pda_experimentalDesign1_files/figure-html/unnamed-chunk-7-1.png" width="672" />
<div data-pagedtable="false">
<script data-pagedtable-source type="application/json">
{"columns":[{"label":["Gender"],"name":[1],"type":["fct"],"align":["left"]},{"label":["mean"],"name":[2],"type":["dbl"],"align":["right"]},{"label":["sd"],"name":[3],"type":["dbl"],"align":["right"]},{"label":["n"],"name":[4],"type":["int"],"align":["right"]},{"label":["se"],"name":[5],"type":["dbl"],"align":["right"]}],"data":[{"1":"female","2":"172.60","3":"1.973575","4":"5","5":"0.8826098"},{"1":"male","2":"167.78","3":"2.837605","4":"5","5":"1.2690154"}],"options":{"columns":{"min":{},"max":[10]},"rows":{"min":[10],"max":[10]},"pages":{}}}
</script>
</div>
<pre><code>
Two Sample t-test
data: Height by Gender
t = 3.1182, df = 8, p-value = 0.01427
alternative hypothesis: true difference in means between group female and group male is not equal to 0
95 percent confidence interval:
1.255452 8.384548
sample estimates:
mean in group female mean in group male
172.60 167.78 </code></pre>
</div>
</div>
<div id="summary" class="section level2" number="4.4">
<h2><span class="header-section-number">4.4</span> Summary</h2>
<ul>
<li><p>We drew at random different subjects in each sample</p></li>
<li><p>As a result, length measurements vary from sample to sample.</p></li>
<li><p>So do the estimated means and standard deviations.</p></li>
<li><p>Consequently, our conclusions are also uncertain and may change from sample to sample.</p></li>
<li><p>For the length example, samples where the effect is opposite to that in the population and where we decide that the difference is significant are rare.</p></li>
</ul>
<p><span class="math inline">\(\rightarrow\)</span> With statistics, we control for the probability of drawing wrong conclusions.</p>
</div>
</div>
<div id="control-of-decision-errors" class="section level1" number="5">
<h1><span class="header-section-number">5</span> Control of Decision Errors</h1>
<p>We have two types of errors:</p>
<ul>
<li>false negatives: there is an effect but we do not pick it up</li>
<li>false positives: there is no effect but we report a difference between both groups</li>
</ul>
<div id="control-of-false-negatives" class="section level2" number="5.1">
<h2><span class="header-section-number">5.1</span> Control of false negatives</h2>
<ul>
<li>We repeat the experiment with 5 females and 5 males 10000 times.</li>
</ul>
<p><img src="pda_experimentalDesign1_files/figure-html/unnamed-chunk-8-1.png" width="672" /></p>
<pre><code>$x
[1] ""
attr(,"class")
[1] "labels"</code></pre>
<p><img src="pda_experimentalDesign1_files/figure-html/unnamed-chunk-8-2.png" width="672" /></p>
<ul>
<li><p>There are 7234 samples for which we return a true positive <span class="math inline">\(\rightarrow\)</span> The power is 72.3%.</p></li>
<li><p>There are 2766 samples for which we cannot report a significant difference.</p></li>
<li><p>There are 0 for which we report a significant height difference between females and males that is positive.</p></li>
<li><p>The sample that we have shown where we concluded that females were larger than males was very unlikely. We had to draw 88605 samples before we were able to find such an extreme sample.</p></li>
<li><p>Why do we have a considerable number of samples for which we do not find a significant height difference between males and females?</p></li>
</ul>
<div id="larger-sample-size" class="section level3" number="5.1.1">
<h3><span class="header-section-number">5.1.1</span> Larger sample size</h3>
<p>When we take 20 subjects in each group:</p>
<p><img src="pda_experimentalDesign1_files/figure-html/unnamed-chunk-9-1.png" width="672" /></p>
<pre><code>$x
[1] ""
attr(,"class")
[1] "labels"</code></pre>
<p><img src="pda_experimentalDesign1_files/figure-html/unnamed-chunk-9-2.png" width="672" /></p>
<p>Larger sample size:</p>
<ul>
<li>Larger power to pick up a real difference in the population.</li>
<li>Mean is more precise</li>
</ul>
<p><img src="pda_experimentalDesign1_files/figure-html/unnamed-chunk-10-1.png" width="672" /></p>
</div>
</div>
<div id="control-of-false-positives" class="section level2" number="5.2">
<h2><span class="header-section-number">5.2</span> Control of false positives</h2>
<ul>
<li><p>Suppose that we set up an experiment with two groups that are both sampled from the females in the NHANES study</p></li>
<li><p>Both groups come from the same population: so no difference</p></li>
<li><p>We again draw repeated experiments with 5 subjects in each group.</p></li>
</ul>
<p><img src="pda_experimentalDesign1_files/figure-html/unnamed-chunk-11-1.png" width="672" /></p>
<pre><code>$x
[1] ""
attr(,"class")
[1] "labels"</code></pre>
<p><img src="pda_experimentalDesign1_files/figure-html/unnamed-chunk-11-2.png" width="672" /></p>
<ul>
<li><p>Only in 451 out of 10000 samples we conclude that the mean in both groups are different or in 4.5% of the samples.</p></li>
<li><p>With the statistical analysis we can control the number of false positive results correctly at the 5% significance level.</p></li>
</ul>
<div id="larger-sample-size-1" class="section level3" number="5.2.1">
<h3><span class="header-section-number">5.2.1</span> Larger sample size</h3>
<p>We perform the simulations again with 20 subjects in each group.</p>
<p><img src="pda_experimentalDesign1_files/figure-html/unnamed-chunk-12-1.png" width="672" /></p>
<pre><code>$x
[1] ""
attr(,"class")
[1] "labels"</code></pre>
<p><img src="pda_experimentalDesign1_files/figure-html/unnamed-chunk-12-2.png" width="672" /></p>
<ul>
<li><p>Only in 517 out of 10000 samples we conclude that the mean in both groups are different or in 5.2% of the samples.</p></li>
<li><p>So with the statistical analysis, also when taking a large sample, we correctly control the number of false positive results at 5%.</p></li>
<li><p>The mean difference is again more accurately estimated (fluctuating less around the real difference of 0).</p></li>
</ul>
<p><img src="pda_experimentalDesign1_files/figure-html/unnamed-chunk-13-1.png" width="672" /></p>
</div>
</div>
</div>
<div id="control-treatment" class="section level1" number="6">
<h1><span class="header-section-number">6</span> Control treatment</h1>
<p>Captopril study: SBP before and after dosign captopril.</p>
<p><img src="pda_experimentalDesign1_files/figure-html/unnamed-chunk-14-1.png" width="672" /></p>
<pre><code>
Paired t-test
data: SBPa and SBPb
t = -8.1228, df = 14, p-value = 1.146e-06
alternative hypothesis: true mean difference is not equal to 0
95 percent confidence interval:
-23.93258 -13.93409
sample estimates:
mean difference
-18.93333 </code></pre>
<div class="sourceCode" id="cb11"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb11-1"><a href="#cb11-1" tabindex="-1"></a><span class="fu">sd</span>(captopril<span class="sc">$</span>SBPb)</span></code></pre></div>
<pre><code>[1] 20.56511</code></pre>
<div class="sourceCode" id="cb13"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb13-1"><a href="#cb13-1" tabindex="-1"></a><span class="fu">sd</span>(captopril<span class="sc">$</span>SBPa)</span></code></pre></div>
<pre><code>[1] 20.00357</code></pre>
<div class="sourceCode" id="cb15"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb15-1"><a href="#cb15-1" tabindex="-1"></a><span class="fu">sd</span>(captopril<span class="sc">$</span>deltaSBP)</span></code></pre></div>
<pre><code>[1] 9.027471</code></pre>
<p>pre-test/post-test experiment</p>
<ul>
<li>Advantage?</li>
<li>Problem?</li>
</ul>
<hr />
<p><img src="./figures/placebo.png" width="20%" style="float: right;"></p>
<p>Good control is nessecary</p>
<p><span class="math inline">\(\rightarrow\)</span> Placebo controlled double blind experiments<br />
<span class="math inline">\(\rightarrow\)</span> Injection of control animal with blank containing same solvents, etc.</p>
</div>
<div id="replication" class="section level1" number="7">
<h1><span class="header-section-number">7</span> Replication</h1>
<p>Within an experiment: Enables to estimate uncertainty / biological variability</p>
<ul>
<li><p>Replication is essential for quantifying the noise</p></li>
<li><p>Noise: biological and technical in nature</p></li>
</ul>
<p>Between experiments: Any true finding should be reproducible</p>
<div id="at-which-level-do-we-have-to-replicate" class="section level2" number="7.1">
<h2><span class="header-section-number">7.1</span> At which level do we have to replicate?</h2>
<ul>
<li>Genuine replicates include all sources of variability: technical + biological</li>
<li>Technical replicates are important if you assess new technologies</li>
</ul>
<p><img src="figures/sumVarComp.png" /></p>
</div>
<div id="pseudoreplication" class="section level2" number="7.2">
<h2><span class="header-section-number">7.2</span> Pseudoreplication</h2>
<ul>
<li><p>Samples are not independent e.g.</p>
<ul>
<li>Same batch of reagents</li>
<li>Same 96-well plate</li>
<li>Leaves from the same plant</li>
<li>Cells from the same plate</li>
<li>Mice in the same cage or from the same litter</li>
<li>Spatially/chronally clustered together (wells on plate, all trt A measured before trt B)</li>
</ul></li>
<li><p>Try to avoid pseudo-replication: samples are not independent</p>
<ul>
<li>Contain less info than genuine replicates</li>
<li>If analysed as if they were independent <span class="math inline">\(\rightarrow\)</span> increased number of false positives</li>
<li>If not possible e.g. in a multi-subject single cell context, pseudo-replication typically occurs and has to be accounted in the analysis!</li>
<li>Consult statistician</li>
</ul></li>
</ul>
</div>
<div id="francisella-tularensis-study-ramond-et-al.-2015" class="section level2" number="7.3">
<h2><span class="header-section-number">7.3</span> Francisella tularensis study Ramond et al. (2015)</h2>
<ul>
<li>Proteome of wild type F. tularensis (WT) vs ArgP-gene deleted F. tularensis (knock-out, D8).</li>
<li>Each bio-rep in technical triplicate on MS</li>
<li>Illustration with 50S ribosomal proteïn L5 A0Q4J5</li>
</ul>
<p><img src="pda_experimentalDesign1_files/figure-html/unnamed-chunk-16-1.png" width="672" /></p>
<ul>
<li><p>If we analyse original data with a t-test we act as if we would have 9 genuine repeats in each condition</p></li>
<li><p>Effect of interest between bio-reps so no block design</p></li>
<li><p>Same number of technical repeats for each genuine repeat we can first average over the techreps.</p></li>
<li><p>If that is not the case more complex data analysis methods have to be used, e.g. mixed models!</p></li>
<li><p><strong>Caution: never average over genuine repeats/experimental units!!!</strong></p></li>
</ul>
<div id="correct-analysis" class="section level3" number="7.3.1">
<h3><span class="header-section-number">7.3.1</span> Correct analysis</h3>
<div class="sourceCode" id="cb17"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb17-1"><a href="#cb17-1" tabindex="-1"></a>lmBiorep <span class="ot"><-</span> <span class="fu">lm</span>(intensityLog2 <span class="sc">~</span> <span class="sc">-</span><span class="dv">1</span> <span class="sc">+</span> biorep, franc)</span>
<span id="cb17-2"><a href="#cb17-2" tabindex="-1"></a>francSum <span class="ot"><-</span> <span class="fu">data.frame</span>(<span class="at">genotype =</span> <span class="fu">rep</span>(<span class="fu">c</span>(<span class="st">"D8"</span>,<span class="st">"WT"</span>),<span class="at">each=</span><span class="dv">3</span>) <span class="sc">%>%</span> as.factor <span class="sc">%>%</span> <span class="fu">relevel</span>(<span class="st">"WT"</span>), <span class="at">intensityLog2 =</span> lmBiorep<span class="sc">$</span>coef)</span>
<span id="cb17-3"><a href="#cb17-3" tabindex="-1"></a>francSum</span></code></pre></div>
<div data-pagedtable="false">
<script data-pagedtable-source type="application/json">
{"columns":[{"label":[""],"name":["_rn_"],"type":[""],"align":["left"]},{"label":["genotype"],"name":[1],"type":["fct"],"align":["left"]},{"label":["intensityLog2"],"name":[2],"type":["dbl"],"align":["right"]}],"data":[{"1":"D8","2":"27.25286","_rn_":"biorepD8_n3"},{"1":"D8","2":"27.42836","_rn_":"biorepD8_n4"},{"1":"D8","2":"27.39357","_rn_":"biorepD8_n5"},{"1":"WT","2":"27.63831","_rn_":"biorepWT_n3"},{"1":"WT","2":"27.53734","_rn_":"biorepWT_n4"},{"1":"WT","2":"27.57232","_rn_":"biorepWT_n5"}],"options":{"columns":{"min":{},"max":[10]},"rows":{"min":[10],"max":[10]},"pages":{}}}
</script>
</div>
<div class="sourceCode" id="cb18"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb18-1"><a href="#cb18-1" tabindex="-1"></a><span class="fu">t.test</span>(intensityLog2 <span class="sc">~</span> genotype, francSum, <span class="at">var.equal=</span><span class="cn">TRUE</span>)</span></code></pre></div>
<pre><code>
Two Sample t-test
data: intensityLog2 by genotype
t = 3.662, df = 4, p-value = 0.02154
alternative hypothesis: true difference in means between group WT and group D8 is not equal to 0
95 percent confidence interval:
0.05426166 0.39452610
sample estimates:
mean in group WT mean in group D8
27.58266 27.35826 </code></pre>
</div>
<div id="wrong-analysis" class="section level3" number="7.3.2">
<h3><span class="header-section-number">7.3.2</span> Wrong analysis</h3>
<pre><code>
Two Sample t-test
data: intensityLog2 by genotype
t = -4.5904, df = 16, p-value = 0.0003017
alternative hypothesis: true difference in means between group D8 and group WT is not equal to 0
95 percent confidence interval:
-0.3280223 -0.1207654
sample estimates:
mean in group D8 mean in group WT
27.35826 27.58266 </code></pre>
<ul>
<li>Result much more significant because we erroneously act as if we have a 9 by 9 comparison.</li>
</ul>
</div>
<div id="simulation-under-h_0" class="section level3" number="7.3.3">
<h3><span class="header-section-number">7.3.3</span> Simulation under <span class="math inline">\(H_0\)</span></h3>