-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathv0_network.html
More file actions
551 lines (516 loc) · 33.8 KB
/
v0_network.html
File metadata and controls
551 lines (516 loc) · 33.8 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Network tools for finding extended pedigrees and path tracing</title>
<script>// Pandoc 2.9 adds attributes on both header and div. We remove the former (to
// be compatible with the behavior of Pandoc < 2.8).
document.addEventListener('DOMContentLoaded', function(e) {
var hs = document.querySelectorAll("div.section[class*='level'] > :first-child");
var i, h, a;
for (i = 0; i < hs.length; i++) {
h = hs[i];
if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6
a = h.attributes;
while (a.length > 0) h.removeAttribute(a[0].name);
}
});
</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;
}
.sourceCode {
overflow: visible;
}
</style>
<style type="text/css" data-origin="pandoc">
html { -webkit-text-size-adjust: 100%; }
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { display: inline-block; 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 { 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
{ }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
code span.al { color: #ff0000; font-weight: bold; }
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; }
code span.at { color: #7d9029; }
code span.bn { color: #40a070; }
code span.bu { color: #008000; }
code span.cf { color: #007020; font-weight: bold; }
code span.ch { color: #4070a0; }
code span.cn { color: #880000; }
code span.co { color: #60a0b0; font-style: italic; }
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; }
code span.do { color: #ba2121; font-style: italic; }
code span.dt { color: #902000; }
code span.dv { color: #40a070; }
code span.er { color: #ff0000; font-weight: bold; }
code span.ex { }
code span.fl { color: #40a070; }
code span.fu { color: #06287e; }
code span.im { color: #008000; font-weight: bold; }
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; }
code span.kw { color: #007020; font-weight: bold; }
code span.op { color: #666666; }
code span.ot { color: #007020; }
code span.pp { color: #bc7a00; }
code span.sc { color: #4070a0; }
code span.ss { color: #bb6688; }
code span.st { color: #4070a0; }
code span.va { color: #19177c; }
code span.vs { color: #4070a0; }
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; }
</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">body {
background-color: #fff;
margin: 1em auto;
max-width: 700px;
overflow: visible;
padding-left: 2em;
padding-right: 2em;
font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.35;
}
#TOC {
clear: both;
margin: 0 0 10px 10px;
padding: 4px;
width: 400px;
border: 1px solid #CCCCCC;
border-radius: 5px;
background-color: #f6f6f6;
font-size: 13px;
line-height: 1.3;
}
#TOC .toctitle {
font-weight: bold;
font-size: 15px;
margin-left: 5px;
}
#TOC ul {
padding-left: 40px;
margin-left: -1.5em;
margin-top: 5px;
margin-bottom: 5px;
}
#TOC ul ul {
margin-left: -2em;
}
#TOC li {
line-height: 16px;
}
table {
margin: 1em auto;
border-width: 1px;
border-color: #DDDDDD;
border-style: outset;
border-collapse: collapse;
}
table th {
border-width: 2px;
padding: 5px;
border-style: inset;
}
table td {
border-width: 1px;
border-style: inset;
line-height: 18px;
padding: 5px;
}
table, table th, table td {
border-left-style: none;
border-right-style: none;
}
table thead, table tr.even {
background-color: #f7f7f7;
}
p {
margin: 0.5em 0;
}
blockquote {
background-color: #f6f6f6;
padding: 0.25em 0.75em;
}
hr {
border-style: solid;
border: none;
border-top: 1px solid #777;
margin: 28px 0;
}
dl {
margin-left: 0;
}
dl dd {
margin-bottom: 13px;
margin-left: 13px;
}
dl dt {
font-weight: bold;
}
ul {
margin-top: 0;
}
ul li {
list-style: circle outside;
}
ul ul {
margin-bottom: 0;
}
pre, code {
background-color: #f7f7f7;
border-radius: 3px;
color: #333;
white-space: pre-wrap;
}
pre {
border-radius: 3px;
margin: 5px 0px 10px;
padding: 10px;
}
pre:not([class]) {
background-color: #f7f7f7;
}
code {
font-family: Consolas, Monaco, 'Courier New', monospace;
font-size: 85%;
}
p > code, li > code {
padding: 2px 0px;
}
div.figure {
text-align: center;
}
img {
background-color: #FFFFFF;
padding: 2px;
border-radius: 3px;
border: 1px solid #CCCCCC;
margin: 0 5px;
}
h1 {
margin-top: 0;
font-size: 35px;
line-height: 40px;
}
h2 {
border-bottom: 4px solid #f7f7f7;
padding-top: 10px;
padding-bottom: 2px;
font-size: 145%;
}
h3 {
border-bottom: 2px solid #f7f7f7;
padding-top: 10px;
font-size: 120%;
}
h4 {
border-bottom: 1px solid #f7f7f7;
margin-left: 8px;
font-size: 105%;
}
h5, h6 {
border-bottom: 1px solid #ccc;
font-size: 105%;
}
a {
color: #0033dd;
text-decoration: none;
}
a:hover {
color: #6666ff; }
a:visited {
color: #800080; }
a:visited:hover {
color: #BB00BB; }
a[href^="http:"] {
text-decoration: underline; }
a[href^="https:"] {
text-decoration: underline; }
code > span.kw { color: #555; font-weight: bold; }
code > span.dt { color: #902000; }
code > span.dv { color: #40a070; }
code > span.bn { color: #d14; }
code > span.fl { color: #d14; }
code > span.ch { color: #d14; }
code > span.st { color: #d14; }
code > span.co { color: #888888; font-style: italic; }
code > span.ot { color: #007020; }
code > span.al { color: #ff0000; font-weight: bold; }
code > span.fu { color: #900; font-weight: bold; }
code > span.er { color: #a61717; background-color: #e3d2d2; }
</style>
</head>
<body>
<h1 class="title toc-ignore">Network tools for finding extended
pedigrees and path tracing</h1>
<div id="introduction" class="section level1">
<h1>Introduction</h1>
<p>This vignette showcases two key features that capitalize on the
network structure inherent in pedigrees:</p>
<ol style="list-style-type: decimal">
<li><p>Finding extended families with <em>any</em> connecting
relationships between members. This feature strictly uses a person’s ID,
mother’s ID, and father’s ID to find out which people in a dataset are
remotely related by any path, effectively finding all separable extended
families in a dataset.</p></li>
<li><p>Using path tracing rules to quantify the <em>amount</em> of
relatedness between all pairs of individuals in a dataset. The amount of
relatedness can be characterized by additive nuclear DNA, shared
mitochondrial DNA, sharing both parents, or being part of the same
extended pedigree.</p></li>
</ol>
<div id="loading-required-libraries-and-data" class="section level2">
<h2>Loading Required Libraries and Data</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1" tabindex="-1"></a><span class="fu">library</span>(BGmisc)</span>
<span id="cb1-2"><a href="#cb1-2" tabindex="-1"></a><span class="fu">data</span>(potter)</span></code></pre></div>
</div>
</div>
<div id="finding-extended-families" class="section level1">
<h1>Finding Extended Families</h1>
<p>Many pedigree datasets only contain information on the person, their
mother, and their father, often without nuclear or extended family IDs.
Recognizing which sets of people are unrelated simplifies many
pedigree-related tasks. This function facilitates those tasks by finding
all the extended families. People within the same extended family have
at least some form of relation, however distant, while those in
different extended families have no relations.</p>
<div class="figure">
<img role="img" aria-label="Potter Family Pedigree" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASAAAAEgCAMAAAAjXV6yAAAAZlBMVEUAAAAAADoAAGYAOjoAOpAAZrY6AAA6ADo6AGY6OpA6kNtEAVRmAABmADpmAGZmZjpmkJBmtv9/006QOgCQOjqQOmaQ2/+2ZgC2/7a2///bkDrb////tmb/25D/29v//7b//9v///9ky6BqAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAKVElEQVR4nO2ca3vcthGF6dRSkmVdV42jrelVJf7/P1kS18GNMyBAWiuf88HPBnuAGbzLy4qKzjBDmxp+dgPvXQDECIAYARAjAGIEQIwAiBEAMQIgRgTQfxKZN8ZF8bySOee9a/GARqNwXt6c9961OEAjEZ2XM5e8dy0G0DgWdp0xF713LQBitA1oHEu7Ts1l710LgBhtAor3THZd471rARAjAGIEQIw2AQ3lPfM0z9/LIQIgRtuA8EURgDgxgPDDKgcIjzv8ywIgPDArv1fxPLbGe1cK9vX6r+/zfBuGp/ntr2F4WDbtR8y7OfOiKfRezfAHEAX0+s/fvs+vX55f/vg+PShGZ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5Dyg5yoK4ZnvvvUTLeEDGnr3NB5u3zZNr0LX3bV6g+v8F6IRiTZMAiPPvqNGhPAB1M/ZeA4A6TwIgzr+jRo/yvyggeXUA6ubsvAYAdZ4EQJx/R40e1QGom7PzGvcCqAchADpiiZ8KqKY4AHX09lwCgDpPAiDOv6NGl+IA1NHbc4lTAdUnzOYmdajb1ON2Aw2ABKVzf7RW2aCsblOPmw00AeIGdo7U1t1Yor0BAAKgtgYACIDaGgAgAGprAIAAqK0BAAKgtgYACIDaGgAgAGprAIAAqK0BAAKgtgYACIDaGgAgAGprAIAAqK0BAAKgtgYACIDaGgCg/oAECSvGuZmwUpzFSBrb0qmBAwExGT37AMmDfzo1cBggNuVpD6Ca6KhODRwFaBzjBuORHYD4RWu8APSeAY1j3E4yUg9IsGiNF4DeMaC4mZyqAUkWrfECEAAB0IcFhIs0ADUCwhdFAGoEhB9WOUB43MEC+mUfmC2ymcY+hVYN0Khj85okE7p3XUKm9/wWxTtu16Vxh/r1LQ1ANN4pbokmNKeeRPsAmUxjl35sBmjUsX5Ns47tuzrr2I8kCcVcXZpqrAuESZzUSzORXXvOm3oS7X9oP118vrEZ8P+SkdfIY7KO/UiQViqpG6UaLwWicObIG47MUd5qGLacaDegJKo2zCJ1IzTr2GTMTmEAcJBsLKkbphqvBQops4s3ingu5MdG0c5UewHpTGOCwwx8eY4sQVLtMmKzjomHJhuL6kapxtenPKDVG0Y865aChOY1bDmOdqbaCchkGntAeoBGHbvXjocaCVLsU4+sboijcJIobxDxrGfTg1y3FEc7U+0DZK9yrpYeoBdK/Zp+tP7SeEk8wiPITXBr6QK5i3SxAXKGGU8c7Uy1D5DNNHaA9ACNOjavSWqxe3eKRq7FFOZC3eg2f8ne5o13ShogB4tfr/Nt/hcSADECIEYAxAiAGAEQIwBiBECMAIgRADECIEYAxAiAGAEQIwBi9H/AmSB5a3UYXgAAAABJRU5ErkJggg==" alt="Potter Family Pedigree" width="50%" />
<p class="caption">
Potter Family Pedigree
</p>
</div>
<p>We will use the <code>potter</code> pedigree data as an example. For
convenience, we’ve renamed the family ID variable to <code>oldfam</code>
to avoid confusion with the new family ID variable we will create.</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>df_potter <span class="ot"><-</span> potter</span>
<span id="cb2-2"><a href="#cb2-2" tabindex="-1"></a><span class="fu">names</span>(df_potter)[<span class="fu">names</span>(df_potter) <span class="sc">==</span> <span class="st">"famID"</span>] <span class="ot"><-</span> <span class="st">"oldfam"</span></span>
<span id="cb2-3"><a href="#cb2-3" tabindex="-1"></a></span>
<span id="cb2-4"><a href="#cb2-4" tabindex="-1"></a>ds <span class="ot"><-</span> <span class="fu">ped2fam</span>(df_potter, <span class="at">famID =</span> <span class="st">"famID"</span>, <span class="at">personID =</span> <span class="st">"personID"</span>)</span>
<span id="cb2-5"><a href="#cb2-5" tabindex="-1"></a></span>
<span id="cb2-6"><a href="#cb2-6" tabindex="-1"></a><span class="fu">table</span>(ds<span class="sc">$</span>famID, ds<span class="sc">$</span>oldfam)</span>
<span id="cb2-7"><a href="#cb2-7" tabindex="-1"></a><span class="co">#> </span></span>
<span id="cb2-8"><a href="#cb2-8" tabindex="-1"></a><span class="co">#> 1</span></span>
<span id="cb2-9"><a href="#cb2-9" tabindex="-1"></a><span class="co">#> 1 36</span></span></code></pre></div>
<p>Because the <code>potter</code> data already had a family ID
variable, we compare our newly created variable to the pre-existing one.
They match!</p>
</div>
<div id="computing-relatedness" class="section level1">
<h1>Computing Relatedness</h1>
<p>Once you know which sets of people are related at all to one another,
you’ll likely want to know how much. For additive genetic relatedness,
you can use the <code>ped2add()</code> function.</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb3-1"><a href="#cb3-1" tabindex="-1"></a>add <span class="ot"><-</span> <span class="fu">ped2add</span>(potter, <span class="at">sparse =</span> <span class="cn">FALSE</span>)</span></code></pre></div>
<p>This computes the additive genetic relatedness for everyone in the
data. It returns a square, symmetric matrix that has as many rows and
columns as there are IDs.</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb4-1"><a href="#cb4-1" tabindex="-1"></a>add[<span class="dv">1</span><span class="sc">:</span><span class="dv">7</span>, <span class="dv">1</span><span class="sc">:</span><span class="dv">7</span>]</span>
<span id="cb4-2"><a href="#cb4-2" tabindex="-1"></a><span class="co">#> 1 2 3 4 5 6 7</span></span>
<span id="cb4-3"><a href="#cb4-3" tabindex="-1"></a><span class="co">#> 1 1.0 0.50 0.00 0.00 0.0 0.500 0.000</span></span>
<span id="cb4-4"><a href="#cb4-4" tabindex="-1"></a><span class="co">#> 2 0.5 1.00 0.00 0.00 0.0 0.250 0.000</span></span>
<span id="cb4-5"><a href="#cb4-5" tabindex="-1"></a><span class="co">#> 3 0.0 0.00 1.00 0.50 0.0 0.500 0.250</span></span>
<span id="cb4-6"><a href="#cb4-6" tabindex="-1"></a><span class="co">#> 4 0.0 0.00 0.50 1.00 0.0 0.250 0.500</span></span>
<span id="cb4-7"><a href="#cb4-7" tabindex="-1"></a><span class="co">#> 5 0.0 0.00 0.00 0.00 1.0 0.000 0.500</span></span>
<span id="cb4-8"><a href="#cb4-8" tabindex="-1"></a><span class="co">#> 6 0.5 0.25 0.50 0.25 0.0 1.000 0.125</span></span>
<span id="cb4-9"><a href="#cb4-9" tabindex="-1"></a><span class="co">#> 7 0.0 0.00 0.25 0.50 0.5 0.125 1.000</span></span></code></pre></div>
<p>The entry in the ith row and the jth column gives the relatedness
between person i and person j. For example, person 1 (Vernon Dursley)
shares 0.5 of their nuclear DNA with person 6 (Dudley Dursley), shares
0.5 of their nuclear DNA with person 2 (Marjorie Dursley).</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb5-1"><a href="#cb5-1" tabindex="-1"></a><span class="fu">table</span>(add)</span>
<span id="cb5-2"><a href="#cb5-2" tabindex="-1"></a><span class="co">#> add</span></span>
<span id="cb5-3"><a href="#cb5-3" tabindex="-1"></a><span class="co">#> 0 0.0625 0.125 0.25 0.5 1 </span></span>
<span id="cb5-4"><a href="#cb5-4" tabindex="-1"></a><span class="co">#> 788 6 94 208 164 36</span></span></code></pre></div>
<p>It’s probably fine to do this on the whole dataset when your data
have fewer than 10,000 people. When the data get large, however, it’s
much more efficient to compute this relatedness separately for each
extended family.</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb6-1"><a href="#cb6-1" tabindex="-1"></a>add_list <span class="ot"><-</span> <span class="fu">lapply</span>(</span>
<span id="cb6-2"><a href="#cb6-2" tabindex="-1"></a> <span class="fu">unique</span>(potter<span class="sc">$</span>famID),</span>
<span id="cb6-3"><a href="#cb6-3" tabindex="-1"></a> <span class="cf">function</span>(d) {</span>
<span id="cb6-4"><a href="#cb6-4" tabindex="-1"></a> tmp <span class="ot"><-</span> potter[potter<span class="sc">$</span>famID <span class="sc">%in%</span> d, ]</span>
<span id="cb6-5"><a href="#cb6-5" tabindex="-1"></a> <span class="fu">ped2add</span>(tmp, <span class="at">sparse =</span> <span class="cn">FALSE</span>)</span>
<span id="cb6-6"><a href="#cb6-6" tabindex="-1"></a> }</span>
<span id="cb6-7"><a href="#cb6-7" tabindex="-1"></a>)</span></code></pre></div>
<div id="other-relatedness-measures" class="section level2">
<h2>Other relatedness measures</h2>
<p>The function works similarly for mitochondrial
(<code>ped2mit</code>), common nuclear environment through sharing both
parents (<code>ped2cn</code>), and common extended family environment
(<code>ped2ce</code>).</p>
<div id="computing-mitochondrial-relatedness" class="section level3">
<h3>Computing mitochondrial relatedness</h3>
<p>Here we calculate the mitochondrial relatedness between all pairs of
individuals in the <code>potter</code> dataset.</p>
<div class="sourceCode" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb7-1"><a href="#cb7-1" tabindex="-1"></a>mit <span class="ot"><-</span> <span class="fu">ped2mit</span>(potter, <span class="at">sparse =</span> <span class="cn">FALSE</span>)</span>
<span id="cb7-2"><a href="#cb7-2" tabindex="-1"></a>mit[<span class="dv">1</span><span class="sc">:</span><span class="dv">7</span>, <span class="dv">1</span><span class="sc">:</span><span class="dv">7</span>]</span>
<span id="cb7-3"><a href="#cb7-3" tabindex="-1"></a><span class="co">#> 1 2 3 4 5 6 7</span></span>
<span id="cb7-4"><a href="#cb7-4" tabindex="-1"></a><span class="co">#> 1 1 1 0 0 0 0 0</span></span>
<span id="cb7-5"><a href="#cb7-5" tabindex="-1"></a><span class="co">#> 2 1 1 0 0 0 0 0</span></span>
<span id="cb7-6"><a href="#cb7-6" tabindex="-1"></a><span class="co">#> 3 0 0 1 1 0 1 1</span></span>
<span id="cb7-7"><a href="#cb7-7" tabindex="-1"></a><span class="co">#> 4 0 0 1 1 0 1 1</span></span>
<span id="cb7-8"><a href="#cb7-8" tabindex="-1"></a><span class="co">#> 5 0 0 0 0 1 0 0</span></span>
<span id="cb7-9"><a href="#cb7-9" tabindex="-1"></a><span class="co">#> 6 0 0 1 1 0 1 1</span></span>
<span id="cb7-10"><a href="#cb7-10" tabindex="-1"></a><span class="co">#> 7 0 0 1 1 0 1 1</span></span>
<span id="cb7-11"><a href="#cb7-11" tabindex="-1"></a><span class="fu">table</span>(mit)</span>
<span id="cb7-12"><a href="#cb7-12" tabindex="-1"></a><span class="co">#> mit</span></span>
<span id="cb7-13"><a href="#cb7-13" tabindex="-1"></a><span class="co">#> 0 1 </span></span>
<span id="cb7-14"><a href="#cb7-14" tabindex="-1"></a><span class="co">#> 1082 214</span></span></code></pre></div>
<p>As you can see, some of the family members share mitochondrial DNA,
such as person 2 and person 3 0, whereas person 1 and person 3 do
not.</p>
</div>
<div id="computing-relatedness-through-common-nuclear-environment" class="section level3">
<h3>Computing relatedness through common nuclear environment</h3>
<p>Here we calculate the relatedness between all pairs of individuals in
the <code>potter</code> dataset through sharing both parents.</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb8-1"><a href="#cb8-1" tabindex="-1"></a>commonNuclear <span class="ot"><-</span> <span class="fu">ped2cn</span>(potter, <span class="at">sparse =</span> <span class="cn">FALSE</span>)</span>
<span id="cb8-2"><a href="#cb8-2" tabindex="-1"></a>commonNuclear[<span class="dv">1</span><span class="sc">:</span><span class="dv">7</span>, <span class="dv">1</span><span class="sc">:</span><span class="dv">7</span>]</span>
<span id="cb8-3"><a href="#cb8-3" tabindex="-1"></a><span class="co">#> 1 2 3 4 5 6 7</span></span>
<span id="cb8-4"><a href="#cb8-4" tabindex="-1"></a><span class="co">#> 1 1 1 0 0 0 0 0</span></span>
<span id="cb8-5"><a href="#cb8-5" tabindex="-1"></a><span class="co">#> 2 1 1 0 0 0 0 0</span></span>
<span id="cb8-6"><a href="#cb8-6" tabindex="-1"></a><span class="co">#> 3 0 0 1 1 0 0 0</span></span>
<span id="cb8-7"><a href="#cb8-7" tabindex="-1"></a><span class="co">#> 4 0 0 1 1 0 0 0</span></span>
<span id="cb8-8"><a href="#cb8-8" tabindex="-1"></a><span class="co">#> 5 0 0 0 0 1 0 0</span></span>
<span id="cb8-9"><a href="#cb8-9" tabindex="-1"></a><span class="co">#> 6 0 0 0 0 0 1 0</span></span>
<span id="cb8-10"><a href="#cb8-10" tabindex="-1"></a><span class="co">#> 7 0 0 0 0 0 0 1</span></span>
<span id="cb8-11"><a href="#cb8-11" tabindex="-1"></a></span>
<span id="cb8-12"><a href="#cb8-12" tabindex="-1"></a><span class="fu">table</span>(commonNuclear)</span>
<span id="cb8-13"><a href="#cb8-13" tabindex="-1"></a><span class="co">#> commonNuclear</span></span>
<span id="cb8-14"><a href="#cb8-14" tabindex="-1"></a><span class="co">#> 0 1 </span></span>
<span id="cb8-15"><a href="#cb8-15" tabindex="-1"></a><span class="co">#> 1196 100</span></span></code></pre></div>
</div>
<div id="computing-relatedness-through-common-extended-family-environment" class="section level3">
<h3>Computing relatedness through common extended family
environment</h3>
<p>Here we calculate the relatedness between all pairs of individuals in
the <code>potter</code> dataset through sharing an extended family.</p>
<div class="sourceCode" id="cb9"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb9-1"><a href="#cb9-1" tabindex="-1"></a>extendedFamilyEnvironment <span class="ot"><-</span> <span class="fu">ped2ce</span>(potter, <span class="at">sparse =</span> <span class="cn">FALSE</span>)</span>
<span id="cb9-2"><a href="#cb9-2" tabindex="-1"></a>extendedFamilyEnvironment[<span class="dv">1</span><span class="sc">:</span><span class="dv">7</span>, <span class="dv">1</span><span class="sc">:</span><span class="dv">7</span>]</span>
<span id="cb9-3"><a href="#cb9-3" tabindex="-1"></a><span class="co">#> [,1] [,2] [,3] [,4] [,5] [,6] [,7]</span></span>
<span id="cb9-4"><a href="#cb9-4" tabindex="-1"></a><span class="co">#> [1,] 1 1 1 1 1 1 1</span></span>
<span id="cb9-5"><a href="#cb9-5" tabindex="-1"></a><span class="co">#> [2,] 1 1 1 1 1 1 1</span></span>
<span id="cb9-6"><a href="#cb9-6" tabindex="-1"></a><span class="co">#> [3,] 1 1 1 1 1 1 1</span></span>
<span id="cb9-7"><a href="#cb9-7" tabindex="-1"></a><span class="co">#> [4,] 1 1 1 1 1 1 1</span></span>
<span id="cb9-8"><a href="#cb9-8" tabindex="-1"></a><span class="co">#> [5,] 1 1 1 1 1 1 1</span></span>
<span id="cb9-9"><a href="#cb9-9" tabindex="-1"></a><span class="co">#> [6,] 1 1 1 1 1 1 1</span></span>
<span id="cb9-10"><a href="#cb9-10" tabindex="-1"></a><span class="co">#> [7,] 1 1 1 1 1 1 1</span></span>
<span id="cb9-11"><a href="#cb9-11" tabindex="-1"></a><span class="fu">table</span>(extendedFamilyEnvironment)</span>
<span id="cb9-12"><a href="#cb9-12" tabindex="-1"></a><span class="co">#> extendedFamilyEnvironment</span></span>
<span id="cb9-13"><a href="#cb9-13" tabindex="-1"></a><span class="co">#> 1 </span></span>
<span id="cb9-14"><a href="#cb9-14" tabindex="-1"></a><span class="co">#> 1296</span></span></code></pre></div>
</div>
</div>
</div>
<div id="subsetting-pedigrees" class="section level1">
<h1>Subsetting Pedigrees</h1>
<p>Subsetting a pedigree allows researchers to focus on specific family
lines or individuals within a larger dataset. This can be particularly
useful for data validation as well as simplifying complex pedigrees for
visualization. However, subsetting a pedigree can result in the
underestimation of relatedness between individuals. This is because the
subsetted pedigree may not contain all the individuals that connect two
people together. For example, if we were to remove Arthur Weasley
(person 9) and Molly Prewett (person 10) from the <code>potter</code>
dataset, we would lose the connections amongst their children.</p>
<div class="figure">
<img role="img" aria-label="Potter Subset Pedigree" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASAAAAEgCAMAAAAjXV6yAAAAZlBMVEUAAAAAADoAAGYAOjoAOpAAZrY6AAA6ADo6AGY6OpA6kNtEAVRmAABmADpmAGZmZjpmkJBmtv9/006QOgCQOjqQOmaQ2/+2ZgC2/7a2///bkDrb////tmb/25D/29v//7b//9v///9ky6BqAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAJfklEQVR4nO2cbXOcRhCEsWM5yWE7UWwLC0uR+P9/MrALy77M0rMsitC5+4Orrm9mdnkE3B2u6magNtW89gbOLgICIiAgAgIiICACAiIgIAICIiAgD9A/idb32lGqSnVhVFnXo1b5cBWgdhasVBcmlXu2sUPlwxWAWk+blepCoXLPNg4ElB+OAbVt0i1Xqgulyj3bOA7QxnACqgXUtmm3WKkuFCv3bOMwQFvDCagSUNxruqVKdaFcuWcbRwHaHL4JqGka5XEXFMqVe7ZxCCA0nIBqAA0vAaj8EsM9VYAqLrFB6FYvky0svknjnjpAFTdpAsKAdN//igpLvyjinkpA+78oEpACkOo3aFlh4Y9V3FMLaPePVduteIpRWlj0uAP3VAPa+7hj6YbPwcoLCx6Y4R61yodvP3Jttt9+ycLKnsOGx28/fbl3/7ru6WU/fuVsLknl0F9c4fPXprkZhoemuQ2rjGPfNYWruS4VT16mjPPjns5foFTenF7a0Dj8vb+jCNDTp+ld+68DtLx8/OM+rhweP66A+puRwu3T57u10FRZx747FXrmulQ0eZkyzY96Hm4kqlo+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nDeBqAqs3LxwyceLwICIiAgAgIiICACAiIgIAICIiAgAgIiICACAiIgIAICIiAgAgIiICACAiIgIAICIiAgAgIiICACAiIgIAICIiAgAgIiICACykgMaNlKbREzXyp1RYDE1KBqXQ0gMXfqAF0LIDG57AgRENCVAGrblyJEQEDXASjmcyAhAgIiICACAroOQLxJE5CkAkD8okhAgkoA8ccqAsTHHRDQr/fAbHCJxmGCpjWXt8LKrmm0wcI6nRzQnHL89On9fWy6AGTffLiJ0kirdXJAk/rL8/cf8VHbmNYoAta8/OUAmQOOj9q+jlzzsv+1LrEl5ThGYc3Pd6mpDs5V6uyAbMqxFHO8vBVVFiacQ50c0JJAHwCyphdOv5oF0ctKnRzQnGgcArLm8lZY2amjl5U6OaDXFwEBERAQAQEREBABAREQEAEBERAQAQEREBABAREQEAEBERDQf5RI1Yl5qeV9AAAAAElFTkSuQmCC" alt="Potter Subset Pedigree" width="50%" />
<p class="caption">
Potter Subset Pedigree
</p>
</div>
<p>In the plot above, we have removed Arthur Weasley (person 9) and
Molly Prewett (person 10) from the <code>potter</code> dataset. As a
result, the connections between their children are lost.</p>
<p>Similarly, if we remove the children of Vernon Dursley (1) and
Petunia Evans (3) from the <code>potter</code> dataset, we would lose
the connections between the two individuals.</p>
<p>However, this subset does not plot the relationship between spouses
(such as the marriage between Vernon Dursley and Petunia Evans), as
there are not children to connect the two individuals together yet.</p>
<div class="sourceCode" id="cb10"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb10-1"><a href="#cb10-1" tabindex="-1"></a>subset_rows <span class="ot"><-</span> <span class="fu">c</span>(<span class="dv">1</span><span class="sc">:</span><span class="dv">5</span>, <span class="dv">31</span><span class="sc">:</span><span class="dv">36</span>)</span>
<span id="cb10-2"><a href="#cb10-2" tabindex="-1"></a>subset_potter <span class="ot"><-</span> potter[subset_rows, ]</span></code></pre></div>
<p><img role="img" aria-label src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASAAAAEgCAMAAAAjXV6yAAAAV1BM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gmBQIJgWCSYFgUiCYFAgmBYJJgWBSIJgUCCYFgkmBYFIgmBQIJgWCSYFgUiCYFAgmBYJJgWBSIJgUCCYFgkmBYFIgmBQIJgWCSYFgUiCYFAgmBYJJgWBSIJgUCCYFgkmBYFIgmBQIJgWCSYFgUiCYFAgmBYJJgWBSIJgUCCYFgkmBYFIgmBQIJgWCSYFgUiCYFAgmBYJJgWBSIJgUCCYFgkmBYFIgmBQIJgWCSYFgUiCYFAgmBYJJgWBSIJgUCCYFgkmBYFIgmBQIJgWCSYFgUiCYFAgmBYJJgWBSIJgUCCYFgsne5x72ijpy3RW1VXqyAFC9KWat9GR2oLpXxF7pydxAdR1+d8pOCgSTmYHqOvzuFJ4UCCbzAu0eOeDulJ78EmjwPw28f+gMkwKdLlDeQ/+MSS/SMCkQTPqDIkwKBJP+sgqTvt0Bk75hBpPxb1z+sgSCBIIEggSCBIIEggSCBIIEggSCBIIEggSCBIIEggSCBIIEggSCBIIOAC1uZ7HHWD5W1SR2sp1W1X3wZNs2V/uf2wdaXJ8FAzWTzij27rxP4h/Hdn6eArR8fg0/cnv4wRlW/BP96S7pGZThocmx2YS/xJqrtJdYDqDFzUv0ZHcZihWa/3kbDWh+kcEn+lXbrP6C3/5kCaD5ZfhTsrtIRz+D2tTvYvFA08OPzdDN8Mt+KpD1EwgSCBIIEggSCBIIEggSCBIIEggSCBIIEggSCPoLAJ/l1j/l4t0AAAAASUVORK5CYII=" alt width="50%" /></p>
</div>
<!-- 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>