-
Notifications
You must be signed in to change notification settings - Fork 51
/
Population_Strata.html
938 lines (864 loc) · 46.4 KB
/
Population_Strata.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
<title>Populations strata: subsetting and clone correction</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/sandstone.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/navigation-1.1/tabsets.js"></script>
<script src="site_libs/accessible-code-block-0.0.1/empty-anchor.js"></script>
<link href="site_libs/anchor-sections-1.0/anchor-sections.css" rel="stylesheet" />
<script src="site_libs/anchor-sections-1.0/anchor-sections.js"></script>
<!-- Global Site Tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-107144798-3"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments)};
gtag('js', new Date());
gtag('config', 'UA-107144798-3');
</script>
<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;}</style>
<style type="text/css" data-origin="pandoc">
code.sourceCode > span { display: inline-block; line-height: 1.25; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode { white-space: pre; position: relative; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
code.sourceCode { white-space: pre-wrap; }
code.sourceCode > span { 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 {
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: #c4a000; } /* 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: #000000; } /* 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: #000000; } /* 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: #000000; } /* 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 */
</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; }
for (var j = 0; j < rules.length; j++) {
var rule = rules[j];
// check if there is a div.sourceCode rule
if (rule.type !== rule.STYLE_RULE || rule.selectorText !== "div.sourceCode") continue;
var style = rule.style.cssText;
// check if color or background-color is set
if (rule.style.color === '' && rule.style.backgroundColor === '') 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">
pre:not([class]) {
background-color: white;
}
</style>
<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>
<link rel="stylesheet" href="styles.css" type="text/css" />
<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%;
}
.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: 61px;
padding-bottom: 40px;
}
/* offset scroll position for anchor links (for fixed navbar) */
.section h1 {
padding-top: 66px;
margin-top: -66px;
}
.section h2 {
padding-top: 66px;
margin-top: -66px;
}
.section h3 {
padding-top: 66px;
margin-top: -66px;
}
.section h4 {
padding-top: 66px;
margin-top: -66px;
}
.section h5 {
padding-top: 66px;
margin-top: -66px;
}
.section h6 {
padding-top: 66px;
margin-top: -66px;
}
.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;
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 -->
</head>
<body>
<div class="container-fluid main-container">
<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">Population genetics and genomics in R</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="TOC.html">Table of contents</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Part I
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="Introduction.html">Introduction</a>
</li>
<li>
<a href="Getting_ready_to_use_R.html">Getting ready to use R</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Part II
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="Data_Preparation.html">Data preparation</a>
</li>
<li>
<a href="First_Steps.html">First steps</a>
</li>
<li>
<a href="Population_Strata.html">Population strata and clone correction</a>
</li>
<li>
<a href="Locus_Stats.html">Locus-based statistics and missing data</a>
</li>
<li>
<a href="Genotypic_EvenRichDiv.html">Genotypic evenness, richness, and diversity</a>
</li>
<li>
<a href="Linkage_disequilibrium.html">Linkage disequilibrium</a>
</li>
<li>
<a href="Pop_Structure.html">Population structure</a>
</li>
<li>
<a href="Minimum_Spanning_Networks.html">Minimum Spanning Networks</a>
</li>
<li>
<a href="AMOVA.html">AMOVA</a>
</li>
<li>
<a href="DAPC.html">Discriminant analysis of principal components (DAPC)</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Part III
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="intro_vcf.html">Population genomics and HTS</a>
</li>
<li>
<a href="reading_vcf.html">Reading VCF data</a>
</li>
<li>
<a href="analysis_of_genome.html">Analysis of genomic data</a>
</li>
<li>
<a href="gbs_analysis.html">Analysis of GBS data</a>
</li>
<li>
<a href="clustering_plot.html">Clustering plot</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Workshops
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li class="dropdown-submenu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">ICPP</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="workshop_icpp.html">Preparation</a>
</li>
<li>
<a href="intro_vcf.html">Introduction</a>
</li>
<li>
<a href="reading_vcf.html">VCF data</a>
</li>
<li>
<a href="quality_control.html">Quality control</a>
</li>
<li>
<a href="gbs_analysis.html">Analysis of GBS data</a>
</li>
<li>
<a href="analysis_of_genome.html">Analysis of genome data</a>
</li>
</ul>
</li>
<li class="dropdown-submenu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">APS Southern Division</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="workshop_southernAPS.html">Preparation</a>
</li>
<li>
<a href="intro_vcf.html">Introduction</a>
</li>
<li>
<a href="reading_vcf.html">VCF data</a>
</li>
<li>
<a href="quality_control.html">Quality control</a>
</li>
<li>
<a href="gbs_analysis.html">Analysis of GBS data</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
About
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="Authors.html">Authors</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Appendices
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="intro_to_R.html">Introduction to R</a>
</li>
<li>
<a href="Data_sets.html">Data sets</a>
</li>
<li>
<a href="funpendix.html">Function glossary</a>
</li>
<li>
<a href="background_functions.html">Background_functions</a>
</li>
<li>
<a href="https://github.com/grunwaldlab/Population_Genetics_in_R/">Source Code</a>
</li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
<div class="fluid-row" id="header">
<h1 class="title toc-ignore">Populations strata: subsetting and clone correction</h1>
<h3 class="subtitle"><em>ZN Kamvar, SE Everhart, and NJ Grünwald</em></h3>
</div>
<p>Populations are best sampled hierarchically on a range of scales from subpopulations (e.g. fields, valleys, ranges) to regions (e.g. valleys, states, countries or continents) or across time (years or decades). This approach is useful because population structure and evolutionary processes may not be discernible <em>a priori</em>. Most of the times we do not know if population are differentiated spatially or temporally. Thus, a combination of targeted local sampling with sampling over larger spatial or temporal scales is necessary to detect population structure over different scales, without using intense sampling throughout the entire range.</p>
<p>The methods implemented in <em>poppr</em> allow specification of which strata you want to analyze. This is a rapid way of working with subsets of your data without having to perform any data manipulation or changing the input file. In this tutorial, we will show you how to define the hierarchical structure of your data and how to specify specific levels that you might want to analyze.</p>
<div id="data-used-in-this-example" class="section level2">
<h2>Data used in this example</h2>
<p>For this example, we will use the <code>monpop</code> data set <span class="citation">(Everhart & Scherm, 2015)</span>. This microsatellite data consists of 13 loci for 694 individuals of the haploid fungal pathogen <em>Monilinia fructicola</em> that infects peach flowers and fruits in commercial orchards. The monpop population came from four trees within a single orchard (trees 26, 45, and 7). Each tree was sampled in 2009, 2010, and/or 2011. Additionally, each sample was noted as to whether it came from a blossom or a fruit. This example data set is included with the <em>poppr</em> package.</p>
</div>
<div id="working-with-stratified-data" class="section level2">
<h2>Working with stratified data</h2>
<p>The steps for working with stratified data include:</p>
<ol style="list-style-type: decimal">
<li>Import data set with samples labeled according to strata</li>
<li>Define the stratifications for the data</li>
<li>Setting the stratification(s) that you want to have analyzed</li>
</ol>
</div>
<div id="importing-data-labeled-according-to-a-stratum" class="section level2">
<h2>Importing data labeled according to a stratum</h2>
<p>The easiest way to work with stratified data is to label each sample using an underscore “_” to separate each level. This was already done for the monpop data, where each sample was coded hierarchically by tree, year, and symptom in the following format: “Tree_Year_Symptom”.</p>
<p>Let’s load the hierarchically labeled example data:</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1"></a><span class="kw">library</span>(<span class="st">"poppr"</span>)</span>
<span id="cb1-2"><a href="#cb1-2"></a><span class="kw">data</span>(monpop)</span>
<span id="cb1-3"><a href="#cb1-3"></a>monpop</span></code></pre></div>
<pre><code>##
## This is a genclone object
## -------------------------
## Genotype information:
##
## 264 multilocus genotypes
## 694 haploid individuals
## 13 codominant loci
##
## Population information:
##
## 1 stratum - Pop
## 12 populations defined -
## 7_09_BB, 26_09_BB, 26_09_FR, ..., 45_10_FR, 26_11_BB, 26_11_FR</code></pre>
<p><strong>Genotype information</strong> shows us that the data contains 264 multilocus genotypes among 694 haploid individuals with 13 loci. <strong>Population information</strong> has two items, the stratifications and the populations defined. You can think of stratifications as the index names for each of the hierarchical levels within your data (so for our data it should be Tree, Year, and Symptom). By default, however, no stratifications are defined and so this is “Pop”, which is the entire dataset of 694 individuals. Because we labeled each sample according to stratification, populations defined shows us our data has 12 groups defined: 7_09_BB, 26_09_BB, 26_09_FR, 7_09_FR, 26_10_BB, 45_10_BB, 79_10_BB, 79_10_FR, 26_10_FR, 45_10_FR, 26_11_BB, and 26_11_FR.</p>
</div>
<div id="assigning-stratifications" class="section level2">
<h2>Assigning stratifications</h2>
<p>We imported the data that has three stratifications “Tree_Year_Symptom”. In order to analyze our data according to any combination of those three stratifications, we need to tell <em>poppr</em> that the 12 groups should be split by tree, year, and/or symptom. Thus, the first step is to split our data according to strata so that we can access each of the three hierarchical levels in the data. The <code>splitStrata</code> command is used to index the three stratifications:</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb3-1"><a href="#cb3-1"></a><span class="kw">splitStrata</span>(monpop) <-<span class="st"> </span><span class="er">~</span>Tree<span class="op">/</span>Year<span class="op">/</span>Symptom</span>
<span id="cb3-2"><a href="#cb3-2"></a>monpop</span></code></pre></div>
<pre><code>##
## This is a genclone object
## -------------------------
## Genotype information:
##
## 264 multilocus genotypes
## 694 haploid individuals
## 13 codominant loci
##
## Population information:
##
## 3 strata - Tree, Year, Symptom
## 12 populations defined -
## 7_09_BB, 26_09_BB, 26_09_FR, ..., 45_10_FR, 26_11_BB, 26_11_FR</code></pre>
<blockquote>
<p>The <code>splitStrata</code> command only needs to be run once: right after you import your data.</p>
</blockquote>
<p>After splitting the data populations are specified by stratification: “Tree Year Symptom”.</p>
<p>We can look at how the stratifications are distributed by using a <strong>treemap</strong> plot. This is a plot that allows us to visualize hierarchical stratifications. The function we’ll use is called <code>treemap()</code> from the <em>treemap</em> package.</p>
<p>The <code>treemap()</code> function needs only a data frame containing the strata and their respective counts. This can easily be done with the <em>dplyr</em> package where we will:</p>
<ol style="list-style-type: decimal">
<li>Group our strata by Tree, Year, and Symptom</li>
<li>Summarize the data by counting how many times we see each specific combination</li>
</ol>
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb5-1"><a href="#cb5-1"></a><span class="kw">library</span>(<span class="st">"dplyr"</span>)</span>
<span id="cb5-2"><a href="#cb5-2"></a>monstrata <-<span class="st"> </span><span class="kw">strata</span>(monpop) <span class="op">%>%</span><span class="st"> </span></span>
<span id="cb5-3"><a href="#cb5-3"></a><span class="st"> </span><span class="kw">group_by</span>(Tree, Year, Symptom) <span class="op">%>%</span></span>
<span id="cb5-4"><a href="#cb5-4"></a><span class="st"> </span><span class="kw">summarize</span>(<span class="dt">Count =</span> <span class="kw">n</span>())</span>
<span id="cb5-5"><a href="#cb5-5"></a></span>
<span id="cb5-6"><a href="#cb5-6"></a>monstrata</span></code></pre></div>
<pre><code>## # A tibble: 12 x 4
## # Groups: Tree, Year [6]
## Tree Year Symptom Count
## <fct> <fct> <fct> <int>
## 1 7 9 BB 23
## 2 7 9 FR 73
## 3 26 9 BB 41
## 4 26 9 FR 132
## 5 26 10 BB 5
## 6 26 10 FR 85
## 7 26 11 BB 30
## 8 26 11 FR 97
## 9 45 10 BB 13
## 10 45 10 FR 130
## 11 79 10 BB 1
## 12 79 10 FR 64</code></pre>
<p>Now we can use the <code>treemap()</code> function to plot the data. Note that it has a lot of arguments to allow you to properly manipulate the graphic, but we will only use the very necessary components to visualize the distribution of the strata:</p>
<ul>
<li><strong>dtf</strong> - The data frame containing the stratifications and counts</li>
<li><strong>index</strong> - The variables used for nesting (in order)</li>
<li><strong>vSize</strong> - The variable to use to compute the size of the blocks</li>
</ul>
<p>All the other arguments we are using here give various aesthetics. If you want to know more about how they work, you can peruse the manual for the treemap function by typing <code>help("treemap", "treemap")</code>.</p>
<div class="sourceCode" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb7-1"><a href="#cb7-1"></a><span class="kw">library</span>(<span class="st">"treemap"</span>)</span>
<span id="cb7-2"><a href="#cb7-2"></a>monstrata <span class="co"># Our data frame</span></span></code></pre></div>
<pre><code>## # A tibble: 12 x 4
## # Groups: Tree, Year [6]
## Tree Year Symptom Count
## <fct> <fct> <fct> <int>
## 1 7 9 BB 23
## 2 7 9 FR 73
## 3 26 9 BB 41
## 4 26 9 FR 132
## 5 26 10 BB 5
## 6 26 10 FR 85
## 7 26 11 BB 30
## 8 26 11 FR 97
## 9 45 10 BB 13
## 10 45 10 FR 130
## 11 79 10 BB 1
## 12 79 10 FR 64</code></pre>
<div class="sourceCode" id="cb9"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb9-1"><a href="#cb9-1"></a><span class="kw">nameStrata</span>(monpop) <span class="co"># The order of our variables</span></span></code></pre></div>
<pre><code>## [1] "Tree" "Year" "Symptom"</code></pre>
<div class="sourceCode" id="cb11"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb11-1"><a href="#cb11-1"></a>monstrata<span class="op">$</span>Count <span class="co"># The variable used for the block size</span></span></code></pre></div>
<pre><code>## [1] 23 73 41 132 5 85 30 97 13 130 1 64</code></pre>
<div class="sourceCode" id="cb13"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb13-1"><a href="#cb13-1"></a><span class="co"># Adjusting the aesthetics for the labels</span></span>
<span id="cb13-2"><a href="#cb13-2"></a>label_position <-<span class="st"> </span><span class="kw">list</span>(<span class="kw">c</span>(<span class="st">"center"</span>, <span class="st">"top"</span>), <span class="kw">c</span>(<span class="st">"center"</span>, <span class="st">"center"</span>), <span class="kw">c</span>(<span class="st">"center"</span>, <span class="st">"bottom"</span>))</span>
<span id="cb13-3"><a href="#cb13-3"></a>label_size <-<span class="st"> </span><span class="kw">c</span>(<span class="dt">Tree =</span> <span class="dv">0</span>, <span class="dt">Year =</span> <span class="dv">15</span>, <span class="dt">Symptom =</span> <span class="dv">15</span>)</span>
<span id="cb13-4"><a href="#cb13-4"></a></span>
<span id="cb13-5"><a href="#cb13-5"></a><span class="co"># Plotting, First three arguments are necessary.</span></span>
<span id="cb13-6"><a href="#cb13-6"></a><span class="kw">treemap</span>(<span class="dt">dtf =</span> monstrata, <span class="dt">index =</span> <span class="kw">nameStrata</span>(monpop), <span class="dt">vSize =</span> <span class="st">"Count"</span>,</span>
<span id="cb13-7"><a href="#cb13-7"></a> <span class="dt">type =</span> <span class="st">"categorical"</span>, <span class="dt">vColor =</span> <span class="st">"Tree"</span>, <span class="dt">title =</span> <span class="st">"M. fructicola"</span>,</span>
<span id="cb13-8"><a href="#cb13-8"></a> <span class="dt">align.labels =</span> label_position, <span class="dt">fontsize.labels =</span> label_size)</span></code></pre></div>
<p><img src="Population_Strata_files/figure-html/treemap-1.png" width="960" /></p>
<blockquote>
<p>You can also use the <code>itreemap()</code> function for an interactive exploration.</p>
</blockquote>
<p>Next, we analyze the data according to Tree and Year:</p>
<div class="sourceCode" id="cb14"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb14-1"><a href="#cb14-1"></a><span class="kw">setPop</span>(monpop) <-<span class="st"> </span><span class="er">~</span>Tree<span class="op">/</span>Year</span>
<span id="cb14-2"><a href="#cb14-2"></a>monpop</span></code></pre></div>
<pre><code>##
## This is a genclone object
## -------------------------
## Genotype information:
##
## 264 multilocus genotypes
## 694 haploid individuals
## 13 codominant loci
##
## Population information:
##
## 3 strata - Tree, Year, Symptom
## 6 populations defined - 7_9, 26_9, 26_10, 45_10, 79_10, 26_11</code></pre>
<p>To analyze the data according to Symptom:</p>
<div class="sourceCode" id="cb16"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb16-1"><a href="#cb16-1"></a><span class="kw">setPop</span>(monpop) <-<span class="st"> </span><span class="er">~</span>Symptom</span>
<span id="cb16-2"><a href="#cb16-2"></a>monpop</span></code></pre></div>
<pre><code>##
## This is a genclone object
## -------------------------
## Genotype information:
##
## 264 multilocus genotypes
## 694 haploid individuals
## 13 codominant loci
##
## Population information:
##
## 3 strata - Tree, Year, Symptom
## 2 populations defined - BB, FR</code></pre>
<p>Order of the levels that you define is important, so if we wanted to define the symptoms according to tree, we would use the following:</p>
<div class="sourceCode" id="cb18"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb18-1"><a href="#cb18-1"></a><span class="kw">setPop</span>(monpop) <-<span class="st"> </span><span class="er">~</span>Symptom<span class="op">/</span>Tree</span>
<span id="cb18-2"><a href="#cb18-2"></a>monpop</span></code></pre></div>
<pre><code>##
## This is a genclone object
## -------------------------
## Genotype information:
##
## 264 multilocus genotypes
## 694 haploid individuals
## 13 codominant loci
##
## Population information:
##
## 3 strata - Tree, Year, Symptom
## 8 populations defined - BB_7, BB_26, FR_26, ..., BB_79, FR_79, FR_45</code></pre>
<p>Now that we have laid out the basics of manipulating data by strata, we will now apply strata for clone correction.</p>
</div>
<div id="clone-correction" class="section level2">
<h2>Clone correction</h2>
<p>When dealing with clonal populations, analyses are typically conducted with and without clone correction. Clone correction is a method of censoring a data set such that only one individual per MLG is represented per population <span class="citation">(Milgroom, 1996; Grünwald et al., 2003; Grünwald & Hoheisel, 2006)</span>. This technique is commonly used with the index of association and genotypic diversity measures since clone corrected populations approximate behavior of sexual populations. Since we want to only observe unique genotypes per population, clone correction requires specification of the stratifications at which clones should be censored. This section will show how to clone correct at a specific stratification and also compare the results with uncorrected data.</p>
<blockquote>
<p>Question: Will allelic diversity increase or decrease with clone-censored data?</p>
</blockquote>
<p>Using <code>monpop</code> as an example, if we wanted to know the diversity of alleles within each tree per year, how should we go about correcting for the clones? We use the function <code>clonecorrect</code> specifying the “Tree/Year” strata:</p>
<div class="sourceCode" id="cb20"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb20-1"><a href="#cb20-1"></a>mcc_TY <-<span class="st"> </span><span class="kw">clonecorrect</span>(monpop, <span class="dt">strata =</span> <span class="op">~</span>Tree<span class="op">/</span>Year, <span class="dt">keep =</span> <span class="dv">1</span><span class="op">:</span><span class="dv">2</span>)</span>
<span id="cb20-2"><a href="#cb20-2"></a>mcc_TY</span></code></pre></div>
<pre><code>##
## This is a genclone object
## -------------------------
## Genotype information:
##
## 264 multilocus genotypes
## 278 haploid individuals
## 13 codominant loci
##
## Population information:
##
## 3 strata - Tree, Year, Symptom
## 6 populations defined - 7_9, 26_9, 26_10, 45_10, 79_10, 26_11</code></pre>
<p>Notice that the number of samples reduced from 694 to 278, but is still more than the number of MLGs. This indicates that there are duplicated genotypes that cross trees and years, but that’s okay because of our definition of a clone-corrected data set as having one representative genotype <em>per population</em>. Before we continue, we should set the original data to the same strata:</p>
<div class="sourceCode" id="cb22"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb22-1"><a href="#cb22-1"></a><span class="kw">setPop</span>(monpop) <-<span class="st"> </span><span class="er">~</span>Tree<span class="op">/</span>Year</span></code></pre></div>
<p>Now we can compare the diversity of alleles at each locus using Simpson’s index (<span class="math inline">\(1-D\)</span>) as implemented in the function <code>locus_table</code> (Detailed in our <a href="Locus_Stats.html">chapter on locus based statistics</a>). We will do this in three steps:</p>
<ol style="list-style-type: decimal">
<li>Calculate diversity of the clone corrected data</li>
<li>Calculate diversity of the uncorrected data</li>
<li>Take the difference of <strong>step 1</strong> from <strong>step 2</strong>.</li>
</ol>
<div class="sourceCode" id="cb23"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb23-1"><a href="#cb23-1"></a>cc <-<span class="st"> </span><span class="kw">locus_table</span>(mcc_TY, <span class="dt">info =</span> <span class="ot">FALSE</span>)</span>
<span id="cb23-2"><a href="#cb23-2"></a>mp <-<span class="st"> </span><span class="kw">locus_table</span>(monpop, <span class="dt">info =</span> <span class="ot">FALSE</span>)</span>
<span id="cb23-3"><a href="#cb23-3"></a>mp <span class="op">-</span><span class="st"> </span>cc</span></code></pre></div>
<pre><code>## summary
## locus allele 1-D Hexp Evenness
## CHMFc4 . 0.00158 0.00031 0.00160
## CHMFc5 . -0.09045 -0.09114 -0.04291
## CHMFc12 . 0.00425 0.00312 0.03873
## SEA . 0.03122 0.02983 0.08509
## SED . -0.07392 -0.07564 -0.07563
## SEE . -0.04693 -0.04770 -0.02642
## SEG . 0.03202 0.03071 0.04818
## SEI . -0.00902 -0.01053 0.03060
## SEL . -0.00919 -0.01071 -0.05397
## SEN . -0.05006 -0.05176 -0.07643
## SEP . 0.01648 0.01511 0.04087
## SEQ . -0.05442 -0.05620 -0.08707
## SER . -0.04207 -0.04374 -0.02363
## mean . -0.02235 -0.02372 -0.01085</code></pre>
<p>Let’s plot <span class="math inline">\(1-D\)</span> so that we can see it better:</p>
<div class="sourceCode" id="cb25"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb25-1"><a href="#cb25-1"></a>locus_diff <-<span class="st"> </span>mp <span class="op">-</span><span class="st"> </span>cc</span>
<span id="cb25-2"><a href="#cb25-2"></a></span>
<span id="cb25-3"><a href="#cb25-3"></a><span class="co"># Note that I need to select the column containing Simpson's Index. That's</span></span>
<span id="cb25-4"><a href="#cb25-4"></a><span class="co"># labeled as "1-D".</span></span>
<span id="cb25-5"><a href="#cb25-5"></a><span class="kw">barplot</span>(locus_diff[, <span class="st">"1-D"</span>], <span class="dt">ylab =</span> <span class="st">"Change in Simpson's Index"</span>, <span class="dt">xlab =</span> <span class="st">"Locus"</span>,</span>
<span id="cb25-6"><a href="#cb25-6"></a> <span class="dt">main =</span> <span class="st">"Comparison of clone-corrected vs. uncorrected data"</span>)</span></code></pre></div>
<p><img src="Population_Strata_files/figure-html/simpdivplot-1.png" width="672" /></p>
<p>We can see quite a difference in some loci after clone correcting based on tree in the overall data set showing that, while some loci show a decrease, many loci show an increase in allelic diversity after clone-correction.</p>
<div id="advanced-r-writing-your-own-functions-for-analysis-by-stratum" class="section level3">
<h3>Advanced R: writing your own functions for analysis by stratum</h3>
<p>Of course, we still want to analyze each tree/year combination separately. Instead of typing those commands above for each combination, we can write a function to do it for us.</p>
<p>A function can be thought of as a set of instructions that tells the computer what to do. You have been using functions before such as <code>poppr()</code>. A function is written like this:</p>
<div class="sourceCode" id="cb26"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb26-1"><a href="#cb26-1"></a>fun_name <-<span class="st"> </span><span class="cf">function</span>(arguments){</span>
<span id="cb26-2"><a href="#cb26-2"></a> <span class="co"># instructions</span></span>
<span id="cb26-3"><a href="#cb26-3"></a>}</span></code></pre></div>
<p><code>fun_name</code> is the name of the function, the R command <code>function</code> tells R that you are about to write a function. Arguments are variables that you will pass to the function and the curly braces (<code>{</code> and <code>}</code>) provide the area where you write all the steps of the function. Next, we will go through an example of writing a function.</p>
<div id="example-harmonic-mean" class="section level4">
<h4>Example: harmonic mean</h4>
<p>Let’s write a function that will take the harmonic mean of a vector of numbers. First, we’ll see how to do this calculation step by step before we write a function.</p>
<blockquote>
<p>The harmonic mean has been utilized to estimate effective population size of a population that has undergone drastic changes in population size <span class="citation">(Nielsen & Slatkin, 2013)</span>.</p>
</blockquote>
<div class="sourceCode" id="cb27"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb27-1"><a href="#cb27-1"></a>psize <-<span class="st"> </span><span class="kw">c</span>(<span class="dv">10</span>, <span class="dv">100</span>, <span class="dv">50</span>, <span class="dv">80</span>, <span class="dv">20</span>, <span class="dv">500</span>)</span>
<span id="cb27-2"><a href="#cb27-2"></a><span class="co"># Arithmetic mean</span></span>
<span id="cb27-3"><a href="#cb27-3"></a><span class="kw">mean</span>(psize)</span></code></pre></div>
<pre><code>## [1] 126.6667</code></pre>
<div class="sourceCode" id="cb29"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb29-1"><a href="#cb29-1"></a><span class="co"># Harmonic mean</span></span>
<span id="cb29-2"><a href="#cb29-2"></a>rmean <-<span class="st"> </span><span class="kw">mean</span>(<span class="dv">1</span><span class="op">/</span>psize)</span>
<span id="cb29-3"><a href="#cb29-3"></a><span class="dv">1</span><span class="op">/</span>rmean</span></code></pre></div>
<pre><code>## [1] 30.84833</code></pre>
<p>Notice that there are two steps to calculating the harmonic mean. If we wanted to calculate the harmonic mean of a lot of different vectors, this would get really repetitive. A function is a way of encapsulating a lot of instructions to reduce the number of steps (and potential errors) you would need to take in your analysis. Below, we will write a function to calculate the harmonic mean using the steps above.</p>
<blockquote>
<p>Note here that the <em>argument</em> is <strong>x</strong> and it is a placeholder for any value you put into the function.</p>
</blockquote>
<div class="sourceCode" id="cb31"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb31-1"><a href="#cb31-1"></a>hmean <-<span class="st"> </span><span class="cf">function</span>(x){</span>
<span id="cb31-2"><a href="#cb31-2"></a> rmean <-<span class="st"> </span><span class="kw">mean</span>(<span class="dv">1</span><span class="op">/</span>x)</span>
<span id="cb31-3"><a href="#cb31-3"></a> <span class="dv">1</span><span class="op">/</span>rmean</span>
<span id="cb31-4"><a href="#cb31-4"></a>}</span>
<span id="cb31-5"><a href="#cb31-5"></a><span class="kw">mean</span>(psize)</span></code></pre></div>
<pre><code>## [1] 126.6667</code></pre>
<div class="sourceCode" id="cb33"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb33-1"><a href="#cb33-1"></a><span class="kw">hmean</span>(psize)</span></code></pre></div>
<pre><code>## [1] 30.84833</code></pre>
</div>
<div id="writing-a-function-for-comparing-clone-corrected-and-uncorrected-data" class="section level4">
<h4>Writing a function for comparing clone corrected and uncorrected data</h4>
<p>We will simply take the steps from above and turn them into a function to calculate the difference in Simpson’s diversity for a given population. In order to do that, we will need to compute three steps:</p>
<ol style="list-style-type: decimal">
<li>the name of the population</li>
<li>the clone-corrected data set</li>
<li>the uncorrected data set</li>
</ol>
<p>From there, we can construct the function.</p>
<div class="sourceCode" id="cb35"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb35-1"><a href="#cb35-1"></a>plot_simp_diff <-<span class="st"> </span><span class="cf">function</span>(pop_name, clone_corrected, un_corrected){</span>
<span id="cb35-2"><a href="#cb35-2"></a></span>
<span id="cb35-3"><a href="#cb35-3"></a> <span class="co"># Step 1: calculate diversity for clone-corrected data</span></span>
<span id="cb35-4"><a href="#cb35-4"></a> cc <-<span class="st"> </span><span class="kw">locus_table</span>(clone_corrected, <span class="dt">pop =</span> pop_name, <span class="dt">info =</span> <span class="ot">FALSE</span>)</span>
<span id="cb35-5"><a href="#cb35-5"></a></span>
<span id="cb35-6"><a href="#cb35-6"></a> <span class="co"># Step 2: calculate diversity for uncorrected data</span></span>
<span id="cb35-7"><a href="#cb35-7"></a> uc <-<span class="st"> </span><span class="kw">locus_table</span>(un_corrected, <span class="dt">pop =</span> pop_name, <span class="dt">info =</span> <span class="ot">FALSE</span>)</span>
<span id="cb35-8"><a href="#cb35-8"></a></span>
<span id="cb35-9"><a href="#cb35-9"></a> <span class="co"># Step 3: Take the difference</span></span>
<span id="cb35-10"><a href="#cb35-10"></a> res <-<span class="st"> </span>uc <span class="op">-</span><span class="st"> </span>cc</span>
<span id="cb35-11"><a href="#cb35-11"></a></span>
<span id="cb35-12"><a href="#cb35-12"></a> <span class="co"># Step 4: Plot Simpson's index.</span></span>
<span id="cb35-13"><a href="#cb35-13"></a> <span class="kw">barplot</span>(res[, <span class="st">"1-D"</span>], <span class="dt">main =</span> pop_name, <span class="dt">ylab =</span> <span class="st">"Change in Simpson's Index"</span>, <span class="dt">xlab =</span> <span class="st">"Locus"</span>)</span>
<span id="cb35-14"><a href="#cb35-14"></a>}</span></code></pre></div>
<p>Now that we have our function written, let’s gather the population names and construct a <em>for loop</em> that will analyze each one.</p>
<div class="sourceCode" id="cb36"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb36-1"><a href="#cb36-1"></a><span class="kw">par</span>(<span class="dt">mfrow =</span> <span class="kw">c</span>(<span class="dv">2</span>, <span class="dv">3</span>)) <span class="co"># Set up the graphics to have two rows and three columns</span></span>
<span id="cb36-2"><a href="#cb36-2"></a></span>
<span id="cb36-3"><a href="#cb36-3"></a><span class="cf">for</span> (i <span class="cf">in</span> <span class="kw">popNames</span>(monpop)){</span>
<span id="cb36-4"><a href="#cb36-4"></a> <span class="kw">plot_simp_diff</span>(i, mcc_TY, monpop)</span>
<span id="cb36-5"><a href="#cb36-5"></a>}</span></code></pre></div>
<p><img src="Population_Strata_files/figure-html/unnamed-chunk-13-1.png" width="672" /></p>
<div class="sourceCode" id="cb37"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb37-1"><a href="#cb37-1"></a><span class="kw">par</span>(<span class="dt">mfrow =</span> <span class="kw">c</span>(<span class="dv">1</span>, <span class="dv">1</span>)) <span class="co"># Next we reset the graphics to have one row and one column</span></span></code></pre></div>
<p>These barplots show the difference in Simpson’s index of original minus clone corrected data for each population per locus. We can see that allelic diversity generally is lower in the total data set (containing some repeated MLGs) relative to clone corrected data.</p>
</div>
</div>
</div>
<div id="conclusions" class="section level2">
<h2>Conclusions</h2>
<p>This was a brief introduction to the easiest way to create stratifications and apply them in <em>poppr</em> to more rapidly analyze your data. By indexing the stratifications of your data, you can set the stratification(s) you want to have analyzed in a single command. This approach avoids having to create new sub-sets of the data for each analysis and simultaneously reduces the chance of error when manipulating data sets by hand.</p>
</div>
<div id="references" class="section level2">
<h2>References</h2>
<!-------->
<div id="refs" class="references">
<div id="ref-everhart2014finescale">
<p>Everhart S., Scherm H. 2015. Fine-scale genetic structure of <em>Monilinia fructicola</em> during brown rot epidemics within individual peach tree canopies. <em>Phytopathology</em> 105:542–549. Available at: <a href="https://doi.org/10.1094/PHYTO-03-14-0088-R">https://doi.org/10.1094/PHYTO-03-14-0088-R</a></p>
</div>
<div id="ref-grunwald2003">
<p>Grünwald NJ., Goodwin SB., Milgroom MG., Fry WE. 2003. Analysis of genotypic diversity data for populations of microorganisms. <em>Phytopathology</em> 93:738–746. Available at: <a href="http://apsjournals.apsnet.org/doi/abs/10.1094/PHYTO.2003.93.6.738">http://apsjournals.apsnet.org/doi/abs/10.1094/PHYTO.2003.93.6.738</a></p>
</div>
<div id="ref-grunwald2006hierarchical">
<p>Grünwald NJ., Hoheisel G-A. 2006. Hierarchical analysis of diversity, selfing, and genetic differentiation in populations of the oomycete <em>aphanomyces euteiches</em>. <em>Phytopathology</em> 96:1134–1141. Available at: <a href="http://apsjournals.apsnet.org/doi/abs/10.1094/PHYTO-96-1134">http://apsjournals.apsnet.org/doi/abs/10.1094/PHYTO-96-1134</a></p>
</div>
<div id="ref-milgroom1996recombination">
<p>Milgroom MG. 1996. Recombination and the multilocus structure of fungal populations. <em>Annual Review of Phytopathology</em> 34:457–477. Available at: <a href="http://www.annualreviews.org/doi/abs/10.1146/annurev.phyto.34.1.457">http://www.annualreviews.org/doi/abs/10.1146/annurev.phyto.34.1.457</a></p>
</div>
<div id="ref-nielsen2013">
<p>Nielsen R., Slatkin M. 2013. <em>An introduction to population genetics: Theory and applications</em>. Sinauer Associates, Incorporated. Available at: <a href="http://books.google.com/books?id=Iy08kgEACAAJ">http://books.google.com/books?id=Iy08kgEACAAJ</a></p>
</div>
</div>
</div>
</div>
<script>
// add bootstrap table styles to pandoc tables
function bootstrapStylePandocTables() {
$('tr.odd').parent('tbody').parent('table').addClass('table table-condensed');
}
$(document).ready(function () {
bootstrapStylePandocTables();
});
</script>
<!-- tabsets -->
<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 -->
<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
(function () {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
document.getElementsByTagName("head")[0].appendChild(script);
})();
</script>
</body>
</html>