3.1 Dataset, genetic diversity and population structure
In this study, we generated whole genomes from native goats of Iraq (n= 23) and Pakistan (n=25) countries. These data were combined with our previously published data from modern Iranian goats and also worldwide goat individuals (n=163). In addition, a total of 50 complete ancient genomes from domestic goats in Anatolia, the Balkans, the eastern Mediterranean area (Jordan and Israel, traditionally denoted as Levant), Iran and Turkmenistan were obtained from one previous study (Daly et al. 2018, Tables S1, S2 ), resulting in a dataset of 261 domestic goats. The ancient samples include Neolithic (~8500-5000 BC), Chalcolithic (~5100-3700 BC), Bronze Age (~ 3300–990 BC), Iron Age (~700-330 BC) and Medieval (~1500-901 AD) individuals. We then further merged these data with 72 wild caprid species including different ibex like species, bezoar and markhor goats to provide an overall comprehensive assessment (Table S3 ). The 211 present-day domestic samples were assigned to eight geographic subgroups, including Europe (EUR), West-Africa (WAFR), East-Africa (EAFR), Iran (IRN), Iraq (IRQ), Pakistan (PKS), Bangladesh (BNG) and China (CHN) (Figure 1a ).
The average nucleotide diversity (θπ) for all individuals was estimated at 1.79e-3 and both Iranian (1.89e-3) and Iraqi (1.88e-3) groups showed slightly higher diversity than other goat groups (Figure S1a ). The LD was clearly higher for PKS goats than for the other populations (Figure S1b ). The individual inbreeding coefficients (F) were relatively high for European (~0.22) goats and lower for both Iranian (~0.09) and Iraqi (~0.10) goats (Figure S2 ).
A rooted ML phylogenetic tree of the whole-genome sequencing data (Figure 1b ) shows the geographic clusters EUR-WAFR- EAFR; IRQ-IRN; PKS-BNG and CHN. In a principal component analysis (PCA) of modern domestic goats, PC1 shows a genetic cline from Chinese samples at the eastern end to European goats at the western end (Figure 1c ), which is completely in agreement with the Admixture pattern (Figures 1d and S3 ). The second PCA coordinate PC2 corresponds to the contrast between African and northern EUR. As shown earlier by Daly et al. (2018), ancient samples projected on the same plot are positioned near contemporary individuals from the same region. The results of painting algorithm from CHROMOPAINTER and fineSTRUCTURE shows in agreement with Fig. 1, a low level of haplotype sharing of SWA (IRN and IRQ) samples with most of the other Asian goat populations (Figure S4 ).
A mitochondrial phylogenetic tree showed that all six previously defined maternal haplogroups A, B, C, D, F and G are present in our dataset (Figures S5a and S5b ). Haplogroup A is predominant in all domestic groups. The PKS samples are with four haplogroups the most diverse, whereas the EUR, IRQ and African individuals only harbor two haplogroups. The analysis of Y-chromosomal haplotype diversity shows that the haplogroup Y2A is predominant in both African and Iranian goat individuals, and has a high frequency in Iraqi goat samples. The haplogroup Y2B is found exclusively in Chinese domestic goats and bezoar group (Figure S5c ). The SMC++ analysis shows that the divergence times between all modern goat populations predated the expected domestication time by archaeological evidence (~11,000 years ago) (Figure S6 ).