# Thread: How can I calculate the genetic distance between ethnic groups?

1. ## How can I calculate the genetic distance between ethnic groups?

a.jpg
Like this photo. Where can I find the calculator?

2. ## The Following User Says Thank You to zzangwiki For This Useful Post:

Nganasankhan (08-23-2022)

3. ## The Following User Says Thank You to chum For This Useful Post:

JMcB (08-23-2022)

4. You can also use shells or R. Download scaled datasheets from here: https://eurogenes.blogspot.com/2019/...obal25_12.html. Then run:

Code:
```\$ dist()(awk -F, 'NR==FNR{for(i=2;i<=NF;i++)a[i]=\$i;next}\$1{s=0;for(i=2;i<=NF;i++)s+=(\$i-a[i])^2;print s^.5,\$1}' "\$2" "\$1"|sort -n|awk '{\$1=sprintf("%."x"f",\$1)}1' "x=\${3-3}"|sed s,^0,,)
\$ dist <(grep Finnish_Southwest Global25_PCA_pop_averages_scaled.txt) Global25_PCA_pop_averages_scaled.txt
.000 Finnish_Southwest
.022 Finnish_Central
.025 Finnish_North
.029 Ingrian
.035 Russian_Kostroma
.036 Karelian
.038 Russian_Krasnoborsky
.038 Polish_Kashubian
.041 Estonian
.041 Vepsian```
Or in R:

Code:
```> t=as.matrix(read.csv("Global25_PCA_modern_pop_averages_scaled.txt",r=1))
> writeLines(sprintf("%.3f %s",d,names(d)))
0.000 Finnish_Southwest
0.022 Finnish_Central
0.025 Finnish_North
0.029 Ingrian
0.035 Russian_Kostroma
0.036 Karelian
0.038 Russian_Krasnoborsky
0.038 Polish_Kashubian
0.041 Estonian
0.041 Vepsian```

5. ## The Following 3 Users Say Thank You to Nganasankhan For This Useful Post:

chum (08-23-2022),  JMcB (08-23-2022),  Toguz (08-23-2022)