Selection on synonymous codon usage in soybean (Glycine max) WRKY genes Authors: Krishnendu Sinha, Sourav Jana, Payel Pramanik, Bithika Bera Published: 2024 ABSTRACT AbstractThe WRKY transcription factor gene family in soybean [Glycine max (L.) Merr.] (GmWRKY) is critical for the plant’s development and stress responses. This study examines the evolutionary dynamics of the GmWRKY gene family, focusing on its synonymous codon usage bias (CUB) in a comprehensive set of 179 coding sequences. CUB was analyzed using various indices, revealing a preference for A/T-ending codons and relatively low codon bias. Codon adaptation index (CAI) analysis suggested that these genes are optimized for efficient translation despite relatively low bias, reflecting a balance between codon diversity and translation efficiency. Neutrality and NC plots indicated that selective forces dominate over mutational forces in shaping codon usage, while selection signature analysis showed purifying selection being prevalent across the gene family. However, episodic positive selection was also detected in certain clades, highlighting potential adaptive diversification in response to environmental stress. Additionally, promoter binding site analysis uncovered correlations between codon usage and transcriptional regulation, indicating a context-dependent relationship between CUB and gene expression. Phylogenetic analysis identified 11 well-supported clades in the modern GmWRKY gene family and ancestral sequence reconstruction revealed more relaxed codon preferences and reduced selection constraints in modern GmWRKY genes, potentially linked to neofunctionalization and adaptation to environmental changes. These findings provide a framework for optimizing gene expression in transgenic soybean crops with resilience. Further functional validation of positively selected genes is recommended to elucidate their role in stress responses.Keywords: Soybean (Glycine max), TFBS, WRKY, Synonymous codon usage bias, Mutation, Natural selectionSubject terms: Computational biology and bioinformatics, Evolution, Genetics, Plant sciences Introduction Genetic codes are conveyed through codons, which are combinations of three nitrogenous bases. Among the 64 possible codons, 61 encode the 20 amino acids that constitute proteins, while three serve as stop signals. This redundancy of the genetic code directly contributes to the degeneracy of codon usage, allowing for flexibility and resilience in protein synthesis. Except for methionine (Met) and tryptophan (Trp), most amino acids are encoded by two to six synonymous codons1. Codon usage bias (CUB) is a universal trait across all genomes which refers to the non-random preference for certain synonymous codons in encoding genetic information1. CUB varies across species and within genes of the same organism, influenced by factors like natural selection, mutation rates, genetic drift, gene expression, GC content, codon context, and tRNA availability1. CUB is a critical factor in determining gene expression and cellular function by influencing diverse processes such as RNA processing, protein translation, and protein folding1. Investigations of codon bias patterns in genomes can reveal phylogenetic relationships between organisms, horizontal gene transfers, and molecular evolution of genes and identify selective forces that drive their evolution1,2. The neutral theory of molecular evolution suggests that much genetic variation is driven by the random fixation of mutations with minimal impact on fitness, rather than by selection3,4. However, advantageous mutations, although rare, play a critical role in driving species evolution5. Positive selection can reduce the established CUB within a gene, leading to decreased bias toward preferred codons during adaptive changes6,7. In contrast, purifying selection preserves high CUB, especially in highly expressed genes, ensuring efficient translation and gene expression 8–10. By comparing synonymous (silent) and nonsynonymous (replacement) substitution rates, the strength and direction of natural selection can be inferred11. A nonsynonymous rate greater than synonymous (dN/dS or ω > 1) indicates positive selection, while ω < 1 suggests purifying selection, removing deleterious mutations. A ratio near 1 indicates neutral evolution, where mutations are fixed primarily by random drift rather than by selection12. WRKY transcription factors are essential in plant development and stress responses, characterized by their conserved ~ 60-amino-acid DNA-binding domain, WRKYGQK, and zinc-finger structures13. Variations like WRRY or WKRY may occur, but the domain generally retains functionality13. These proteins bind to W-box elements (TTGACC/T) in DNA, and their adjacent sequences influence binding specificity and affinity13. WRKY transcription factors are classified into three groups (I, II, and III) based on the number of WRKY domains and the type of zinc-finger motif. Group I contains two WRKY domains, while Groups II and III have one; Group III members feature the C2HC-type zinc-finger motif13. Phylogenetic analyses reveal that the WRKY gene family is not monophyletic, particularly within Group II, which is further divided into subgroups (IIa + IIb, IIc, IId + IIe), suggesting multiple evolutionary pathways driven by selective pressures13. The WRKY gene family is one of the largest transcription factor families in plants, with gene numbers varying across species. For example, Arabidopsis thaliana has approximately 74 WRKY genes, whereas soybean has nearly 20014,15. The expansion of the WRKY family is primarily observed in land plants, with Group I genes being the most ancestral15. These genes modulate responses to both biotic (e.g., pathogens) and abiotic (e.g., drought) stresses, as well as playing roles in plant development15. Their autoregulatory and cross-regulatory mechanisms enable rapid reprogramming of gene expression in response to environmental changes13. Additionally, WRKY proteins interact with other regulatory proteins like MAP kinases and calmodulin, adding complexity to their regulatory networks13. Soybean [Glycine max (L.) Merr.], a major legume crop known for its high protein content and economic importance, is a key model in agricultural and genomic research16. The soybean variety Glycine max var. Williams 82, with its well-characterized genome, serves as a model organism for studying gene function and stress responses14. The Wm82.a2v1 genome assembly provides a valuable resource for such studies, facilitating investigations into molecular mechanisms of stress adaptation and nitrogen fixation14. The WRKY transcription factors in soybean, GmWRKY, are pivotal for plant development and stress responses, highlighting their importance in both fundamental research and agricultural applications. A recent study identified 176 WRKY proteins in the soybean genome (Wm82.a2v1), divided into three groups: Group I (32 proteins), Group II (120 proteins), and Group III (24 proteins)14. Most GmWRKY genes were located on Chromosome 6, with sparser distributions on Chromosomes 11, 12, and 2014. Gene density was highest at chromosome ends. Despite extensive studies on WRKY CUB in species like Arabidopsis thaliana17, Helianthus annuus18 and Medicago truncatula19, a comprehensive analysis of GmWRKY CUB in soybean remains unexplored. This study provides a comprehensive analysis of selection signatures in the GmWRKY gene family and the evolutionary dynamics of its CUB. By examining the relationship between selection pressure and transcriptional regulation, insights into the evolutionary forces and regulatory mechanisms influencing CUB in GmWRKY genes are offered. The findings could contribute to optimizing transgene design, potentially enhancing gene expression, and improving the efficiency of transgenic crops, particularly in soybeans1. Furthermore, investigating the evolutionary trajectory of GmWRKY CUB is expected to deepen our understanding of the molecular dynamics governing this gene family20,21. Methods Sequence retrieval and quality check of the GmWRKY gene family To analyze CUB in the GmWRKY gene family, the coding sequences (CDSs) of GmWRKY genes were retrieved from the PlantTFDB v5.0 database22,23 following the analytical pipeline presented in Fig. 1. The longest sequence was selected when multiple transcripts of the same gene were detected. These sequences were then cross-validated with data from the Phytozome13 database24 by performing a keyword search for “WRKY” within the Glycine max Wm82.a2. v1 genome assembly (Phytozome genome ID: 275; NCBI taxonomy ID: 3847). A comprehensive quality assessment was performed using a custom Python script (Script S1), which evaluated six critical parameters: the presence of a start codon at the 5’ end of the coding sequences (CDS), a stop codon at the 3’ end, divisibility of the CDS length by three, absence of internal stop codons, a minimum CDS length of 300 nucleotides (nt), and exclusion of sequences containing non-nucleic acid characters25. Following these quality checks, the selected sequences were further screened for outliers in length, as significant length discrepancies can negatively impact the quality of multiple sequence alignment (MSA), which is essential for downstream analysis. A schematic overview of the analytical pipeline used in this study. Analyses of CUB indices The CodonW (version 1.4.4)26 program was used for multiple compositional analyses, including overall GC content, GC content specifically at the third position of synonymous codons (GC3s), and the occurrences of individual nucleotides at the synonymous third codon positions (T3s, C3s, A3s, G3s). Additionally, the CAIcal web server (https://ppuigbo.me/programs/CAIcal/)27 was employed to analyze various CUB indices such as the codon adaptation index (CAI), effective number of codons (NC) and relative synonymous codon usage (RSCU) for individual genes and concatenated sequences. It also calculated the average GC content at the first and second codon positions (GC1/2) and individual nucleotide occurrences at the third codon positions (T3, C3, A3, G3). Codons lacking synonymous counterparts, such as AUG, UGG, and the stop codons (UAG, UAA, UGA), were excluded from the RSCU analysis. For visualization, RSCU values were normalized between 0 and 1 to enhance clarity and facilitate the comparison of codon bias across genes. In this approach, higher values indicate a stronger bias toward specific codons. Concatenated RSCU values were plotted using a deviation plot, with a baseline adjustment at 1. This adjustment simplifies interpretation by marking RSCU values greater than 1 as positive (preferred codons) and those less than 1 as negative. Normalization and the baseline adjustment at reference value 1 were applied to improve the visual detection of trends in CUB, making it easier to detect any inherent trend in the dataset. Neutrality plot The neutrality plot is inherently a regression plot that examines the relationship between GC12 and GC3 values to explore the dynamics of selective and mutational forces shaping CUB28,29. In this plot, GC12, the dependent variable, was placed on the ordinate, while GC3, the independent variable, was plotted on the abscissa. The GC12 value is calculated by averaging the GC1 and GC2 values (Script S2)30. NC plot An NC plot was created by plotting the expected NC (eNC) and observed NC (NC) values on the ordinate and the corresponding GC3 values on the abscissa. The eNC values for the GC3s were determined using the formula, NC=2+GC3s+29(GC3s2+1-GC3s2)31,32. When the expected NC values closely match the observed NC, there is a strong correlation between codon bias and GC3s, with mutation being the primary influencing factor33. Hence, (eNC − NC)/eNC ratios were computed for genes to further assess differences in NC values18. The Kolmogorov–Smirnov test was also performed to determine if there is a significant difference between the distributions of NC and eNC, as well as to assess the direction of any observed differences34. Script S2 was used for this analysis. Parity rule 2 (PR2)‑plot To analyze the bias according to Chargaff’s PR2, a scatter plot was created. The abscissa represents GC-bias, G3/(G3+C3), while the ordinate represents, AT-bias, A3/(A3+T3) (Script S2)35. Analysis of promoter binding sites concerning CUB To investigate the relationship between the frequencies of promoter binding sites and CUB within the GmWRKY gene family, promoter sequences (Dataset S3) were retrieved from the Phytozome13 database24. Regions extending 2000 bp upstream of the transcription start sites for all WRKY genes were extracted. Transcription factor binding sites (TFBS) within these promoter regions were identified using the FIMO tool36 from the MEME Suite 5.5.737, with motifs sourced from the JASPAR CORE database (JASPAR2024 Position Frequency Matrix (PFM), plants, non-redundant)38, ensuring the use of current and relevant motifs for detecting potential regulatory elements. The raw results from FIMO were curated to remove redundancies. All motifs with overlapping binding sites were consolidated into a single binding site, with consideration given to strand sense throughout the process39,40. This curation was performed using an in-house Python script (Script S3) designed for this task. Subsequently, the TFBS frequency data were converted into a contingency table using the same Python script, facilitating more detailed statistical analysis. Following curation and transformation, the distribution and frequency of the identified motifs were analyzed concerning CUB in the GmWRKY gene family. A customized R script was employed to calculate Spearman’s correlations between the identified TFBSs and both CAI and NC values. To account for multiple comparisons, the Benjamini-Hochberg (BH) correction41 was applied. Instead of applying the BH correction to all identified TFBSs, an exploratory analysis was first conducted to determine which TFBSs showed significant correlations with CAI and NC values. The BH correction was then applied specifically to these subsets of TFBSs, allowing for enhanced accuracy while preserving statistical power and reducing noise. This targeted approach, along with iterative data analysis, ensured that the findings were both statistically robust and biologically relevant, providing insights into the regulatory mechanisms influencing gene expression within the GmWRKY gene family. Phylogenetic analysis and test for selection signatures To investigate the selection signature in the GmWRKY gene family, the protein-coding sequences were analyzed using advanced codon-based models of evolution implemented in the CODEML5 program within the PAML42 package. This analysis enabled the estimation of synonymous (dS) and nonsynonymous (dN) substitution rates and the identification of selection signatures shaping the evolution of this gene family. CODEML requires accurate sequence alignments and strong phylogenetic reconstructions to provide reliable estimates42. In multiple sequence alignment (MSA), it’s crucial to differentiate between evolutionary homology and structural homology, as alignments based on structural similarity may lead to misleading results in comparative and phylogenetic studies43. In such cases, the PRANK algorithm is recognized for generating reliable alignments for evolutionary analyses44. However, due to the size of the dataset, PRANK’s significantly slower processing speed made it impractical to align the entire dataset. Phylogenetic reconstruction To overcome the limitation regarding processing speed, a two-step progressive alignment pipeline was employed. First, exploratory analysis was performed by aligning all coding sequences (CDSs) at the codon level using the MUSCLE algorithm45 in MEGA XI46. To root the phylogeny and determine evolutionary directionality, the Arabidopsis thaliana WRKY47 gene (NM_116402.4) was used as an outgroup47. The maximum likelihood tree of GmWRKY genes was inferred using IQ-TREE v2.3.648 under the best-fit model KOSI07 + F + R7, according to Bayesian information criterion scores (BIC) derived through ModelFinder49. Confidence in the tree topology was reinforced through ultrafast bootstrap analysis50 with 1000 replicates. Additionally, the approximate likelihood-ratio test (aLRT) was applied to further support branch robustness48. The bootstrap node support was refined using the BNNI (Better Nearest Neighbor Interchange) algorithm, which improved the accuracy of the support values during the bootstrap analysis48. The resulting phylogenetic tree was visualized using TreeViewer v.2.2.051, rooted at the outgroups, and clades were identified based on high bootstrap support (> 90) (Table S4). Once the clades were established, the outgroup was excluded from subsequent analyses. In the second step, to improve alignment accuracy for CODEML analysis, sequences belonging to each clade were realigned using PRANK, implemented within the GUIDANCE252 framework. The refined MSAs for each clade were used to reconstruct clade-wise phylogenies using IQ-TREE v2.3.648 with an optimum codon-based substitution model selected by ModelFinder49. Confidence in the resulting tree was ensured by repeating the ultrafast bootstrap analysis with 10,000 replicates, applying the aLRT for branch support, and refining bootstrap values using the BNNI algorithm48. Computational efficiency was maximized by allowing IQ-TREE to automatically detect the optimal number of CPU threads for parallel computation. This stepwise approach, starting with the inclusion of an outgroup and followed by clade-specific refinements, ensured that the final phylogeny was both accurate and biologically meaningful. Test for selection signatures Selection pressure on the GmWRKY genes was assessed using codon-based likelihood models in the CODEML program5 from the PAML package42, focusing on three types of models: site, branch, and branch-site53, to comprehensively explore selection dynamics. Site models with heterogeneous ω across sites Several site model comparisons were conducted to detect positive selection at specific codon sites. These comparisons included M0 (one-ratio) and M1a (nearly neutral), M0 and M3 (discrete), and M1a (neutral) vs. M2a (positive selection), as well as M7 (beta) vs. M8 (beta + ω > 1)5,53. The objective was to identify codon sites with ω > 1, indicating positive selection. Likelihood ratio tests (LRTs) were performed to determine statistical significance, and codons under positive selection were identified using the Bayes Empirical Bayes (BEB) method42. In this context, key control file parameters included model = 0 and NSsites = 0,1,2,3,7,85,53. Branch models with heterogeneous ω across branches Branch models were used to investigate lineage-specific variations in selection pressure by comparing the M0 model, which assumes a single ω ratio across all branches, with models that allowed different ω ratio values for foreground and background branches. The free-ratio model (model = 1, NSsites = 0) 53 was initially applied to explore potential positive selection. Based on the results, 12 genes from six distinct clades, exhibiting ω > 1, were selected for further study as foreground branches. For branch model analysis, the key control file parameters were model = 2 and NSsites = 0 5. Branch-site models with heterogeneous ω across branches and sites Branch-site models were applied to detect episodic positive selection on specific codon sites along foreground branches. These models allowed some codons in foreground branches to evolve under positive selection (ω > 1) while being constrained in background branches5,42. Control file parameters for the branch-site model (Model A) included model = 2 and NSsites = 2. LRTs were used to test the significance of these models, and the BEB54 method was employed to identify codons with a greater than 95% probability of being under positive selection42. The null model (Model A1) in this analysis assumed a fixed ω = 1 for foreground branches. This integrated approach, utilizing site, branch, and branch-site models, provided a comprehensive framework for evaluating selection pressures acting on specific codon sites and evolutionary lineages within the GmWRKY gene family. Analyzing the correlation between translational and positive selection To explore the relationship between translational selection and positive selection, Spearman’s correlation was calculated between the ω ratio of positively selected lineages (1 < ω < 4)5 and their CAI and NC. Due to the small sample size, a power analysis was also performed to determine the minimum detectable effect. Ancestral sequence reconstruction Ancestral sequences for the GmWRKY gene family were reconstructed using the CODEML module of the PAML package42. The ancestral sequence reconstruction (ASR) was conducted in a clade-based manner, ensuring more accurate evolutionary insights across different branches of the gene family42. PRANK-derived clade-wise MSAs and respective phylogenetic trees as described above, were used as inputs for the ASR process. The analysis was carried out by setting RateAncestor = 2 in the control file42. The free-ratio model was applied, allowing each branch of the phylogenetic tree to have an independent ω ratio to capture lineage-specific selection pressures42. The NSsites parameter was set to 0 to prevent site-specific variation42. Following ASR, CAI and NC for the ancestral sequences were calculated using the CAIcal server. The Shapiro–Wilk test assessed the normality of CAI and NC distributions, and, due to non-normality, the Mann–Whitney U test was used to compare CAI and NC values between ancestral and modern gene sequences. Additionally, the Mann–Whitney U test was applied to detect significant differences in selective pressures on the ancestral and modern ω ratios. Statistical analysis All the statistical analyses and plotting were performed using a proprietary data pipeline crafted in R version 4.4.0 (Puppy Cup) and executed within RStudio55,56. Spearman correlation was chosen for all reported correlations in this study because the variables (except NC values for modern genes) did not follow a normal distribution, as indicated by the Shapiro‒Wilk test57. The Kolmogorov‒Smirnov test34 was performed to evaluate the goodness-of-fit of the observed NC with the eNC. To account for multiple comparisons whenever applicable, the Benjamini-Hochberg (BH) correction41 was applied. All statistical tests were conducted, and significance was reported at a minimum confidence level of 95% (p < 0.05). Results Quality checks retrieved a dataset of 179 CDS of GmWRKY Initially, 296 CDS of GmWRKY were retrieved from the PlantTFDBv5.0 database (Dataset S1). After filtering for multiple transcripts, 186 sequences were selected based on the criteria of choosing the largest transcript for each gene. Following the quality assessment, 179 sequences met the required standards and were cross-referenced with the Phytozome13 database for validation (Dataset S2). This sequence dataset was then used for all subsequent analyses. Analysis of codon base composition and CUB indices Base composition analysis of the dataset revealed that T (30.57%) was the most abundant base, followed by A (26.31%), C (22.75%), and G (20.37%) at the third position of codons. Moreover, the average GC content in the third codon positions (GC3) and third synonymous codon position (GC3s) were 43.12% and 41.25%, respectively, suggesting a preference for A/T(U) bases at the third codon position in GmWRKY genes. Further analysis of CUB using the NC revealed values ranging from 42.17 to 61.00, with an average of 52.35. The NC metric measures how biased a gene’s codon usage is, with values close to 61 indicating random codon usage (low bias), and values closer to 20 suggesting strong bias31,33. In this study, the average NC value of 52.35 suggests that GmWRKY genes exhibit relatively low codon bias, meaning they tend to use a broader range of synonymous codons, which could reflect weak selection for codon optimization in these genes. In contrast, the CAI values ranged from 0.713 to 0.904, with an average of 0.839. The CAI is an indicator of how well a gene’s codon usage matches the preferred codon usage of highly expressed genes. CAI values closer to 1.0 reflect higher adaptation and potential higher expression efficiency27,58. The high average CAI in GmWRKY genes indicates that many of these genes have codon usage patterns optimized for efficient translation, possibly related to high gene expression levels in soybean. A unique codon usage pattern in the GmWRKY gene family is revealed by these results, characterized by low codon bias (NC) and high codon adaptation (CAI). This pattern indicates a balance between codon diversity and translation efficiency, with selection pressure optimizing high expression levels of GmWRKY transcription factors despite low codon bias. An enhanced understanding of the selection pressures influencing genetic regulation and translation efficiency in GmWRKY genes is provided by these findings58. Correlation analysis between CUB indices The analysis of CUB in GmWRKY transcription factors revealed significant correlations between various indices, as determined by Spearman rank correlation (Fig. 2). Specifically, T3s and A3s showed a moderately strong positive correlation with CAI (r = 0.58 and 0.31; p < 5E − 13, respectively), while G3s, C3s, and GC3s exhibited a moderately strong negative correlation with CAI (r = − 0.32, − 0.42, and − 0.51; p < 5E − 13, respectively). The results indicate that codon usage in GmWRKY genes is linked to gene expression. The choice of specific codons (the third base in synonymous codons) in the GmWRKY gene family is not random but rather seems to be connected to how much a gene is expressed. A3s and T3s show a positive correlation with CAI, suggesting that A/T-rich codons are favored in highly expressed genes, while G3s and C3s show a negative correlation, indicating lower expression with G/C-rich codons. This suggests selective pressure for A/T-rich codons to optimize translation efficiency in these genes. Correlation matrix with hierarchical clustering. Note: *p < 0.05 **p < 0.01 ***p < 0.001. Blank cells indicate nonsignificant correlations. The correlation analysis between NC and CAI revealed a strong negative correlation (r = − 0.52, p < 7e − 05), indicating that genes with relatively higher codon bias tend to have greater adaptiveness and higher expression levels. This finding is consistent with similar studies on GmWRKY genes in other plant species, such as Helianthus annuus18, Brassica rapa and Arabidopsis thaliana17. RSCU value analysis and determination of putative optimal codons RSCU values were calculated to assess codon usage preferences59. The RSCU value represents the ratio of a codon’s observed frequency to its expected frequency, indicating the relative preference among synonymous codons for a given amino acid58. An RSCU value of 1 indicates unbiased codon usage, suggesting equal or random selection. Values above 1 reflect biased usage, indicating preferred codons, while values below 1 suggest lower preference18. Specifically, codons with RSCU values greater than 1.6 are classified as overrepresented, while those below 0.6 are considered underrepresented60. RSCU values for all genes are visualized as a heatmap (Fig. 3A), and the RSCU values from concatenated sequences are displayed as a deviation graph (Fig. 3B). The heatmap shows a preference for A/T-ending codons over G/C-ending codons. The deviation graph highlights specific codon usage patterns, revealing that 27 codons are preferred, 32 have lower preference, and 20 of the preferred codons are A/T-ending, while 7 are G/C-ending, justifying the heatmap. This bias toward A/T-ending codons aligns with compositional constraints influencing codon usage in Helianthus annuus WRKY genes. Additionally, 7 underrepresented codons were identified, 6 of which are G/C-ending, while 2 overrepresented codons, AGA and AGG, stand out (Fig. 3B). (A) Heatmap displaying normalized relative synonymous codon usage (RSCU) values for 59 codons across 179 GmWRKY CDS grouped using k-means clustering. (B) Deviation plot illustrating baseline-adjusted RSCU values (reference value 1) for the same 59 codons based on concatenated GmWRKY CDS. Color coding corresponds to different RSCU value range (red > 1.6; yellow < 0.6; grey ~ others). Neutrality plot shows an important role of selective forces The neutrality plot was employed to illustrate the relationship between GC3 and GC12 values, allowing for an assessment of the impacts of mutational and selective forces60. A slope close to 1 on the regression line indicates that codon usage is mainly influenced by mutational forces, while deviations from 1 suggest the presence of selective pressures28. The regression analysis between GC3 and GC12 demonstrated a weak but statistically significant positive correlation where GC3 accounts for 14% of the variation in GC12 (Fig. 4A). The slope of 0.162 indicates that relative neutrality is 16.2%, while the relative constraint is 83.8%, suggesting that selective forces (83.8%) dominate over mutational forces (16.2%)60. Additionally, the weak but significant positive correlation between GC12 and GC3 (r = 0.374, p < 0.001) reinforces the subtle impact of mutational forces. Different codon usage bias indices. (A) Neutrality plot with regression equation, R2, and p value. GC12 represents the average G + C content at the first and second codon positions while GC3 represents the G + C content at the third codon position. The grey shaded area around the regression line represents the confidence interval (95%); (B) NC plot. The solid curve illustrates the expected gene positions under the assumption that codon usage is solely influenced by GC3 composition; (C) CDF plot for NC and eNC values; (D) Frequency distribution of (eNC−NC)/eNC with % of genes under each bin width; (E) PR2 plot. The mean values are 0.463 ± 0.054 for A3/(A3+T3) and 0.476 ± 0.069 for G3/(G3+C3). The lines are centered at 0.5. A3/(A3+T3) represents the ratio of A to A + T at the third position of the codon while G3/(G3+C3) represents the ratio of G to G + C at the third position of the codon. NC-plot shows significant deviation from neutral expectations An NC-plot is commonly used to examine the impact of GC3s composition on codon bias, reflecting both mutational pressure and compositional effects31. If codon usage is driven solely by random mutational forces, data points will align with or lie just below the GC3 curve. However, when selection or other non-neutral forces are at play, the points fall well below the curve60,61. In this study, most data points lie below the GC3 curve, indicating that selection, rather than random mutation, plays a dominant role in shaping codon usage in GmWRKY genes (Fig. 4B)60. The Kolmogorov–Smirnov test supports this, revealing a significant difference between the distributions of NC and eNC (p < 5e − 14), with the NC’s CDF being lower than the eNC CDF (Fig. 4C), suggesting that NC values are generally smaller than eNC values. To provide additional support for this interpretation, the (eNC-NC)/eNC ratio for GmWRKY genes was calculated, and the frequency distribution was determined (Fig. 4D). Among the analyzed GmWRKY genes, a negative (eNC-NC)/eNC value was exhibited by a minority of genes (5%), while a positive value was shown by the majority (95%). This observation suggested that most of the observed NC values did not closely align with the expected values and were less related to the eNC, further emphasizing the close relationship between codon bias in GmWRKY genes and GC3s, which is primarily influenced by natural selection18. PR2-bias plot reveals pyrimidine is favored over purine bases A parity rule 2 (PR2) bias measures the relative frequencies of A and T compared to C and G at the third position of codons62. This analysis looks at the bias between A/T and C/G, where a value of 0.5 indicates an equal use of purines (A and G) and pyrimidines (C and T)63. Values below 0.5 suggest a preference for pyrimidines over purines and vice versa60. In this study, the average values were x = 0.476 ± 0.069 and y = 0.463 ± 0.054, both below 0.5. This suggests a preference for T over A and C is favored over G (Fig. 4E)60. Promoter analysis reveals potential context dependency of CUB’s effect on translational efficiency TFBS are specific sequences within the promoter region where transcription factors (proteins that regulate gene expression) bind. The presence and arrangement of these sites can significantly influence the activity of the promoter and, consequently, gene expression64. In this study, promoter analysis reveals a total of 703 unique TFBSs were identified in the promoter regions of 179 GmWRKY genes. Of these, 61 TFBSs exhibited significant correlations with the CAI, showing their probable connection with the translational selection of these genes (Table S5). The correlation values ranged from -0.205 to -0.150 for negatively correlated TFBSs (28 TFBSs) and from 0.149 to 0.247 for positively correlated TFBS (33 TFBS) (Table S5). Similarly, 42 TFBSs demonstrated significant correlations with the NC, highlighting their probable connection with CUB (Table S5). Among these, 22 TFBS were negatively correlated, with values ranging from − 0.236 to − 0.151, and 20 were positively correlated, with values ranging from 0.149 to 0.204 (Table S5). Of particular note, 13 TFBS were found to be significantly correlated with both CAI and NC. These transcription factors included members of the DOF, ARF, MYB, and ERF families, among others. For instance, DOF3.2 showed a negative correlation with CAI (r = -0.178, padj = 0.042) and a positive correlation with NC (r = 0.153, padj = 0.044). Other examples include ERF15, which exhibited the highest positive correlation with CAI (r = 0.247, padj = 0.038) and a negative correlation with NC (r = -0.153, padj = 0.044) (Table 1). The identification of 13 TFBS correlated with both CAI and NC potentially indicates that the effects of codon usage on gene expression are promoter context-dependent65. Table 1Correlation between TFBSs and the CUB indices (*p < 0.05; padj: p-value adjusted using the Benjamini–Hochberg correction).Transcription factorMatrix IDFamilyCAINCRppadjRppadjARF36MA1695.2ARF− 0.154620.03877*0.04500*0.194100.00923*0.04438*DOF1.7MA1277.2DOF− 0.159640.03280*0.04500*0.167350.02515*0.04438*DOF3.2MA1270.2DOF− 0.178260.01697*0.04200*0.152550.04149*0.04438*ERF15MA1231.3ERF/DREB0.247030.00086*0.03800*− 0.152770.04119*0.04438*ERF011MA1219.3ERF/DREB0.190330.01071*0.03800*− 0.182710.01436*0.04438*ERF012MA1248.2ERF/DREB0.175940.01848*0.04200*− 0.160080.03231*0.04438*estExt_gwp_gw1.C_550163MA2386.1ERF/DREB0.152860.04107*0.04500*− 0.154200.03931*0.04438*PHYPADRAFT_182268MA1008.2ERF/DREB0.152860.04107*0.04500*− 0.154200.03931*0.04438*HHO5MA1164.2GARP_G2− like0.167320.02517*0.04500*− 0.172580.02088*0.04438*IDD4MA1371.2IDD0.196600.00835*0.03800*− 0.156760.03612*0.04438*PK06182.1MA2354.1MYB0.154250.03925*0.04500*− 0.195880.00859*0.04438*MYB3MA1038.2MYB0.150660.04411*0.04600*− 0.153750.03990*0.04438*NAC038MA2033.2NAC0.180060.01587*0.04200*− 0.171710.02155*0.04438* Correlation between TFBSs and the CUB indices (*p < 0.05; padj: p-value adjusted using the Benjamini–Hochberg correction). Phylogenetic reconstruction reveals 11 clades with high bootstrap values The maximum likelihood tree derived from IQTREE was visualized in TreeViewer and rooted at the outgroup, WRKY47 (NM_116402.4) gene of A. thaliana (Fig. 5A). The choice to use A. thaliana WRKY47 as an outgroup was critical in establishing evolutionary directionality, allowing clearer identification of ancestral and derived lineages. In the large, conserved WRKY gene family, this step provided greater confidence in clade delineation, leading to a more stable and interpretable phylogenetic framework. The analysis reveals 11 clades (C1, C2, C3, C4, C5a, C5b, C5c, C6, C7, C8a, and C8b) with high bootstrap values (> 90) (Fig. 5B). These clades were used for subsequent analysis for detecting selection signatures (Table S4, Figure S1). Phylogenetic tree for 179 G. max and one Arabidopsis thaliana WRKY gene reconstructed by maximum-likelihood (ML) under the KOSI07 + F + R7 model with IQ-TREE v2.3.6 using the CDS. The tree is rooted at the outgroup A. thaliana WRKY gene for clear clade delineation. Clades were selected based on high bootstrap values (> 90). (A) Clades are designated as C1, C2, C3, C4, C5a, C5b, C5c, C6, C7, C8a, and C8b (color-coded counter-clockwise starting form sky-blue and ending in red) (Figure S1). 12 branches C1 (Glyma.09G005700.1, Glyma.18G092200.1), C4 (Glyma.10G171200.1), C5c (Glyma.19G094100.1, Glyma.06G168400.1, Glyma.05G203900.1), C6 (Glyma.19G177400.1), C7 (Glyma.16G219800.1, Glyma.03G256700.1, Glyma.08G021900.1), C8b (Glyma.11G021200.1, Glyma.08G078700.1) were identified as the foreground branches in the branch and branch-site tests of positive selection based on their ω ratio (> 1) produced by the free-ratio branch model. (B) Tree showing nodes’ scores using branch color. Note: Support2 is the bootstrap support value produced by IQTREE2. CODEML analysis reveals the prevalence of purifying selection force To investigate selection forces’ signatures on the GmWRKY gene family, site models implemented in CODEML were utilized to assess variable ω ratios across codon sites. Comparisons between the M0, M1a, and M3 models indicated significant variation in selective pressures, with LRTs of M0 vs. M1a and M0 vs. M3 showing substantial heterogeneity (p < 1e − 9) across clades C1 to C8b (Table 2). This analysis revealed that certain sites are under purifying selection (ω < 1), while others are evolving neutrally (ω ≈ 1). However, these comparisons were not able to provide evidence of positive selection. To further investigate positive selection, M1a vs. M2a and M7 vs. M8 models were applied. Although no significant positive selection was detected in the M1a vs. M2a comparisons (p > 0.05), significant evidence of positive selection was observed in clades C6 (2Δℓ = 8.444, p < 0.05) and C8b (2Δℓ = 6.905, p < 0.05) using the M7 vs. M8 comparison (Table 2). These results suggest that some sites within these clades have undergone positive selection, contributing to the functional divergence of GmWRKY genes. Table 2LRT of positive selection under site models (*Pr(ω > 1) > 95%; ** Pr(ω > 1) > 99%).CladesModel comparisonℓFree parametersdf2ΔℓPositively selectedsites (BEB/NEB)C1M0 vs. M1aℓ0 =− 19046.76737401377.437**ℓ1 =− 18858.0488541M0 vs. M3ℓ0 =− 19046.76737404547.280**ℓ1 =− 18773.1269944C2M0 vs. M1aℓ0 =− 12239.75778261278.306**ℓ1 =− 12100.6045827M0 vs. M3ℓ0 =− 12239.75778264344.227**ℓ1 =− 12067.6440130C3M0 vs. M1aℓ0 =− 6148.1215324195.115**ℓ1 =− 6100.5638425M0 vs. M3ℓ0 =− 6148.12153244138.674**ℓ1 =− 6078.78440928C4M0 vs. M1aℓ0 =− 32116.22997681701.329**ℓ1 =− 31765.5652469M0 vs. M3ℓ0 =− 32116.229976841162.170**ℓ1 =− 31535.1445472C5aM0 vs. M1aℓ0 =− 2464.77020616146.745**ℓ1 =− 2441.39767617M0 vs. M3ℓ0 =− 2464.77020616451.290**ℓ1 =− 2439.12474620C5bM0 vs. M1aℓ0 =− 9004.824669301249.885**ℓ1 =− 8879.88177631M0 vs. M3ℓ0 =− 9004.824669304392.293**ℓ1 =− 8808.67768334C5cM0 vs. M1aℓ0 =− 5766.52097732180.965**ℓ1 =− 5726.03841733M0 vs. M3ℓ0 =− 5766.520977324211.088**ℓ1 =− 5660.97669936C6M0 vs. M1aℓ0 =− 4733.17306212155.320**ℓ1 =− 4705.51286813M0 vs. M3ℓ0 =− 4733.17306212463.183**ℓ1 =− 4701.58106316M7 vs. M8ℓ0 =− 4705.8365491328.443*59*, 413*, 537*, 560*ℓ1 =− 4701.61475715C7M0 vs. M1aℓ0 =− 15625.64499501246.569**ℓ1 =− 15502.3604351M0 vs. M3ℓ0 =− 15625.64499504441.874**ℓ1 =− 15404.7079654C8aM0 vs. M1aℓ0 =− 10671.44685361179.194**ℓ1 =− 10581.8498237M0 vs. M3ℓ0 =− 10671.44685364349.102**ℓ1 =− 10496.8956440C8bM0 vs. M1aℓ0 =− 14770.46372461365.458**ℓ1 =− 14587.7343947M0 vs. M3ℓ0 =− 14770.46372464580.636**ℓ1 =− 14480.1453350M7 vs. M8ℓ0 =− 14483.12974726.905*952*ℓ1 =− 14479.6771249The critical values are χ1,0.1\%2 = 10.82 (i.e., 1 degree of freedom at 0.1% significance), χ2,5\%2 = 5.99 (i.e., 2 degree of freedom at 5% significance), χ4,0.1\%2 = 18.46 (i.e., 4 degrees of freedom at 0.1% significance); 2Δℓ is the LRT statistic; df is the degrees of freedom. Only significant LRT results are presented here. Blank cells under the 'Positively selected sites’ column indicate no positively selected sites were not found for the respective case. LRT of positive selection under site models (*Pr(ω > 1) > 95%; ** Pr(ω > 1) > 99%). The critical values are χ1,0.1\%2 = 10.82 (i.e., 1 degree of freedom at 0.1% significance), χ2,5\%2 = 5.99 (i.e., 2 degree of freedom at 5% significance), χ4,0.1\%2 = 18.46 (i.e., 4 degrees of freedom at 0.1% significance); 2Δℓ is the LRT statistic; df is the degrees of freedom. Only significant LRT results are presented here. Blank cells under the 'Positively selected sites’ column indicate no positively selected sites were not found for the respective case. The free-ratio branch model identified lineage-specific selection, detecting positive selection signals in 12 branches with ω ratios greater than 1 (Table 3). These branches were then selected as foreground branches to confidently assess the positive selection signatures using statistically robust models, including the two-ratio branch model and branch-site models (A and A1). Table 3Foreground branches selected for further study in two-ratio branch model and branch-site model A and A1 (model A with ω = 1).Gene lineage as foreground branchCladeOmega (ω) ratioGlyma.09G005700.1C11.803Glyma.18G092200.1C11.088Glyma.10G171200.1C41.380Glyma.19G094100.1C5c1.838Glyma.06G168400.1C5c2.378Glyma.05G203900.1C5c1.276Glyma.19G177400.1C64.000Glyma.16G219800.1C71.146Glyma.03G256700.1C71.123Glyma.08G021900.1C71.334Glyma.11G021200.1C8b1.333Glyma.08G078700.1C8b1.106 Foreground branches selected for further study in two-ratio branch model and branch-site model A and A1 (model A with ω = 1). Within clade C1, the foreground branch Glyma.18G092200.1 exhibited a significant likelihood ratio test (LRT) result (2Δℓ = 11.214, p < 0.001) with ω = 1.7049, indicating positive selection (Table 4). In clade C4, Glyma.10G171200.1 demonstrated the strongest signal of positive selection (2Δℓ = 26.391, p < 1e − 6, ω = 10.79312), suggesting adaptive evolution in this lineage. Clade C5c also showed significant LRT results for Glyma.06G168400.1 and Glyma.05G203900.1 (2Δℓ = 13.395, p < 5e-4; 6.053, p < 0.05), with ω = 1.329 and 0.8633, respectively, indicating that these genes may have undergone adaptive changes related to stress response mechanisms. In clade C7, the foreground branch Glyma.16G219800.1 displayed moderate positive selection (2Δℓ = 4.121, p < 0.05, ω = 1.8434), while in clade C8b, Glyma.11G021200.1 and Glyma.08G078700.1 exhibited strong positive selection (2Δℓ = 7.374, p < 0.01; 18.453, p < 5e-5, ω = 2.7235 and 9.8929, respectively), highlighting these genes as potential candidates for further functional analysis (Table 4). Table 4LRT under branch models (*p < 0.05, **p < 0.01).CladesModel comparisonℓEstimates ofparametersFree parametersdf2ΔℓC1Null model(M0, unrooted tree)ℓ0 =− 19046.76737ω = 0.306240111.21488Alternative model (branch model, Glyma.18G092200.1 as foreground, unrooted tree)ℓ1 =− 19041.15993ω0 = 0.2985,ω1 = 1.704941C4Null model (M0, unrooted tree)ℓ0 =− 32116.22997ω = 0.2826668126.391584Alternative model (branch model, Glyma.10G171200.1 as foreground, unrooted tree)ℓ1 =− 32103.03418ω0 = 0.27496,ω1 = 10.7931269C5cNull model (M0, unrooted tree)ℓ0 =− 5766.520977ω = 0.202532113.395072Alternative model (branch model, Glyma.06G168400.1 as foreground, unrooted tree)ℓ1 =− 5759.823441ω0 = 0.18423,ω1 = 1.329933Null model (M0, unrooted tree)ℓ0 =− 5766.520977ω = 0.20253216.053388Alternative model (branch model, Glyma.05G203900.1 as foreground, unrooted tree)ℓ1 =− 5763.494283ω0 = 0.19539,ω1 = 0.8633233C7Null model (M0, unrooted tree)ℓ0 =− 15625.64499ω = 0.36355014.121438Alternative model (branch model, Glyma.16G219800.1 as foreground, unrooted tree)ℓ1 =− 15623.58427ω0 = 0.3590,ω1 = 1.843451C8bNull model (M0, unrooted tree)ℓ0 =− 14770.46372ω = 0.26034617.374452Alternative model (branch model, Glyma.11G021200.1 as foreground, unrooted tree)ℓ1 =− 14766.7765ω0 = 0.2548,ω1 = 2.723547Null model (M0, unrooted tree)ℓ0 =− 14770.46372ω = 0.260346118.453122Alternative model (branch model, Glyma.08G078700.1 as foreground, unrooted tree)ℓ1 =− 14761.23716ω0 = 0.2495,ω1 = 9.892947The critical values are χ1,5%2 = 3.84 (i.e., 1 degree of freedom at 5% significance) χ1,1%2 = 6.63 (i.e., 1 degree of freedom at 1% significance); 2Δℓ is the LRT statistic; df is the degrees of freedom. Only significant results are presented here. See Table S1 for the complete analysis. LRT under branch models (*p < 0.05, **p < 0.01). Null model (M0, unrooted tree) ω0 = 0.2985, ω1 = 1.7049 ω0 = 0.27496, ω1 = 10.79312 ω0 = 0.18423, ω1 = 1.3299 ω0 = 0.19539, ω1 = 0.86332 ω0 = 0.3590, ω1 = 1.8434 ω0 = 0.2548, ω1 = 2.7235 ω0 = 0.2495, ω1 = 9.8929 The critical values are χ1,5%2 = 3.84 (i.e., 1 degree of freedom at 5% significance) χ1,1%2 = 6.63 (i.e., 1 degree of freedom at 1% significance); 2Δℓ is the LRT statistic; df is the degrees of freedom. Only significant results are presented here. See Table S1 for the complete analysis. Branch-site models provided further evidence of episodic positive selection. In clade C4, Glyma.10G171200.1 exhibited an extremely high ω (549.44675), and BEB analysis identified sites 992C, 1288P (> 95% probability), and 1275R (> 99% probability) under positive selection (Tables 5, 6). Similarly, clade C5c (Glyma.05G203900.1) exhibited strong positive selection, with BEB analysis pinpointing sites 279 V, 282S, 284H, and 297R as positively selected residues. In clade C8b, Glyma.08G078700.1 showed significant positive selection (ω = 24.92899), with Naïve Empirical Bayes (NEB) analysis66 revealing site 952 under selection with > 95% probability. Table 5Maximum-likelihood estimates of parameters in the ω distribution under the branch-site Model A.CladesForeground branchSite classProportionBackground ωForeground ωC4Glyma.10G171200.10p0 = 0.34214ω0 = 0.13213ω0 = 0.132131p1 = 0.51079ω1 = 1.00000ω1 = 1.000002ap2a = 0.05899ω0 = 0.13213ω2 = 549.446752bp2b = 0.08807ω1 = 1.00000ω2 = 549.44675C5cGlyma.05G203900.10p0 = 0.50210ω0 = 0.11867ω0 = 0.118671p1 = 0.40538ω1 = 1.00000ω1 = 1.000002ap2a = 0.05119ω0 = 0.11867ω2 = 55.458042bp2b = 0.04133ω1 = 1.00000ω2 = 55.45804C8bGlyma.08G078700.10p0 = 0.52735ω0 = 0.13784ω0 = 0.137841p1 = 0.43621ω1 = 1.00000ω1 = 1.000002ap2a = 0.01994ω0 = 0.13784ω2 = 24.928992bp2b = 0.01650ω1 = 1.00000ω2 = 24.92899The branch-site model includes four site classes (0, 1, 2a, 2b) with distinct ω ratios for foreground and background lineages. Site class 0 is under purifying selection across all branches (0 < ω0 < 1) while site class 1 undergoes neutral evolution (ω1 = 1). In site classes 2a and 2b foreground branches experience positive selection (ω2 > 1) whereas background branches are either under purifying selection (0 < ω0 < 1) or neutral evolution (ω1 = 1). Only significant results are presented here. See Table S2 for the complete analysis. Maximum-likelihood estimates of parameters in the ω distribution under the branch-site Model A. The branch-site model includes four site classes (0, 1, 2a, 2b) with distinct ω ratios for foreground and background lineages. Site class 0 is under purifying selection across all branches (0 < ω0 < 1) while site class 1 undergoes neutral evolution (ω1 = 1). In site classes 2a and 2b foreground branches experience positive selection (ω2 > 1) whereas background branches are either under purifying selection (0 < ω0 < 1) or neutral evolution (ω1 = 1). Only significant results are presented here. See Table S2 for the complete analysis. Table 6Branch-site test of positive selection along the foreground branches (*Pr(ω > 1) > 95%; ** Pr(ω > 1) > 99%).CladesModel comparisonℓFree parametersdf2ΔℓPositively selectedsites (BEB/NEB)C4Glyma.10G171200.1 as the foreground (unrooted)Null model(model A with ω2 = 1)ℓ0 =− 31754.6937170119.610552992*, 1288*, 1275**Alternative model (model A)ℓ1 =− 31744.88843711C5cGlyma.05G203900.1 as the foreground (unrooted)Null model(model A with ω2 = 1)ℓ0 =− 5716.05547734113.18009279*, 282**,284**, 297**Alternative model (model A)ℓ1 =− 5709.465432351C8bGlyma.08G078700.1 as the foreground (unrooted)Null model(model A with ω2 = 1)ℓ0 =− 14587.693894816.498984952*Alternative model (model A)ℓ1 =− 14584.44439491The critical values are χ1,5\%2 = 3.84 (i.e., 1 degree of freedom at 5% significance) χ1,1\%2 = 6.63 (i.e., 1 degree of freedom at 1% significance); 2Δℓ is the LRT statistic; df is the degrees of freedom. Only significant results are presented here. See Table S3 for the complete analysis. Branch-site test of positive selection along the foreground branches (*Pr(ω > 1) > 95%; ** Pr(ω > 1) > 99%). Null model (model A with ω2 = 1) Null model (model A with ω2 = 1) 279*, 282**, 284**, 297** Null model (model A with ω2 = 1) The critical values are χ1,5\%2 = 3.84 (i.e., 1 degree of freedom at 5% significance) χ1,1\%2 = 6.63 (i.e., 1 degree of freedom at 1% significance); 2Δℓ is the LRT statistic; df is the degrees of freedom. Only significant results are presented here. See Table S3 for the complete analysis. Cumulatively, significant heterogeneity in selective pressures was observed across the GmWRKY gene family, with strong evidence of episodic positive selection detected in certain clades, particularly clades C4, C5c, and C8b. These findings suggest that positive selection may have contributed to the functional diversification of WRKY transcription factors, especially in response to biotic and abiotic stresses. Ancestral sequences reveal relaxation of selective pressure on modern GmWRKY genes The ancestral sequences and modern sequences of the GmWRKY gene family were analyzed for CUB and selection pressure. Shapiro–Wilk tests confirmed that the data did not follow a normal distribution. For the ancestral sequences, CAI values (p < 0.001) and NC values (p < 0.001) were non-normally distributed, as were the filtered subsets for CAI (p < 0.001) and NC (p < 0.001). A Spearman’s correlation test was conducted between the CAI and NC values for the ancestral sequences. A significant negative correlation was observed (Spearman’s ρ = − 0.486, p < 0.001), indicating that as codon adaptation increases, codon usage diversity decreases. To compare CUB and selection pressure between ancestral and extant sequences, Mann–Whitney U tests were performed. The results revealed highly significant differences in CAI values (p < 0.001) (Fig. 6A), NC values (p < 0.001) (Fig. 6B), and ω ratios (p < 0.001) (Fig. 6C) between ancestral and extant sequences, suggesting distinct evolutionary dynamics in codon usage and selective pressures between the two groups. Violin plots comparing ancestral and modern GmWRKY genes based on Mann–Whitney U tests for (A) Codon adaptation index (CAI) (B) Effective number of codons (NC) and (C) omega (ω) ratio (dN/dS). Significant differences (****p < 1e-4) between ancestral and extant sequences were observed for all comparisons. The width of each violin represents the distribution of values and horizontal lines indicate the median. Discussion Genetic codes are transmitted through codons, sequences of three nitrogenous bases, with 61 codons encoding 20 amino acids and three acting as stop signals. CUB reflects the non-random use of synonymous codons and varies across species, shaped by factors like natural selection, mutation rates, and gene expression67,68. CUB influences key processes like protein translation and gene expression69. In plants, WRKY transcription factors, critical for development and stress response, show distinct CUB patterns, which can reveal evolutionary dynamics70. This study investigates the selection pressures on CUB in GmWRKY genes, providing insights that could enhance gene expression and transgenic crop efficiency. In this light, various studies have been undertaken to understand the CUB dynamics among various plant species17–19,71. However, no previous work has described the selection pressure on codon usage patterns of WRKY genes in soybean. Hence, the present research focuses on the evolutionary forces shaping codon preferences in a panel of 179 selected GmWRKY genes. Nucleotide composition is imperative in knowing codon usage since many of the parameters associated with codon usage indices, including nucleotide skew, neutrality, and parity plots, are composition-dependent60,68,72. Compositional analysis revealed that %T occurrence was highest, with the lowest occurrence of %G and GC3s was 41.25%. Additionally, parity analysis showed a preference for pyrimidine bases (C/T) over purines (A/G) at the third position of codons. Several studies indicate skews significantly correlate with NC, indicating that skewness can influence CUB73. Furthermore, RSCU analysis revealed a preference for A/T-ending codons over C/G-ending ones, with 87.5% of underrepresented codons being G/C-ending. However, the overrepresentation of AGA and AGG codons, both encoding arginine, may be due to specific constraints on this amino acid within the gene family, deviating from the overall trend and warranting further investigation. These findings suggest that RSCU bias reflects the genome-wide nucleotide preferences, influenced by intrinsic characteristics and evolutionary forces such as selection and mutation73. The linear relationship between GC12 and GC3 exhibits a slope of 0.162 and mild but statistically significant positive correlation (r = 0.374, p < 0.001), indicating that while mutational forces, represented by relative neutrality of 16.2%, have a subtle impact while, selection forces, indicated by relative constraints of 83.8%, play a more dominant role in shaping codon usage60. This is further supported by the relationship between NC and GC3s, where the observed NC values are significantly lower than the expected NC values18. This discrepancy suggests that mutational forces alone cannot fully account for the distribution of the observed NC values, highlighting the stronger influence of other robust evolutionary forces, like selection force70,74. CAI values in this study ranged from 0.713 (Glyma.05G160800.1) to 0.904 (Glyma.08G218600.1) with an average of 0.839 ± 0.037. The higher CAI value for Glyma.08G218600.1 likely indicates a high level of gene expression58. For comparison, the lpp gene in Escherichia coli has a CAI of 0.85, reflecting high expression75. However, despite the high CAI values observed, the NC was also high, indicating relatively low codon bias as compared to studies performed on other plant species like H. annus18, A. thaliana, B. rapa17, etc. This finding contrasts with the general expectation that highly expressed genes, indicated by high CAI, should exhibit low NC values due to stronger codon bias. Related studies in E. coli genes have shown a positive correlation between CAI and gene expression75. However, some highly expressed genes exhibited low CAI values, suggesting that factors beyond codon bias, such as mutation-selection balance, may also play a role in regulating gene expression75. This unexpected relationship in this study could be attributed to complex mutation-selection dynamics and/or compositional constraints, supporting the idea that gene expression is driven not only by codon bias but also by base composition, which in turn directly affected by the mutation-selection balance, as also described by Sahoo et al. in A. thaliana71. Codon bias and its effect on gene expression is affected by several factors, and promoter context is one of them65. This study finds that CUB and 13 TFBS in the promoter sequences of GmWRKY genes were significantly correlated (positive or negative) with the CAI and NC values. In the analysis, distinct patterns emerged among transcription factor families concerning their correlations with CAI and NC, reflecting their roles in regulating CUB. DOF transcription factors (DOF3.2, DOF1.7) showed negative correlations with CAI and positive correlations with NC, indicating lower CUB, which may regulate translation efficiency during critical phases like dormancy, seed development, germination, or light responses76. In contrast, MYB3 displayed a positive CAI correlation and negative NC correlation, suggesting strong codon bias and more efficient translation, particularly under stress77. Similarly, ARF and ERF transcription factors (ARF36, ERF012, ERF011, ERF15) showed high CUB, likely linked to the need for rapid protein synthesis in response to hormonal signals78. NAC038, another key stress-responsive TF, also exhibited high CUB, reflecting efficient protein production under stress79. Notably, 13 transcription factors80, including HHO5, IDD4, and PK06182.1, showed dual correlations with both CAI and NC, indicating highly optimized codon usage and suggesting their role in promoting efficient translation alongside transcriptional regulation, especially in stress responses or developmental transitions. An evaluation of selective forces on the gene family, both site-specific and lineage-specific, revealed significant variation in the ω ratio across codon sites and branches. While strong purifying selection was widespread, positive selection appeared sporadically in both sites and branches. Three branches among 179, showing significant positive selection may reflect neofunctionalization to adapt to environmental changes. Overall, the analysis highlights the importance of widespread selective pressure, supporting earlier findings that other evolutionary forces, stronger than mutation, shape codon bias in this gene family. However, the study does not assess the role of selective sweeps, another strong evolutionary force known to influence codon bias73, leaving this area open for future research. Also, A moderately strong negative correlation (r = − 0.519) between the CAI and ω ratio values was found across 11 genes, but it was not statistically significant (p > 0.05). This aligns with the idea that positively selected genes often relax codon preferences68. The small sample size may explain the lack of significance. Power analysis suggests that 21 genes are needed to detect a significant effect (power = 0.8), indicating that the current sample size is inadequate despite the strong correlation (Script S4). This aspect could also be addressed in future studies. An interesting evolutionary trend emerged from the ancestral sequence reconstruction study, showing that selective forces were stronger on ancestral sequences compared to modern ones. Codon bias and gene expression in ancestral sequences were under greater selective pressure. This suggests that the influence of evolutionary forces on codon bias has weakened in modern sequences, allowing for a broader range of codon preferences70. This finding likely explains the observation recorded in this study regarding relatively lower codon bias in modern GmWRKY genes, as reflected by their relatively higher NC values. This study sheds light on the evolutionary dynamics and evolutionary trend of codon bias in WRKY genes in soybean, showing that selection pressures, particularly in ancestral sequences, significantly influence codon preferences alongside subtle mutational forces. The findings, which highlight the relationship between CUB and transcription factor binding sites, can be leveraged to optimize codon usage in transgenes, enhancing gene expression and stress responses in soybean and other crops. By focusing on preferred codons and specific transcription factors, researchers can use state-of-the-art biotechnological tools to improve crop resilience and contribute to food security. Conclusion A comprehensive analysis of the evolutionary trajectory of codon usage in the GmWRKY gene family reveals a clear preference for A/T-ending codons in the gene family. There was also a relatively high CAI value that prevails across all 179 genes, suggesting high levels of gene expression throughout the gene family. Notably, it was observed that gene expression is influenced by compositional constraints. C/G-ending codons were underrepresented, which aligns with our RSCU analysis showing that 87.5% of underrepresented codons end with C/G, and the pyrimidine skew in codons third position, evaluated through PR2-bias, appears to influence CUB as well. The neutrality plot highlights the significant role of selection forces in shaping codon utilization. There was also a negative correlation between codon bias and the ω ratio in genes under positive selection. This indicates that genes facing positive selection exhibit more relaxed codon preferences. Further, rigorous selection signature analysis using CODEML identified significant variability in the ω ratio across codon sites. Both branch and branch-site models indicated signatures of sporadic positive selection, particularly within clades C4, C5c, and C8b, while most lineages and codon sites exhibited to be under purifying selection. These findings suggest that although purifying selection predominantly shapes GmWRKY gene codon usage, episodic positive selection has fostered functional diversification in response to environmental stress. Comparative analysis with ancestral sequences indicates that modern GmWRKY genes have relaxed codon preferences (higher NC), reduced gene expression levels (lower CAI), and decreased selection constraints (higher ω ratios). This is probably due to the neofunctionalization of these genes which likely aids adaptation to varying environmental conditions and may contribute to the effects of domestication, offering potential adaptive advantages for crop improvement. Additionally, the correlation analysis between CAI and transcription factor binding sites reveals a complex interplay between transcriptional and translational processes. These insights could have important implications for optimizing transgene design and gene expression efficiency in soybean. By leveraging data on synonymous codon usage, codon pair bias, and CAI, we can develop synthetic transgene constructs to fine-tune gene expression and enhance crop resilience. However, several gaps remain. Functional validation of positively selected genes is necessary to confirm their roles in stress responses. Furthermore, exploring the relationship between regulatory elements and CUB, as well as codon co-occurrence, will deepen our understanding of translational efficiency. Expanding taxonomic comparisons, particularly with non-plant species, could provide a broader perspective on WRKY gene evolution. Addressing these gaps through functional studies and integrating multi-omics data will significantly enhance our understanding of soybean genetics and inform strategies for improving crop resilience. Supplementary Information Supplementary Information. Acknowledgements KS extends his gratitude to the global community for supporting open-access science and data reproducibility, which made this research possible. Special thanks to Nabanita Ghosh, Ph.D., Assistant Professor, Maulana Azad College, Kolkata for her constructive feedback. KS also acknowledges the freely available LLMs, used with care, for improving the manuscript’s language and readability. Author contributions K.S. conceived the idea, collected the data, analyzed the data, wrote the main and revised manuscript texts, and prepared the tables and figures. S.J., P.P., and B.B. collected the data. S.J. also assisted in analyzing the data for Fig. 2 and 3 and in proofreading the manuscript. All authors reviewed the manuscript. Funding This research received no funding. Data availability The GitHub repository at https://github.com/sinhakrishnendu/GmWRKY-CUB-CODEML.git contains all the supplementary materials in the form of raw and processed data, as well as all necessary scripts to replicate the analyses presented in this manuscript. Detailed instructions on how to reproduce the analyses, including configuration files and documentation, are also provided in the repository. Declarations 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. Supplementary Information The online version contains supplementary material available at 10.1038/s41598-024-77156-5. References Associated Data Supplementary Materials Supplementary Information. Data Availability Statement The GitHub repository at https://github.com/sinhakrishnendu/GmWRKY-CUB-CODEML.git contains all the supplementary materials in the form of raw and processed data, as well as all necessary scripts to replicate the analyses presented in this manuscript. Detailed instructions on how to reproduce the analyses, including configuration files and documentation, are also provided in the repository.