## 2 Materials and Methods
### Similarity Comparison  
Coelution is important to reveal the relationships between a precursor ion and its fragment ions [19]. The purpose of our experiment is to reconstruct the corresponding relationship between precursor and fragment ions through their high similarity. As shown in Figure 2, the XLCs can be defined as the curve of the intensity of mass spectra peak signal changing with retention time within a certain period. In this work, we set the retention time interval value of 1 min. For example, to extract the chromatogram of the precursor p in a precursor ion mass spectrum, it is necessary to find precursor ion mass spectra with a retention time of \(\pm\)0.5 min from the current precursor ion mass spectrum and then extract the peak intensity in these mass spectra within the threshold \(m/z\) range. When extracting the peak intensity, we extracted the peak intensity whose \(m/z\) difference with the ion was 0.02 Da, then combined these intensities to generate a chromatogram. Correlation has been widely used to generate pseudo-MS/MS spectra. We took advantage of the XLCs' consistency between the precursor and fragment ions and interpreted the MS/MS spectrum based on the ranking of precursor and fragment similarities. We calculated the cosine similarity C = corr (P, F) between all possible precursor XLCs and their fragment XLCs. P (p\({}_{1}\), p\({}_{2}\),..., p\({}_{n}\)), F (f\({}_{1}\), f\({}_{2}\),..., f\({}_{n}\)), as mentioned in the paper,  
Figure 2: Isolation window in MS1. refer to the extracted ion chromatogram profile (1 \(\ast\) n). This is a list of peak intensity values, and n represents the number of ions. The formula is as follows:  
\[\text{C}=\text{corr}(\text{P},\text{F})=\frac{\text{P}\cdot\text{F}}{||\text{P} ||||\text{F}||}=\frac{\frac{\sum\limits_{i=1}^{n}\text{P}_{i}\text{*f}_{i}}{ \sqrt{\sum\limits_{i=1}^{n}\left(\text{P}_{i}\right)^{2*}}\sqrt{\sum\limits_{i =1}^{n}\left(\text{f}_{i}\right)^{2}}} \tag{1}\]  
In this representation, one fragment ion can have multiple precursors, and several precursors can share the same fragment. The corr (F, Pi) of a fragment ion F is calculated based on the cosine similarity between the fragment and all candidate precursors. For a precursor ion P, the corr (F\({}_{i}\), P) is calculated based on the cosine similarity between the precursor and all possible fragments. The pseudo-code for the similarity calculation is shown in Algorithm 1. ```
Input: Peak intensity list of each precursor item1, peak intensity list of each fragment item2 Output: Cosine_similarity two-dimensional matrix result
1 device \(\leftarrow\) torch.device ('cuda' if torch.cuda_is_available () else 'cpu')
2 for i, pre in enumerate (item1) do
3 for j, frg in enumerate (time2) do
4 x, y \(\leftarrow\) torch.tensor (np.array([pre, frg]), dtype = torch.float64, device = device)
5 cos \(\leftarrow\) torch.nn.CosineSimilarity (dim = 0)
6 similar \(\leftarrow\) cos (x, y)
7 tmp_list \(\leftarrow\) similar.cpu ()
8 result[i] \(\leftarrow\) tmp_list
9 return result
```  
**Algorithm 1**Calculating cosine_similarity of chromatograms of precursors and fragments. All similarities form a two-dimensional matrix, as shown in Table 1.  
Then, we obtained the similarity of all candidate precursor ions and their fragmentions. As shown in Table 1, each row represents one precursor; we calculated the number of cosine similarity values greater than 0.6 in each row as the sorting method for all precursors within the isolation window range. Through the experimental test, we selected the top 30 precursor ions for each MS/MS spectra: one MS/MS spectrum was disassembled into 30 new pseudo-MS/MS spectra, corresponding to 30 precursor \(m/z\) (pepmass). We took all the fragment ions with a cosine similarity greater than 0.6 with the current precursor ion as the fragment ions of the newly generated pseudo-MS/MS spectrum. It is worth noting that, here, we needed to de-redundant the precursor before selecting the top precursor ion for each MS/MS spectrum.