Integrated ecological, anatomical, phytochemical and genetic characterization of Peganum harmala L. along a soil salinity gradient in the Taif Region, Saudi Arabia Authors: Zainab M Almutairi, Magda Elsayed Abd-Elgawad Published: 2026 ABSTRACT AbstractBackgroundPeganum harmala L. is a medicinal shrub that tolerates harsh, dry conditions, but the links between its habitat, structure, chemistry, and genetics are still not well understood. In this study, we investigated five geo‑referenced natural populations from the Taif region in Saudi Arabia, using an integrated ecological, anatomical, phytochemical, and molecular approach.ResultsAll soils samples were slightly alkaline (pH 7.61–7.79), and fell within the non-saline to slightly saline range based on electrical conductivity (EC) classifications, but they differed in salinity. Sites P1 (Al Ahlam Park) and P2 (C36) had lower EC values, while P3 (Ashayra), P4 (As Sayl al Kabir), and P5 (Al Sir) showed relatively higher EC values within this overall low salinity range. In all locations, P. harmala L. formed well-established, low, spreading to dense dome-shaped shrubs on sandy–stony substrates. Multivariate analysis of soil variables (pH, EC, CaCO₃, major anions and cations) set P3 apart from the other sites, and both clustering and principal component analysis (PCA) grouped P1, P2, P4, and P5 together, with P3 forming its own distinct cluster. Anatomically, most populations had stem cross sections with well-organized vascular cylinders. By contrast, stems from P3 displayed an irregular outline, a compact multilayered cortex, and scattered vascular strands with visibly reduced secondary xylem. Total alkaloid content ranged from 3.208 to 4.106%, with the highest values at P1 and P2 and the lowest at P3. Molecular analyses using SCoT markers (10 primers; 121 bands, 54 polymorphic) and IRAP markers (10 primers; 130 bands, 76 polymorphic) revealed moderate to high nuclear genetic diversity (expected heterozygosity up to 0.50; Shannon’s index up to 0.69). Overall genetic similarity among populations was high, but their structure was non-random: populations 2, 4, and 5 consistently clustered together, whereas populations 1 and especially 3 were more divergent. Chloroplast barcodes (matK: PX089557; rpoC1: PV942406) from a representative voucher from Population 1 were consistent with its identification as P. harmala L. and clearly separated this sequence from those of related species in phylogenetic trees. In combination with morphological identification, this supports assignment of all sampled populations to P. harmala L.ConclusionsAmong the studied populations, P3 emerges as an ecologically and genetically distinct unit within P. harmala L. in the Taif region, characterized by its unique nuclear genetic profile, modified stem anatomy, and reduced total alkaloid content associated with higher soil salinity and altered major-ion composition. This integrative framework—combining soil characterization, quantitative anatomy, total alkaloids, SCoT/IRAP markers, and plastid barcodes illustrate how fine-scale edaphic heterogeneity is associated with anatomical, chemical, and genetic variation in this key desert medicinal shrub.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12870-026-09398-6.Keywords: Peganum harmala L., Soil salinity, Stem anatomy, Alkaloids, Genetic diversity, Chloroplast barcoding Background Peganum harmala L. (Zygophyllaceae R.Br.) is a hardy perennial shrub that thrives in some of the harshest environments on Earth. It is common in arid and semi-arid regions of North Africa, the Middle East, and Central Asia, where it grows on rocky and sandy soils under low rainfall and high temperatures [1, 2]. Beyond its role as a pioneer and stress-tolerant species, it has long been valued in traditional medicine. Its tissues are rich in β-carboline and quinazoline alkaloids, which underpin its use as an analgesic, antiseptic, and psychoactive remedy and to contribute antimicrobial, antioxidant, anticancer, and neuroactive activities [3–6]. Key alkaloids such as harmine, harmaline, harmalol, vasicine, and vasicinone also function as defensive compounds, shaping the plant’s interactions with herbivores and microbes [7, 8]. Alkaloid production in medicinal plants is not fixed, but is strongly shaped by environmental conditions, including soil salinity, pH, and nutrient availability [9, 10]. In P. harmala L., previous work has documented marked variation in alkaloid profiles among populations and among different organs within the same plant [11]. However, very few studies have gone beyond general patterns to quantitatively link alkaloid levels in geo‑referenced populations to specific soil properties and to associated anatomical traits. Such integrative analyses are essential for understanding how habitat conditions and intrinsic plant features together drive chemical variability in this ecologically and pharmacologically important species. In arid landscapes, environmental conditions can change sharply over very short distances, particularly in terms of soil pH, electrical conductivity (as an indicator of salinity), and nutrient status [12, 13]. These small-scale differences can substantially influence where plants occur, how their populations are structured, and how their traits vary, even for stress-tolerant shrubs [1, 14]. For P. harmala, earlier studies have emphasized its association with calcareous, alkaline soils, its notable tolerance to salinity and drought, and its potential use in the rehabilitation of disturbed or polluted sites [1, 15]. Yet, systematic efforts to connect measured soil parameters with variation in plant form, internal stem structure, and alkaloid content at the population level remain scarce [16]. Stem anatomy offers a powerful window into how plants cope with environmental stress. In xerophytic perennials, traits such as a thick cortex, reinforced xylem, a well-developed periderm, and shifts in vessel size and arrangement are often associated with greater resistance to hydraulic failure, improved water storage, and enhanced mechanical stability [1, 17, 18]. When examined across multiple populations, anatomical variation can reveal whether local challenges—such as heightened salinity or differences in moisture—are consistently mirrored by changes in vascular organization and secondary thickening [19, 20]. For P. harmala, however, most anatomical descriptions are brief, generalized, and based on limited sampling. They offer only fragmentary insights into how stem structure may shift across habitats [1]. On the genetic side, molecular markers are indispensable for resolving population structure, quantifying genetic diversity, and detecting differentiation within and among natural stands of medicinal plants [13, 21]. Start Codon Targeted (SCoT) markers, which target conserved regions flanking the ATG start codon, have proven especially useful for assessing diversity in a range of species, including medicinal and arid-zone taxa [22, 23]. Likewise, Inter-Retrotransposon Amplified Polymorphism (IRAP) markers detect polymorphisms at retrotransposon insertion sites, capturing genome-wide changes often driven or modulated by environmental stress [13, 24]. Although P. harmala has featured in a few molecular studies using ISSR, RAPD, or chloroplast DNA markers [25, 26], its population-level diversity as revealed by SCoT and IRAP remains poorly documented, particularly in relation to environmental gradients and phenotypic traits. Chloroplast DNA barcodes, especially matK and rbcL, are now standard tools for plant identification, phylogenetic inference, and biogeographic analysis. These plastid regions are relatively conserved and uniparentally inherited, making them well suited for tracing lineages and assessing relationships among closely related species [27, 28]. They are widely applied to uncover cryptic diversity, refine taxonomic boundaries, and place population-level variation into a broader evolutionary framework, including within Peganum [29]. DNA barcoding also has important practical applications in verifying the authenticity and quality of plant-derived products (teas, oils, spices, medicinal herbs) and in constructing robust phylogenies for community-level studies [13, 21, 29–31]. Among standard barcodes, matK is often highlighted for its strong discriminatory power, especially when combined with other plastid loci such as rpoC1 [32]. Integrating matK and rpoC1 with nuclear markers yields a more complete view of genetic structure and evolutionary relationships in desert plants, including P. harmala and its congeners. Here we adopt a deliberately integrated, hypothesis-driven framework to fill this gap. We combine georeferenced sampling across a fine-scale salinity gradient in the Taif region with concurrent measurements of soil pH and electrical conductivity, quantitative stem anatomy, and total alkaloid content, and we pair these phenotypic and chemical datasets with complementary nuclear marker systems (SCoT and IRAP) and plastid barcodes (matK, rpoC1). This design is novel for P. harmala L. because it (i) links site-specific edaphic conditions to within- and among-population variation in anatomy and alkaloid production, (ii) assesses nuclear genomic variation with two different retroelement- and start-codon–targeted marker types to capture genome-wide responses to stress, and (iii) situates population-level patterns within a plastid phylogenetic context. Importantly, rather than reporting only descriptive patterns, we use multivariate and population-genetic analyses to test whether and how environmental salinity correlates with anatomical adjustments, chemical allocation, and genetic structure—thereby moving beyond purely descriptive correlations to a more integrated inference about how habitat heterogeneity shapes adaptive and neutral variation in this ecologically and pharmacologically important shrub. Taken together, these ecological, anatomical, phytochemical, and molecular datasets clarify to clarify how local environmental conditions shape plant form, alkaloid profiles, and genetic diversity in this key desert medicinal shrub. Materials and methods Sampling and collection of P. harmala populations Fresh plant samples of P. harmala L. were collected from five natural populations located in different phytogeographical regions of Saudi Arabia, with three replicates per population (Fig. 1). Microhabitat characteristics at each site (substrate type, topographic position, visible surface salts, and apparent disturbance) were recorded in the field following standard ecological survey procedures. The five populations are all xerophytic and occur on sandy–stony substrates, but differ in local microhabitat: P1 (Al Ahlam Park) is an open recreational area with compacted sandy soil and scattered shrubs; P2 (C36) lies along a roadside verge with disturbed, gravelly sand; P3 (Ashayra) occupies a low‑lying basin with finer textured soil, higher visible surface salts and occasional water accumulation; P4 (As Sayl al Kabir) occurs on a gently sloping alluvial fan with mixed sand and coarse gravels; and P5 (Al Sir) is situated on a slightly elevated terrace with well‑drained sandy soil and sparse associated vegetation (Table 1). At each site, individual plants were randomly selected along a predefined transect covering the main microhabitats of the population, and fresh aerial parts were sampled from spatially separated plants to reduce the likelihood of collecting closely related individuals. At each site, seeds were harvested from several individual plants and pooled at the population level to minimize the influence of single-plant variation. Specimens were identified at the King Saud University Herbarium (KSU), Department of Botany and Microbiology, by Dr. Amal Mohamed AlGarawi, Professor of Botany and Herbarium Curator, and voucher specimens have been deposited in the KSU Herbarium (KSU). Composite field photographs of P. harmala L. shrubs from the five sampled populations in the Taif region (P1–P5), showing the low, spreading to dome-shaped growth form on sandy–stony substrates under arid conditions. Each panel corresponds to a distinct locality (P1, P2, P3, P4, P5) and includes an individual scale bar to indicate plant size and ground texture Table 1Soil physicochemical properties, major ion concentrations, EC class, and total alkaloid content (%) of P. harmala L. populations (P1–P5) sampled in the Taif region, Saudi Arabia. Values are mean ± SE (n = 3). One way ANOVA was used to test for differences among populations, followed by Tukey’s HSD for post hoc multiple comparisons (p < 0.05)PopulationGPS coordinates (geo‑referenced)pHEC (dS/m)%CaCO3Cations (meq L-1)Anions (meq L-1)Alkaloid content(%) ± SENa+ 1K+ 1Cl− 1HCO3−1CO3−2P1 (Al Ahlam Park)21.29406, 40.538377.79 ± 0.003ᵃ0.18 ± 0.000ᵇ1.12 ± 0.01ᵉ0.12 ± 0.01ᵇ0.43 ± 0.003ᵇ0.46 ± 0.003ᵇ1.14 ± 0.003ᵉ04.106 ± 0.004ᵃP2 (C36)21.23455, 40.479327.76 ± 0.003ᵇ0.16 ± 0.001ᵃ1.10 ± 0.00ᵈ0.10 ± 0.00ᵃ0.31 ± 0.003ᵃ0.44 ± 0.003ᵃ1.12 ± 0.003ᵈ04.072 ± 0.005ᵃP3 (Ashayra)21.71729, 40.650297.61 ± 0.003ᶜ0.41 ± 0.000ᶜ0.34 ± 0.00ᵃ0.43 ± 0.01ᶜ1.01 ± 0.003ᵉ1.06 ± 0.006ᶜ0.56 ± 0.003ᶜ03.208 ± 0.002ᶜP4 (As Sayl al Kabir)21.63545, 40.319337.74 ± 0.003ᵈ0.54 ± 0.000ᵉ0.94 ± 0.01ᶜ0.72 ± 0.01ᵉ0.84 ± 0.003ᵈ1.45 ± 0.006ᵉ0.51 ± 0.003ᵇ03.811 ± 0.003ᵇP5 (Al Sir)21.20095, 40.552797.71 ± 0.003ᵉ0.51 ± 0.004ᵈ0.92 ± 0.01ᵇ0.70 ± 0.01ᵈ0.82 0.003ᶜ1.43 ± 0.003ᵈ0.49 ± 0.003a03.758 ± 0.003ᵇ Soil physicochemical properties, major ion concentrations, EC class, and total alkaloid content (%) of P. harmala L. populations (P1–P5) sampled in the Taif region, Saudi Arabia. Values are mean ± SE (n = 3). One way ANOVA was used to test for differences among populations, followed by Tukey’s HSD for post hoc multiple comparisons (p < 0.05) Soil sampling and physicochemical analysis Soil was sampled from the root zones of P. harmala at each of the five sites. At each site, multiple subsamples were collected from the upper 0–20 cm of soil within the main rooting zone and composited to obtain a representative sample per population. Chemical analyses were performed on 1:1 soil extracts: calcium carbonate was quantified calorimetrically, soil pH was measured with a calibrated pH meter following standard soil analysis protocols, and electrical conductivity (EC) was measured with an EC meter as an indicator of salinity. Classification of salinity levels followed commonly used EC thresholds for non-saline and slightly saline soils [33, 34]. Soluble anions were determined by titration—chloride with silver nitrate and bicarbonate with sulfuric acid—while soluble cations were measured using a flame photometer for sodium and potassium and EDTA titration for calcium and magnesium [35]. All measurements were taken at controlled room temperature and each soil sample was analyzed in triplicate to ensure accuracy and reproducibility. Anatomical study of stem For anatomical analysis, fresh plants were randomly selected at each site, and 2-cm segments were excised from the basal internode of the main stem. Sample preparation followed the micro technique of Nassar and El Sahhar [36]. Tissues were fixed for at least 48 h in FAA solution (10 mL formalin, 5 mL glacial acetic acid, 25 mL distilled water, 60 mL 95% ethanol). After fixation, samples were rinsed in 50% ethanol and dehydrated through a normal butyl alcohol series. Freehand transverse sections were prepared, stained with safranin–light green or crystal violet–erythrosine, and mounted in Canada balsam under cover slips. Prepared slides were examined and photographed using a light microscope to document cortical and vascular organization. To minimize age-related effects, stems of comparable developmental stage and diameter were selected from each population, based on internode position and external morphology. Determination of alkaloid content Total alkaloids were quantified gravimetrically following Harborne [37], as outlined by Onwuka [38]. For each sample, 5 g of dried, ground material was dispersed in 50 mL of 10% acetic acid in ethanol, shaken, and allowed to stand for 4 h before filtration. The filtrate was concentrated to one quarter of its original volume, and concentrated NH₄OH was added dropwise to precipitate alkaloids. The precipitate was collected on pre-weighed filter paper and washed with 1% NH₄OH, then dried at 60 °C for 30 min and reweighed. Alkaloid content was calculated from the weight difference and expressed as a percentage of dry mass. Pearson correlation coefficients were calculated to assess relationships among soil parameters and total alkaloid content across populations. DNA extraction and SCoT/IRAP PCR amplification Genomic DNA was extracted from young, fresh leaves of P. harmala using the DNeasy Plant Mini Kit (QIAGEN, Santa Clarita, CA, USA) according to the manufacturer’s instructions. DNA concentration and purity were assessed with a Nanodrop 2000 spectrophotometer (Thermo Scientific, Germany). PCR amplification was carried out with ten SCoT and ten IRAP primers (Table 2). Each 25 µL reaction contained 12.5 µL of 2× PCR Master Mix (Sigma), 2 µL of primer (10 pmol/µL), 3 µL of genomic DNA (10 ng/µL), and 7.5 µL of distilled water, following Ibrahim et al. [39]. Reactions were run on a Perkin-Elmer/GeneAmp® PCR System 9700 (PE Applied Biosystems, Waltham, MA, USA). The thermal profile began with 3 min at 94 °C, followed by 35 cycles for IRAP and 40 cycles for SCoT of 94 °C for 40 s, 50 °C for 50 s, and 72 °C for 60 s, and a final extension at 72 °C for 7 min. Table 2Genetic diversity parameters based on banding patterns in P. harmala using SCoT and IRAP molecular markers and barcoding genes (matK, rpoC1). TB: Total number of bands, M: Monomorphic bands, PB: Polymorphic bands, P%: Polymorphism (%), F: frequency, PIC: Polymorphic Information ContentNo.Primer NamePrimer sequence (5’- 3’)TBMBPBP%FPICSCoT1SCoT-01ACGACATGGCGACCACGC1457640.50.52SCoT-02ACCATGGCTACCACCGGC1439790.640.463SCoT-03ACGACATGGCGACCCACA1439790.640.464SCoT-04ACCATGGCTACCACCGCA943560.330.445SCoT-05CAATGGCTACCACTAGCG1061400.10.186SCoT-06CAATGGCTACCACTACAG1144640.360.467SCoT-07ACAATGGCTACCACTGAC1248670.670.448SCoT-08ACAATGGCTACCACTGCC1494360.290.419SCoT-09ACAATGGCTACCACCAGC1153550.270.3910SCoT-10ACAATGGCTACCACTACC1256580.50.5Sum1214854Average1255IRAP1IRAP-2175TTAGACCCGGAACCGCCGTG1495360.360.462IRAP-2198ATCCTTCGCGTAGATCAAGCGCCA1376460.460.503IRAP-2197GAAGTACCGATTTACTTCCGTGTA1679560.560.494IRAP-2200ATGTGACAGTCGACTAACCAC12210830.830.285IRAP-2204AACTTGATCCAGATCATCTCC12210830.830.286IRAP-784CGAGTGAGGACAAGTGCGCAG1275420.420.497IRAP-681ACGTCGGCATCGGGCTGTCAC16610630.630.478IRAP-1372TGTTTCCCATGCGACGTTCCCCAACAC1064400.400.489IRAP-4385GGAAGGTGGGCATCGGGCTG1266500.500.5010IRAP-823CTGTGTTGGTCTGTGAGGGCAG13211850.850.26Sum1305476Average23.69.813.8Barcoding Genes1matKF: CGATCTATTCATTCAATATTTCR: TCTAGCACACGAAAGTCGAAGT2rpoC1F: GGC AAA GAG GGA AGA TTT CGR: CCA TAA GCA TAT CTT GAG TTGG Genetic diversity parameters based on banding patterns in P. harmala using SCoT and IRAP molecular markers and barcoding genes (matK, rpoC1). TB: Total number of bands, M: Monomorphic bands, PB: Polymorphic bands, P%: Polymorphism (%), F: frequency, PIC: Polymorphic Information Content F: CGATCTATTCATTCAATATTTC R: TCTAGCACACGAAAGTCGAAGT F: GGC AAA GAG GGA AGA TTT CG R: CCA TAA GCA TAT CTT GAG TTGG PCR products were separated on 1.5% agarose gels containing ethidium bromide (0.5 µg/mL) in 1× TBE buffer at 95 V. A 100 bp DNA ladder was used as a size standard. Bands were visualized under UV light and documented using a BIO-RAD 2000 Gel Documentation System. Chloroplast DNA barcoding (matK, rpoC1) and PCR amplification The chloroplast regions matK and rpoC1 were amplified for DNA barcoding. Each 50 µL PCR reaction contained 1× buffer (Promega), 15 mM MgCl₂, 0.2 mM of each dNTP, 20 pmol of each primer (Table 2), 1 U of GoTaq DNA polymerase (Promega), 40 ng genomic DNA, and ultra-pure water to volume. Amplifications were performed on a Perkin-Elmer/GeneAmp® PCR System 9700 under the following program: initial denaturation at 94 °C for 5 min; 40 cycles of 94 °C for 10 s, annealing at 47 °C for 1 min, and extension at 72 °C for 1 min; followed by a final extension at 72 °C for 7 min. Products were resolved on 1.5% agarose gels stained with ethidium bromide (0.5 µg/mL) in 1× TBE buffer at 95 V, using a 100 bp ladder as a marker. Bands were visualized under UV light and photographed with a BIO-RAD 2000 Gel Documentation System. Amplified fragments were purified with the EZ-10 Spin Column PCR Purification Kit according to the manufacturer’s protocol. DNA sequencing of barcoding regions Purified matK and rpoC1 amplicons were sequenced on an ABI PRISM 3730XL Analyzer using BigDye™ Terminator Cycle Sequencing Kits, following the manufacturer’s instructions. Single-pass sequencing was performed for each template using the corresponding forward primer. Fluorescently labelled extension products were cleaned by ethanol precipitation, resuspended in distilled water, and analysed by capillary electrophoresis on the ABI 3730XL at the School of Sciences and Engineering, The American University in Cairo. Phylogenetic analysis of chloroplast barcodes Sequences of matK and rpoC1 from P. harmala and reference taxa were aligned using MAFFT [40]. Phylogenetic relationships were inferred with raxmlHPC under a maximum likelihood framework, selected for its robustness in phylogenetic reconstruction [41]. The resulting tree was visualized using the Interactive Tree of Life (iTOL) platform, providing a clear graphical overview of relationships among the analysed sequences [42]. Conserved motif discovery and visualization To explore conserved sequence features, matK and rpoC1 sequences of P. harmala were analysed with the MEME Suite, limiting the search to a maximum of five motifs [39]. Identified motifs were visualized and mapped using TBtools, and these patterns were integrated with the phylogenetic tree to give a combined view of motif conservation across lineages [40]. Genetic similarity, clustering, and diversity analysis Genetic relationships among populations were quantified using Dice’s similarity coefficient. Clear, reproducible SCoT bands were visually scored as present (1) or absent (0) across all samples, and both polymorphic and monomorphic loci were included in a binary data matrix. Dice similarity values were calculated, and a dendrogram was constructed using the UPGMA (Unweighted Pair Group Method with Arithmetic Mean) algorithm. A phylogenetic tree based on the Euclidean similarity index was also generated with PAST3 software (version 1.91) [41]. Genetic diversity was summarized using several standard parameters: Percentage of polymorphic bands (P%): Percentage of polymorphic bands (P%): P% = (ΣPB / ΣTNB) × 100, where PB is the number of polymorphic bands and TNB is the total number of bands per primer. P% = (ΣPB / ΣTNB) × 100, where PB is the number of polymorphic bands and TNB is the total number of bands per primer. Polymorphic information content (PIC): Polymorphic information content (PIC): PIC = 1 − Σpi², where pi is the frequency of each allele at a locus. PIC = 1 − Σpi², where pi is the frequency of each allele at a locus. Shannon’s information index (I): Shannon’s information index (I): I = −Σ(pi ln pi), where pi is allele frequency. I = −Σ(pi ln pi), where pi is allele frequency. Nei’s gene diversity (H): Nei’s gene diversity (H): H = 1 − Σpi². H = 1 − Σpi². Effective number of alleles (Ne): Effective number of alleles (Ne): Ne = 1 / (p² + q²), where p and q are the frequencies of the two alleles (0 and 1). Ne = 1 / (p² + q²), where p and q are the frequencies of the two alleles (0 and 1). Number of observed alleles (Na): Number of observed alleles (Na): Total count of distinct alleles across populations. Total count of distinct alleles across populations. Expected heterozygosity (He): Expected heterozygosity (He): He = 2pq, where p and q are the allele frequencies. He = 2pq, where p and q are the allele frequencies. Statistical analysis Multivariate analyses (hierarchical cluster analysis, principal component analysis, and heatmap visualization) were performed on standardized soil, anatomical, and genetic data to identify patterns of similarity and differentiation among populations. One‑way ANOVA was used to test for significant differences among populations in soil variables, quantitative anatomical traits, and total alkaloid content, followed by post hoc comparisons using Tukey’s HSD where applicable. Pearson correlation coefficients (r) were calculated to assess relationships among key soil parameters (pH, EC, CaCO₃, Na⁺, K⁺, Cl⁻, HCO₃⁻), stem anatomical traits (e.g. cortex thickness, secondary xylem area, vessel regularity index), and total alkaloid content across populations, and these correlations were visualized as a heatmap. All diversity indices were calculated with GenAlEx [43], providing a comprehensive assessment of genetic variation within and among populations. Results pH, salinity, and population patterns of P. harmala Figure 1 shows how P. harmala is distributed across the five Taif sites. In all locations, the plants form low, spreading to dense dome-shaped shrubs on sandy–stony ground, reflecting successful establishment under arid conditions. Soil data (Table 1) indicate weakly alkaline conditions across populations (pH 7.61–7.79) and non-saline to slightly saline conditions based on EC thresholds, but a clear salinity gradient: EC is low at P1 and P2 (0.16–0.18 dS/m) and higher at P3–P5 (0.41–0.54 dS/m). Multivariate analyses (Fig. 2A, B and C) consistently identify P3 as environmentally distinct: cluster analysis and PCA separate P3 from the other populations, while P1 and P2 cluster together and P4 and P5 form a closely related group. The heatmap of standardized soil variables (CaCO3, pH, HCO3−, Cl−, EC, Na+, K+) reinforces this pattern, shows elevated EC, Na⁺ and K⁺ and lower CaCO₃ and HCO₃⁻ at P3 relative to the other sites. We note that our soil characterization does not include key macronutrients (e.g. total N, available P) or micronutrients, so the observed patterns primarily reflect salinity and major ion chemistry rather than the full nutrient status of each site. Although all five sites can be classified as xerophytic, saline habitats, these microhabitat differences in substrate, topographic position and apparent disturbance (particularly the low‑lying, salt‑affected basin at P3) coincide with the observed edaphic and trait variation. Among these, P3 shows the highest EC and the most pronounced shift in major‑ion composition (elevated Na⁺ and K⁺ and reduced CaCO₃ and HCO₃⁻), marking it as the most saline and chemically distinct site. A cluster dendrogram, B principal component analysis (PCA), and C heatmap of P. harmala soil samples (P1–P5) showing pH, electrical conductivity (EC), and major ion composition Anatomical features of stem internodes Transverse stem sections (Fig. 3) show that, in most populations (P1, P2, P4, P5), stems have a regular, well-organized vascular cylinder with a central pith, radially arranged xylem, continuous phloem rings, and clearly defined cortical layers. These traits are typical of mature secondary growth in a xerophytic shrub. Stems of comparable developmental stage and diameter were selected across all populations to minimize age-related anatomical differences. Anatomical features of stem internodes in P. harmala L. populations (P1–P5) from the Taif region. Transverse stem sections showing the vascular organization in populations P1–P5. Each micrograph displays a central pith (Pi), radially arranged xylem (X), a continuous cambial zone (Ca), phloem (Ph), cortex (Co), epidermis (E). The micrographs are presented as a full-page, high-resolution composite, with enlarged subpanels for each population (P1, P2, P3, P4, P5) arranged in a balanced multi-panel layout (2 + 2+1). Each subpanel now includes a clearly visible scale bar (scale bar = 1 mm) and enlarged, legible anatomical labels to ensure clarity and readability at publication size. In contrast, stems from P3 look noticeably different. They have an irregular external outline, a compact multilayered cortex, and vascular strands that are more scattered and less regularly arranged, with a visibly reduced amount of secondary xylem relative to stems of similar age from the other sites. This suggests that plants at P3 have a modified or more disrupted vascular organization, potentially reflecting local environmental pressures at this site rather than simple differences in stem age. This combination of irregular outline, compact cortex and reduced secondary xylem in stems of similar age to those at other sites highlights P3 as anatomically distinct among the five populations. Variation in alkaloid content Total alkaloid concentrations are fairly similar among the five populations, with mean values between 3.208% and 4.106% and very low standard deviations, indicating that plants within each site are chemically consistent. The highest alkaloid levels were recorded at P1 (4.106 ± 0.004a%) and P2 (4.072 ± 0.005a%). The lowest value occurred at P3 (3.208 ± 0.002c%), while P4 (3.811 ± 0.003b%) and P5 (3.758 ± 0.003b%) showed intermediate levels (Table 1). Overall, there is a modest decline in alkaloid content from the low‑salinity sites (P1, P2) toward the more saline sites, with P3 combining the lowest total alkaloid content (3.208 ± 0.002%) and a relatively higher EC (0.41 ± 0.000 dS/m) compared with P1 and P2. One‑way ANOVA was used to test for differences among populations, followed by Tukey’s HSD for post hoc multiple comparisons (p < 0.05). One‑way ANOVA confirmed that total alkaloid content differed significantly among populations (p < 0.05); post hoc tests showed that P3 was significantly lower than P1 and P2, while P4 and P5 exhibited intermediate, partially overlapping values (see superscript letters in the alkaloid column). Multivariate integration of soil chemistry, anatomical traits, and alkaloid content. To jointly visualize patterns across soil variables, stem anatomy, and total alkaloid content, we performed principal component analysis (PCA), hierarchical clustering, and heatmap analysis (Fig. 4A, B and C). The first principal component (PC1) explained 68.9% of the total variance and separated P3 from the remaining populations, mainly along gradients in EC, Na⁺, K⁺, cortex thickness, vessel irregularity, and reduced total alkaloid content. PC2 (25.2% of the variance) captured more subtle differences among P1, P2, P4, and P5. The correlation heatmap highlights that EC is positively associated with Na⁺, K⁺, cortex thickness and deviations from regular vessel arrangement, and negatively associated with CaCO₃, HCO₃⁻ and total alkaloid content. The hierarchical clustering dendrogram based on Euclidean similarity groups P2, P4 and P5 together, with P1 forming a nearby branch and P3 occupying a clearly isolated position, reinforcing its status as the most distinct population when soil chemistry (including higher EC and altered Na⁺, K⁺, CaCO₃, HCO₃⁻), anatomical traits and alkaloid levels are considered jointly (Fig. 4). A Pearson correlation analysis, B Heatmap and C Hierarchical Clustering of soil variables, stem anatomical traits, and total alkaloid content among P. harmala populations (P1–P5) from the Taif region. Variables include pH, EC, CaCO₃, Na⁺, K⁺, Cl⁻, HCO₃⁻, cortex thickness, secondary xylem area, vessel regularity index, and total alkaloid content. Cells are coloured according to Pearson’s correlation coefficient (r), with warm colours indicating positive correlations and cool colours indicating negative correlations. Asterisks indicate significant correlations (p < 0.05, p < 0.01) SCoT marker polymorphism and genetic patterns The ten SCoT primers generated 121 bands in total, of which 54 were polymorphic (polymorphism up to 79%). Primers SCoT 02, 03, 06, 07, and 10 had the highest discriminatory power and polymorphic information content (PIC) (Fig. 5; Table 2). Ten primers of SCoT marker amplification patterns in P. harmala genotypes using selected primers. M: DNA Ladder Genetic diversity indices point to moderate to high variation across SCoT loci (effective number of alleles, Ne, up to 2.00; expected heterozygosity, He, up to 0.50; Shannon’s index, I, up to 0.69). Among the primers, SCoT 01 and SCoT 10 were the most informative, whereas SCoT 05 showed the least variation (Table 3). Table 3Allelic frequency and genetic diversity parameters in P. harmala based on SCoT molecular marker data. p (freq): Frequency of the dominant allele, q: Frequency of the recessive allele, Na: Observed number of alleles, Ne: Effective number of alleles, He: Expected heterozygosity, I: Shannon’s Information IndexNo.Primer p qNaNeHeISCoT1SCoT-010.50.5220.50.692SCoT-020.640.3621.830.460.653SCoT-030.640.3621.830.460.654SCoT-040.330.6721.80.440.645SCoT-050.10.921.220.180.336SCoT-060.360.6421.830.460.657SCoT-070.670.3321.80.440.648SCoT-080.290.7121.690.410.69SCoT-090.270.7321.650.390.5810SCoT-100.50.5220.50.69IRAP1IRAP-21750.360.6421.830.460.652IRAP-21980.460.5421.990.50.693IRAP-21970.560.4421.970.490.694IRAP-22000.830.1721.390.280.455IRAP-22040.830.1721.390.280.456IRAP-7840.420.5821.950.490.687IRAP-6810.630.3721.860.470.668IRAP-13720.40.621.920.480.679IRAP-43850.50.5220.50.6910IRAP-8230.850.1521.350.260.42 Allelic frequency and genetic diversity parameters in P. harmala based on SCoT molecular marker data. p (freq): Frequency of the dominant allele, q: Frequency of the recessive allele, Na: Observed number of alleles, Ne: Effective number of alleles, He: Expected heterozygosity, I: Shannon’s Information Index Pairwise similarity values among populations were generally high (0.67–0.89), indicating overall genetic relatedness. The closest relationships were observed for population pairs 3–4, 2–4, and 1–5, while population 1 was more clearly differentiated from 3 to 4 (Table 4). Multivariate analyses (cluster analysis, PCA, and heatmap; Fig. 6A, B and C) consistently grouped populations 2, 4, and 5 together, while 1 and especially 3 formed separate branches. This pattern supports a non-random, structured distribution of nuclear genetic diversity among sites. Table 4Pairwise genetic similarity among P. harmala genotypes based on dice’s similarity coefficient of SCoT primers.1234511.0020.681.0030.690.821.001.0040.670.850.891.0050.870.730.730.691.00 Pairwise genetic similarity among P. harmala genotypes based on dice’s similarity coefficient of SCoT primers. A Hierarchical Clustering, B Principal Component Analysis, and C Heatmap of Genetic Relationships among the Five P. harmala Populations based on SCoT Marker Data IRAP marker polymorphism and genetic patterns The ten IRAP primers produced 130 bands, including 76 polymorphic bands, with polymorphism levels reaching up to 85%. Several primers (e.g. IRAP 2198, 2197, 681, 4385) showed high PIC values, confirming that the IRAP set was highly informative (Fig. 7; Table 2). Ten primers of IRAP marker amplification patterns in P. harmala genotypes using selected primers. M: DNA Ladder Genetic diversity measures again indicated moderate to high variation (Na = 2; Ne = 1.35–2.00; He = 0.26–0.50; I = 0.42–0.69), with IRAP 2198, 2197, 784, 681, 1372, and 4385 contributing most to overall diversity (Table 3, 5). Pairwise similarity values were uniformly high (0.74–0.85), with populations 4 and 5 the most similar and population 1 slightly more differentiated, particularly from 3 to 4 (Table 1234511.00 20.841.00 30.740.811.00 40.740.820.831.00 50.750.800.780.851.005). Table 5Pairwise genetic similarity among P. harmala genotypes based on dice’s similarity coefficient of IRAP primers 1 2 3 4 5 1 1.00 2 0.841.00 3 0.740.811.00 4 0.740.820.831.00 5 0.750.800.780.851.00 Pairwise genetic similarity among P. harmala genotypes based on dice’s similarity coefficient of IRAP primers Cluster analysis, PCA, and heatmap visualization (Fig. 8A, B and C) all reproduced the main SCoT pattern: populations 2, 4, and 5 consistently grouped together, while 1 and especially 3 formed more distinct branches. Together, SCoT and IRAP results strongly support a non-random genetic structure across the five populations. In both SCoT‑ and IRAP‑based clustering, P3 consistently occupied a more isolated branch than the other populations, reinforcing its status as a genetically distinct unit that coincides with the most saline and anatomically divergent site. Phylogenetic position and conserved motifs of matK and rpoC1 The chloroplast genes matK (accession PX089557) and rpoC1 (PV942406) were successfully amplified and sequenced from a representative Population 1 voucher of P. harmala and aligned with homologous sequences from other angiosperms, producing high-quality alignments with few insertions or deletions (Fig. 8A, B, C). (A) Hierarchical Clustering, (B) Principal Component Analysis, and (C) Heatmap of Genetic Relationships among the Five P. harmala Populations based on IRAP marker data Maximum likelihood phylogenies placed the P. harmala rpoC1 sequence within well-supported clades (CII/CIII) alongside close relatives, while matK formed a distinct but closely related branch. This pattern indicates a shared ancestry with related taxa, together with some lineage-specific divergence (Fig. 9A, B and C). (A) Phylogenetic Relationships (B), and (C) Conserved Motif Architecture of P. harmala Chloroplast Genes matK (PX089557) and rpoC1 (PV942406) Motif analysis revealed several highly conserved amino acid motifs shared with other species, especially in regions linked to core enzymatic or structural functions. The overall motif arrangement and composition in P. harmala were largely similar to those of its close relatives, with only minor differences near the sequence ends. These results are consistent with strong functional conservation of rpoC1 and matK and suggest that only limited fine-scale evolutionary changes have occurred in these genes within P. harmala. Discussion P. harmala in the Taif region is clearly well adapted to sandy–stony, weakly alkaline soils, but the within-region gradient in electrical conductivity among sites—even within the non-saline to slightly saline range points to salinity -related differences in soil solution chemistry as a major factor driving local variation. The unique environmental position of Site 3, together with its distinct stem structure and lower total alkaloid content, mirrors its separation in SCoT and IRAP genetic space. Although P4 and P5 also fall within the higher-EC group, P3 is particularly distinctive because it combines elevated EC with a low-lying, salt-affected microhabitat and marked shifts in major-ion composition. And fits with patterns reported for other arid‑zone shrubs exposed to salinity, where increased salt stress alters cambial activity, tissue arrangement and hydraulic safety [1, 44, 45]. In contrast, the more typical xeromorphic yet regularly organized stems at the other sites suggest that most populations have achieved a stable balance between mechanical support and efficient water transport under chronic drought and high evaporative demand [46, 47]. In addition, our anatomical analyses were restricted to stem internodes; comparative leaf anatomy across populations was not examined. Given the importance of leaf traits in xerophytic and saline environments, future studies should integrate leaf anatomical and physiological measurements with stem structure to obtain a more complete picture of population‑level adaptations. The distinctive anatomical syndrome at P3—irregular stem outline, compact multilayered cortex and reduced, less regularly arranged secondary xylem in stems of comparable developmental stage—coincides with its position in a low‑lying, more saline basin. The Pearson correlation analysis (Fig. 4) showed that EC was positively associated with cortex thickness and deviations from regular vessel arrangement, reinforcing the link between relatively higher EC (at P3–P5 compared with P1–P2) and a more conservative stem design. Together with the correlations between EC and cortical/vessel traits (Fig. 4), this pattern suggests that chronic exposure to relatively higher EC and periodically wetter–drier cycles in this microhabitat have selected for or induced a more conservative, hydraulically safer vascular architecture. While we cannot exclude additional influences such as local disturbance history or unmeasured soil nutrients, the concordance between elevated EC and altered stem structure is consistent with the hypothesis that EC-related stress contributes to the distinctive P3 anatomy, although additional unmeasured factors may also be involved. Alkaloid levels showed only modest variation, but the pattern was consistent: slightly higher contents at the less saline sites (P1–P2) and lower values at the more saline sites (P3–P5). This indicates that secondary metabolism in P. harmala is relatively stable, yet still responsive to local resource conditions and osmotic stress. Correlation analysis further revealed a negative relationship between EC and total alkaloid content, whereas pH and CaCO₃ showed weaker or non‑significant associations with both anatomical traits and alkaloid levels. In combination with the correlation analysis linking EC to cortex thickness, vessel arrangement and total alkaloid content, these results suggest that increasing salinity may be associated with changes in resource allocation between secondary metabolism and structural/physiological adjustments, though experimental work would be required to confirm causation. It agrees with the idea that many defensive alkaloids are under strong genetic control but can be fine-tuned by the environment [9, 48]. The SCoT and IRAP marker results together point to moderate to high nuclear genetic diversity and a non-random genetic structure among populations. Populations 2, 4 and 5 form a consistent genetic cluster, whereas populations 1 and particularly 3 are more distinct. This kind of pattern is typical for long-lived, outcrossing perennials in patchy dryland environments, where limited gene flow, local selection and past demographic events generate fine-scale genetic mosaics [13, 21, 49]. The high levels of polymorphism and strong PIC values show that both SCoT and IRAP are sensitive tools for detecting variation within and among populations, and they could be used to monitor genetic resources and inform conservation or sustainable harvesting strategies for P. harmala [26]. Chloroplast markers matK (PX089557) and rpoC1 (PV942406) added a complementary phylogenetic perspective. matK helped resolve relationships among closely related lineages, whereas rpoC1 contributed to a stable placement within broader angiosperm clades. Both genes maintained largely conserved motif structures, reflecting strong functional constraints. This combination of high identification power and structural conservation supports their use as reliable barcodes for P. harmala and its congeners [13, 21, 51, 52]. Extending plastid sampling and combining it with broader nuclear datasets would help separate species-level history from plastid-specific processes such as introgression or incomplete lineage sorting, and clarify how environmental gradients across the wider range of P. harmala have shaped its genetic and chemical diversity [22, 53, 54]. Our barcoding data provide sequence-level confirmation for a representative voucher from Population 1 as P. harmala, and, together with concordant morphology and ecology across all five populations, support the assignment of all sampled material to P. harmala. However, only the Population 1 voucher was submitted to NCBI, and we do not claim sequence confirmation for every individual plant. Taken together, the congruence between the edaphic gradient, stem-level anatomical shifts, changes in total alkaloid content, and the non-random distribution of SCoT/IRAP genotypes indicates that local salinity and associated soil chemistry are strongly associated with both functional and genetic variation in P. harmala, but causal relationships cannot be confirmed from our correlative design. Population P3, in particular, combines the most saline soils, the most divergent vascular architecture, the lowest alkaloid levels, and a distinct nuclear genetic signature, consistent with a scenario in which prolonged exposure to higher EC has driven both phenotypic adjustment and partial genetic differentiation. In contrast, the relative similarity of P2, P4, and P5 across soil, anatomical, chemical, and molecular dimensions implies that gene flow and comparable environmental conditions have maintained a shared syndrome of xerophytic adaptation. This integrated pattern supports a model in which habitat heterogeneity in arid landscapes structures P. harmala populations through interacting ecological filters, plastic anatomical responses, and spatially heterogeneous selection on standing genetic variation. Despite the integrative design, this study has several limitations. First, our soil dataset focuses on pH, EC, CaCO₃ and major ions (Na⁺, K⁺, Cl⁻, HCO₃⁻), and does not include measurements of key macronutrients (e.g. N, P, K) or micronutrients. As a result, we cannot fully disentangle the specific effects of salinity from those of broader nutrient availability, and some of the anatomical and phytochemical differences among populations may also reflect unmeasured nutritional contrasts. Second, the sample size per population was necessarily limited by field access and processing capacity, and future work with larger within‑site replication would help refine estimates of variance and increase statistical power. Third, our phytochemical analysis focused on total alkaloid content rather than compound‑specific profiles; targeted quantification of individual alkaloids (e.g. harmine, harmaline, vasicine) would provide deeper insight into how particular metabolites respond to local edaphic conditions. Conclusion Our results show that even relatively small, local differences in soil salinity are linked to clear changes in stem anatomy, alkaloid content and nuclear genetic structure in P. harmala from the Taif region, with population P3 standing out as a distinct unit associated with higher-EC, ion-altered soils, modified vascular organization and reduced total alkaloid content. In contrast, P2, P4 and P5 are genetically and functionally more similar to each other, reflecting their occupancy of broadly comparable, higher-EC but less ion-distinct habitats than P3, while P1 shows an intermediate pattern. These similarities and differences are consistent with a scenario in which localized salinity regimes, site-specific environmental histories and spatially restricted gene flow contribute to the observed patterns, but our data demonstrate associations rather than direct causation. By bringing together soil characterization, stem anatomy, alkaloid profiling, nuclear markers (SCoT, IRAP) and plastid barcodes, this study offers a practical framework for dissecting environment–trait–genotype relationships in arid-zone medicinal plants. It also supports the use of P. harmala as a useful model for exploring adaptation, guiding conservation planning and informing the sustainable use of medicinal shrubs in desert ecosystems. Supplementary Information Supplementary Material 1. Acknowledgements The authors extend their appreciation to Prince Sattam bin Abdulaziz University for funding this research work through the project number (PSAU/2024/01/31574). Authors' contributions Conceptualization, methodology, software, validation, M.A-E. and Z.A.; formal analysis, investigation, resources, data curation, Z.A.; writing—original draft preparation, writing—review and editing, visualization, M.A-E.; supervision, Z.A.; project administration, M.A-E.; funding acquisition, Z.A. All authors have read and agreed to the published version of the manuscript. Funding The authors extend their appreciation to Prince Sattam bin Abdulaziz University for funding this research work through the project number (PSAU/2024/01/31574). Data availability We have carefully revised the manuscript for language, correcting minor grammatical, typographical, and stylistic issues to improve clarity and readability throughout; all substantive wording changes are highlighted in the revised version. Edits include standardizing tense and terminology, smoothing long or complex sentences (especially in the Abstract, Background, Discussion, and Conclusion), correcting minor typographical errors (spacing, punctuation, symbol formatting such as Na⁺, K⁺, dS/m), and ensuring consistent use of scientific terms and abbreviations. These changes do not alter the scientific content or conclusions but are intended to make the manuscript clearer and easier to follow. Declarations Consent for publication Not applicable. Competing interests The authors declare no competing interests. Footnotes Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. References Associated Data Supplementary Materials Supplementary Material 1. Data Availability Statement We have carefully revised the manuscript for language, correcting minor grammatical, typographical, and stylistic issues to improve clarity and readability throughout; all substantive wording changes are highlighted in the revised version. Edits include standardizing tense and terminology, smoothing long or complex sentences (especially in the Abstract, Background, Discussion, and Conclusion), correcting minor typographical errors (spacing, punctuation, symbol formatting such as Na⁺, K⁺, dS/m), and ensuring consistent use of scientific terms and abbreviations. These changes do not alter the scientific content or conclusions but are intended to make the manuscript clearer and easier to follow.