## 2 Materials and Methods
### Use of QLM and GBDT to Train the QPAML Model with Experimentally Validated Tryptophan Reactions  
GBDT and QLM have similarities: both use input variables, assign importance to each variable, and generate an output. However, GBDT automatically adjusts the importance of variables to minimize the error in the outputs using training data. On their part, the QLM construction seeks to minimize the difference between the predictions and the observed system output in the same way as GBDT. Therefore, we guide variable selection with QLM and evaluate the model performance with GBDT (see Figure 1). The overall classification of reactions obtained with this approach is the output of QPAML.  
Figure 1: Workflow used to build the QPAML model. First, the pFBA algorithm identifies 76 core reactions to produce tryptophan (T) from glucose (S), represented by the orange line fluxes in the figure. The FSEOF algorithm was then applied to the GEM after increasing the flux in each of the 76 enzymatic reactions to perturb them, as shown in the figure represented by P1-P4. The colored arrows represent the directions of fluxes and whether they increase flux to the main path for tryptophan synthesis and biomass or deviate from it to lateral reactions. The color of the arrows indicates the distribution of fluxes for perturbations P1 (yellow), P2 (gray), P3 (blue), and P4 (orange). Some lateral reactions are activated to compensate for the perturbations and maintain the cell’s growth state (B). The modified FSEOF algorithm generates a table with ten flux values for each of the 76 perturbations. These fluxes are converted into qualitative variables (see Section 2.10) to create a QLM. The GBDT is then trained with the selected qualitative variables and experimental evidence to assign a role in tryptophan production for each enzymatic reaction of GEM. The cycle is stopped if the model categorizes all the literature reactions correctly and no more variables are defined. Otherwise, another cycle is started by selecting new variables. Reactions with a cross symbolize no metabolic flux due to insufficient substrates or stoichiometric unfavourability. Reactions R3 and R4 represent salvage pathways, while R10-R12, R6, and R9 represent reactions unaffected by the production of the target metabolite but are crucial for biomass production. Lastly, reaction R2 represents a competing pathway for tryptophan production.  
Algorithm 1 describes the variable selection for QPAML model. A list of 40 genetic modifications validated in the literature for tryptophan production (See Supplementary Table S3) guided the classification as the ground truth label vector (\(y\)) [6; 7; 8; 9; 12; 13; 14; 15; 16]. A GBDT model (\(F\)) was trained by testing these qualitative variables (\(x\)) calculated from perturbated fluxes (\(V\)). When a new qualitative variable (\(X_{i}\)) was tested, the multi-class log-loss function (\(L\)) was calculated: if introducing \(X_{i}\) reduces \(L\), \(X_{i}\) is selected to construct the model; otherwise, it is discarded. This process continued until the loss function was zero or no more tested variables were available.  
```
0: Truth label vector \(y\)
```
0: Qualitative variables \(X\)
0: QPAML model \(F\)
1. Obtain pFBA optima reactions with Equation (2): \(V_{Optima}\)
2.\(V=[]\)
3.for\(v_{perturbed}\)in\(V_{Optima}\):
4. Calculate fluxes perturbing \(v_{perturbed}\) with Equation (3): \(v\)
5.\(V=V\cup[v]\)
6.endfor
7. Calculate\(X\) values using \(V\)
8.\(i=1\)
9.\(x=[]\)
10. While\(L(y,p)_{n}>0\)and\(X\
eq\emptyset\):
11.\(x=x\cup[X_{i}]\)
12. Fit\(F(x,y)\)
13. Calculate \(L(y,p)_{n+1}\)
14. If\(L(y,p)_{n+1}<L(y,p)_{n}\)then:
15.\(L(y,p)_{n}=L(y,p)_{n+1}\)
16. else:
17.\(x=x-[X_{i}]\)
18.endif
19.\(X=X-[X_{i}]\)
20.\(i=i+1\)
21.endwhile
22.return\(F\) ```
**Algorithm 1**QPAML model construction algorithm.