## 5 Dynamic Pocket Feature Extraction
### High-Dimensional Pocket Similarity Calculation Based on P2V-DTW
#### 5.3.2 High-Dimensional Pocket Correlation Calculation Based on P2V-DTW  
We propose a novel P2V-DTW algorithm to calculate the correlation between two dynamic pockets. The P2V-DTW algorithm is used twice to solve the problem of different time length sequences and different alpha sphere number sequences, and calculate the correlation between pockets (Figure 6).  
First, calculate the distance between the mapping relationship of two static pocket vectors (the correlation between the two pocket alpha sphere vectors). Dist(\(i\),\(j\)) represents the distance between the \(i\)th alpha sphere vector in the first pocket and the \(j\)th alpha sphere vector in the second pocket, Dist(\(i\),\(j\)) given two vectors \(i\) and \(j\), and the remaining chords are similar given by the dot product and the vector length as follows:  
\[\text{Dist}(P_{i,a}^{1},P_{j,b}^{2})=\frac{\sum_{n=1}^{N}P_{i,a}^{1}P_{i,b}^{2 }}{\sqrt{\sum_{n=1}^{N}(P_{i,a}^{1})^{2}}\sqrt{\sum_{n=1}^{N}(P_{j,b}^{2})^{2}}}, \tag{5}\]  
where \(n\) is the word vector (alpha sphere vector) length, and we choose the length of the word vector as \(N\).  
Secondly, the distance between two dynamic pockets is calculated (the correlation between two static pockets). When calculating the correlation between the two static pockets, the number of alpha spheres between the two pockets is different (\(m\) is different), so the alpha spheres of the two static pockets may have local relationship dislocation. For the second time, DTW is used to align the pockets with different alpha sphere lengths, establish the alpha sphere mapping relationship between the two static pockets, stretch and align the pocket vectors with different alpha sphere lengths through mapping, and obtain the static pocket alpha sphere mapping relationship matrix, so as to complete the alignment of pocket alpha sphere lengths and the correction of local dislocation of pocket alpha spheres. The calculation method is as follows:  
Figure 5: Input and output of Word2 vec word vector.  
Figure 6: Dynamic pocket extraction and P2V-DTW similarity calculation pipeline.  
\[LD(P^{1}_{i,a},P^{2}_{j,b})=Dist(P^{1}_{i,a},P^{2}_{j,b}) \tag{6}\] \[+\min[LD(P^{1}_{i-1,a},P^{2}_{j,b}),LD(P^{1}_{i,a},P^{2}_{j-1,b}),LD (P^{1}_{i-1,a},P^{2}_{j-1,b})],\]  
where \(LD\) represents the normalized path distance between two pocket length sequences, \(P^{1}_{i,a}\) represents the pocket 1 with timestep is \(i\)th, pocket length is \(a\), \(P^{2}_{j,b}\) represents the pocket 2 with timestep is \(j\)th, and the pocket length is \(b\).  
Finally, when calculating the correlation between the two dynamic pockets, the timestep length of the two dynamic pocket matrix vectors is different (\(z\) is different), so the two dynamic pockets may have a dislocation relationship in local time. For the first DTW of dynamic pocket vector, the time mapping relationship between two dynamic pocket data is established. By mapping, two dynamic pocket vectors with different time lengths are stretched to the same length, and the dynamic pocket time mapping relationship matrix is obtained. The alignment of pocket time length and the correction of pocket local time dislocation are completed. The calculation method is as follows:  
\[TD(P^{1}_{i},P^{2}_{j})=LD(P^{1}_{i},P^{2}_{j}) \tag{7}\] \[+\min[TD(P^{1}_{i-1},P^{2}_{j}),TD(P^{1}_{i},P^{2}_{j-1}),TD(P^{1 }_{i-1},P^{2}_{j-1})],\]  
where \(TD\) represents the normalized path distance between two different pocket time sequences, \(P^{1}_{i}\) and \(P^{2}_{j}\) represents the pocket 1 with timesteps is \(i\) length, and pocket 2 with timesteps is \(j\) length.  
Dynamics pocket similarity is a scalar quantity normalised to be displayed as a pure quantity in the VAPPD system. The visualization system VAPPD is designed to help users understand the pocket characteristics of MD simulations through interactive exploration, which allows comparison throughout the dynamics process.