Since version 1.1.2, AdmixPy includes fast source screening that fits convex mixtures of candidate sources against a common reference set. Unlike qpAdm rotation, it keeps the reference panel fixed, allowing models with the same number of sources to be compared using descriptive, covariance-aware fit scores. Selected models should then be evaluated with qpAdm.
I recommend using source screening as a preliminary step before qpAdm to identify the best-fitting models within a proposed setup. As with qpAdm, the results depend on the chosen reference set. I discussed reference selection in the previous article on qpAdm. The default, allsnps=False, uses SNPs shared across the target, all candidate sources, and references, so choose population groupings that retain good shared SNP coverage. Consider repeating the analysis with allsnps=True, which uses the available SNPs for each contrast. Also refer to the package reference on GitHub for more details.
As an example, I first model the Karum-period Kaman group (MA2205, MA2206), followed by the Old Hittite group (MA2200, MA2203). I then reuse the same setup to model them with Chalcolithic groups from the region.
You can run the code below directly in the Python REPL or save it in a .py file and run it as a script. For installation and update instructions, see Introducing AdmixPy.
First, I define the dataset prefix, candidate sources, and references. I won’t discuss the reference choices in detail here. The candidate sources span Chalcolithic West Asian groups and an Eneolithic steppe group that might be relevant to the ancestry of these two Bronze Age Anatolian groups:
import admixpy as ap
data = "dataset_prefix"
candidates = [
"Eneolithic_Berezhnovka",
"Turkey_Central_CamlibelTarlasi_Chalcolithic",
"Turkey_East_Arslantepe_C",
"Iran_SehGabi_C",
"Peqiin_LateC",
"Areni-1_C",
]
references = [
"Mbuti",
"Turkey_Central_Boncuklu_PPN",
"Jordan_PPNC",
"Iran_GanjDareh_N",
"Russia_Vologda_Mesolithic",
"Serbia_IronGates_Mesolithic",
"Morocco_Iberomaurusian",
]
I first run the screening for the Karum-period Kaman group:
result = ap.screening(data, "Turkey_Kalehoyuk_KarumPeriod", candidates, references)
print(result)
This returns:
ScreeningResult(target='Turkey_Kalehoyuk_KarumPeriod')
Lower score = closer fit. Exploratory scores, no model-fit p-values.
Source key:
S1 = Eneolithic_Berezhnovka
S2 = Turkey_Central_CamlibelTarlasi_Chalcolithic
S3 = Turkey_East_Arslantepe_C
S4 = Iran_SehGabi_C
S5 = Peqiin_LateC
S6 = Areni-1_C
2-source models (5 of 15):
model mixture score max_abs_z status
9 S2:85.4% S6:14.6% 0.705 1.12 ok
1 S1:3.2% S2:96.8% 0.803 1.27 ok
7 S2:93.0% S4:7.0% 0.832 1.47 ok
6 S2:78.0% S3:22.0% 0.971 1.41 ok
12 S3:79.0% S6:21.0% 1.03 1.81 ok
3-source models (5 of 20):
model mixture score max_abs_z status
28 S2:55.7% S3:28.9% S6:15.3% 0.513 0.785 ok
16 S1:3.9% S2:59.4% S3:36.8% 0.548 0.83 ok
30 S2:82.6% S4:5.0% S6:12.3% 0.558 1.25 ok
17 S1:2.9% S2:90.9% S4:6.2% 0.593 1.37 ok
19 S1:0.0% S2:85.4% S6:14.6% 0.705 1.12 boundary
4-source models (5 of 15):
model mixture score max_abs_z status
47 S2:60.6% S3:23.5% S4:1.3% S6:14.6% 0.509 0.894 ok
38 S1:0.0% S2:55.7% S3:28.9% S6:15.3% 0.513 0.785 boundary
48 S2:55.7% S3:28.9% S5:0.0% S6:15.3% 0.513 0.785 boundary
36 S1:3.6% S2:66.9% S3:27.5% S4:2.1% 0.537 1 ok
37 S1:3.9% S2:59.4% S3:36.8% S5:0.0% 0.548 0.83 boundary
Choosing models for qpAdm testing also requires some judgment about which sources make sense for the target. I’ll test the top-ranked three-source model: 55.7% Çamlıbel Tarlası Chalcolithic, 28.9% Arslantepe Chalcolithic, and 15.3% Areni-1 Chalcolithic. These are the screening estimates, qpAdm will estimate the proportions again and evaluate the model’s fit.
I run the three-source qpAdm model as follows:
res = ap.qpadm(
data,
"Turkey_Kalehoyuk_KarumPeriod",
[
"Turkey_Central_CamlibelTarlasi_Chalcolithic",
"Turkey_East_Arslantepe_C",
"Areni-1_C",
],
references,
)
print(res)
Result:
QpAdmResult(target='Turkey_Kalehoyuk_KarumPeriod')
weights:
left weight se z
Turkey_Central_CamlibelTarlasi_Chalcolithic 0.597 0.23 2.58
Turkey_East_Arslantepe_C 0.24 0.23 1.05
Areni-1_C 0.162 0.075 2.17
rankdrop:
f4rank dof chisq p p_nested
2 4 1.28 0.865 4.15e-07
1 10 41.49 9.26e-06 3.49e-36
0 18 228.48 1.88e-38 NaN
popdrop:
pat dropped f4rank dof chisq p feasible status
000 2 4 1.28 0.865 True PASS
001 Armenia_C 1 5 6.02 0.305 True PASS
010 Turkey_East_Arslantepe_C 1 5 2.42 0.788 True PASS
100 Turkey_Central_CamlibelTarlasi_Chalcolithic 1 5 8.34 0.138 True PASS
011 Turkey_East_Arslantepe_C,Armenia_C 0 6 7.02 0.319 True PASS
101 Turkey_Central_CamlibelTarlasi_Chalcolithic,Armenia_C 0 6 15.47 0.017 True FAIL
110 Turkey_Central_CamlibelTarlasi_Chalcolithic,Turkey_East_Arslantepe_C 0 6 74.75 4.32e-14 True FAIL
The model is a very good fit. The Arslantepe contribution, however is not well resolved. Dropping it still results in a passing model:
QpAdmResult(target='Turkey_Kalehoyuk_KarumPeriod')
weights:
left weight se z
Turkey_Central_CamlibelTarlasi_Chalcolithic 0.83 0.079 10.45
Areni-1_C 0.17 0.079 2.14
rankdrop:
f4rank dof chisq p p_nested
1 5 2.42 0.788 2.35e-30
0 12 158.31 1.16e-27 NaN
popdrop:
pat dropped f4rank dof chisq p feasible status
00 1 5 2.42 0.788 True PASS
01 Areni-1_C 0 6 7.02 0.319 True PASS
10 Turkey_Central_CamlibelTarlasi_Chalcolithic 0 6 74.75 4.32e-14 True FAIL
The Karum-period Kaman group can therefore be modeled as approximately 83% Çamlıbel Tarlası Chalcolithic and 17% Areni-1 Chalcolithic (±7.9 percentage points), with a model-fit p-value of 0.788. However, a model using Çamlıbel Tarlası alone also passes (p = 0.319), so this reference set does not require an Areni-1 contribution. The possible connection is relevant to discussions of Proto-Anatolian origins because Areni-1 consistently shows Eneolithic steppe-related ancestry in my earlier analysis. I discuss this in Revisiting Genetic Ancestry in Chalcolithic and Early Bronze Age Eastern Anatolia and the Southern Caucasus.
Repeating the screening with the same candidates and references for the Old Hittite group gives the following results:
ScreeningResult(target='Turkey_Kalehoyuk_OldHittitePeriod')
Lower score = closer fit. Exploratory scores, no model-fit p-values.
Source key:
S1 = Eneolithic_Berezhnovka
S2 = Turkey_Central_CamlibelTarlasi_Chalcolithic
S3 = Turkey_East_Arslantepe_C
S4 = Iran_SehGabi_C
S5 = Peqiin_LateC
S6 = Areni-1_C
2-source models (5 of 15):
model mixture score max_abs_z status
9 S2:73.0% S6:27.0% 0.614 0.98 ok
1 S1:6.8% S2:93.2% 0.656 1.01 ok
12 S3:68.5% S6:31.5% 1.04 1.51 ok
2 S1:7.9% S3:92.1% 1.12 1.55 ok
15 S5:39.7% S6:60.3% 1.14 1.59 ok
3-source models (5 of 20):
model mixture score max_abs_z status
31 S2:51.1% S5:14.1% S6:34.7% 0.203 0.351 ok
18 S1:8.4% S2:80.2% S5:11.5% 0.45 0.535 ok
16 S1:7.0% S2:68.3% S3:24.7% 0.556 0.867 ok
28 S2:61.0% S3:12.1% S6:26.9% 0.589 0.901 ok
34 S3:39.6% S5:19.5% S6:40.9% 0.59 1.12 ok
4-source models (5 of 15):
model mixture score max_abs_z status
48 S2:42.7% S3:9.0% S5:13.7% S6:34.5% 0.151 0.299 ok
49 S2:49.3% S4:1.2% S5:15.0% S6:34.5% 0.178 0.361 ok
41 S1:0.0% S2:51.1% S5:14.1% S6:34.7% 0.203 0.351 boundary
37 S1:8.5% S2:55.3% S3:24.7% S5:11.4% 0.264 0.372 ok
39 S1:8.5% S2:71.7% S4:4.3% S5:15.6% 0.286 0.546 ok
The top-ranked two-source model again combines Çamlıbel Tarlası and Areni-1, but the estimated Areni-1-like contribution rises from 14.6% in the Karum-period group to 27.0%. The top-ranked three-source model includes Peqi’in as well, with an Areni-1-like contribution of 34.7%. These estimates depend on the sources included in each model.
Testing the same Çamlıbel Tarlası–Areni-1 two-source model with qpAdm gives:
QpAdmResult(target='Turkey_Kalehoyuk_OldHittitePeriod')
weights:
left weight se z
Turkey_Central_CamlibelTarlasi_Chalcolithic 0.733 0.089 8.25
Areni-1_C 0.267 0.089 3
rankdrop:
f4rank dof chisq p p_nested
1 5 2.87 0.72 6.89e-33
0 12 170.79 3.29e-30 NaN
popdrop:
pat dropped f4rank dof chisq p feasible status
00 1 5 2.87 0.72 True PASS
01 Armenia_C 0 6 13.17 0.04 True FAIL
10 Turkey_Central_CamlibelTarlasi_Chalcolithic 0 6 54.08 7.1e-10 True FAIL
The two-source model passes with p = 0.72 and estimates 73.3% Çamlıbel Tarlası Chalcolithic and 26.7% Areni-1 Chalcolithic (±8.9 percentage points). Unlike the Karum-period group, the Old Hittite group fails the model using Çamlıbel Tarlası alone, although its p-value of 0.04 is close to the 0.05 threshold. Within this setup, however, including Areni-1 allows the model to pass well. The aim does not need to be a borderline pass.