Simulation of DNA kinship 2

Simulation of DNA kinship 2



 6 generations from a 
founding couple with all 'mates' from external randoms 
except the cousin pairings 
3rd generation cousin pairings 3.7%
4th gen 2.4%
5th gen 1.2%
6th gen 0.4%


Macro generates a pg0 file of random profiles to be called later . Repeated xxxx times Generates 6 generations of offspring 3 children each pairing with external random profiles. All 729 are sorted and all 5 pair or more profiles output. Also for each 729 columns 11 to 20 are swapped for 1 to 10 and again sorted and >=5 pair matches output. For 20 digit matches both match sorts tally of course. Matches are mainly for siblings 3 in 100 runs of 729
' Generating 10 loci x2 profiles ' to be called on later ' 2 +3 +9 +27 +81 +243 = 365 = profiles zz = 0 Dim ph(20) Dim ps As String Dim pg0(365, 20) Dim pg1(1, 20) Dim pg2(2, 20) ' initialising RNG Randomize a = 214013 c = 2531011 x0 = Timer z = 2 ^ 24 Dim pg3(8, 20) Dim pg4(26, 20) Dim pg5(80, 20) Dim pg6(242, 20) Dim pg7(728, 20) Open "sept29-7m.txt" For Output As #2 Open "sept29-7mb.txt" For Output As #3 Open "sept29-24" For Output As #24 Open "sept29-25" For Output As #25 Open "sept29-26" For Output As #26 Open "sept29-27" For Output As #27 For xx = 0 To 9 count9 = 0 count8 = 0 Open "sept29-0" For Output As #10 Open "sept29-1" For Output As #11 Open "sept29-2" For Output As #12 Open "sept29-3" For Output As #13 Open "sept29-4" For Output As #14 Open "sept29-5" For Output As #15 Open "sept29-6" For Output As #16 Open "sept29-7" For Output As #17 Open "sept29-7b" For Output As #18 For x = 0 To 364 For j = 0 To 1 ' vWA ' RNG temp = x0 * a + c temp = temp / z x1 = (temp - Fix(temp)) * z x0 = x1 phj = x1 / z ph(j) = phj If ph(j) < 0.001 Then ph(j) = 11 If ph(j) < 0.106 Then ph(j) = 1 If ph(j) < 0.186 Then ph(j) = 2 If ph(j) < 0.402 Then ph(j) = 3 If ph(j) < 0.672 Then ph(j) = 4 If ph(j) < 0.891 Then ph(j) = 5 If ph(j) < 0.984 Then ph(j) = 6 If ph(j) < 0.998 Then ph(j) = 7 If ph(j) < 1 Then ph(j) = 8 If ph(j) > 10 Then ph(j) = 0 Next j For j = 2 To 3 ' THO1 ' RNG temp = x0 * a + c temp = temp / z x1 = (temp - Fix(temp)) * z x0 = x1 phj = x1 / z ph(j) = phj If ph(j) < 0.002 Then ph(j) = 11 If ph(j) < 0.243 Then ph(j) = 1 If ph(j) < 0.437 Then ph(j) = 2 If ph(j) < 0.545 Then ph(j) = 3 If ph(j) < 0.546 Then ph(j) = 4 If ph(j) < 0.686 Then ph(j) = 5 If ph(j) < 0.99 Then ph(j) = 6 If ph(j) < 1 Then ph(j) = 7 If ph(j) > 10 Then ph(j) = 0 Next j For j = 4 To 5 ' D8 ' RNG temp = x0 * a + c temp = temp / z x1 = (temp - Fix(temp)) * z x0 = x1 phj = x1 / z ph(j) = phj If ph(j) < 0.018 Then ph(j) = 11 If ph(j) < 0.031 Then ph(j) = 1 If ph(j) < 0.125 Then ph(j) = 2 If ph(j) < 0.191 Then ph(j) = 3 If ph(j) < 0.334 Then ph(j) = 4 If ph(j) < 0.667 Then ph(j) = 5 If ph(j) < 0.876 Then ph(j) = 6 If ph(j) < 0.964 Then ph(j) = 7 If ph(j) < 0.995 Then ph(j) = 8 If ph(j) < 1 Then ph(j) = 9 If ph(j) > 10 Then ph(j) = 0 Next j For j = 6 To 7 ' FGA ' RNG temp = x0 * a + c temp = temp / z x1 = (temp - Fix(temp)) * z x0 = x1 phj = x1 / z ph(j) = phj If ph(j) < 0.025 Then ph(j) = 11 If ph(j) < 0.081 Then ph(j) = 1 If ph(j) < 0.224 Then ph(j) = 2 If ph(j) < 0.411 Then ph(j) = 3 If ph(j) < 0.576 Then ph(j) = 4 If ph(j) < 0.587 Then ph(j) = 5 If ph(j) < 0.726 Then ph(j) = 6 If ph(j) < 0.872 Then ph(j) = 7 If ph(j) < 0.947 Then ph(j) = 8 If ph(j) < 0.982 Then ph(j) = 9 If ph(j) < 1 Then ph(j) = 0 ' 1.8% not generated If ph(j) > 10 Then ph(j) = 0 Next j For j = 8 To 9 ' D21 ' RNG temp = x0 * a + c temp = temp / z x1 = (temp - Fix(temp)) * z x0 = x1 phj = x1 / z ph(j) = phj If ph(j) < 0.031 Then ph(j) = 11 If ph(j) < 0.191 Then ph(j) = 1 If ph(j) < 0.417 Then ph(j) = 2 If ph(j) < 0.675 Then ph(j) = 3 If ph(j) < 0.702 Then ph(j) = 4 If ph(j) < 0.771 Then ph(j) = 5 If ph(j) < 0.864 Then ph(j) = 6 If ph(j) < 0.882 Then ph(j) = 7 If ph(j) < 0.972 Then ph(j) = 8 If ph(j) < 0.994 Then ph(j) = 9 If ph(j) < 1 Then ph(j) = 0 ' 0.5% not generated If ph(j) > 10 Then ph(j) = 0 Next j For j = 10 To 11 ' D18 ' RNG temp = x0 * a + c temp = temp / z x1 = (temp - Fix(temp)) * z x0 = x1 phj = x1 / z ph(j) = phj If ph(j) < 0.012 Then ph(j) = 11 If ph(j) < 0.151 Then ph(j) = 1 If ph(j) < 0.276 Then ph(j) = 2 If ph(j) < 0.44 Then ph(j) = 3 If ph(j) < 0.585 Then ph(j) = 4 If ph(j) < 0.722 Then ph(j) = 5 If ph(j) < 0.837 Then ph(j) = 6 If ph(j) < 0.917 Then ph(j) = 7 If ph(j) < 0.958 Then ph(j) = 8 If ph(j) < 0.975 Then ph(j) = 9 If ph(j) < 1 Then ph(j) = 0 ' 2.5% not generated If ph(j) > 10 Then ph(j) = 0 Next j For j = 12 To 13 ' D2S1338 ' RNG temp = x0 * a + c temp = temp / z x1 = (temp - Fix(temp)) * z x0 = x1 phj = x1 / z ph(j) = phj If ph(j) < 0.037 Then ph(j) = 11 If ph(j) < 0.222 Then ph(j) = 1 If ph(j) < 0.309 Then ph(j) = 2 If ph(j) < 0.419 Then ph(j) = 3 If ph(j) < 0.557 Then ph(j) = 4 If ph(j) < 0.589 Then ph(j) = 5 If ph(j) < 0.613 Then ph(j) = 6 If ph(j) < 0.725 Then ph(j) = 7 If ph(j) < 0.867 Then ph(j) = 8 If ph(j) < 0.978 Then ph(j) = 9 If ph(j) < 1 Then ph(j) = 0 ' 2.2% not generated If ph(j) > 10 Then ph(j) = 0 Next j For j = 14 To 15 ' D16 ' RNG temp = x0 * a + c temp = temp / z x1 = (temp - Fix(temp)) * z x0 = x1 phj = x1 / z ph(j) = phj If ph(j) < 0.019 Then ph(j) = 11 If ph(j) < 0.148 Then ph(j) = 1 If ph(j) < 0.202 Then ph(j) = 2 If ph(j) < 0.491 Then ph(j) = 3 If ph(j) < 0.779 Then ph(j) = 4 If ph(j) < 0.965 Then ph(j) = 5 If ph(j) < 0.994 Then ph(j) = 6 If ph(j) < 1 Then ph(j) = 7 If ph(j) > 10 Then ph(j) = 0 Next j For j = 16 To 17 ' D19 ' RNG temp = x0 * a + c temp = temp / z x1 = (temp - Fix(temp)) * z x0 = x1 phj = x1 / z ph(j) = phj If ph(j) < 0.087 Then ph(j) = 11 If ph(j) < 0.309 Then ph(j) = 1 If ph(j) < 0.322 Then ph(j) = 2 If ph(j) < 0.704 Then ph(j) = 3 If ph(j) < 0.713 Then ph(j) = 4 If ph(j) < 0.896 Then ph(j) = 5 If ph(j) < 0.934 Then ph(j) = 6 If ph(j) < 0.975 Then ph(j) = 7 If ph(j) < 0.992 Then ph(j) = 8 If ph(j) < 0.997 Then ph(j) = 9 If ph(j) < 1 Then ph(j) = 0 If ph(j) > 10 Then ph(j) = 0 ' 0.3% not generated Next j For j = 18 To 19 ' D3 ' RNG temp = x0 * a + c temp = temp / z x1 = (temp - Fix(temp)) * z x0 = x1 phj = x1 / z ph(j) = phj If ph(j) < 0.001 Then ph(j) = 11 If ph(j) < 0.007 Then ph(j) = 1 If ph(j) < 0.139 Then ph(j) = 2 If ph(j) < 0.404 Then ph(j) = 3 If ph(j) < 0.651 Then ph(j) = 4 If ph(j) < 0.846 Then ph(j) = 5 If ph(j) < 0.987 Then ph(j) = 6 If ph(j) < 1 Then ph(j) = 7 If ph(j) > 10 Then ph(j) = 0 Next j ' directing pairs For j = 0 To 18 Step 2 If ph(j + 1) < ph(j) Then jjj = ph(j) ph(j) = ph(j + 1) ph(j + 1) = jjj End If pg0(x, j) = ph(j) pg0(x, j + 1) = ph(j + 1) Next j Write #10, pg0(x, 0) & pg0(x, 1) & pg0(x, 2) & pg0(x, 3) & pg0(x, 4) & pg0(x, 5) & pg0(x, 6) & pg0(x, 7) & pg0(x, 8) & pg0(x, 9) & pg0(x, 10) & pg0(x, 11) & pg0(x, 12) & pg0(x, 13) & pg0(x, 14) & pg0(x, 15) & pg0(x, 16) & pg0(x, 17) & pg0(x, 18) & pg0(x, 19) Next x ' generating adam and eve For m = 0 To 1 For k = 0 To 19 pg1(m, k) = pg0(m, k) Next k Write #11, pg1(m, 0) & pg1(m, 1) & pg1(m, 2) & pg1(m, 3) & pg1(m, 4) & pg1(m, 5) & pg1(m, 6) & pg1(m, 7) & pg1(m, 8) & pg1(m, 9) & pg1(m, 10) & pg1(m, 11) & pg1(m, 12) & pg1(m, 13) & pg1(m, 14) & pg1(m, 15) & pg1(m, 16) & pg1(m, 17) & pg1(m, 18) & pg1(m, 19) Next m ' first generation of 3 offspring ' 4 way random to select one of ' 2 alleles from adam and one of 2 from eve ' 3 times over For m = 0 To 2 For k = 0 To 18 Step 2 rr = Rnd pg2(m, k) = pg1(0, k) pg2(m, k + 1) = pg1(1, k) If rr < 0.75 Then pg2(m, k) = pg1(0, k) pg2(m, k + 1) = pg1(1, k + 1) End If If rr < 0.5 Then pg2(m, k) = pg1(0, k + 1) pg2(m, k + 1) = pg1(1, k) End If If rr < 0.25 Then pg2(m, k) = pg1(0, k + 1) pg2(m, k + 1) = pg1(1, k + 1) End If Next k ' directing pairs For j = 0 To 18 Step 2 If pg2(m, j + 1) < pg2(m, j) Then jjj = pg2(m, j) pg2(m, j) = pg2(m, j + 1) pg2(m, j + 1) = jjj End If Next j Write #12, pg2(m, 0) & pg2(m, 1) & pg2(m, 2) & pg2(m, 3) & pg2(m, 4) & pg2(m, 5) & pg2(m, 6) & pg2(m, 7) & pg2(m, 8) & pg2(m, 9) & pg2(m, 10) & pg2(m, 11) & pg2(m, 12) & pg2(m, 13) & pg2(m, 14) & pg2(m, 15) & pg2(m, 16) & pg2(m, 17) & pg2(m, 18) & pg2(m, 19) Next m ' second generation of 3 offspring of each pg2 parent ' 4 way random to select one of ' 2 alleles from each offsping and ' one of 2 from a random parent For mm = 0 To 6 Step 3 ' mm 1,2 or3 rd child For m = 0 To 2 ' m parent For k = 0 To 18 Step 2 rr = Rnd ' mm+m+2 (2 as 2 called up previously in pg0) pg3(mm + m, k) = pg0(m + 2, k) pg3(mm + m, k + 1) = pg2(m, k) If rr < 0.75 Then pg3(mm + m, k) = pg0(m + 2, k) pg3(mm + m, k + 1) = pg2(m, k + 1) End If If rr < 0.5 Then pg3(mm + m, k) = pg0(m + 2, k + 1) pg3(mm + m, k + 1) = pg2(m, k) End If If rr < 0.25 Then pg3(mm + m, k) = pg0(m + 2, k + 1) pg3(mm + m, k + 1) = pg2(m, k + 1) End If Next k ' directing pairs For j = 0 To 18 Step 2 If pg3(mm + m, j + 1) < pg3(mm + m, j) Then jjj = pg3(mm + m, j) pg3(mm + m, j) = pg3(mm + m, j + 1) pg3(mm + m, j + 1) = jjj End If Next j Write #13, pg3(mm + m, 0) & pg3(mm + m, 1) & pg3(mm + m, 2) & pg3(mm + m, 3) & pg3(mm + m, 4) & pg3(mm + m, 5) & pg3(mm + m, 6) & pg3(mm + m, 7) & pg3(mm + m, 8) & pg3(mm + m, 9) & pg3(mm + m, 10) & pg3(mm + m, 11) & pg3(mm + m, 12) & pg3(mm + m, 13) & pg3(mm + m, 14) & pg3(mm + m, 15) & pg3(mm + m, 16) & pg3(mm + m, 17) & pg3(mm + m, 18) & pg3(mm + m, 19) Next m Next mm ' third generation of 3 offspring of each pg3 parent ' 4 way random to select one of ' 2 alleles from each parent and ' 2 from a random parent For mm = 0 To 18 Step 9 For m = 0 To 8 For k = 0 To 18 Step 2 rr = Rnd ' the + as first 2 + 3used previously pg4(mm + m, k) = pg0(m + 5, k) pg4(mm + m, k + 1) = pg3(m, k) If rr < 0.75 Then pg4(mm + m, k) = pg0(m + 5, k) pg4(mm + m, k + 1) = pg3(m, k + 1) End If If rr < 0.5 Then pg4(mm + m, k) = pg0(m + 5, k + 1) pg4(mm + m, k + 1) = pg3(m, k) End If If rr < 0.25 Then pg4(mm + m, k) = pg0(m + 5, k + 1) pg4(mm + m, k + 1) = pg3(m, k + 1) End If Next k ' cousin marriage on 27th mating rrr = Rnd * 6 If mm + m = 26 Then Write #24, mm + m, pg4(mm + m, 0) & pg4(mm + m, 1) & pg4(mm + m, 2) & pg4(mm + m, 3) & pg4(mm + m, 4) & pg4(mm + m, 5) & pg4(mm + m, 6) & pg4(mm + m, 7) & pg4(mm + m, 8) & pg4(mm + m, 9) & pg4(mm + m, 10) & pg4(mm + m, 11) & pg4(mm + m, 12) & pg4(mm + m, 13) & pg4(mm + m, 14) & pg4(mm + m, 15) & pg4(mm + m, 16) & pg4(mm + m, 17) & pg4(mm + m, 18) & pg4(mm + m, 19) For k = 0 To 18 Step 2 rr = Rnd yy = 7 If rrr < 5 Then yy = 6 If rrr < 4 Then yy = 4 If rrr < 3 Then yy = 3 If rrr < 2 Then yy = 1 If rrr < 1 Then yy = 0 pg4(mm + m, k) = pg3(yy, k) pg4(mm + m, k + 1) = pg3(m, k) If rr < 0.75 Then pg4(mm + m, k) = pg3(yy, k) pg4(mm + m, k + 1) = pg3(m, k + 1) End If If rr < 0.5 Then pg4(mm + m, k) = pg3(yy, k + 1) pg4(mm + m, k + 1) = pg3(m, k) End If If rr < 0.25 Then pg4(mm + m, k) = pg3(yy, k + 1) pg4(mm + m, k + 1) = pg3(m, k + 1) End If Next k Write #24, mm + m, pg4(mm + m, 0) & pg4(mm + m, 1) & pg4(mm + m, 2) & pg4(mm + m, 3) & pg4(mm + m, 4) & pg4(mm + m, 5) & pg4(mm + m, 6) & pg4(mm + m, 7) & pg4(mm + m, 8) & pg4(mm + m, 9) & pg4(mm + m, 10) & pg4(mm + m, 11) & pg4(mm + m, 12) & pg4(mm + m, 13) & pg4(mm + m, 14) & pg4(mm + m, 15) & pg4(mm + m, 16) & pg4(mm + m, 17) & pg4(mm + m, 18) & pg4(mm + m, 19) End If ' directing pairs For j = 0 To 18 Step 2 If pg4(mm + m, j + 1) < pg4(mm + m, j) Then jjj = pg4(mm + m, j) pg4(mm + m, j) = pg4(mm + m, j + 1) pg4(mm + m, j + 1) = jjj End If Next j Write #14, pg4(mm + m, 0) & pg4(mm + m, 1) & pg4(mm + m, 2) & pg4(mm + m, 3) & pg4(mm + m, 4) & pg4(mm + m, 5) & pg4(mm + m, 6) & pg4(mm + m, 7) & pg4(mm + m, 8) & pg4(mm + m, 9) & pg4(mm + m, 10) & pg4(mm + m, 11) & pg4(mm + m, 12) & pg4(mm + m, 13) & pg4(mm + m, 14) & pg4(mm + m, 15) & pg4(mm + m, 16) & pg4(mm + m, 17) & pg4(mm + m, 18) & pg4(mm + m, 19) Next m Next mm ' fourth generation of 3 offspring of each pg4 parent ' 4 way random to select one of ' 2 alleles from each parent and ' 2 from a random parent For mm = 0 To 54 Step 27 For m = 0 To 26 For k = 0 To 18 Step 2 rr = Rnd ' the +14 as first 2 +3+ 9 used previously pg5(mm + m, k) = pg0(m + 14, k) pg5(mm + m, k + 1) = pg4(m, k) If rr < 0.75 Then pg5(mm + m, k) = pg0(m + 14, k) pg5(mm + m, k + 1) = pg4(m, k + 1) End If If rr < 0.5 Then pg5(mm + m, k) = pg0(m + 14, k + 1) pg5(mm + m, k + 1) = pg4(m, k) End If If rr < 0.25 Then pg5(mm + m, k) = pg0(m + 14, k + 1) pg5(mm + m, k + 1) = pg4(m, k + 1) End If Next k ' cousin marriage on 40th mating rrr1 = Rnd * 6 rrr2 = Rnd * 6 If mm + m = 40 Or mm + m = 80 Then Write #25, mm + m, pg5(mm + m, 0) & pg5(mm + m, 1) & pg5(mm + m, 2) & pg5(mm + m, 3) & pg5(mm + m, 4) & pg5(mm + m, 5) & pg5(mm + m, 6) & pg5(mm + m, 7) & pg5(mm + m, 8) & pg5(mm + m, 9) & pg5(mm + m, 10) & pg5(mm + m, 11) & pg5(mm + m, 12) & pg5(mm + m, 13) & pg5(mm + m, 14) & pg5(mm + m, 15) & pg5(mm + m, 16) & pg5(mm + m, 17) & pg5(mm + m, 18) & pg5(mm + m, 19) If mm + m = 40 Then rrr = rrr1 If mm + m = 40 Then rrr = rrr2 For k = 0 To 18 Step 2 rr = Rnd yy = 19 If rrr < 5 Then yy = 25 If rrr < 4 Then yy = 24 If rrr < 3 Then yy = 23 If rrr < 2 Then yy = 21 If rrr < 1 Then yy = 20 pg5(mm + m, k) = pg4(yy, k) pg5(mm + m, k + 1) = pg4(m, k) If rr < 0.75 Then pg5(mm + m, k) = pg4(yy, k) pg5(mm + m, k + 1) = pg4(m, k + 1) End If If rr < 0.5 Then pg5(mm + m, k) = pg4(yy, k + 1) pg5(mm + m, k + 1) = pg4(m, k) End If If rr < 0.25 Then pg5(mm + m, k) = pg4(yy, k + 1) pg5(mm + m, k + 1) = pg4(m, k + 1) End If Next k Write #25, mm + m, pg5(mm + m, 0) & pg5(mm + m, 1) & pg5(mm + m, 2) & pg5(mm + m, 3) & pg5(mm + m, 4) & pg5(mm + m, 5) & pg5(mm + m, 6) & pg5(mm + m, 7) & pg5(mm + m, 8) & pg5(mm + m, 9) & pg5(mm + m, 10) & pg5(mm + m, 11) & pg5(mm + m, 12) & pg5(mm + m, 13) & pg5(mm + m, 14) & pg5(mm + m, 15) & pg5(mm + m, 16) & pg5(mm + m, 17) & pg5(mm + m, 18) & pg5(mm + m, 19) End If ' directing pairs For j = 0 To 18 Step 2 If pg5(mm + m, j + 1) < pg5(mm + m, j) Then jjj = pg5(mm + m, j) pg5(mm + m, j) = pg5(mm + m, j + 1) pg5(mm + m, j + 1) = jjj End If Next j Write #15, pg5(mm + m, 0) & pg5(mm + m, 1) & pg5(mm + m, 2) & pg5(mm + m, 3) & pg5(mm + m, 4) & pg5(mm + m, 5) & pg5(mm + m, 6) & pg5(mm + m, 7) & pg5(mm + m, 8) & pg5(mm + m, 9) & pg5(mm + m, 10) & pg5(mm + m, 11) & pg5(mm + m, 12) & pg5(mm + m, 13) & pg5(mm + m, 14) & pg5(mm + m, 15) & pg5(mm + m, 16) & pg5(mm + m, 17) & pg5(mm + m, 18) & pg5(mm + m, 19) Next m Next mm ' fifth generation of 3 offspring of each pg5 parent ' 4 way random to select one of ' 2 alleles from each parent and ' 2 from a random parent For mm = 0 To 162 Step 81 For m = 0 To 80 For k = 0 To 18 Step 2 rr = Rnd pg6(mm + m, k) = pg0(m + 41, k) pg6(mm + m, k + 1) = pg5(m, k) If rr < 0.75 Then pg6(mm + m, k) = pg0(m + 41, k) pg6(mm + m, k + 1) = pg5(m, k + 1) End If If rr < 0.5 Then pg6(mm + m, k) = pg0(m + 41, k + 1) pg6(mm + m, k + 1) = pg5(m, k) End If If rr < 0.25 Then pg6(mm + m, k) = pg0(m + 41, k + 1) pg6(mm + m, k + 1) = pg5(m, k + 1) End If Next k ' cousin marriage on 79th mating rrr = Rnd * 6 If m = 79 Then Write #26, mm + m, pg6(mm + m, 0) & pg6(mm + m, 1) & pg6(mm + m, 2) & pg6(mm + m, 3) & pg6(mm + m, 4) & pg6(mm + m, 5) & pg6(mm + m, 6) & pg6(mm + m, 7) & pg6(mm + m, 8) & pg6(mm + m, 9) & pg6(mm + m, 10) & pg6(mm + m, 11) & pg6(mm + m, 12) & pg6(mm + m, 13) & pg6(mm + m, 14) & pg6(mm + m, 15) & pg6(mm + m, 16) & pg6(mm + m, 17) & pg6(mm + m, 18) & pg6(mm + m, 19) For k = 0 To 18 Step 2 rr = Rnd yy = 77 If rrr < 5 Then yy = 75 If rrr < 4 Then yy = 73 If rrr < 3 Then yy = 71 If rrr < 2 Then yy = 69 If rrr < 1 Then yy = 67 pg6(mm + m, k) = pg5(yy, k) pg6(mm + m, k + 1) = pg5(m, k) If rr < 0.75 Then pg6(mm + m, k) = pg5(yy, k) pg6(mm + m, k + 1) = pg5(m, k + 1) End If If rr < 0.5 Then pg6(mm + m, k) = pg5(yy, k + 1) pg6(mm + m, k + 1) = pg5(m, k) End If If rr < 0.25 Then pg6(mm + m, k) = pg5(yy, k + 1) pg6(mm + m, k + 1) = pg5(m, k + 1) End If Next k Write #26, mm + m, pg6(mm + m, 0) & pg6(mm + m, 1) & pg6(mm + m, 2) & pg6(mm + m, 3) & pg6(mm + m, 4) & pg6(mm + m, 5) & pg6(mm + m, 6) & pg6(mm + m, 7) & pg6(mm + m, 8) & pg6(mm + m, 9) & pg6(mm + m, 10) & pg6(mm + m, 11) & pg6(mm + m, 12) & pg6(mm + m, 13) & pg6(mm + m, 14) & pg6(mm + m, 15) & pg6(mm + m, 16) & pg6(mm + m, 17) & pg6(mm + m, 18) & pg6(mm + m, 19) End If ' directing pairs For j = 0 To 18 Step 2 If pg6(mm + m, j + 1) < pg6(mm + m, j) Then jjj = pg6(mm + m, j) pg6(mm + m, j) = pg6(mm + m, j + 1) pg6(mm + m, j + 1) = jjj End If Next j Write #16, pg6(mm + m, 0) & pg6(mm + m, 1) & pg6(mm + m, 2) & pg6(mm + m, 3) & pg6(mm + m, 4) & pg6(mm + m, 5) & pg6(mm + m, 6) & pg6(mm + m, 7) & pg6(mm + m, 8) & pg6(mm + m, 9) & pg6(mm + m, 10) & pg6(mm + m, 11) & pg6(mm + m, 12) & pg6(mm + m, 13) & pg6(mm + m, 14) & pg6(mm + m, 15) & pg6(mm + m, 16) & pg6(mm + m, 17) & pg6(mm + m, 18) & pg6(mm + m, 19) Next m Next mm ' sixth generation of 3 offspring of each pg6 parent ' 4 way random to select one of ' 2 alleles from each parent and ' 2 from a random parent For mm = 0 To 486 Step 243 For m = 0 To 242 For k = 0 To 18 Step 2 rr = Rnd pg7(mm + m, k) = pg0(m + 122, k) pg7(mm + m, k + 1) = pg6(m, k) If rr < 0.75 Then pg7(mm + m, k) = pg0(m + 122, k) pg7(mm + m, k + 1) = pg6(m, k + 1) End If If rr < 0.5 Then pg7(mm + m, k) = pg0(m + 122, k + 1) pg7(mm + m, k + 1) = pg6(m, k) End If If rr < 0.25 Then pg7(mm + m, k) = pg0(m + 122, k + 1) pg7(mm + m, k + 1) = pg6(m, k + 1) End If Next k ' cousin marriage on 79th mating rrr = Rnd * 6 If m = 79 Then Write #27, mm + m, pg7(mm + m, 0) & pg7(mm + m, 1) & pg7(mm + m, 2) & pg7(mm + m, 3) & pg7(mm + m, 4) & pg7(mm + m, 5) & pg7(mm + m, 6) & pg7(mm + m, 7) & pg7(mm + m, 8) & pg7(mm + m, 9) & pg7(mm + m, 10) & pg7(mm + m, 11) & pg7(mm + m, 12) & pg7(mm + m, 13) & pg7(mm + m, 14) & pg7(mm + m, 15) & pg7(mm + m, 16) & pg7(mm + m, 17) & pg7(mm + m, 18) & pg7(mm + m, 19) For k = 0 To 18 Step 2 rr = Rnd yy = 76 If rrr < 5 Then yy = 74 If rrr < 4 Then yy = 72 If rrr < 3 Then yy = 70 If rrr < 2 Then yy = 69 If rrr < 1 Then yy = 68 pg7(mm + m, k) = pg6(yy, k) pg7(mm + m, k + 1) = pg6(m, k) If rr < 0.75 Then pg7(mm + m, k) = pg6(yy, k) pg7(mm + m, k + 1) = pg6(m, k + 1) End If If rr < 0.5 Then pg7(mm + m, k) = pg6(yy, k + 1) pg7(mm + m, k + 1) = pg6(m, k) End If If rr < 0.25 Then pg7(mm + m, k) = pg6(yy, k + 1) pg7(mm + m, k + 1) = pg6(m, k + 1) End If Next k Write #27, mm + m, pg7(mm + m, 0) & pg7(mm + m, 1) & pg7(mm + m, 2) & pg7(mm + m, 3) & pg7(mm + m, 4) & pg7(mm + m, 5) & pg7(mm + m, 6) & pg7(mm + m, 7) & pg7(mm + m, 8) & pg7(mm + m, 9) & pg7(mm + m, 10) & pg7(mm + m, 11) & pg7(mm + m, 12) & pg7(mm + m, 13) & pg7(mm + m, 14) & pg7(mm + m, 15) & pg7(mm + m, 16) & pg7(mm + m, 17) & pg7(mm + m, 18) & pg7(mm + m, 19) End If ' directing pairs For j = 0 To 18 Step 2 If pg7(mm + m, j + 1) < pg7(mm + m, j) Then jjj = pg7(mm + m, j) pg7(mm + m, j) = pg7(mm + m, j + 1) pg7(mm + m, j + 1) = jjj End If Next j Write #17, pg7(mm + m, 0) & pg7(mm + m, 1) & pg7(mm + m, 2) & pg7(mm + m, 3) & pg7(mm + m, 4) & pg7(mm + m, 5) & pg7(mm + m, 6) & pg7(mm + m, 7) & pg7(mm + m, 8) & pg7(mm + m, 9) & pg7(mm + m, 10) & pg7(mm + m, 11) & pg7(mm + m, 12) & pg7(mm + m, 13) & pg7(mm + m, 14) & pg7(mm + m, 15) & pg7(mm + m, 16) & pg7(mm + m, 17) & pg7(mm + m, 18) & pg7(mm + m, 19) & zz & xx & zz & mm & zz & m ' the clutter at the end is to check the final result for sibling or other matches ' remove the ends of these #17 and #18 writes for clean 20 digit profiles Write #18, pg7(mm + m, 10) & pg7(mm + m, 11) & pg7(mm + m, 12) & pg7(mm + m, 13) & pg7(mm + m, 14) & pg7(mm + m, 15) & pg7(mm + m, 16) & pg7(mm + m, 17) & pg7(mm + m, 18) & pg7(mm + m, 19) & pg7(mm + m, 0) & pg7(mm + m, 1) & pg7(mm + m, 2) & pg7(mm + m, 3) & pg7(mm + m, 4) & pg7(mm + m, 5) & pg7(mm + m, 6) & pg7(mm + m, 7) & pg7(mm + m, 8) & pg7(mm + m, 9) & zz & xx & zz & mm & zz & m Next m Next mm Close #10 Close #11 Close #12 Close #13 Close #14 Close #15 Close #16 Close #17 Close #18 ' sort contents of file sept29-7 Documents.Open FileName:="sept29-7", ConfirmConversions:=False, ReadOnly:= _ False, AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:= _ "", Revert:=False, WritePasswordDocument:="", WritePasswordTemplate:="", _ Format:=wdOpenFormatAuto Selection.Sort ExcludeHeader:=False, FieldNumber:="Paragraphs", _ SortFieldType:=wdSortFieldAlphanumeric, SortOrder:=wdSortOrderAscending, _ FieldNumber2:="", SortFieldType2:=wdSortFieldAlphanumeric, SortOrder2:= _ wdSortOrderAscending, FieldNumber3:="", SortFieldType3:= _ wdSortFieldAlphanumeric, SortOrder3:=wdSortOrderAscending, Separator:= _ wdSortSeparateByTabs, SortColumn:=False, CaseSensitive:=False, LanguageID _ :=wdLanguageNone ActiveDocument.SaveAs FileName:="sept29-7.txt", FileFormat:=wdFormatText, _ LockComments:=False, Password:="", AddToRecentFiles:=True, WritePassword _ :="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _ SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _ False ActiveWindow.Close ' Find matching pairs in 10 digits ' xxxx is count = xxxx = 729 bb$ = "0" count1 = 0 Open "sept29-7.txt" For Input As #1 ' change the 12 in the #2 file name above and ' the Left function below to suit number of matches xxxx = xxxx - 1 For x = 0 To xxxx Input #1, ps aa$ = Left(ps, 10) If aa$ = bb$ Then Write #2, ps, pps count1 = count1 + 1 End If bb$ = aa$ pps = ps Next x If count1 > 0 Then ' Write #2, xx, count1 End If Close #1 Open "sept29-7.txt" For Input As #1 ' Find matching pairs in 12 digits bb$ = "0" count2 = 0 For x = 0 To xxxx Input #1, ps aa$ = Left(ps, 12) If aa$ = bb$ Then ' Write #2, "twelve", ps, pps count2 = count2 + 1 End If bb$ = aa$ pps = ps Next x If count2 > 0 Then ' Write #2, xx, count2 End If Close #1 Open "sept29-7.txt" For Input As #1 ' Find matching pairs in 14 digits bb$ = "0" count3 = 0 For x = 0 To xxxx Input #1, ps aa$ = Left(ps, 14) If aa$ = bb$ Then ' Write #2, ps count3 = count3 + 1 End If bb$ = aa$ Next x If count3 > 0 Then ' Write #2, xx, count3 End If Close #1 Open "sept29-7.txt" For Input As #1 ' Find matching pairs in 16 digits bb$ = "0" count4 = 0 For x = 0 To xxxx Input #1, ps aa$ = Left(ps, 16) If aa$ = bb$ Then ' Write #2, ps count4 = count4 + 1 End If bb$ = aa$ Next x If count4 > 0 Then ' Write #2, xx, count4 End If Close #1 Open "sept29-7.txt" For Input As #1 ' Find matching pairs in 18 digits bb$ = "0" count5 = 0 For x = 0 To xxxx Input #1, ps aa$ = Left(ps, 6) If aa$ = bb$ Then ' Write #2, ps count5 = count5 + 1 End If bb$ = aa$ Next x If count5 > 0 Then ' Write #2, xx, count5 End If Close #1 Open "sept29-7.txt" For Input As #1 ' Find matching pairs in 20 digits bb$ = "0" count6 = 0 For x = 0 To xxxx Input #1, ps aa$ = Left(ps, 8) If aa$ = bb$ Then ' Write #2, ps count6 = count6 + 1 End If bb$ = aa$ Next x If count6 > 0 Then ' Write #2, xx, count6 End If count1t = count1t + count1 count2t = count2t + count2 count3t = count3t + count3 count4t = count4t + count4 count5t = count5t + count5 count6t = count6t + count6 Close #1 ' sort split contents of file sept29-7b Documents.Open FileName:="sept29-7b", ConfirmConversions:=False, ReadOnly:= _ False, AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:= _ "", Revert:=False, WritePasswordDocument:="", WritePasswordTemplate:="", _ Format:=wdOpenFormatAuto Selection.Sort ExcludeHeader:=False, FieldNumber:="Paragraphs", _ SortFieldType:=wdSortFieldAlphanumeric, SortOrder:=wdSortOrderAscending, _ FieldNumber2:="", SortFieldType2:=wdSortFieldAlphanumeric, SortOrder2:= _ wdSortOrderAscending, FieldNumber3:="", SortFieldType3:= _ wdSortFieldAlphanumeric, SortOrder3:=wdSortOrderAscending, Separator:= _ wdSortSeparateByTabs, SortColumn:=False, CaseSensitive:=False, LanguageID _ :=wdLanguageNone ActiveDocument.SaveAs FileName:="sept29-7b.txt", FileFormat:=wdFormatText, _ LockComments:=False, Password:="", AddToRecentFiles:=True, WritePassword _ :="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _ SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _ False ActiveWindow.Close ' Find matching pairs in 10 digits ' xxxx is count = bb$ = "0" count1b = 0 Open "sept29-7b.txt" For Input As #1 ' change the 12 in the #3 file name above and ' the Left function below to suit number of matches For x = 0 To xxxx Input #1, ps aa$ = Left(ps, 10) If aa$ = bb$ Then Write #3, ps, pps count1b = count1b + 1 End If bb$ = aa$ pps = ps Next x If count1b > 0 Then ' Write #3, xx, count1b End If Close #1 Open "sept29-7b.txt" For Input As #1 ' Find matching pairs in 12 digits bb$ = "0" count2b = 0 For x = 0 To xxxx Input #1, ps aa$ = Left(ps, 12) If aa$ = bb$ Then ' Write #3, "twelve", ps, pps count2b = count2b + 1 End If bb$ = aa$ pps = ps Next x If count2b > 0 Then ' Write #3, xx, count2b End If Close #1 Open "sept29-7b.txt" For Input As #1 ' Find matching pairs in 14 digits bb$ = "0" count3b = 0 For x = 0 To xxxx Input #1, ps aa$ = Left(ps, 14) If aa$ = bb$ Then ' Write #3, ps count3b = count3b + 1 End If bb$ = aa$ Next x If count3b > 0 Then ' Write #3, xx, count3b End If Close #1 Open "sept29-7b.txt" For Input As #1 ' Find matching pairs in 16 digits bb$ = "0" count4b = 0 For x = 0 To xxxx Input #1, ps aa$ = Left(ps, 16) If aa$ = bb$ Then ' Write #3, ps count4b = count4b + 1 End If bb$ = aa$ Next x If count4b > 0 Then ' Write #3, xx, count4b End If Close #1 Open "sept29-7b.txt" For Input As #1 ' Find matching pairs in 6 digits bb$ = "0" count5b = 0 For x = 0 To xxxx Input #1, ps aa$ = Left(ps, 6) If aa$ = bb$ Then ' Write #3, ps count5b = count5b + 1 End If bb$ = aa$ Next x If count5b > 0 Then ' Write #3, xx, count5 End If Close #1 Open "sept29-7b.txt" For Input As #1 ' Find matching pairs in 8 digits bb$ = "0" count6b = 0 For x = 0 To xxxx Input #1, ps aa$ = Left(ps, 8) If aa$ = bb$ Then ' Write #3, ps count6b = count6b + 1 End If bb$ = aa$ Next x If count6b > 0 Then ' Write #3, xx, count6b End If count1tb = count1tb + count1b count2tb = count2tb + count2b count3tb = count3tb + count3b count4tb = count4tb + count4b count5tb = count5tb + count5b count6tb = count6tb + count6b Close #1 Next xx Write #2, count5t, count6t, count1t, count2t, count3t, count4t Write #3, count5tb, count6tb, count1tb, count2tb, count3tb, count4tb Close #2 Close #3 Close #24 Close #25 Close #26
To count individual allele matches
Dim c(20) Dim d(20) Dim ct(1000) Dim ps As String Dim pt As String xxxx = count1 = 0 count2 = 0 count3 = 0 count4 = 0 count5 = 0 count6 = 0 count7 = 0 count8 = 0 count9 = 0 count10 = 0 Open "sept29-7m.txt" For Input As #1 Open "test7m.txt" For Output As #2 For x = 1 To xxxx flag2 = 0 Input #1, ps, pt For j = 11 To 20 c(j) = Mid(ps, j, 1) d(j) = Mid(pt, j, 1) Next j ' the 'm' count added to the profile is suggestive ' of being siblings if the same ' check further as only final digit eg 221 and 81 e = Right(ps, 2) f = Right(pt, 2) If e <> f Then flag2 = 1 Count = 0 For j = 11 To 19 Step 2 flag = 0 If c(j) = d(j) Or c(j) = d(j + 1) Then Count = Count + 1 flag = flag + 1 End If If c(j + 1) = d(j) Or c(j + 1) = d(j + 1) Then Count = Count + 1 flag = flag + 1 End If If c(j) = c(j + 1) And d(j) <> d(j + 1) And flag = 2 Then Count = Count - 1 Next j If Count = 1 Then count1 = count1 + 1 If Count = 2 Then count2 = count2 + 1 If Count = 3 Then count3 = count3 + 1 If Count = 4 Then count4 = count4 + 1 If Count = 5 Then count5 = count5 + 1 If Count = 6 Then count6 = count6 + 1 If Count = 7 Then count7 = count7 + 1 If Count = 8 Then count8 = count8 + 1 If Count = 9 Then count9 = count9 + 1 If Count = 10 Then count10 = count10 + 1 If Count = 10 And flag2 = 1 Then flag2 = 2 ' non sibling matches when flag2 = 2 Write #2, count1, count2, count3, count4, count5, count6, count7, count8, count9, count10, flag2, ps Next x Close #1 Close #2 End Sub

The following postings of developements to usenet group uk.legal postscipt to previous - the word i was looking for, for totally independent 'profiles' - parthenogenesis. My next simulation will be for co-ancestry. For the moment ignoring sexes,external (to 'family') co-ancestry, internal inbreeding,child deaths ,infertility etc, and some lost multiple pairs. Any results will be on the conservative side. Randomly generate,using the same generator as before, 2 x 20 'profiles' of directed numbers and save as 'Adam' and 'Eve' for later reference These 2 are 'mated' 3 times Each of these 3 is 'mated' with a random external mate. Repeated another 3 times giving 3^5 = 243 profiles. Sort just the 243 Check for matching in 12,14,16,18,20 'alleles' If ,say, first 12 match and last 2 match it will only be recorded as a 12 match,not 14 match. Save all matches as full 20 numbers along with cumulative match counts. Then to pick up some otherwise lost matches Swap 11-20 alleles with 1-10 of each profile Resort all 243 ,test for matches and save Repeat whole process ,all randomly generated afresh, perhaps 100 times to guage what sort of numbers result. I may change the sort structure as order 1,3,5,7,9,11,13,15,17,19,2,4,6,8,10,12,14,16,18,20 Eventually repeat perhaps 100,000 times and see if there is any 20 loci matches in any 243 sets.
I have placed my co-ancestry macro, as it stands ,so far, on http://www.nutteing2.freeservers.com/dnas2.htm for anyone wishing to check it - especially whether any errors in the representative output. The output looks very random but because of the proponderance of 6s and 7s in columns 5 to 8 of Adam & Eve(a&e) there is still a proponderence 3 generations later. I've yet to find a working value for the amount of cousin or second cousin marriages in the uk over 5 generations. Pregnancies due to incest as such are probably too rare to include. I have some UK and German data on that ,reported incest 1951 to 1978 between 18 and 49 per year in 6 million population and about 300 per year in 50 million population. And between 9 and 20% leading to pregnancy. So even multiplying by 10 for unreported cases still very low. I've actually expanded to 5 generations ,sorted and tested 243 for matches . Just 2 off 8 loci matches with no obvious relation to the a&e profiles. Two areas to go next is multiple repeats of this 5 generation routine and test for number of 10 loci matches each time. Also work out a routine to meld adjascent north,east,south and west , similar family groups, randomly called to mate instead of totally random 'mates'. Starting with 5 parthegenic isolated families like this first family. I will probably have to construct a macro to check for matches for any of all 20 alleles of all profiles with either adam or eve profile. Some of the yahoo forensic lot are in a tizz now because 2 of their number thought the group was totally private , not open to all and sundry, as far as viewing their messages.
I've added cousin 'marriages' to my 5 generation simulation otherwise all external 'mates' are purely independent /random No cousins at all for first 1,500 runs (36 minutes for 1500) producing 243 fifth generation each run,all runs starting from scratch. 3 (6 digit),4 loci,5 loci,6 loci ,7 loci matches 15,094 ; 586 ; 31 ; 2 ; 0 including cousin marriages (1 in 27 ) in third generation results 15,245 ; 611 ; 41 ; 4 ; 0 including cousin marriages, 1in 27 in 3rd, and 1 in 40 in 4th generation 14,808 ; 607 ; 51 ; 4 ; 1 No i've no idea why the 3 and 4 loci matches have decreased. Next will include 1 in 79 of the 5th generation Bear in mind for ,say, the 7 loci match if 8th was a mismatch but 9 and 10 pairs matched it would only pick up 7. Info from uk.genealogy group etc About 2.7% marriages pre-1837 in Berkshire,all classes, were cousin marriages And for the English nobs 0.3% of marriages in 1920s 1.1% for 1890s
I have a working macro that generates 6 generations from a founding couple with all 'mates' from external randoms except the cousin pairings mentioned before 3rd generation cousin pairings 3.7% 4th gen 2.4% 5th gen 1.2% 6th gen 0.4% Pair matching for 1000 runs of 6 generations (1 hour 20 mins) produces for 6,8,10,12,14,16 allele pair matches 73631,3057,189,8,1,0 and also swapping end for end 11-20 with 1-10 of each profile,sorting and pair matching 17077,1672,132,9,1,0 But another macro for all >=5 matched adjascent pairs a routine to inspect and count individual alleles above numbers 1 to 10 giving for 11,12,13,14,15,16,17,18,19,20 29,39,59,21,20,9,4,2,1,0 so one 19 allele match "34125534131715351133" and "34125534131714351133" And for the end-over-end and checking 12,24,36,25,16,11,2,1,1,0 so one 19 allele match "66664523381314333735" and "26664523381314333735" There are other missed partial matches because only selecting first 10 or last 10 then individually checking converted to standard in both senses,second pair 10 for 10 swapped back to normal (16,17)(6,7)(13,13)(21,22)(28,30)(12,18)(17,21)(11,13)(13,13)(15,15) (16,17)(6,7)(13,13)(21,22)(28,30)(12,18)(17,20)(11,13)(13,13)(15,15) (19,19)(9.3,9.3)(12,13)(20,21)(30,32.2)(12,14)(17,20)(11,11)(14,16)(15,17) (15,19)(9.3,9.3)(12,13)(20,21)(30,32.2)(12,14)(17,20)(11,11)(14,16)(15,17) 1000 runs of 729 6th generation is 729,000 profiles. How many runs to get a single 20 allele match.? I've not factored in any extended 'families' to feed into each of these 729 family trees, each one is generated afresh from a new random founding pair. For the number of relatives to one person in terms of common ancestor pairs ,3 children each family ,excluding cousin pairings seems to be second generation 3x1 + 1 [your own 2 pairs of grandparents( one common) and the other 2 pairs of grandparents of your 6 cousins] third generation 9x2 +2 fourth gen 27x4 +4 fifth gen 81x8 +8 sixth generation 243x16 + 16 = 3904 So am i right in thinking there is 3904 x 729 people (2.846016 million) possible people linked to one individual with all the other offspring of all these ancestors in common,just over 6 generations. So a run of 3904 instead of 1000 for all possible people with one ancestor pair in common . If that is the case and i assume a high probability of a 3904 run producing one full 10 loci ,20 digit, match then you could say without any further inter-relatedness from external input then everyone is likely to have one match in their extended linkage. All people who have a blood-line link to yourself from one ancestor pair sharing a blood-line link forward to one other person. It looks like a four-hour run is required and some more scribbling on paper to check the common ancestor factor of {(2^n)/4}{1+3^(n-1)} for n generations
14 pairs of 19 'allele' matches testing all 729, 6th generation offspring for 10,096 pairs of ancestors. May be more as only tested for first or last 5 pairs of adjascent matches before testing for single matches. I've given up trying to find a 20 digit match. These results are effectively halved because male/female taken out of the processing. (16,17)(6,7)(13,13)(21,22)(28,30)(12,18)(17,21)(11,13)(13,13)(15,15) (16,17)(6,7)(13,13)(21,22)(28,30)(12,18)(17,20)(11,13)(13,13)(15,15) (19,19)(9.3,9.3)(12,13)(20,21)(30,32.2)(12,14)(17,20)(11,11)(14,16)(15,17) (15,19)(9.3,9.3)(12,13)(20,21)(30,32.2)(12,14)(17,20)(11,11)(14,16)(15,17) (17,19)(6,9.3)(13,14)(21,22)(29,31.2)(12,16)(20,24)(12,12)(14,14)(13,17) (17,19)(6,9.3)(13,14)(21,22)(29,31.2)(12,16)(20,24)(12,12)(14,14)(13,15) (17,18)(9,9.3)(13,14)(22,24)(28,29)(13,19)(20,23)(11,13)(14,15)(15,17) (17,18)(9,9.3)(13,14)(22,24)(28,29)(13,19)(17,23)(11,13)(14,15)(15,17) (17,18)(9,9.3)(14,14)(22,23)(30,30)(14,18)(18,20)(9,12)(13,15)(16,19) (17,18)(9,9.3)(14,14)(22,23)(30,30)(14,18)(18,20)(9,12)(13,15)(15,16) (18,18)(9,9.3)(12,15)(18,24)(29,30)(13,16)(20,24)(9,11)(13,15)(15,16) (18,18)(9,9.3)(12,15)(18,24)(29,30)(13,16)(20,20)(9,11)(13,15)(15,16) (17,17)(8,9.3)(13,14)(21,23)(28,30)(12,18)(17,24)(12,13)(14,14)(15,17) (17,17)(6,9.3)(13,14)(21,23)(28,30)(12,18)(17,24)(12,13)(14,14)(15,17) (14,17)(6,9)(13,13)(21,23)(29,29)(17,17)(16,25)(8,11)(13,13)(15,17) (14,14)(6,9)(13,13)(21,23)(29,29)(17,17)(16,25)(8,11)(13,13)(15,17) (17,18)(6,6)(14,15)(19,19)(30,31)(14,18)(20,24)(11,13)(12,14)(16,18) (17,18)(6,6)(14,15)(19,19)(28,30)(14,18)(20,24)(11,13)(12,14)(16,18) (14,19)(6,9)(12,13)(21,25)(28,32.2)(15,17)(18,22)(11,12)(12,13)(15,15) (14,19)(6,9)(12,13)(21,25)(28,32.2)(13,17)(18,22)(11,12)(12,13)(15,15) (18,19)(7,9.3)(13,16)(21,22)(28,30)(14,15)(20,23)(9,12)(14,14)(15,16) (17,18)(7,9.3)(13,16)(21,22)(28,30)(14,15)(20,23)(9,12)(14,14)(15,16) (15,17)(7,9)(12,13)(21,22)(28,30)(16,16)(19,20)(12,12)(14,14)(14,16) (15,17)(7,9)(12,13)(21,22)(28,30)(16,16)(16,19)(12,12)(14,14)(14,16) (17,21)(6,9.3)(12,14)(19,22)(28,32.2)(12,14)(19,20)(11,12)(14,15)(13,16) (17,21)(6,9.3)(12,14)(19,22)(28,32.2)(12,14)(19,20)(9,11)(14,15)(13,16) (14,19)(7,9.3)(13,13)(20,20)(29,31)(16,16)(20,25)(11,13)(12,15)(14,14) (14,19)(7,9.3)(13,13)(20,20)(29,31)(16,16)(17,20)(11,11)(12,15)(14,14) And for other combined match counts for 10,096 runs 11 alleles,12,13,14,15,16,17,18 195,399,478,306,228,105,40,22 and the end-over-end for 11 to 18 152,276,338,519,187,102,41,12 The way forward,next week ,will have to be more generations (but from preliminary study beyond 6 generations there is probably too much dilution. Or as origionally hypothetised placing these 'families' in a surrounding sea of families from which to randomly choose mates. Too few families and not representative and too many then effectively back to totally random externals. Anyone any ideas what a representative number of surrounding familes would be ?. All contributions would be one way ,from external to internal, rather than the real situation which would be 2 way ,mutually reinforcing co-ancestry. For the moment i think i will try 20 external families . Generating 20 of these families as in the 1000/1024 structure and then randomly selecting from the 20 to produce my array of externals to call on instead of the truly random array for further processing . Macros as files dnas.htm,dnas2.htm and dnas3.htm on URL below.
I could not understand why I was not picking up sibling matches. The answer is a major error in my routine. Each child was the offspring of one parent and a random mate each time not 3 offspring of the same pair of parents. Ignore the previous versions of dnas2.htm and dnas3.htm and previous kin results. Now in a 7 minute run of 100 x 729 kin there was 3 separate 20 digit matches (repeated of course in the end-over-end matching) Also 28 x 19 digit matches. The next is of course - how many runs to pick up a non-sibling match.
2000 run gave 50pairs x 20 digit matches - all siblings. Probably generally valid for brothers or sisters. So for 2000 x 243 sets of 3 siblings then 50 pairs of matches. So about one in 30,000 for 1.5 m population. Of more interest is the non-sibling situation. For same 2000 run of 729 profiles each,14 or less digit matches not recorded (straight 10 digit match preliminary not end-over-end routine added this time) 15 out of 20 digits matched - 37 pairs of 'cousins' 16 - 11 pairs 17 - 3 pairs 18 - 1 pair So approx double these figures for end-over-end and halve for same sex plus more not trapped matches. All for totally random external input so next week 20 extended families (each with random external input) randomly chosen to 'mate' with the core family over 6 generations
I slightly adapted the macro to include parents in with children before match checking. For a 1000 run produced 27x 20 digit matches all matching siblings or uncles (siblings in previous generation) 50x 19 digit matches again no non-siblings 135x 18 digit matches -not checked for sibling /non sibling Over the weekend arrived at a working macro for 20 founding families to feed into the core family. Disappointing results for non-sib matches 100 times repeated for 20 founder families (fresh set each time) taking about an hour number of sibling matches for 11,12,13,14,15,16,17,18,19,20 0,5,7,25,66,56,73,31,9,1 and non sib matches for 12,13,14,15 'alleles' 1,2,2,1 So reduced down to 100 repeats of 4 founder families sibling matches 0,8,15,25,67,94,65,29,7,3 non-sibs on 12,13,14,15 4,3,1,1 So reduced to just 2 families sibling m 0,2,10,28,75,89,92,52,16,3 non-sibs on 12,13,14,15,16 1,3,1,2,1 Then reduced to just one external family sibs 4,7,15,52,105,122,96,50,21,1 non-sibs on 11,12,13,14,15,16,17 2,7,7,7,2,1,3 Then returning to 20 families and a 3 hour 300 run sibs 4,10,33,85,190,203,177,91,28,3 non sibs matches on 11,12,13,14,15,16 4,6,3,2,0,1 To push the non sib count to include 1 x 20 match would probably need a run of more than 90 hours at this rate The above macro now as file dnas4.htm on URL below I've done spot checks of 'individuals' in this macro and found no errors so I think i will return to random external input to the one family and increase from 5 to 6 ,7 or 8 generations and see what happens
A simulation of a large DNA profile database
A simulation of DNA profile 'families'
A simulation of DNA profile 'families' for 6 generations
dnas.htm revisited with all alleles represented
dnas.htm revisited for >8 percent allele frequency subset (similar ancestry )
Simulation of Taiwanese Tao and Rukai populations to explore the effect of within and without ancestral clusters
Basques autochthonous DNA profiles simulation, 9 loci
Australian Capital Caucasian 9 loci simulation
Australian Capital Caucasian 9 loci simulation, >= 5% allele frequency
CODIS, 13 Loci Caucasian Simulation
Automating the macros
Exploring other DNA profile match scenarios
Suspect familial matching
Return to co-ancestry factor in the NDNAD simulations
144 random matches in 65,000 -- ONLY?
Background
'Peer review' of some of the dnapr.htm material

Powered by counter.bloke.com