Page 1 of 4 123 ... LastLast
Results 1 to 10 of 37

Thread: Making two-way G25 models with negative weights

  1. #1
    Registered Users
    Posts
    340
    Sex
    Ethnicity
    Finnish

    Making two-way G25 models with negative weights

    I made a JavaScript interface which allows you to make two-way models with negative weight percentages: https://jsbin.com/gojecoh. It currently looks like this:



    It's based on the same formula as the Dodecad Oracle script that Dienekes wrote in R: http://dodecad.blogspot.com/2011/07/...oracle-v1.html, https://anthrogenica.com/showthread....l=1#post857447. The same method is also used by allelocator.com and the 2WAY tab in Lukasz's Vahaduo fork, even though they're much slower than my JavaScript interface.

    My script loops through each combination of two source populations, and it finds the closest point to the target population on the line that intersects the two source populations. Sometimes the closest point is not between the two source populations, but it's beyond the source populations on either side of the line, which corresponds to one of the source populations having more than 100% ancestry and the other source population having negative ancestry.

    I accidentally found that when you allow negative weights for the models, then it's a useful way to find which populations can be modeled as a combination of your target population and another population. Or in other words, instead of using a regular two-way model to find which populations your target population has ancestry from, you can use a model with negative weights to find which populations your target population has contributed ancestry to (or which populations can be modeled as a combination of your target population and another population).

    For example when I used modern populations to model Finns, and I excluded Finnic populations from the sources, and I only allowed models with a negative weight, then the best model was 437% Swedish - 337% Danish (which indicates that Swedes can be modeled as a mixture of Danes and Finns):

    Target: Finnish
    0.018 437% Swedish - 337% Danish
    0.021 110% Russian_Krasnoborsky - 10% Tatar_Lipka
    0.021 107% Russian_Krasnoborsky - 7% Turkmen
    0.021 106% Russian_Krasnoborsky - 6% Turkmen_Uzbekistan
    0.021 104% Russian_Krasnoborsky - 4% Hazara
    0.021 105% Russian_Krasnoborsky - 5% Uzbek
    0.021 107% Russian_Krasnoborsky - 7% Tatar_Crimean_steppe
    0.021 104% Russian_Krasnoborsky - 4% Hazara_Afghanistan
    0.021 104% Russian_Krasnoborsky - 4% Uygur
    0.021 121% Russian_Krasnoborsky - 21% Tatar_Mishar

    The model "100% Finnish = 437% Swedish - 337% Danish" is equivalent to "437% Swedish = 337% Danish + 100% Finnish", or when divided by 4.37 and rounded to the nearest integer, "100% Swedish = 77% Danish + 23% Finnish". (However you cannot actually use this method to find the closest point to Swedes on the line between Finns and Danes, which is actually slightly different.)

    Below is also an R version of my script. You can try running it here: https://yint.org/static/stats-mooc/4H.R (other websites for running R code either resulted in a timeout or they didn't allow downloading the G25 datasheet from an external URL). Or you can also download an R installer and run the code in the R Console application, or you can install R through your package manager and run `R` to start an interactive R session.

    Code:
    weightmode=1 # 1 converts negative weights to 0 (standard), 2 allows both non-negative and negative weights, and 3 keeps only models with a negative weight
    nprint=20
    
    source=read.csv("https://drive.google.com/uc?export=download&id=1wZr-UOve0KUKo_Qbgeo27m-CQncZWb8y",r=1) # modern averages scaled
    # source=read.csv("https://drive.google.com/uc?export=download&id=1F2rKEVtu8nWSm7qFhxPU6UESQNsmA-sl",r=1) # ancient averages scaled
    # targ="Finnish_Central";target=source[targ,];source=source[!rownames(source)%in%c(targ),]
    target=colMeans(source[grepl("Finnish",rownames(source)),]) # average of Finnish regional averages
    source=source[!grepl("Finnish|Estonian|Ingrian|Karelian|Vepsian",rownames(source)),]
    # target=c(.08651,-.13202,.10672,.08689,-.06801,-.02733,.04371,.02515,-.02781,-.0503,.06853,-.02338,.03211,-.04101,-.02158,.02227,-.0206,-.02065,-.02627,-.03001,-.04966,.01088,-.09375,-.01458,.00862)
    
    sourcename=rownames(source)
    target=unname(as.numeric(target))
    source=unname(as.matrix(source))
    
    npop=nrow(source)
    comb=npop*(npop-1)/2 # number of 2-combinations of npop items
    
    ij=double(comb*2)
    n=1;for(i in 1:(npop-1))for(j in(i+1):npop){ij[2*n-1]=i;ij[2*n]=j;n=n+1} # this was faster than `combn(npop,2)`
    ij1=ij[seq(1,comb*2,2)]
    ij2=ij[seq(2,comb*2,2)]
    
    targetdist=sapply(colSums((target-t(source))^2),sqrt) # this is a fast vectorized way to get the distance of one vector to a matrix of many vectors
    d0=dist(source)
    d1=targetdist[ij1]
    d2=targetdist[ij2]
    weight=(d0^2+d2^2-d1^2)/(2*d0^2)
    dist=sapply(d2^2-weight^2*d0^2,sqrt)
    
    if(weightmode==1){o1=weight>1;u0=weight<0;weight[o1]=1;weight[u0]=0;dist[o1]=targetdist[ij[2*which(o1)-1]];dist[u0]=targetdist[ij[2*which(u0)]]}
    if(weightmode==3)dist[weight<=1]=NA
    
    ord=head(order(dist),min(nprint,comb-sum(is.na(dist))))
    n1=sourcename[ij1][ord]
    n2=sourcename[ij2][ord]
    rev=weight<.5
    revo=rev[ord]
    temp=n1;n1[revo]=n2[revo];n2[revo]=temp[revo]
    wo=weight[ord]
    wo[revo]=1-wo[revo]
    
    writeLines(sprintf("%.3f %.0f%% %s %s %.0f%% %s",dist[ord],100*wo,n1,ifelse(wo>1,"-","+"),100*(abs(1-wo)),n2))
    You now have to request permission to access the original R script by Dienekes, so I only have bce's version of the script that was modified for G25. It's slower than my version, because it uses two nested for loops to calculate the weight and distance of each model instead of my vectorized method, because it formats all models as strings and not only the models that get printed, because it unnecessarily gets the same index from a dataframe and a vector multiple times inside the nested for loops instead of saving the retrieved values in variables, because it doesn't use a vectorized method to calculate the `targetdist` vector, and because it doesn't convert the dataframe of the source coordinates into a matrix without row and column names (removing the names alone made an earlier version of my script about twice as fast, but in the new vectorized version it doesn't make much difference). So when I used a single population as the target and all 716 populations from the datasheet for modern averages as the source, then bce's version of the script by Dienekes took about 4.5 seconds to run, my R script took about 0.2 seconds, and a Node.js version of my JavaScript interface took about 0.3 seconds.

    When I tried making models for Nenetses where I only allowed negative weights, then Nenetses ended up looking like Bolshoy Oleniy Ostrov with less EHG ancestry, or like Sargat with less Sarmatian ancestry:

    Target: Nenets
    0.053 175% RUS_Bolshoy_Oleni_Ostrov - 75% RUS_Sidelkino_HG
    0.053 289% Sargat_IA - 189% Sarmatian_RUS_Urals
    0.058 174% RUS_Bolshoy_Oleni_Ostrov - 74% RUS_Karelia_HG
    0.059 171% RUS_Bolshoy_Oleni_Ostrov - 71% RUS_Samara_HG
    0.061 170% RUS_Bolshoy_Oleni_Ostrov - 70% RUS_Volga-Kama_N
    0.061 170% RUS_Bolshoy_Oleni_Ostrov - 70% RUS_Veretye_Meso
    0.062 132% RUS_Bolshoy_Oleni_Ostrov_o - 32% RUS_Karelia_HG
    0.062 132% RUS_Bolshoy_Oleni_Ostrov_o - 32% RUS_Sidelkino_HG

    VK518 from Margaryan et al. 2020 looks like a more extreme version of Saami with less Finnic ancestry:

    Target: VK2020_NOR_North_VA_o1
    0.028 142% Saami - 42% Finnish_Southeast
    0.029 148% Saami - 48% Finnish_East
    0.032 134% Saami - 34% Estonian
    0.032 146% Saami - 46% Karelian
    0.032 193% Saami_Kola - 93% Estonian
    0.032 141% Saami - 41% Ingrian
    0.032 137% Saami - 37% Cossack_Kuban
    0.032 208% Komi - 108% Ukrainian_Zhytomyr

    Udmurts look like Sargat but with less East Inner Asian ancestry:

    Target: Udmurt
    0.031 130% Sargat_IA - 30% MNG_Munkhkhairkhan_MBA_2
    0.032 120% Sargat_IA - 20% MNG_Mongun_Taiga_LBA_1
    0.032 132% Sargat_IA - 32% CHN_Zaghunluq_IA3
    0.032 117% Sargat_IA - 17% CHN_Songshugou_BA3
    0.033 175% Sargat_IA - 75% CHN_Songshugou_IA2
    0.033 116% Sargat_IA - 16% RUS_Lena_River_N
    0.033 148% Sargat_IA - 48% MNG_Xiongnu_Central_Asian
    0.033 117% Sargat_IA - 17% RUS_Ust_Ida_LN

    Nganasans actually get a pretty good distance as a more extreme version of Nenetses with less Ob-Ugric ancestry:

    Target: Nganassan
    0.033 259% Nenets - 159% Khanty
    0.039 241% Nenets - 141% Mansi
    0.060 147% Evenk - 47% Sakha
    0.064 248% Nenets - 148% Ket
    0.066 142% Yukagir_Tundra - 42% Nivkh
    0.066 141% Evenk - 41% Yakut
    0.071 123% Evenk - 23% Daur
    0.071 144% Yukagir_Tundra - 44% Ulchi

    The best model for Uyelgi is similar to some of the best models for Nenetses because it gets over 100% Sargat ancestry and negative Sarmatian ancestry:

    Target: RUS_Kusnarenkovo_Karajakupovo_MED
    0.028 163% Sargat_IA - 63% Sarmatian_KAZ_Aktobe
    0.029 142% Sargat_IA - 42% DNK_Gjerrild_SGC_low_res
    0.030 166% Sargat_IA - 66% Sarmatian_RUS_Urals
    0.030 142% Sargat_IA - 42% RUS_Fatyanovo_Ivanovo_BA
    0.030 141% Sargat_IA - 41% KAZ_Ak_Moustafa_MLBA1
    0.030 140% Sargat_IA - 40% Yamnaya_BGR
    0.030 145% Sargat_IA - 45% CHN_Jirentaigoukou_LBA2
    0.031 141% Sargat_IA - 41% Corded_Ware_CZE_late

    Another feature in my JavaScript interface is that you can choose a fixed second source population which is used in every model. If for example Ashkenazis are modeled so that the fixed source population is set as Sephardim and the other source populations consist of goyim, then in half of the top models, the goy population is Uralic:



    And when I tried to model Erfurt Jews with modern sources so that I only allowed models with a negative weight, and I rejected models where the minimum absolute weight of the second population was below 10, then the best models looked like Ashkenazis with less ancestry from either West Uralic populations or Balkan Turks:

    0.008 DEU_MA_Erfurt1 = 131% Ashkenazi_Poland - 31% Turkish_Deliorman
    0.009 DEU_MA_Erfurt1 = 113% Ashkenazi_Poland - 13% Erzya
    0.009 DEU_MA_Erfurt1 = 113% Ashkenazi_Poland - 13% Moksha
    0.010 DEU_MA_Erfurt1 = 112% Ashkenazi_Germany - 12% Turkish_Rumeli
    0.010 DEU_MA_Erfurt1 = 111% Ashkenazi_Poland - 11% Finnish_North
    0.010 DEU_MA_Erfurt1 = 144% Ashkenazi_Russia - 44% Turkish_Deliorman
    0.010 DEU_MA_Erfurt1 = 111% Ashkenazi_Poland - 11% Finnish_Central
    0.010 DEU_MA_Erfurt1 = 111% Ashkenazi_Poland - 11% Russian_Pinezhsky

    And similarly when I used ancient populations as a target and modern populations as a source, and when I set Saami as the fixed second source population, and when I set the minimum absolute percentage of the second source population to 10%, then the very best model was that Erfurt Jews were modeled as Russian Ashkenazis who had less Saami ancestry:

    0.015 DEU_MA_Erfurt1 = 110% Ashkenazi_Russia - 10% Saami
    0.018 Greater_Antilles_eastern_Ceramic = 110% Mixtec - 10% Saami
    0.019 DOM_southeast_Ceramic = 110% Mixtec - 10% Saami
    0.020 BHS_Ceramic = 110% Mixtec - 10% Saami
    0.024 ARG_Aconcagua_500BP = 111% Mayan - 11% Saami
    0.024 CHN_Upper_Yellow_River_IA = 112% Bonan - 12% Saami
    0.024 DEU_MA_Krakauer_Berg = 131% Ingrian - 31% Saami
    0.025 DEU_MA_Krakauer_Berg = 134% Erzya - 34% Saami

    And if you model Ashkenazis as a mixture of southern Italians and some gentile population, then in some of the best models they get around 5-10% ancestry from the Volga-Ural region or even from Saami:

    0.016 Ashkenazi_average = 93% Italian_Calabria + 7% Tatar_Lipka
    0.016 Ashkenazi_average = 95% Italian_Calabria + 5% Bashkir
    0.016 Ashkenazi_average = 93% Italian_Calabria + 7% Tatar_Kazan
    0.017 Ashkenazi_average = 94% Italian_Calabria + 6% Besermyan
    0.017 Ashkenazi_average = 95% Italian_Calabria + 5% Saami
    0.017 Ashkenazi_average = 94% Italian_Calabria + 6% Udmurt
    0.017 Ashkenazi_average = 96% Italian_Calabria + 4% Tatar_Siberian_Zabolotniye
    0.017 Ashkenazi_average = 96% Italian_Calabria + 4% Tatar_Siberian
    Last edited by Nganasankhan; 07-31-2022 at 07:35 PM.

  2. The Following 29 Users Say Thank You to Nganasankhan For This Useful Post:

     Aben Aboo (07-31-2022),  Ajeje Brazorf (07-31-2022),  AlluGobi (07-31-2022),  Andour (07-31-2022),  Andrewid (08-03-2022),  Aspar (08-02-2022),  cercle (07-31-2022),  Corky (08-06-2022),  hokkanto (07-31-2022),  Huck Finn (07-31-2022),  Jalisciense (08-03-2022),  Jessie (08-01-2022),  jstephan (07-31-2022),  kolompar (07-31-2022),  lehmannt (07-31-2022),  michal3141 (08-04-2022),  MiranZai (07-31-2022),  Mis (08-03-2022),  mokordo (08-03-2022),  peloponnesian (08-11-2022),  ph2ter (07-31-2022),  PLogan (07-31-2022),  randwulf (07-31-2022),  rothaer (08-05-2022),  Saeed (08-04-2022),  sheepslayer (08-01-2022),  Thracian88 (08-01-2022),  Toguz (07-31-2022),  Tomenable (08-01-2022)

  3. #2
    Registered Users
    Posts
    9
    Sex
    Ethnicity
    TŁrk

    0.064 Toguz_scaled = 249% Sargat_IA - 149% RUS_Bolshoy_Oleni_Ostrov
    0.073 Toguz_scaled = 159% KAZ_Kipchak - 59% RUS_Shamanka_N
    0.077 Toguz_scaled = 167% KAZ_Kipchak - 67% RUS_Baikal_N
    0.080 Toguz_scaled = 166% RUS_Tagar - 66% RUS_Sosonivoy_HG
    0.088 Toguz_scaled = 158% RUS_Tagar - 58% RUS_Tyumen_HG
    0.093 Toguz_scaled = 161% RUS_Tagar - 61% KAZ_Botai
    0.094 Toguz_scaled = 162% RUS_Tagar - 62% RUS_Karelia_HG
    0.100 Toguz_scaled = 146% RUS_Tagar - 46% CHN_Tarim_EMBA1
    0.102 Toguz_scaled = 146% RUS_Nomad_MA - 46% RUS_Baikal_N
    0.102 Toguz_scaled = 146% RUS_Tagar - 46% RUS_AfontovaGora3


    0.019 Toguz_scaled = 94% Turkish_Aydin + 6% Komi
    0.019 Toguz_scaled = 92% Turkish_Aydin + 8% Tatar_Mishar
    0.019 Toguz_scaled = 95% Turkish_Aydin + 5% Saami_Kola
    0.019 Toguz_scaled = 94% Turkish_Aydin + 6% Russian_Leshukonsky
    0.019 Toguz_scaled = 93% Turkish_Aydin + 7% Tatar_Kazan
    0.019 Toguz_scaled = 95% Turkish_Aydin + 5% Udmurt
    0.019 Toguz_scaled = 94% Turkish_Aydin + 6% Besermyan
    0.019 Toguz_scaled = 95% Turkish_Aydin + 5% Chuvash
    0.019 Toguz_scaled = 96% Turkish_Aydin + 4% Saami
    0.019 Toguz_scaled = 93% Turkish_Aydin + 7% Tatar_Lipka
    0.019 Toguz_scaled = 95% Turkish_Aydin + 5% Finnish_North
    0.019 Toguz_scaled = 96% Turkish_Aydin + 4% Mari
    0.019 Toguz_scaled = 95% Turkish_Aydin + 5% Vepsian
    0.019 Toguz_scaled = 95% Turkish_Aydin + 5% Karelian
    0.019 Toguz_scaled = 95% Turkish_Aydin + 5% Finnish_Central
    0.019 Toguz_scaled = 95% Turkish_Aydin + 5% Erzya
    0.019 Toguz_scaled = 96% Turkish_Aydin + 4% Finnish_East
    0.019 Toguz_scaled = 95% Turkish_Aydin + 5% Finnish_Southwest
    0.019 Toguz_scaled = 95% Turkish_Aydin + 5% Moksha
    0.020 Toguz_scaled = 96% Turkish_Aydin + 4% Ingrian
    0.020 Toguz_scaled = 96% Turkish_Aydin + 4% Bashkir
    0.020 Toguz_scaled = 96% Turkish_Aydin + 4% Estonian

  4. The Following 6 Users Say Thank You to Toguz For This Useful Post:

     Aben Aboo (07-31-2022),  AlluGobi (07-31-2022),  Huck Finn (07-31-2022),  lehmannt (07-31-2022),  Nganasankhan (07-31-2022),  randwulf (07-31-2022)

  5. #3
    Registered Users
    Posts
    443
    Sex
    Location
    Auvergne, France
    Ethnicity
    "Arvern"
    Nationality
    French
    Y-DNA (P)
    R-L2-DF103-FT21550
    mtDNA (M)
    H1bm

    European Union France
    Fantastic !!

    0.012 Andour_scaled = 61% ITA_Etruscan:RMPR473 + 39% VK2020_SWE_Gotland_VA:VK48
    0.012 Andour_scaled = 66% England_Saxon:I0157 + 34% BGR_C:I2509
    0.012 Andour_scaled = 52% Bell_Beaker_HUN_EBA:I2364 + 48% VK2020_Scotland_Orkney_VA:VK203
    0.013 Andour_scaled = 54% England_MIA:I19654 + 46% Bell_Beaker_HUN_EBA:I2364
    0.013 Andour_scaled = 50% Bell_Beaker_HUN_EBA:I2364 + 50% England_IA:I0160
    0.013 Andour_scaled = 71% England_Saxon:I0157 + 29% TUR_Barcin_N:I0709
    0.014 Andour_scaled = 51% England_EastYorkshire_MIA_LIA:I14104 + 49% Bell_Beaker_HUN_EBA:I2364
    0.014 Andour_scaled = 62% England_Saxon:I0157 + 38% BGR_Middle_C:I2431
    0.014 Andour_scaled = 70% England_Roman:6DT3 + 30% HRV_Pop_MNOP02
    0.014 Andour_scaled = 60% England_Saxon:I0157 + 40% ITA_Sicily_EBA:I11442
    0.014 Andour_scaled = 68% England_Saxon:I0157 + 32% ITA_Ripabianca_di_Monterado_N:RMPR18
    0.014 Andour_scaled = 72% England_MIA_LIA:I20623 + 28% CZE_N:I7952
    0.014 Andour_scaled = 54% Bell_Beaker_HUN_EBA:I2364 + 46% England_LBA:I13713
    0.014 Andour_scaled = 70% England_MIA_LIA:I20623 + 30% DEU_LBK_SMH:XN188
    0.014 Andour_scaled = 66% England_Saxon:I0157 + 34% HRV_Pop_MNOP13
    0.014 Andour_scaled = 55% ITA_Etruscan:RMPR473 + 45% VK2020_SWE_Oland_VA:VK337
    0.014 Andour_scaled = 61% ITA_Etruscan:RMPR473 + 39% VK2020_DNK_Jutland_VA:VK384
    0.014 Andour_scaled = 66% England_Saxon:I0157 + 34% HRV_C_Lasinja:I10052
    0.014 Andour_scaled = 64% England_Saxon:I0157 + 36% ITA_Sicily_MBA:I4109

    With fixed source populations:

     
    0.024 Andour_scaled = 82% AUT_IA_La_Tene:I11699 + 18% FRA_Alsace_IA1:NOR2B6
    0.025 Andour_scaled = 76% CZE_IA_La_Tene:I17145 + 24% FRA_Alsace_IA1:NOR2B6
    0.025 Andour_scaled = 73% CZE_IA_La_Tene:I15954 + 27% FRA_Alsace_IA1:NOR2B6
    0.025 Andour_scaled = 86% SRB_Mokrin_EBA_Maros:MOK29A + 14% FRA_Alsace_IA1:NOR2B6
    0.026 Andour_scaled = 81% CZE_LBA_Knoviz:I13795 + 19% FRA_Alsace_IA1:NOR2B6
    0.026 Andour_scaled = 99% SVN_EIA:I5691 + 1% FRA_Alsace_IA1:NOR2B6
    0.027 Andour_scaled = 66% FRA_SouthEast_IA2:I13620 + 34% FRA_Alsace_IA1:NOR2B6
    0.027 Andour_scaled = 93% CZE_IA_La_Tene:I15046 + 7% FRA_Alsace_IA1:NOR2B6
    0.027 Andour_scaled = 74% ITA_Etruscan_Campiglia_CEU_o:CAM002 + 26% FRA_Alsace_IA1:NOR2B6
    0.027 Andour_scaled = 89% HRV_MBA:I26774 + 11% FRA_Alsace_IA1:NOR2B6
    0.027 Andour_scaled = 74% VK2020_SWE_Oland_VA:VK350 + 26% FRA_Alsace_IA1:NOR2B6
    0.027 Andour_scaled = 98% ITA_Rome_Imperial:RMPR116 + 2% FRA_Alsace_IA1:NOR2B6
    0.027 Andour_scaled = 70% SVK_LIA_La_Tene:I11715 + 30% FRA_Alsace_IA1:NOR2B6
    0.028 Andour_scaled = 68% ITA_Collegno_MA:CL57 + 32% FRA_Alsace_IA1:NOR2B6
    0.028 Andour_scaled = 81% SRB_Mokrin_EBA_Maros:MOK24A + 19% FRA_Alsace_IA1:NOR2B6
    0.028 Andour_scaled = 79% VK2020_DNK_Langeland_VA:VK286 + 21% FRA_Alsace_IA1:NOR2B6
    0.028 Andour_scaled = 71% SVN_EIA:I5693 + 29% FRA_Alsace_IA1:NOR2B6

    0.020 Andour_scaled = 71% ITA_Rome_Imperial:RMPR116 + 29% ITA_Etruscan:RMPR473
    0.020 Andour_scaled = 57% ITA_Rome_Imperial:RMPR116 + 43% AUT_IA_La_Tene:I11701
    0.020 Andour_scaled = 51% ITA_Rome_Imperial:RMPR116 + 49% HRV_MBA:I26774
    0.020 Andour_scaled = 52% AUT_IA_La_Tene:I11699 + 48% ITA_Rome_Imperial:RMPR116
    0.020 Andour_scaled = 65% ITA_Rome_Imperial:RMPR116 + 35% HRV_EIA:I23996
    0.021 Andour_scaled = 67% ITA_Rome_Imperial:RMPR116 + 33% ITA_Rome_Late_Antiquity:RMPR33
    0.021 Andour_scaled = 77% ITA_Rome_Imperial:RMPR116 + 23% Scythian_HUNA198
    0.021 Andour_scaled = 66% ITA_Rome_Imperial:RMPR116 + 34% CZE_LBA_Knoviz_o3:I13786
    0.021 Andour_scaled = 72% ITA_Rome_Imperial:RMPR116 + 28% HRV_MBA:I26726
    0.021 Andour_scaled = 80% ITA_Rome_Imperial:RMPR116 + 20% ITA_Etruscan_Vetulonia:VET002
    0.022 Andour_scaled = 63% ITA_Rome_Imperial:RMPR116 + 37% HUN_IA_La_Tene:I25510
    0.022 Andour_scaled = 81% ITA_Rome_Imperial:RMPR116 + 19% ITA_Chiusi_EMA:ETR010
    0.022 Andour_scaled = 60% ITA_Rome_Imperial:RMPR116 + 40% ITA_Rome_MA:RMPR61
    0.022 Andour_scaled = 57% ITA_Rome_Imperial:RMPR116 + 43% VK2020_DNK_Langeland_VA:VK286
    0.022 Andour_scaled = 72% ITA_Rome_Imperial:RMPR116 + 28% HRV_IA:I3313
    0.022 Andour_scaled = 69% ITA_Rome_Imperial:RMPR116 + 31% SVN_EIA:I22940

    0.023 Andour_scaled = 57% ITA_Etruscan_Campiglia_CEU_o:CAM002 + 43% ITA_Rome_Late_Antiquity:RMPR109
    0.023 Andour_scaled = 59% HRV_MBA:I26774 + 41% ITA_Etruscan_Campiglia_CEU_o:CAM002
    0.023 Andour_scaled = 63% SVN_EIA:I5691 + 37% ITA_Etruscan_Campiglia_CEU_o:CAM002
    0.023 Andour_scaled = 51% ITA_Etruscan_Campiglia_CEU_o:CAM002 + 49% HUN_LBA:I25504
    0.023 Andour_scaled = 62% ITA_Etruscan_Campiglia_CEU_o:CAM002 + 38% HUN_IA_La_Tene:I18531
    0.024 Andour_scaled = 55% ITA_Etruscan_Campiglia_CEU_o:CAM002 + 45% HUN_IA_La_Tene:I25510
    0.024 Andour_scaled = 62% CZE_IA_La_Tene:I15046 + 38% ITA_Etruscan_Campiglia_CEU_o:CAM002
    0.024 Andour_scaled = 62% ITA_Etruscan_Campiglia_CEU_o:CAM002 + 38% ITA_Rome_MA:RMPR1289
    0.024 Andour_scaled = 76% ITA_Etruscan_Campiglia_CEU_o:CAM002 + 24% ITA_Daunian:ORD006
    0.024 Andour_scaled = 60% ITA_Etruscan_Campiglia_CEU_o:CAM002 + 40% Iberia_Northeast_Empuries1:I8203
    0.024 Andour_scaled = 67% AUT_IA_La_Tene:I11699 + 33% ITA_Etruscan_Campiglia_CEU_o:CAM002
    Immi uiros rios toutias rias
     
    ___ Paper trail since 1550 : 100% South Auvergne, France ___
    Distance: 1.510% : 50.0 German , 50.0 Spanish Castilla .... Distance: 1.453% : 50.4 Swiss German , 49.6 Spanish Barcelona
    Distance: 1.659% : 50.2 Scottish , 49.8 French Corsica...... Distance: 1.714% : 50.8 Italian Lombardy , 49.2 French Brittany
    Distance: 1.959% : 50.8 Irish , 49.2 Italian Tuscany ......... Distance: 2.189% : 50.8 Dutch , 49.2 Basque French

  6. The Following 3 Users Say Thank You to Andour For This Useful Post:

     Aben Aboo (07-31-2022),  lehmannt (07-31-2022),  W‚ldpykjong (07-31-2022)

  7. #4
    Registered Users
    Posts
    1,722
    Ethnicity
    Arab
    Y-DNA (P)
    J2a-J-L210-J-y15222

    Deleted
    Target: Me
    Distance: 1.4392% / 0.01439195
    36.0 TUR_Tepecik_Ciftlik_N
    22.2 Iberomaurusian
    22.0 SYR_Tell_Qarassa_Early_Antiquity
    13.4 COG_Kindoki_230BP
    5.8 Steppe_Pastoralist
    0.6 Iran_Neolithic

    Target: Me
    Distance: 1.5117% / 0.01511723
    41.8 MAR_LN
    24.6 SYR_Tell_Qarassa_Early_Antiquity
    13.8 COG_Kindoki_230BP
    10.8 Iberomaurusian
    5.0 Caucasus_Hunter-gatherer
    4.0 Steppe_Pastoralist

    R11109 MALE 1 CE 1749.5 400 CE ARCHAEOLOGY Isola_Sacra Y-DNA: J-Y15222 mtDNA: X2m'n

  8. #5
    Registered Users
    Posts
    1,722
    Ethnicity
    Arab
    Y-DNA (P)
    J2a-J-L210-J-y15222

    Ancient averages

    0.037 Me = 80% Canary_Islands_Guanche + 20% SDN_MA_Kulubnarti
    0.042 Me = 93% Canary_Islands_Guanche + 7% KEN_IA_Deloraine
    0.042 Me = 94% Canary_Islands_Guanche + 6% COG_NgongoMbata_220BP
    0.042 Me = 94% Canary_Islands_Guanche + 6% UGA_Munsa_500BP
    0.042 Me = 88% Canary_Islands_Guanche + 12% TZA_Luxmanda_3100BP
    0.042 Me = 94% Canary_Islands_Guanche + 6% KEN_Kakapel_300BP
    0.042 Me = 86% Canary_Islands_Guanche + 14% KEN_Early_Pastoral_N
    0.042 Me = 94% Canary_Islands_Guanche + 6% TZA_Pemba_600BP
    0.042 Me = 88% Canary_Islands_Guanche + 12% KEN_Pastoral_N_Elmenteitan
    0.042 Me = 94% Canary_Islands_Guanche + 6% COG_Kindoki_230BP
    0.042 Me = 94% Canary_Islands_Guanche + 6% ZAF_400BP
    0.043 Me = 89% Canary_Islands_Guanche + 11% KEN_Pastoral_N
    0.043 Me = 88% Canary_Islands_Guanche + 12% TZA_PN
    0.043 Me = 88% Canary_Islands_Guanche + 12% TZA_PN_o
    0.043 Me = 95% Canary_Islands_Guanche + 5% BWA_Taukome_1100BP
    0.043 Me = 90% Canary_Islands_Guanche + 10% KEN_MoloCave_1500BP
    0.043 Me = 92% Canary_Islands_Guanche + 8% KEN_Pastoral_IA
    0.043 Me = 94% Canary_Islands_Guanche + 6% BWA_Xaro_1400BP
    0.043 Me = 93% Canary_Islands_Guanche + 7% KEN_Kakapel_900BP
    0.043 Me = 87% Canary_Islands_Guanche + 13% KEN_Pastoral_N_o
    0.044 Me = 92% Canary_Islands_Guanche + 8% KEN_400BP
    0.044 Me = 89% Canary_Islands_Guanche + 11% KEN_LuKENHill_3500BP
    0.044 Me = 89% Canary_Islands_Guanche + 11% KEN_HyraxHill_2300BP
    0.044 Me = 94% Canary_Islands_Guanche + 6% KEN_Nyarindi_3500BP
    0.044 Me = 95% Canary_Islands_Guanche + 5% CMR_Shum_Laka
    0.045 Me = 94% Canary_Islands_Guanche + 6% TZA_Gishimangeda
    0.045 Me = 94% Canary_Islands_Guanche + 6% KEN_LSA
    0.045 Me = 94% Canary_Islands_Guanche + 6% ETH_Mota
    0.045 Me = 94% Canary_Islands_Guanche + 6% TZA_Kisese
    0.045 Me = 94% Canary_Islands_Guanche + 6% KEN_Kakapel_3900BP
    0.045 Me = 94% Canary_Islands_Guanche + 6% TZA_Zanzibar_1300BP
    0.046 Me = 95% Canary_Islands_Guanche + 5% MWI_Hora_9000BP
    0.046 Me = 95% Canary_Islands_Guanche + 5% MWI_Fingira
    0.046 Me = 95% Canary_Islands_Guanche + 5% MWI_Chencherere
    0.046 Me = 95% Canary_Islands_Guanche + 5% MWI_Hora
    0.047 Me = 95% Canary_Islands_Guanche + 5% ZAF_1200BP
    0.049 Me = 97% Canary_Islands_Guanche + 3% ZAF_2100BP
    0.049 Me = 97% Canary_Islands_Guanche + 3% ZAF_2000BP
    0.049 Me = 92% Canary_Islands_Guanche + 8% IRN_Wezmeh_N
    0.050 Me = 87% Iberia_Central_CA_Afr + 13% IRN_Tepe_Abdul_Hosein_N
    0.050 Me = 87% Iberia_Central_CA_Afr + 13% IRN_Ganj_Dareh_N
    0.050 Me = 86% Iberia_Central_CA_Afr + 14% IRN_Wezmeh_N
    Target: Me
    Distance: 1.4392% / 0.01439195
    36.0 TUR_Tepecik_Ciftlik_N
    22.2 Iberomaurusian
    22.0 SYR_Tell_Qarassa_Early_Antiquity
    13.4 COG_Kindoki_230BP
    5.8 Steppe_Pastoralist
    0.6 Iran_Neolithic

    Target: Me
    Distance: 1.5117% / 0.01511723
    41.8 MAR_LN
    24.6 SYR_Tell_Qarassa_Early_Antiquity
    13.8 COG_Kindoki_230BP
    10.8 Iberomaurusian
    5.0 Caucasus_Hunter-gatherer
    4.0 Steppe_Pastoralist

    R11109 MALE 1 CE 1749.5 400 CE ARCHAEOLOGY Isola_Sacra Y-DNA: J-Y15222 mtDNA: X2m'n

  9. The Following 4 Users Say Thank You to Gentica277282 For This Useful Post:

     Abceff (08-01-2022),  Aben Aboo (07-31-2022),  lehmannt (07-31-2022),  sheepslayer (08-01-2022)

  10. #6
    Registered Users
    Posts
    574
    Sex
    Location
    Missouri, U.S.
    Ethnicity
    Colonial American
    Nationality
    American
    aDNA Match (1st)
    VK2020_Scotland_Orkney_VA:VK207
    Y-DNA (P)
    R1b-U152 >R-FTA96415
    mtDNA (M)
    J1b1a1a
    Y-DNA (M)
    I2-P37 > I-BY77146
    mtDNA (P)
    H

    United States of America Scotland England Netherlands
    The Moriopoulas Averages (no simulations).... Top Ten only

    0.022 PLogan_scaled = 83% Scotland_Orkney_Viking_Age_(Insular_Celtic_Profile ) + 17% Slovenia_LBA-EIA_Urnfield/Hallstatt
    0.022 PLogan_scaled = 74% Scotland_Orkney_Viking_Age_(Insular_Celtic_Profile ) + 26% French_Occitan_Nouvelle-Aquitaine_Creuse
    0.022 PLogan_scaled = 74% Scotland_Orkney_Viking_Age_(Insular_Celtic_Profile ) + 26% French_Arpitan_Auvergne-Rhone-Alpes_Rhone
    0.022 PLogan_scaled = 88% Scotland_Orkney_Viking_Age_(Insular_Celtic_Profile ) + 12% Scythian_IA_Hungary_o2
    0.022 PLogan_scaled = 73% Greenland_Eastern_Settlement_Viking_Age_(Late_Nors e)_(Mixed_Insular_Celtic-Norse_Profile) + 27% Germany_BA_Tollense_(R1b)_o
    0.023 PLogan_scaled = 66% Scotland_Orkney_Viking_Age_(Insular_Celtic_Profile ) + 34% Flemish_Belgium
    0.023 PLogan_scaled = 89% Scotland_Orkney_Viking_Age_(Insular_Celtic_Profile ) + 11% Italy_EBA_Broion
    0.023 PLogan_scaled = 81% Scotland_Orkney_Viking_Age_(Insular_Celtic_Profile ) + 19% Italian_Friuli_Venezia_Giulia_Sauris_(Bavarian)
    0.023 PLogan_scaled = 93% Scotland_Orkney_Viking_Age_(Insular_Celtic_Profile ) + 7% Hungary_ECA_Tiszapolgar_(contaminated)
    0.023 PLogan_scaled = 86% Scotland_Orkney_Viking_Age_(Insular_Celtic_Profile ) + 14% Italy_Late_Antiquity_Rome_(North_Italian_Profile)
    0.023 PLogan_scaled = 83% Scotland_Orkney_Viking_Age_(Insular_Celtic_Profile ) + 17% Germany_EIA_Singen

  11. The Following 5 Users Say Thank You to PLogan For This Useful Post:

     Aben Aboo (07-31-2022),  Andour (07-31-2022),  lehmannt (07-31-2022),  sheepslayer (08-01-2022),  W‚ldpykjong (07-31-2022)

  12. #7
    Registered Users
    Posts
    1,005
    Sex
    Ethnicity
    Mixed
    aDNA Match (1st)
    Muslim Andalusi Iberia_Southeast_c.10-16CE:I12514 0.03148322

    Only TOP 10, Ancient Averages:

    Code:
    0.018 scaled = 78% ITA_Collegno_MA + 22% Iberia_Central_CA_Afr
    0.018 scaled = 79% ITA_Etruscan_Campiglia_CEU_o + 21% Canary_Islands_Guanche
    0.019 scaled = 81% ITA_Etruscan_Campiglia_CEU_o + 19% Iberia_Central_CA_Afr
    0.019 scaled = 67% Iberia_Southeast_c.5-8CE + 33% VK2020_NOR_North_IA
    0.020 scaled = 76% FRA_Champagne_IA2 + 24% Iberia_Central_CA_Afr
    0.020 scaled = 81% ITA_Collegno_MA + 19% ITA_Sardinia_C_o
    0.020 scaled = 84% ITA_Etruscan_Campiglia_CEU_o + 16% ITA_Sardinia_C_o
    0.020 scaled = 66% Iberia_Southeast_c.5-8CE + 34% VK2020_GreenlandW_VA
    0.020 scaled = 66% Levant_LBN_MA_o1 + 34% VK2020_NOR_North_IA
    0.020 scaled = 82% SVK_LIA_La_Tene + 18% ITA_Sardinia_C_o
    Fixed source
    Code:
    0.018 scaled = 79% ITA_Etruscan_Campiglia_CEU_o + 21% Canary_Islands_Guanche
    0.021 scaled = 77% SVK_LIA_La_Tene + 23% Canary_Islands_Guanche
    0.022 scaled = 76% ITA_Collegno_MA + 24% Canary_Islands_Guanche
    0.022 scaled = 74% FRA_Champagne_IA2 + 26% Canary_Islands_Guanche
    0.022 scaled = 76% England_LBA_highEEF + 24% Canary_Islands_Guanche
    0.023 scaled = 79% ITA_Rome_Renaissance + 21% Canary_Islands_Guanche
    0.025 scaled = 78% HUN_IA_La_Tene + 22% Canary_Islands_Guanche
    0.025 scaled = 79% AUT_IA_La_Tene + 21% Canary_Islands_Guanche
    0.026 scaled = 74% CZE_MBA_Tumulus + 26% Canary_Islands_Guanche
    0.026 scaled = 75% CZE_IA_Hallstatt + 25% Canary_Islands_Guanche
    Ancient individuals:
    Code:
    0.017 scaled = 65% England_MIA:I19911 + 35% ITA_Sardinia_Punic:VIL011
    0.017 scaled = 80% VK2020_SWE_Oland_VA:VK350 + 20% Iberia_Central_CA_Afr:I4246
    0.017 scaled = 78% ITA_Collegno_MA:CL63 + 22% Iberia_Central_CA_Afr:I4246
    0.017 scaled = 81% ITA_Etruscan_Campiglia_CEU_o:CAM002 + 19% Canary_Islands_Guanche:gun002
    0.018 scaled = 76% SRB_Mokrin_EBA_Maros:I23212 + 24% Iberia_Central_CA_Afr:I4246
    0.018 scaled = 77% CZE_IA_La_Tene:I17143 + 23% Canary_Islands_Guanche:gun011
    0.018 scaled = 64% England_MIA:I19911 + 36% ITA_Rome_Imperial:RMPR132
    0.018 scaled = 77% ITA_Etruscan_Campiglia_CEU_o:CAM002 + 23% Canary_Islands_Guanche:gun005
    0.019 scaled = 81% ITA_Etruscan_Campiglia_CEU_o:CAM002 + 19% Iberia_Central_CA_Afr:I4246
    0.019 scaled = 61% FRA_Champagne_IA2:I19357 + 39% ITA_Rome_Imperial:RMPR132
    Fixed source
    Code:
    0.019 scaled = 77% VK2020_DNK_Langeland_VA:VK365 + 23% Canary_Islands_Guanche:gun008
    0.019 scaled = 74% CZE_IA_La_Tene:I17143 + 26% Canary_Islands_Guanche:gun008
    0.019 scaled = 78% ITA_Etruscan_Campiglia_CEU_o:CAM002 + 22% Canary_Islands_Guanche:gun008
    0.019 scaled = 71% CZE_LBA_Knoviz:I13789 + 29% Canary_Islands_Guanche:gun008
    0.020 scaled = 73% SRB_Mokrin_EBA_Maros:I23212 + 27% Canary_Islands_Guanche:gun008
    0.020 scaled = 77% VK2020_SWE_Oland_VA:VK350 + 23% Canary_Islands_Guanche:gun008
    0.020 scaled = 77% SRB_BA_Maros:I23210 + 23% Canary_Islands_Guanche:gun008
    0.020 scaled = 75% ITA_Collegno_MA:CL63 + 25% Canary_Islands_Guanche:gun008
    0.020 scaled = 71% VK2020_NOR_Mid_MA:VK118 + 29% Canary_Islands_Guanche:gun008
    0.021 scaled = 81% VK2020_England_Oxford_VA:VK146 + 19% Canary_Islands_Guanche:gun008
    This tool seems very nice, thank you.
    Last edited by Aben Aboo; 07-31-2022 at 02:12 PM.
    Illustrative DNA, Global ancestry 5 POPS
     

    Fit: 1.007 (Good)
    Continental Celtic (400BC-200AD) 28%+Germanic (100-1000AD)25.4%+ Guanche (580-11601AD) 22.4% +Iberian (730-100BC) 15.4% +Anatolian (1-400AD) 8.8%

  13. The Following 5 Users Say Thank You to Aben Aboo For This Useful Post:

     Andour (07-31-2022),  Gentica277282 (07-31-2022),  lehmannt (07-31-2022),  PLogan (07-31-2022),  Toguz (07-31-2022)

  14. #8
    Registered Users
    Posts
    1,722
    Ethnicity
    Arab
    Y-DNA (P)
    J2a-J-L210-J-y15222

    Quote Originally Posted by Aben Aboo View Post
    Only TOP 10, Ancient Averages:

    Code:
    0.018 scaled = 78% ITA_Collegno_MA + 22% Iberia_Central_CA_Afr
    0.018 scaled = 79% ITA_Etruscan_Campiglia_CEU_o + 21% Canary_Islands_Guanche
    0.019 scaled = 81% ITA_Etruscan_Campiglia_CEU_o + 19% Iberia_Central_CA_Afr
    0.019 scaled = 67% Iberia_Southeast_c.5-8CE + 33% VK2020_NOR_North_IA
    0.020 scaled = 76% FRA_Champagne_IA2 + 24% Iberia_Central_CA_Afr
    0.020 scaled = 81% ITA_Collegno_MA + 19% ITA_Sardinia_C_o
    0.020 scaled = 84% ITA_Etruscan_Campiglia_CEU_o + 16% ITA_Sardinia_C_o
    0.020 scaled = 66% Iberia_Southeast_c.5-8CE + 34% VK2020_GreenlandW_VA
    0.020 scaled = 66% Levant_LBN_MA_o1 + 34% VK2020_NOR_North_IA
    0.020 scaled = 82% SVK_LIA_La_Tene + 18% ITA_Sardinia_C_o
    Fixed source
    Code:
    0.018 scaled = 79% ITA_Etruscan_Campiglia_CEU_o + 21% Canary_Islands_Guanche
    0.021 scaled = 77% SVK_LIA_La_Tene + 23% Canary_Islands_Guanche
    0.022 scaled = 76% ITA_Collegno_MA + 24% Canary_Islands_Guanche
    0.022 scaled = 74% FRA_Champagne_IA2 + 26% Canary_Islands_Guanche
    0.022 scaled = 76% England_LBA_highEEF + 24% Canary_Islands_Guanche
    0.023 scaled = 79% ITA_Rome_Renaissance + 21% Canary_Islands_Guanche
    0.025 scaled = 78% HUN_IA_La_Tene + 22% Canary_Islands_Guanche
    0.025 scaled = 79% AUT_IA_La_Tene + 21% Canary_Islands_Guanche
    0.026 scaled = 74% CZE_MBA_Tumulus + 26% Canary_Islands_Guanche
    0.026 scaled = 75% CZE_IA_Hallstatt + 25% Canary_Islands_Guanche
    Ancient individuals:
    Code:
    0.017 scaled = 65% England_MIA:I19911 + 35% ITA_Sardinia_Punic:VIL011
    0.017 scaled = 80% VK2020_SWE_Oland_VA:VK350 + 20% Iberia_Central_CA_Afr:I4246
    0.017 scaled = 78% ITA_Collegno_MA:CL63 + 22% Iberia_Central_CA_Afr:I4246
    0.017 scaled = 81% ITA_Etruscan_Campiglia_CEU_o:CAM002 + 19% Canary_Islands_Guanche:gun002
    0.018 scaled = 76% SRB_Mokrin_EBA_Maros:I23212 + 24% Iberia_Central_CA_Afr:I4246
    0.018 scaled = 77% CZE_IA_La_Tene:I17143 + 23% Canary_Islands_Guanche:gun011
    0.018 scaled = 64% England_MIA:I19911 + 36% ITA_Rome_Imperial:RMPR132
    0.018 scaled = 77% ITA_Etruscan_Campiglia_CEU_o:CAM002 + 23% Canary_Islands_Guanche:gun005
    0.019 scaled = 81% ITA_Etruscan_Campiglia_CEU_o:CAM002 + 19% Iberia_Central_CA_Afr:I4246
    0.019 scaled = 61% FRA_Champagne_IA2:I19357 + 39% ITA_Rome_Imperial:RMPR132
    Fixed source
    Code:
    0.019 scaled = 77% VK2020_DNK_Langeland_VA:VK365 + 23% Canary_Islands_Guanche:gun008
    0.019 scaled = 74% CZE_IA_La_Tene:I17143 + 26% Canary_Islands_Guanche:gun008
    0.019 scaled = 78% ITA_Etruscan_Campiglia_CEU_o:CAM002 + 22% Canary_Islands_Guanche:gun008
    0.019 scaled = 71% CZE_LBA_Knoviz:I13789 + 29% Canary_Islands_Guanche:gun008
    0.020 scaled = 73% SRB_Mokrin_EBA_Maros:I23212 + 27% Canary_Islands_Guanche:gun008
    0.020 scaled = 77% VK2020_SWE_Oland_VA:VK350 + 23% Canary_Islands_Guanche:gun008
    0.020 scaled = 77% SRB_BA_Maros:I23210 + 23% Canary_Islands_Guanche:gun008
    0.020 scaled = 75% ITA_Collegno_MA:CL63 + 25% Canary_Islands_Guanche:gun008
    0.020 scaled = 71% VK2020_NOR_Mid_MA:VK118 + 29% Canary_Islands_Guanche:gun008
    0.021 scaled = 81% VK2020_England_Oxford_VA:VK146 + 19% Canary_Islands_Guanche:gun008
    This tool seems very nice, thank you.
    I think this doesn’t work well for people who are mixed more then two ethnicities
    Target: Me
    Distance: 1.4392% / 0.01439195
    36.0 TUR_Tepecik_Ciftlik_N
    22.2 Iberomaurusian
    22.0 SYR_Tell_Qarassa_Early_Antiquity
    13.4 COG_Kindoki_230BP
    5.8 Steppe_Pastoralist
    0.6 Iran_Neolithic

    Target: Me
    Distance: 1.5117% / 0.01511723
    41.8 MAR_LN
    24.6 SYR_Tell_Qarassa_Early_Antiquity
    13.8 COG_Kindoki_230BP
    10.8 Iberomaurusian
    5.0 Caucasus_Hunter-gatherer
    4.0 Steppe_Pastoralist

    R11109 MALE 1 CE 1749.5 400 CE ARCHAEOLOGY Isola_Sacra Y-DNA: J-Y15222 mtDNA: X2m'n

  15. The Following User Says Thank You to Gentica277282 For This Useful Post:

     Aben Aboo (07-31-2022)

  16. #9
    Registered Users
    Posts
    1,005
    Sex
    Ethnicity
    Mixed
    aDNA Match (1st)
    Muslim Andalusi Iberia_Southeast_c.10-16CE:I12514 0.03148322

    Quote Originally Posted by Gentica277282 View Post
    I think this doesn’t work well for people who are mixed more then two ethnicities
    I'm in this case with more than 2, but it's globally good for 2 way (concerning my case, to see for other people)
    Last edited by Aben Aboo; 07-31-2022 at 02:40 PM.
    Illustrative DNA, Global ancestry 5 POPS
     

    Fit: 1.007 (Good)
    Continental Celtic (400BC-200AD) 28%+Germanic (100-1000AD)25.4%+ Guanche (580-11601AD) 22.4% +Iberian (730-100BC) 15.4% +Anatolian (1-400AD) 8.8%

  17. The Following 4 Users Say Thank You to Aben Aboo For This Useful Post:

     Andour (07-31-2022),  Gentica277282 (07-31-2022),  lehmannt (07-31-2022),  Toguz (07-31-2022)

  18. #10
    Registered Users
    Posts
    340
    Sex
    Ethnicity
    Finnish

    I have so far tried four different methods for calculating the weight and distance of the two-way models, but the method that's used by Dienekes was the fastest. It relies on two precalculated distance matrices, so you don't have to do that much math later when you iterate through 2-combination of populations, and it's also possible to vectorize the calculation of the weight and distance of each model. I have gradually made more and more optimizations to the code, so it now takes only about 160 ms to generate 255,255 models and to list the top 10 models:


    Code:
        Unit: milliseconds
                             expr       min        lq      mean    median        uq       max neval
            dienekes_vectorized()  155.6935  158.1007  168.3192  163.0630  179.3417  194.4780    10
              dienekes_names_ij()  314.0376  322.9072  338.3058  330.9828  345.9954  406.7017    10
      dienekes_names_from_combn()  428.4525  432.1891  480.6478  464.2943  518.0949  586.3877    10
     dienekes_names_inside_loop()  452.1308  458.1821  516.1062  506.3484  560.8288  611.7460    10
                     dotproduct() 1423.0732 1474.3779 1511.8572 1500.4344 1546.0870 1603.1368    10
             analyticalgeometry() 1599.2413 1635.7533 1651.0704 1647.0626 1661.5754 1712.6522    10
               vectorprojection() 2365.1779 2412.6577 2455.3308 2423.0995 2472.8851 2669.7229    10
    Code:
    source=as.matrix(read.csv("g/25/mas",r=1))
    targetname="Udmurt"
    target=unname(source[targetname,])
    source=source[!rownames(source)%in%targetname,]
    npop=nrow(source)
    sourcename=rownames(source)
    source=unname(source)
    
    # http://dodecad.blogspot.com/2011/07/dodecad-oracle-v1.html
    dienekes_vectorized=function(){
      comb=npop*(npop-1)/2
      ij=double(comb*2)
    
      n=1;for(i in 1:(npop-1))for(j in(i+1):npop){ij[2*n-1]=i;ij[2*n]=j;n=n+1}
    
      ij1=ij[seq(1,comb*2,2)]
      ij2=ij[seq(2,comb*2,2)]
    
      targetdist=sapply(colSums((target-t(source))^2),sqrt)
      d0=dist(source)
      d1=targetdist[ij1]
      d2=targetdist[ij2]
      weight=(d0^2+d2^2-d1^2)/(2*d0^2)
      dist=sapply(d2^2-weight^2*d0^2,sqrt)
    
      name1=sourcename[ij1]
      name2=sourcename[ij2]
    
      ord=head(order(dist),min(10,comb-sum(is.na(dist))))
      list(weight[ord],dist[ord],name1[ord],name2[ord])
    }
    
    dienekes_names_ij=function(){
      sourcedist=as.matrix(dist(source))
      targetdist=sapply(colSums((target-t(source))^2),sqrt)
    
      comb=npop*(npop-1)/2
      ofrac=double(comb)
      odist=double(comb)
      opop1=character(comb)
      opop2=character(comb)
      ij=integer(comb*2)
    
      n=1
      for(i in 1:(npop-1))for(j in(i+1):npop){
        d0=sourcedist[i,j]
        d1=targetdist[i]
        d2=targetdist[j]
        frac=(d0^2+d2^2-d1^2)/(2*d0^2)
        dist=sqrt(d2^2-frac^2*d0^2)
        ofrac[n]=frac
        odist[n]=dist
        ij[2*n-1]=i
        ij[2*n]=j
        n=n+1
      }
    
      name=cbind(sourcename[ij[seq(1,comb*2,2)]],sourcename[ij[seq(2,comb*2,2)]])
    
      ord=head(order(odist),min(10,comb-sum(is.na(odist))))
      t(sapply(ord,function(i)list(ofrac[i],odist[i],name[i,1],name[i,2])))
    }
    
    dienekes_names_from_combn=function(){
      sourcedist=as.matrix(dist(source))
      targetdist=sapply(colSums((target-t(source))^2),sqrt)
    
      comb=npop*(npop-1)/2
      ofrac=double(comb)
      odist=double(comb)
      opop1=character(comb)
      opop2=character(comb)
    
      n=1
      for(i in 1:(npop-1))for(j in(i+1):npop){
        d0=sourcedist[i,j]
        d1=targetdist[i]
        d2=targetdist[j]
        frac=(d0^2+d2^2-d1^2)/(2*d0^2)
        dist=sqrt(d2^2-frac^2*d0^2)
        ofrac[n]=frac
        odist[n]=dist
        n=n+1
      }
    
      combi=combn(npop,2)
      opop1=sourcename[combi[1,]]
      opop2=sourcename[combi[2,]]
    
      ord=head(order(odist),min(10,comb-sum(is.na(odist))))
      t(sapply(ord,function(i)list(ofrac[i],odist[i],opop1[i],opop2[i])))
    }
    
    dienekes_names_inside_loop=function(){
      sourcedist=as.matrix(dist(source))
      targetdist=sapply(colSums((target-t(source))^2),sqrt)
    
      comb=npop*(npop-1)/2
      ofrac=double(comb)
      odist=double(comb)
      opop1=character(comb)
      opop2=character(comb)
    
      n=1
      for(i in 1:(npop-1))for(j in(i+1):npop){
        d0=sourcedist[i,j]
        d1=targetdist[i]
        d2=targetdist[j]
        frac=(d0^2+d2^2-d1^2)/(2*d0^2)
        dist=sqrt(d2^2-frac^2*d0^2)
        ofrac[n]=frac
        odist[n]=dist
        opop1[n]=sourcename[i]
        opop2[n]=sourcename[j]
        n=n+1
      }
    
      ord=head(order(odist),min(10,comb-sum(is.na(odist))))
      t(sapply(ord,function(i)list(ofrac[i],odist[i],opop1[i],opop2[i])))
    }
    
    # https://stackoverflow.com/questions/64663170/how-to-find-nearest-point-in-segment-in-a-3d-space/64677993#64677993
    dotproduct=function(){
      comb=npop*(npop-1)/2
      opoint=matrix(nrow=comb,ncol=ncol(source))
    
      n=1
      for(i in 1:(npop-1))for(j in(i+1):npop){
        p1=source[i,]
        p2=source[j,]
        s=p2-p1
        w=target-p1
        ps=(w%*%s)[1]
        l2=(s%*%s)[1]
        opoint[n,]=p1+ps/l2*s
        n=n+1
      }
    
      combi=combn(npop,2)
      s1=source[combi[1,],]
      s2=source[combi[2,],]
      ofrac=rowMeans((opoint-s2)/(s1-s2),na.rm=T)
      opop1=sourcename[combi[1,]]
      opop2=sourcename[combi[2,]]
    
      odist=sqrt(outer(rowSums(opoint^2),sum(target^2),"+")-tcrossprod(opoint,2*t(target)))
    
      ord=head(order(odist),min(10,comb-sum(is.na(odist))))
      t(sapply(ord,function(i)list(ofrac[i],odist[i],opop1[i],opop2[i])))
    }
    
    # https://stackoverflow.com/questions/47177493/python-point-on-a-line-closest-to-third-point/47198877#47198877
    analyticalgeometry=function(){
      comb=npop*(npop-1)/2
      opoint=matrix(nrow=comb,ncol=ncol(source))
    
      n=1
      for(i in 1:(npop-1))for(j in(i+1):npop){
        p1=source[i,]
        p2=source[j,]
        opoint[n,]=p1+sum((target-p1)*(p2-p1))/sum((p2-p1)^2)*(p2-p1)
        n=n+1
      }
    
      combi=combn(npop,2)
      s1=source[combi[1,],]
      s2=source[combi[2,],]
      ofrac=rowMeans((opoint-s2)/(s1-s2),na.rm=T)
      opop1=sourcename[combi[1,]]
      opop2=sourcename[combi[2,]]
    
      odist=sqrt(outer(rowSums(opoint^2),sum(target^2),"+")-tcrossprod(opoint,2*t(target)))
    
      ord=head(order(odist),min(10,comb-sum(is.na(odist))))
      t(sapply(ord,function(i)list(ofrac[i],odist[i],opop1[i],opop2[i])))
    }
    
    # https://stackoverflow.com/questions/47177493/python-point-on-a-line-closest-to-third-point/47177763#47177763
    vectorprojection=function(){
      comb=npop*(npop-1)/2
      opoint=matrix(nrow=comb,ncol=ncol(source))
    
      n=1
      for(i in 1:(npop-1))for(j in(i+1):npop){
        p1=source[i,]
        p2=source[j,]
        p21=p2-p1
        p31=target-p1
        angle=acos(sum(p21*p31)/(sqrt((sum(p21^2)))*sqrt((sum(p31^2)))))
        opoint[n,]=p1+(p2-p1)*sqrt(sum((target-p1)^2))/sqrt(sum((p2-p1)^2))*cos(angle)
        n=n+1
      }
    
      combi=combn(npop,2)
      s1=source[combi[1,],]
      s2=source[combi[2,],]
      ofrac=rowMeans((opoint-s2)/(s1-s2),na.rm=T)
      opop1=sourcename[combi[1,]]
      opop2=sourcename[combi[2,]]
    
      odist=sqrt(outer(rowSums(opoint^2),sum(target^2),"+")-tcrossprod(opoint,2*t(target)))
    
      ord=head(order(odist),min(10,comb-sum(is.na(odist))))
      t(sapply(ord,function(i)list(ofrac[i],odist[i],opop1[i],opop2[i])))
    }
    
    microbenchmark(times=1,
      dienekes_vectorized(),
      dienekes_names_ij(),
      dienekes_names_from_combn(),
      dienekes_names_inside_loop(),
      dotproduct(),
      analyticalgeometry(),
      vectorprojection()
    )
    Last edited by Nganasankhan; 07-31-2022 at 07:05 PM.

  19. The Following 8 Users Say Thank You to Nganasankhan For This Useful Post:

     AlluGobi (07-31-2022),  Andour (07-31-2022),  Archetype0ne (08-10-2022),  jstephan (08-01-2022),  lehmannt (08-01-2022),  PLogan (07-31-2022),  Toguz (07-31-2022),  Tomenable (08-01-2022)

Page 1 of 4 123 ... LastLast

Similar Threads

  1. Making Vahaduo-like models based on SNP-level data?
    By Nganasankhan in forum Autosomal (auDNA)
    Replies: 10
    Last Post: 09-04-2022, 02:26 PM
  2. False negative DNA match
    By chocoholic in forum General
    Replies: 0
    Last Post: 01-20-2020, 08:09 PM
  3. U106 and U198 negative
    By bwitlox in forum R1b-U106
    Replies: 1
    Last Post: 09-19-2019, 12:36 PM
  4. M222 Negative
    By jdean in forum M222
    Replies: 8
    Last Post: 10-12-2018, 02:55 PM
  5. early R1a - M17 negative
    By alan in forum R1a General
    Replies: 80
    Last Post: 10-07-2017, 05:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •