A descriptor space mapping molecular retrieval method, system and storage medium
By combining the descriptor space mapping method and the local metric module, the problem of inconsistent activity correlation between structurally similar surfaces in drug discovery and material molecule screening is solved, enabling effective candidate molecule screening under the condition of scarce annotation and supporting molecular design in multi-target scenarios.
Patent Information
- Application Number
- CN202611204679.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-10
- Publication Date
- 2026-11-06
AI Technical Summary
In drug discovery and material molecule screening, existing technologies struggle to screen candidate molecules with similar structural surfaces but inconsistent activity correlations using local metrics without relying on activity labeling. Furthermore, fixed metrics across the entire space are difficult to align with the direction of local activity discrimination.
The descriptor space mapping method is adopted, which maps the target molecules to chemical space coordinates by comparing the pre-trained mapping encoder with the self-supervised structure. Combined with the few-sample local metric module, a positive definite local metric matrix is synthesized on the local support set to screen out the candidate molecule set.
Even when labeling is scarce, it can still screen candidate molecules based on their activity relevance, providing a stable structural foundation, supporting molecular design in multi-target scenarios, and simplifying the search process.
Smart Images

Figure CN123053299A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of cheminformatics and computer-aided molecular design technology, and more specifically, to a molecular retrieval method, system, and storage medium based on descriptor space mapping. Background Technology
[0002] In drug discovery and material screening, given a target molecule, it is necessary to quickly identify candidate molecules with similar structures or properties from a set of compounds of a certain scale, even on the order of millions, to support subsequent drug-likeness assessment, structure-activity analysis, or synthesis prioritization. Common existing techniques include molecular fingerprinting or rule-based hard matching, approximate nearest neighbor retrieval based on vector databases of molecular descriptors, and encoding compound structures into neural network embedding vectors and then sorting the candidate set by similarity scores.
[0003] The aforementioned existing technologies still have the following technical problems in implementation: First, ranging or sorting often uses uniform equal-weight distances or fixed similarities across the entire space, which makes it difficult to reflect the differences in the direction and sensitivity of activity discrimination at different chemical spatial locations. A fixed metric for the entire library cannot simultaneously take into account activity cliff regions and flat regions. Second, the meaning of coordinate axes in deeply embedded or cross-modal semantic spaces is opaque. Molecules with similar structural surfaces but changed key pharmacophores are easily recalled together, and it is difficult to distinguish between activity retention and activity loss based on surface similarity. Third, in weakly labeled novel regions, direct regression of absolute activity lacks sufficient labeling support, while relying solely on structural neighbors is insufficient to organize candidate priority according to the degree of activity relevance.
[0004] In summary, the relevant technologies are still insufficient to synthesize positive definite local metrics that vary with location in the query neighborhood using a small number of active labels on a structural base that does not rely on active labels, and to complete the closed loop of screening for permissible conditions and outputting a list of candidate molecules for molecular design. Summary of the Invention
[0005] This invention provides a molecular retrieval method, system, and storage medium based on descriptor space mapping, which solves the technical problems in related technologies where the similarity of structural surfaces and the degree of proximity of activity correlation are inconsistent under weak annotation conditions, and the fixed measurement in the whole space is difficult to fit the local activity discrimination direction.
[0006] Firstly, this application provides a molecular retrieval method based on descriptor space mapping, comprising the following steps: S1. Obtain the structural representation of the target molecule and complete its normalization. Calculate the three types of features—topological, physicochemical, and substructure statistics—according to the unified molecular descriptor protocol, forming the descriptor vector and feature anomaly markers of the target molecule. S2, after standardizing the descriptor vector of the target molecule, it is fed into the self-supervised structure and compared with the pre-trained mapping encoder to transform it layer by layer, and the target molecule is mapped to its chemical space coordinates. S3 uses the same descriptor protocol and the same mapping encoder to perform offline coordinate transformation on the preset molecular library, builds an indexed preset molecular coordinate reference set, and simultaneously registers activity labels that can be searched by coordinate proximity; S4, at the chemical spatial coordinates of the target molecule, take the local support set recalled from the activity label registration, and synthesize the positive definite local metric matrix that varies with the support set in the field by the query conditional small sample local metric module. S5, calculate the local metric distance between the chemical space coordinates of the target molecule and the preset molecular coordinate reference set using the local metric matrix, and screen out the candidate molecule set according to the acceptable conditions; S6 sorts the candidate molecule set in ascending order by local metric distance and merges the structural attributes, outputting a list of candidate molecules with proximity metrics and structural attribute summaries.
[0007] In a preferred embodiment, the unified molecular descriptor protocol defines the category composition and calculation order of the descriptors, wherein topological features characterize atomic connections and ring system information, physicochemical features characterize molecular weight, lipid-water partition tendency, hydrogen bond donor and acceptor count and polar surface area, and substructure statistical features characterize the occurrence of functional group and pharmacophore fragments, and the three types of features are concatenated into a descriptor vector. The query side and the database side use the same descriptor list, calculation parameters, and arrangement order; missing or outlier values appearing in the calculation are given corresponding feature anomaly tags for subsequent standardization to mask or fill.
[0008] In a preferred embodiment, the standardization in S2 is to subtract the mean of the corresponding dimension statistically calculated according to the preset molecular library from each dimension of the descriptor vector and then divide it by the standard deviation of the corresponding dimension. The mean and standard deviation are estimated and fixed once in the offline stage, and the query side and the library side share the same set. Dimensions marked by feature anomalies are masked or filled with the statistical values of adjacent effective dimensions. The mapping encoder is a multi-layer feedforward neural network with the input layer dimension equal to the descriptor vector dimension. Each hidden layer performs a linear weighted sum of the output of the previous layer and then performs non-linear activation. The last layer outputs chemical space coordinates. The mapping encoder is pre-trained using a self-supervised structural comparison method and does not use active annotations during training. It uses equivalent notations, conformational perturbations, or structural approximations of the same molecule as positive sample pairs and different molecules as negative sample pairs, so that the chemical spatial coordinates of positive sample pairs are close together and the chemical spatial coordinates of negative sample pairs are far apart.
[0009] In a preferred embodiment, the offline coordinate transformation in S3 involves calculating the descriptor vector for each molecule in the preset molecular library according to the same normalization and descriptor protocol as the target molecule, normalizing it with the same normalization statistics, and then sending it to the same mapping encoder to obtain chemical space coordinates; the activity label registration is stored separately according to the target point, and the same molecule is recorded with an activity label under different target points, and the preset molecules with activity labels are included in the indexed preset molecule coordinate reference set according to their chemical space coordinates; When online, given a target point, a local support set is formed by taking the pre-defined molecules with target point activity labels from the target point's activity label registration area according to the coordinates of the neighbors. If there are not enough pre-defined molecules with activity labels in the neighborhood, the range is widened and the selection continues.
[0010] In a preferred embodiment, the query-conditional small-sample local metric module in S4 concatenates the coordinate displacement of each preset molecule relative to the target molecule in the local support set with its own normalized activity label as input, where the length of the coordinate displacement is equal to the dimension of the chemical space coordinates; each input is mapped to a hidden vector by a feedforward sub-network with shared parameters, and then the hidden vectors are weighted and summed by an order-insensitive attention convergence to obtain a context vector, wherein the weight is obtained by multiplying the proximity of the preset molecule to the target molecule and the reliability of its activity label and normalizing them within the local support set; The context vector is divided into two branches by the output subnetwork. One branch outputs local discriminant directions that are normalized to unit vectors. The other branch outputs non-negative stretching coefficients that correspond one-to-one with the local discriminant directions through activations that only take non-negative values. Based on the identity matrix, the outer product of each local discriminant direction and itself is weighted by the corresponding non-negative stretching coefficient and then superimposed to obtain a positive definite local metric matrix. The superposition of the outer products makes the matrix symmetric, and the non-negative stretching coefficients and the identity matrix make the matrix positive definite. The number of local discriminant directions is less than the dimension of the chemical space coordinates.
[0011] In a preferred embodiment, the query-conditional small-sample local metric module is obtained through scenario-based meta-training. For each training scenario, a local region of a target point is selected. An anchor molecule is designated from the preset molecules with activity labels within the local region to act as the query. The remaining preset molecules with activity labels near the anchor molecule are used to form a local support set, and a positive definite local metric matrix is synthesized at the chemical spatial coordinates of the anchor molecule. The remaining preset molecules with activity labels within the local region are used as evaluation molecules. The training objective is to reduce the local metric distance from the anchor molecule to the evaluation molecule if the activity of the evaluation molecule is closer to that of the anchor molecule under the positive definite local metric matrix. During training, the sampling of the local support set and the number and activity composition of the preset molecules in it are randomly changed. When preset molecules with different activity levels exist simultaneously in a local support set, the local discrimination direction is the direction that distinguishes the preset molecules according to their activity levels; when the activities of the preset molecules in the local support set tend to be consistent and there is a lack of difference comparison, the query conditional small sample local metric module is changed to output the direction of leaving the known active molecule aggregation area as the local discrimination direction and amplified; when the local support set is empty, the positive definite local metric matrix reverts to the identity matrix and gives the structural nearest neighbors according to the Euclidean distance of chemical space coordinates; the latter two cases are recorded as activity-adaptive-limited in the candidate molecule list.
[0012] In a preferred embodiment, in step S5, the difference between the chemical spatial coordinates of the target molecule and the preset molecular coordinates in the preset molecular coordinate reference set is used as the displacement vector. The displacement vector is then subjected to the action of a positive definite local metric matrix, and the inner product of the displacement vector with itself is taken, and the square root is then taken to obtain the local metric distance. First, a pre-defined molecular pool with a larger number of candidates is roughly screened out by index according to the Euclidean proximity of chemical spatial coordinates. Then, the local metric distance is calculated for each pre-defined molecule in the pre-defined molecular pool and rearranged according to it. The permissible condition is to include a preset set of candidate molecules whose local metric distance does not exceed the permissible threshold, and to set an upper limit on the number of molecules that meet the permissible threshold, selecting the ones with the highest local metric distance in ascending order. If the number is insufficient, all molecules will be included.
[0013] In a preferred embodiment, in step S6, the candidate molecule set is sorted in ascending order by local metric distance, and the structural identifier, structural formula representation, and physicochemical property summary of each candidate molecule, together with the local metric distance used as a measure of proximity, are merged into a list entry. Candidate molecules are also categorized according to their structural skeletons, with those sharing the same core skeleton grouped together and those undergoing skeleton transitions grouped separately, thus forming the candidate molecule list.
[0014] Secondly, this application also provides a molecular retrieval system based on descriptor space mapping, comprising: The descriptor calculation module is used to obtain the structural representation of the target molecule and complete its normalization. It calculates three types of features—topological, physicochemical, and substructure statistics—according to a unified molecular descriptor protocol, forming the descriptor vector and feature anomaly markers of the target molecule. The mapping and encoding module is used to standardize the descriptor vector of the target molecule and feed it into the self-supervised structure to compare with the pre-trained mapping encoder and transform it layer by layer to map the target molecule to its chemical space coordinates. The offline coordinate conversion module is used to convert the preset molecular library offline using the same descriptor protocol and the same mapping encoder, build an indexed preset molecular coordinate reference set, and simultaneously register activity labels that can be searched by coordinate proximity. The metric synthesis module is used to retrieve the local support set recalled from the activity labeling registration at the chemical spatial coordinates of the target molecule, and synthesize a positive definite local metric matrix that varies with the support set in the field by the query-conditional small sample local metric module. The ranging and screening module is used to calculate the local metric distance between the chemical space coordinates of the target molecule and the preset molecular coordinate reference set using a local metric matrix, and to screen out a set of candidate molecules based on acceptable conditions. The sorting output module sorts the candidate molecule set in ascending order by local metric distance and merges structural attributes, outputting a list of candidate molecules with proximity metrics and structural attribute summaries.
[0015] Thirdly, this application further provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in the aforementioned molecular retrieval method for descriptor space mapping.
[0016] The beneficial effects of this invention are as follows: The structure-dependent self-supervised mapping encoder and the query-conditional small-sample local metric module are configured with separate functions: the encoder provides a structural base for the entire space, including sparse regions of the novel framework, without incorporating activity information; the local metric module, at the chemical space coordinates of the target molecule, provides the local discrimination direction and non-negative stretching coefficient based on the local support set recalled from the activity labeling registration, and obtains a positive definite local metric matrix by superimposing the outer product on the identity matrix, so that the ranging is amplified along the activity discrimination direction and maintained as a baseline along other directions, thus allowing candidates to be screened according to the activity relevance even when labels are scarce; when the local support set is empty, the identity matrix is returned to provide the structural nearest neighbors and recorded in the list as activity-adaptive-limited, and the behavior is traceable. The query side and the database side share the same descriptor protocol and the same mapping encoder. Offline, an indexed coordinate reference set and an activity label registration archived by target point are built. Online, it is only necessary to map the target molecule, obtain the support set, synthesize local metrics, and rearrange the distance on the coarse screening molecule pool. After screening candidates according to the allowable threshold and the upper limit of the number, they are sorted in ascending order and merged into structural attributes and skeleton classification, outputting a list of candidate molecules for molecular design. The same encoder and metric module can serve multi-target scenarios without the need to train a complete model separately for each target, which is convenient for embedding into the daily retrieval workflow. Attached Figure Description
[0017] Figure 1 This is an overall structural diagram of a molecular retrieval system based on descriptor space mapping according to the present invention; Figure 2 This is a flowchart of a molecular retrieval method based on descriptor space mapping according to the present invention; Figure 3This is a flowchart of a molecular retrieval method based on descriptor space mapping according to the present invention; Figure 4 This is a two-dimensional projection scatter plot of the chemical space of the present invention; Figure 5 This is a schematic curve illustrating how the retrieval quality of the present invention changes with the ranking position. Detailed Implementation
[0018] The subject matter described herein will now be discussed with reference to exemplary embodiments. It should be understood that these embodiments are discussed only to enable those skilled in the art to better understand and implement the subject matter described herein, and changes may be made to the function and arrangement of the elements discussed without departing from the scope of this specification. Various processes or components may be omitted, substituted, or added as needed in the examples. Furthermore, some features described in the examples may be combined in other examples.
[0019] Example 1: At least one embodiment of the present invention discloses a molecular retrieval method using descriptor space mapping, such as... Figure 1 The diagram shows the overall architecture of a molecular retrieval system based on descriptor space mapping according to the present invention. In the diagram, target molecules enter the online retrieval platform from the input end, and sequentially undergo descriptor calculation, mapping encoding, local metric synthesis, ranging screening, and sorting output to obtain a candidate molecule list. The mapping encoder serves the mapping encoding step, providing a structural base independent of activity annotations for the entire space. The local metric module serves the local metric synthesis step, synthesizing positive definite local metrics highlighting the activity discrimination direction in the query neighborhood. Offline, a coordinate reference set and activity annotation registration with nearest neighbor indexes are constructed from a preset molecule library through offline coordinate transformation, and then a local support set and a coarse-screening molecule pool are provided to the online platform. The online main process and offline coordinate transformation share the same descriptor protocol and the same mapping encoder. Specific steps are as follows: Figures 2 to 3 As shown, it includes: S1. Obtain the structural representation of the target molecule and complete its normalization. Calculate the three types of features—topological, physicochemical, and substructure statistics—according to the unified molecular descriptor protocol, forming the descriptor vector and feature anomaly markers of the target molecule. Specifically, the target molecular structure representation submitted by R&D personnel is obtained. The common form is a normalized SMILES (Simplified Molecular Input Line Entry System) string, which can also be a molecular diagram or structure file. The same molecule often has multiple equivalent representations, and directly using them to calculate descriptors will result in inconsistencies, so normalization is performed first. Normalization includes removing countersalt and solvent fragments, unifying the writing of tautomers, unifying the handling of protonated states and explicit hydrogen, and normalizing stereochemical information according to established conventions. After normalization, a structural validity check is performed again to pick out inputs that cannot be parsed or have non-compliant valence bonds and mark them as abnormal, so as to prevent bad data from flowing into subsequent calculations. This part follows the common practice of cheminformatics tools and is a routine method in this field, so it will not be elaborated. After this step, we get a normalized molecular structure that can be recalculated stably, which can be used as the direct input for descriptor calculations. In one embodiment of the present invention, based on the normalized structure, descriptors are calculated according to a unified molecular descriptor protocol. The protocol defines the categories and calculation order of the descriptors, covering three major categories: topological connectivity, physicochemical properties, and substructure statistics. The topological category describes atomic connections and ring system information, the physicochemical category describes molecular weight, lipid-water partition tendency, hydrogen bond donor and acceptor count, and polar surface area, etc., and the substructure statistics category describes the presence of specific functional groups and pharmacophore fragments. The three types of features are concatenated into a high-dimensional descriptor vector as a numerical characterization of the target molecule. The reason for using all three categories is that they complement each other. The topological category captures the overall framework such as backbone connections and ring systems, the physicochemical category captures the tendency of molecular-environment interactions, and the substructure statistics category captures the presence or absence of specific functional groups and pharmacophore fragments. Local features that play a key role in activity, such as hinge hydrogen bonds, often fall into the substructure statistics category. Any single category may miss information that determines activity, so concatenating them together provides sufficient raw materials for subsequent identification of activity direction. It is important to emphasize that the query side and the database side must use the exact same protocol, that is, the same descriptor list, the same calculation parameters, and the same arrangement order; otherwise, the vectors on both sides will not be comparable. For missing or outlier values that occur during the calculation, this step provides the corresponding feature anomaly markers for subsequent masking or imputation during standardization. The output of this step is the descriptor vector of the target molecule and its feature anomaly markers.
[0020] S2, after standardizing the descriptor vector of the target molecule, feeds it into the self-supervised structure and compares it with the pre-trained mapping encoder to transform it layer by layer, mapping the target molecule to its chemical space coordinates; Specifically, what is obtained is the target molecule descriptor vector and its feature anomaly markers output from the previous step. The dimensions and numerical ranges of each dimension of the descriptor differ greatly. If not processed, the physicochemical dimensions with larger dimensions will overwhelm the dimensions with smaller dimensions but potentially critical to activity simply by their numerical values. Therefore, standardization is performed first. Standardization is to subtract the mean of each dimension and then divide it by the standard deviation of that dimension. The mean and standard deviation are estimated and fixed once in the offline stage according to the preset library. The query side directly calls the same set of statistics. Dimensions marked as anomalies are masked or filled with the statistical values of neighboring valid dimensions during standardization. The standardized vectors are fed into a mapping encoder, which is a multi-layer feedforward neural network. The input layer dimension is equal to the descriptor vector dimension, and several hidden layers are set in between. Each layer first performs a linear weighted sum of the outputs of the previous layer, and then passes it through a non-linear activation function to obtain the output of the current layer. Layer by layer, the high-dimensional descriptors are compressed and rearranged into a low-dimensional coordinate space. The output of the last layer is the coordinate of the molecule in chemical space. The intermediate vectors after activation are passed between layers. The later layers are closer to the compact characterization of the structure. The reason why a non-linear encoder is used instead of a linear principal component projection is that the linear projection takes the principal axis according to the variance preservation, which will be biased towards the physical and chemical dimensions with large numerical fluctuations. It is easy to suppress the subtle but key directions for structure identification as noise. The non-linear encoder can organize these directions into the coordinates. In one embodiment of the present invention, the encoder parameters are pre-trained using a self-supervised structural comparison method. During training, no activity annotations are used; only the structure itself is used. The method involves generating several structurally equivalent or approximate views of the same molecule, for example, by changing the equivalent notation, making slight conformational perturbations, or taking its immediate neighboring structural approximations. Views from the same molecule are treated as positive sample pairs, and views from different molecules are treated as negative sample pairs. The goal of training is to make the coordinates of positive sample pairs close together in chemical space and the coordinates of negative sample pairs spaced apart. The Euclidean distance of the resulting coordinates reflects the degree of structural similarity without incorporating activity information. There are several approaches that can be used together to generate positive sample views. One is to enumerate the equivalent notions of the same molecule before normalization, obtain multiple SMILES with different notations but pointing to the same structure, and then calculate the descriptors for each. The second is to make slight perturbations at the descriptor level, add controlled random jitter to the continuous physicochemical dimension, and simulate the small differences caused by the measurement error. The third is to take the molecule as an approximation that is structurally very close to it. For negative samples, molecules that are structurally far from the molecule are randomly selected from the library, and non-homologous samples are used as negative examples for each other in a batch during training. The comparison target is optimized by the conventional comparison learning loss of positive targets moving closer and negative targets moving further away. This is an existing method in this field. Here, we only use its effect of imprinting structural similarity into the coordinates, and will not go into its derivation. It should be noted that the magnitudes of perturbations and approximate object views are controlled. The purpose is to enable the encoder to learn coordinates that are insensitive to small differences in structural writing but sensitive to actual structural changes. This will prevent misjudging the distance when taking local support sets and measuring structural neighbors due to differences in writing. After such pre-training, the encoder can also provide coordinates for molecules without active labels, covering every corner of the library. This arrangement serves two purposes: First, the encoder relies only on structure and not on activity annotations, thus allowing for pre-training on the entire large-scale library and providing a stable structural foundation for the entire space, including the sparse region where the novel skeleton is located, ensuring coverage. Second, the activity correlation is completely handled by the subsequent local metrics, avoiding mixing structure and activity in the encoder, which would prevent the entire space from being forcibly stretched according to activity and torn or flattened at the cliff. The dimension of the chemical spatial coordinates is a quantity that must be predetermined, and it represents a trade-off between preserving structural information and controlling the scale of subsequent measurements. A higher dimension allows the coordinates to accommodate more detailed structural orientations, but the directional space to be processed by subsequent local measurements also increases accordingly. A lower dimension saves on measurements, but may suppress some subdivided structural orientations. In practice, the dimension is determined by comparing the quality of structural nearest neighbor recall under different coordinate dimensions during the verification process, based on the preset library size and descriptor dimension. This embodiment does not limit the specific value of the dimension. The output of this step is the chemical spatial coordinates of the target molecule.
[0021] S3 uses the same descriptor protocol and the same mapping encoder to perform offline coordinate transformation on the preset molecular library, builds an indexed preset molecular coordinate reference set, and simultaneously registers activity labels that can be searched by coordinate proximity; Specifically, the processing of the preset molecular library follows an offline path. It shares the same descriptor protocol and the same mapping encoder as the online processing of target molecules to ensure that the library-side coordinates and query-side coordinates fall within the same chemical space. The processing involves first performing structural normalization on each molecule in the library to be consistent with the target molecule, then calculating the descriptor vector, then normalizing it using the same normalization statistics, and finally feeding it into the mapping encoder to obtain the chemical space coordinates. This batch coordinateization is completed offline, and the calculated coordinates are archived together with the molecule identifiers. To enable online retrieval to quickly find neighboring molecules, a spatial index is built for the coordinate reference set. The index organizes the coordinates using a nearest-neighbor query structure, so that when given the coordinates of a target molecule, a batch of nearby molecules can be coarsely screened out first, and then subsequent precise processing can be performed on this batch of molecules, thus avoiding the need to calculate the entire database one by one. The creation of the index is a conventional method in this field, and only its ability to quickly recall molecules based on coordinate proximity is used here. The pre-set database is not static. Newly added molecules only need to have their descriptors calculated according to the same protocol, their coordinates calculated using the same standardized statistics and the same encoder, and then inserted into the index, without having to recalculate the entire database. Only when the encoder is re-pre-trained does it need to refresh the coordinates of the entire database uniformly to ensure that the coordinates on both sides are always generated by the same version of the encoder. In one embodiment of the present invention, in addition to the coordinates themselves, this step also involves registering molecules with activity labels in the library separately to prepare for retrieving local support sets at the query point later. The activity labels here are taken from publicly available bioactivity data. Before use, they are organized to unify the activity values from different sources into the same expression, and to merge multiple records of the same molecule for the same target into one in a robust manner and remove contradictory records. Data should be taken from the same type of measurement conditions as much as possible to avoid mistaking differences in measurement systems for differences in activity. The organized activity labels are archived by target and associated with the chemical spatial coordinates of the corresponding molecules. The registration organization method should support the rapid retrieval of labeled molecules based on coordinate proximity. Specifically, molecules with activity labels are included in the nearest neighbor index according to their chemical spatial coordinates and marked with a usable label. In this way, given a target molecule coordinate and a target point in the online stage, the same index can be used to retrieve both structural nearest neighbors for retrieval and nearest neighbors with the target activity label to form a local support set. The local support set refers to a small group of pre-defined molecules with target activity labels that are closest to the target molecule in chemical space. Since the same molecule may have activity labels on multiple target sites, they are stored separately according to the target site during registration. Each molecule is recorded with a label for different target sites to avoid confusion. In this way, when a target site is given in the online stage, the support set is retrieved only from the registration of that target site based on the nearest neighbors, and the activity of other targets is not misused. The support set retrieval step reuses the same nearest neighbor index. First, a batch of molecules is recalled based on the nearest neighbors, and then those labeled with the target site are screened out. The first few nearest neighbors are taken to form the support set. If there are not enough labeled molecules in the nearest neighbor range, the range is appropriately widened and the search continues until enough are found or it is confirmed that there are no labeled molecules in the region. In this way, the retrieval of the support set and the recall of structural nearest neighbors use the same set of indexes, saving redundant calculations. The output is a preset molecular coordinate reference set with index, as well as activity label registrations archived by target site and searchable by the nearest neighbors.
[0022] S4, at the chemical spatial coordinates of the target molecule, take the local support set recalled from the activity label registration, and synthesize the positive definite local metric matrix that varies with the support set in the field by the query conditional small sample local metric module. Specifically, it obtains the chemical spatial coordinates of the target molecule from the previous step, as well as the local support set extracted from the activity labeling registry according to the coordinate proximity. Its task is to determine which directions truly determine the level of activity at the location of the target molecule, and then highlight these directions in the metric. The reason for doing this separately at each query location is that the direction of the activity terrain is different at different locations. In one place, a small step can change the direction of activity, while in another place, the activity does not change much no matter how you move. A fixed metric for the entire space cannot take into account both of these situations at the same time. The extraction of the discrimination direction is accomplished by a query-conditional local metric module. The module first constructs an input for each molecule in the local support set. This input combines the coordinate displacement of the support molecule relative to the target molecule with its own activity label. The coordinate displacement indicates the direction in which it is biased relative to the target molecule in chemical space, and the activity label gives its own activity level, which is used to distinguish between molecules with high activity and molecules with low activity within the support set. The discrimination direction is determined within the support set accordingly, without using the activity of the query molecule as a benchmark. Therefore, even if the query molecule does not have an accurate activity value, it will not affect this step. The input of each support molecule is first mapped into a hidden vector through a small feedforward sub-network with shared parameters. Then, an attention convergence that is insensitive to the order of support molecules merges these hidden vectors into a context vector. During the convergence, weights are assigned according to the proximity of the support molecule to the target molecule and the reliability of the label. Let's explain the data flow in more detail: At the input end, the vector corresponding to each supporting molecule is composed of two parts. The first part is its coordinate displacement relative to the target molecule, with a length equal to the chemical space coordinate dimension. The second part is its activity label, encoded numerically. Activity levels are first normalized to a unified range and then appended as a one-dimensional dimension to the displacement. The shared subnetwork performs linear weighted summation and non-linear activation layer by layer, mapping the concatenated vector of each supporting molecule to a hidden vector of equal length. Attention convergence calculates a weight for each supporting molecule, with the weight increasing as it gets closer to the target molecule and the label more reliable. The hidden vectors of each supporting molecule are weighted and summed to obtain the context vector. Because convergence only uses weighted summation, the order of the supporting molecules does not affect the result; it can handle both increases and decreases in the supporting set. Attention weights are determined by two factors: one is the proximity of the supporting molecule to the target molecule in chemical space; the closer the molecule is, the more valuable it is for characterizing the local activity of the target molecule, and the greater its weight. The other is the reliability of the activity labeling of the supporting molecule; labels from standardized measurement conditions and consistent repeated measurements have higher weights, while labels from single measurements or of questionable origin have lower weights. Each factor is calculated into a score, which is then multiplied and normalized within the support set to obtain the final attention weight for each supporting molecule. This arrangement is intended to make the direction extraction rely more on points that are both close to the query and have reliable labels, reducing the interference of individual noisy labels on direction determination. The context vector is then passed through an output subnetwork, which provides several local discriminant directions and corresponding non-negative stretching coefficients. The output subnetwork consists of several fully connected layers at the beginning and splits into two branches at the end. One branch outputs a set of vectors equal to the number of directions, with each vector having a length equal to the coordinate dimension and being normalized to a unit vector as a local discriminant direction. The other branch outputs a set of scalars that correspond one-to-one with the directions. These scalars are then activated by an activation function that takes only non-negative values to ensure that the coefficients are not negative and that the synthesized metric remains positive definite. The number of directions is a pre-defined small number, indicating how many discriminant directions the module is allowed to highlight at the current position. The local discriminant directions refer to the coordinate directions in the current support set where the activity changes the fastest, i.e., those directions that best separate highly active molecules from less active molecules. The stretching coefficient indicates how sensitive this direction is to activity. The entire extraction process only uses a few labeled molecules in the vicinity. The module relies on reading the directions from these few points rather than fitting the absolute activity of each molecule. Therefore, it identifies discriminant directions, not predicts activity. Here, it's important to clarify why a pre-trained module is used to read the direction, rather than analytically solving it using only a few points. Chemical spatial coordinates are on the order of tens of dimensions, while the labeled supporting molecules in the query neighborhood are often only three to five. Analytically determining a direction using so few points results in a severe underdeterminacy, with the number of unknowns equal to the coordinate dimensions and the available constraints limited to only a few supporting points. The resulting direction is not unique and can easily flip if a point is moved, or diverge due to high noise levels. It cannot provide stable retrieval. The module's role is to fill in the missing prior knowledge in this step. It has been trained in numerous local scenarios composed of different target points, regions, and labels, learning the commonality of a reasonable direction across scenarios given a few labeled neighbors. Therefore, when facing a new query online, it doesn't solve an underdetermined problem on the spot, but instead uses this learned prior knowledge to flatten the few points into a forward inference to directly provide a stable direction. This is the reason why this method can still provide usable metrics even in areas with scarce labels. In one embodiment of the present invention, after obtaining the local discrimination direction and the stretching coefficient, they are synthesized into a positive definite local metric matrix that varies with position. The synthesis method involves additively amplifying each local discrimination direction along its stretching coefficient on a reference metric with equal weights in each direction. The resulting matrix is naturally symmetric, and because the reference part guarantees positive definiteness and the amplified part is a superposition of non-negative directional outer products, the synthesis result is always positive definite, thus constituting a valid distance metric. The synthesis formula of the local metric matrix is: in, This is the local metric matrix synthesized at the query location where the target molecule is located. The identity matrix is the benchmark metric with equal weights in all directions. The number of directions to be determined locally. For direction number, The first output of the module A unit vector for local direction discrimination. Transpose it. This is the non-negative tensile coefficient corresponding to this direction; Among them, the directional outer product It is only in direction The matrix with the magnification effect is multiplied by a non-negative stretching factor. Then, summing these values onto the identity matrix yields a metric that is magnified along each discrimination direction while remaining unchanged in the other directions; the number of directions... By choosing a value much smaller than the coordinate dimension, the metric remains low-rank, thus saving parameters and reducing the likelihood of overfitting, as in this embodiment. The default value is set to the units digit. The module provides different metrics depending on the activity composition of the support set. Ideally, when the support set contains both highly and less active molecules, the module outputs a direction separating these two categories and stretches accordingly. However, when the molecular activity in the support set is unilateral, almost entirely high or entirely low, lacking a clear contrast, the boundary direction cannot be determined from the label. In this case, the module outputs and amplifies the direction away from the known active molecule clusters. This means that movements away from known active clusters are counted as larger distances, while movements along the active clusters are relatively closer because they maintain the baseline, thus prioritizing the retention of molecules without bias. Candidates from known active clusters are identified and recorded as activity-limited in the results. Here, the direction of the module output is amplified, which is completely consistent with the aforementioned construction of amplification along the discrimination direction, except that the highlighted direction has changed from the boundary direction to the direction away from the active cluster. When the local support set is empty, i.e., the query falls in a completely unlabeled region, the module does not output any discrimination direction, and the synthesis result reverts to the identity matrix. At this time, the metric is equivalent to the Euclidean metric on the structural base, and the retrieval gives the pure structural nearest neighbor, which is also recorded as activity-limited. These cases are all endogenous behaviors given by the same module based on the support set content, and are not additional components. It's also necessary to explain the scope of application of this local metric. It is synthesized based on the support set of the target molecule's location and reflects the activity trend in the vicinity of that location. Therefore, it is only meaningful when used within the neighborhood of the target molecule. The activity trend may have changed in distant locations, and this metric may not be applicable. Fortunately, the retrieval is only concerned with candidates near the target molecule, and the ranging object is the neighboring molecules recalled by the index, all of which fall within the scope of this metric. Therefore, it is logically consistent to use this local metric only within the neighborhood with the query as the center. And precisely because it only needs to be locally effective within the neighborhood, it is sufficient to select a few directions and keep the metric in low rank, without having to fit the complex geometry of the entire space. The parameters of the local metric module are obtained through scenario-based meta-training. The purpose of this training is to enable the module to extract the direction of discrimination from a few local annotations. Each training scenario corresponds to a local region of a target point. First, an anchor molecule is selected from the molecules with activity labels in the region to act as a query molecule. Then, the remaining labeled molecules near the anchor molecule are used to form a support set, which is then fed to the module. The local metric is synthesized at the coordinates of the anchor molecule, and the remaining labeled molecules in the region are used as evaluation molecules. In this way, the anchor molecules in the training correspond one-to-one with the target molecules in the online region, and the coordinate displacement of the support molecules relative to the anchor molecules also matches the displacement of the support molecules relative to the target molecules in the online region. The online region is used exactly as it is set up in training. The desired effect of the training is that when the synthesized local metric is used to measure the distance from the anchor molecule to each evaluation molecule, the evaluation molecules whose activity is closer to that of the anchor molecule are ranked higher, and those whose activity is farther away are ranked lower. This ranking requirement is used as the training objective for the scenario. The module parameters are repeatedly optimized on thousands of scenarios from different targets, regions, and anchor molecules. The module then learns the general ability to extract the direction of discrimination from a few points. The ranking objective is achieved using conventional pairwise comparison loss, which involves comparing each molecule being evaluated pairwise. The molecule whose activity is closer to the anchor molecule should have a smaller local metric distance to the anchor molecule. The pairwise penalties that violate this ordering relationship are accumulated as the loss for that scenario. The average of multiple scenarios in a batch is then fed back to update the module parameters. This type of pairwise ranking loss is an existing method, and it is only used here to guide the local metrics synthesized from a few points to the correct retrieval ranking without going into its derivation. To prevent the module from simply memorizing targets seen in training, the support set for each scenario is randomly resampled, and the number of molecules in the support set is randomly varied during training with a small sample size. This forces the module to learn the ability to extract directions from any number of points, rather than memorizing a fixed configuration. The support sets for training scenarios are also intentionally made diverse in terms of activity composition. Some contain both high and low activity, while others have one-sided activity. This allows the module to learn to provide a discriminative direction when there is a comparison and to provide a direction that fits the known activity clusters when there is no comparison, thus matching the various support set compositions that may be encountered in the online phase. The size of the support set and the number of directions are two quantities that need to be predetermined. If the support set is too small, the direction estimation will be unstable, and if it is too large, locality will be lost. In practice, it is determined according to the number of labeled molecules that can usually be obtained in the neighborhood of the query in chemical space. For example, in this embodiment, the size of the online support set is set by default to a small number that can stably estimate the main discriminant direction. The number of directions is taken to be much smaller than the coordinate dimension to maintain the low rank of the metric. After such meta-training, the module can synthesize a reasonable local metric based on these points when faced with a novel query with only three or five local labels online, because it has seen a large number of small sample scenarios of the same size in training. Different targets are simply different scenarios here. The module parameters are shared among all targets, so the same set of encoder coordinates and the same metric module can serve the retrieval of multiple targets without the need to set up a separate set for each target. It's important to distinguish between what the module does and directly predicting activity. The module doesn't estimate the absolute activity of any molecule; it only reads which coordinate directions at the current location can separate high-activity from low-activity molecules in the support set, and outputs only these directions and their corresponding stretching coefficients. In other words, it solves the small-sample task of identifying directions from a few points, rather than regressing absolute activity. This is crucial for novel queries because regressing absolute activity in weakly labeled regions is extrapolation and unreliable, while identifying local directions requires much less information—a few points of varying heights are sufficient. The module has been trained to determine directions from a few points in numerous scenarios, so it can still provide usable metrics in areas where retrieval is most needed but labels are scarce, unlike absolute activity regression which fails in these situations. The output is a positive definite local metric matrix at the query location of the target molecule.
[0023] S5, calculate the local metric distance between the chemical space coordinates of the target molecule and the preset molecular coordinate reference set using the local metric matrix, and screen out the candidate molecule set according to the acceptable conditions; Specifically, this step obtains the chemical spatial coordinates of the target molecule, the preset molecular coordinate reference set, and the local metric matrix synthesized in the previous step. Its task is to calculate the proximity between the target molecule and each candidate molecule in the library using the distance with local metric. The algorithm first takes the difference between the target molecule coordinates and the preset molecular coordinates to obtain a displacement vector, then applies this displacement vector through the local metric matrix, then takes the inner product with itself, and finally takes the square root to obtain the distance between the two molecules under local metric, which is referred to as the local metric distance in this paper. The reason for this calculation is that the local metric matrix is amplified along the activity discrimination direction. The component of the displacement vector falling in the discrimination direction is counted more, while the component falling in other directions is counted less. As a result, the distance between two molecules that are different only in non-discrimination directions is smaller, and the distance between molecules that deviate in the discrimination direction is larger. The local metric is taken from the part at the query location of the target molecule, so the distance measures the local activity terrain as seen from the perspective of the target molecule. This query-centric asymmetry is exactly the semantics required for retrieval. To avoid calculating the distance for each molecule in the entire database, in actual implementation, a batch of preset molecules near the target molecule are first coarsely screened by coordinate proximity using the index, and the local metric distance is calculated precisely only for this batch of molecules. In one embodiment of the present invention, after calculating the local metric distance, candidates can be selected. The selection adopts an allowable condition, that is, the molecules whose local metric distance does not exceed an allowable threshold are included in the candidate set. At the same time, an upper limit can be set. Among the molecules that meet the threshold, the top few are selected in ascending order of local metric distance. If the number is insufficient, all are retained. This threshold and the upper limit are set according to the business's trade-off between recall and precision. For example, in this embodiment, the default value of the upper limit is set to a positive integer within the range that can be manually verified. Since the local metric is only used within the query neighborhood, the threshold also measures the relative distance within the query neighborhood, and the meaning is consistent. It is worth mentioning that there is no need to normalize the distance for different targets separately. The reason is that the local metric itself is synthesized based on the support set of the current query and the current target. It has already incorporated the activity discrimination direction and sensitivity of the current target at the current position into the matrix. Therefore, the local metric distances calculated for different targets and different positions are each measured under their own local discrimination scale. A unified threshold can be used for approximate measurement. The specific threshold is determined through the verification process. Generally, there will not be a situation where a certain target is too large or too small overall due to different activity scales. The screening logic thus remains unified and simple. It should be noted that the index is organized according to Euclidean proximity on the structural base, while the final distance measurement uses a local metric. The proximity order of the two is not completely consistent. Some molecules that are close to the target molecule under the local metric may not enter the coarse screening range of the index under the Euclidean sense. Therefore, in the coarse screening stage, a molecule pool with a larger number of molecules than the final candidates is first recalled according to Euclidean proximity. Then, the local metric is used to accurately measure the distance and rearrange the molecules in this pool to make up for the molecules missed due to the difference in measurement. The size of the recall pool is set according to the stretching of the local metric relative to the benchmark metric. The larger the stretching, the wider the pool is set. Its value can be determined in the verification process according to the stability of the intersection of the candidates before and after the rearrangement. This embodiment does not limit its specific value. One more point regarding recall robustness: the local metric amplifies the distance in the discrimination direction, meaning that a molecule that was originally not too close to the target molecule on the structural base but happened to fall outside the discrimination direction may actually be ranked higher after rearrangement. If the coarse screening pool is too narrow, it will be missed. Therefore, it is worthwhile to set the recall pool wider. The molecules that are recalled more will naturally be ranked later and blocked by the threshold if they are indeed far away during rearrangement, without contaminating the final candidates. The only cost is to calculate more distances. Conversely, if molecules that were originally at the edge of the recall pool are frequently found in the candidates ranked higher after rearrangement, it means that the pool should be widened further. This feedback can be set during offline validation and used directly online. The output of this step is the set of candidate molecules that meet the acceptable conditions and their local metric distances.
[0024] S6 sorts the candidate molecule set in ascending order by local metric distance and merges the structural attributes, outputting a list of candidate molecules with proximity metrics and structural attribute summaries. Specifically, this step obtains the set of candidate molecules and their local metric distances obtained in the previous step. First, the candidates are sorted in ascending order according to their local metric distances. The smaller the distance, the closer the candidate is to the target molecule in the local activity discrimination direction, and the higher it is ranked. This allows researchers to see the most promising candidates at a glance. After sorting, the structural identifier, structural formula, and optional physicochemical property summary of each candidate molecule are combined to form a complete list of entries for direct use without having to search the database again. The physicochemical property summary can include quantities that are often referenced during procurement and synthesis sorting, such as molecular weight, lipid-water partition tendency, and hydrogen bond donor and acceptor count. These have already been calculated during offline coordinate conversion and can be used directly without recalculation. The list entries can also include a brief description of the discrimination directions in which the candidate is close to the target molecule, helping researchers understand why it is ranked higher. This list, which includes proximity metrics and structural attributes, allows researchers to directly order structurally available analogues, send top candidates for further activity confirmation, and plan exploration routes for structure-activity relationships by grouping them according to the skeleton in the list. The list provides all the search results and subsequent information at once, reducing the cost of switching between different tools. When merging candidates, the local metric distance corresponding to each candidate is included as a measure of proximity to the user. For cases where the local metric reverts to the structural base or where the fit is insufficient due to the one-sided activity of the support set, these candidates are collectively recorded as having limited activity fit in the list. This indicates to the user that their activity discrimination direction is not sufficiently reshaped and is more based on the structure, requiring judgment based on experience. This approach does not hide the actual behavior of the method in weakly labeled areas and makes the difference between sufficient and limited fit results immediately apparent. In one embodiment of the present invention, to facilitate structure-activity relationship analysis, this step can further classify candidates according to their structural skeletons, grouping candidates that share the same core skeleton into one group and listing candidates that have undergone skeleton transitions in a separate group. This allows researchers to both expand analogues along known skeletons and see molecules that are still judged as similar despite structurally different segments. Classification only affects the organization of the list and does not change the local distance measurement and sorting itself. Finally, the sorted, merged, and classified candidates are organized into a structured search result output. By reviewing the entire data flow again, we can see how each step is interconnected. The structural representation of the target molecule is first transformed into a descriptor vector and anomaly markers. The descriptor vector is then normalized and mapped by an encoder to become chemical space coordinates. These coordinates are used in two ways: firstly, they are fed into an offline nearest neighbor index to recall structural neighbors and retrieve local support sets; secondly, they are fed together with the support sets to a local metric module to synthesize a local metric matrix. The coordinates, the recalled preset molecular coordinates, and the local metric matrix are then combined in a ranging step to calculate the local metric distance. This distance then drives the selection of a candidate set based on permissible conditions. Finally, the candidate set and its distance are sorted, merged, and categorized to form the search results. The output of this step is the candidate molecule search results designed for molecular analysis.
[0025] In one embodiment of the present invention, this method is applied to a lead compound expansion task for a certain kinase target; researchers have obtained a seed molecule whose activity comes from an aromatic heterocyclic skeleton that forms key hydrogen bonds with the target hinge region, and now hope to search for analogs that have the potential to retain the activity of the target in a pre-set library of millions of purchasable compounds, while there are only a few available activity labels for the target near this chemotype; the initial data obtained in the example is shown in Table 1; Table 1, Example of obtaining initial data Researchers submit the standardized structure of the seed molecule to the system. The system calculates its descriptor vector according to a unified descriptor protocol, and then obtains its coordinates in chemical space through a mapping encoder. Near these coordinates, the system extracts a few molecules labeled with the target from the activity label register to form a local support set. After observing these points, the local metric module schematically identifies whether the hinge hydrogen bond donor at the current position separates high activity from low activity most effectively in this coordinate direction. Therefore, this direction is used as the local discriminant direction and assigned a high stretching factor, while other directions related to peripheral lipophilicity are not amplified. The local metric synthesized accordingly is then used to measure and screen the neighboring library molecules coarsely screened by the index. It is worth noting that in this example, there are only a few labeled molecules available near the seed molecule for this target. If the approach of directly predicting activity and then sorting is adopted, it is almost impossible to start in such a novel region with few labels. However, this method only needs to read the hinge hydrogen bond as the discriminant direction from these few points to carry out the search, which is why it is still usable in weak labeling scenarios. In this example, it can be illustrated that although the isosteres with benzene rings replaced by pyridine rings have changes in structural surface, the hinge hydrogen bond pattern is preserved, and there is no deviation in the stretched discrimination direction. Therefore, the local metric distance is smaller, and they are included in the candidates. However, for molecules with key amino links replaced by oxygen links, the hinge hydrogen bonds are broken. Even if their overall physicochemical properties are similar to the lead molecules, they will deviate significantly in the discrimination direction, and the local metric distance will be larger, thus being excluded from the candidates. This distinction between inclusion and exclusion is consistent with the height of the activity labels in the table, indicating that the search judges the proximity based on the activity-related direction, rather than treating all surface structures equally. like Figure 4 The diagram shows a two-dimensional projection scatter plot in chemical space. Each point represents a library molecule, and the brightness of the point indicates its activity level (darker colors indicate higher activity, lighter colors indicate lower activity). The central marker is the seed molecule QRY-0. The two axes correspond to the hinge hydrogen bond related direction and the lipophilicity related direction, respectively. Two equidistant contours are superimposed on the diagram: one corresponds to the equidistant range with equal weight in each direction on the structural base, forming a circular contour consistent in all directions; the other corresponds to the equidistant range under the local metric synthesized at the seed molecule by this method, forming an elliptical contour that narrows along the hinge hydrogen bond related direction and widens along the lipophilicity related direction. Based on the example, we can deduce that the low-activity molecule LIB-3, which disrupts the hinge hydrogen bonds, is... Those falling within the circular outline but outside the elliptical outline were excluded; highly active molecules LIB-1 and LIB-4, which retain hinge hydrogen bonds, and LIB-2, which, despite undergoing pyridine isobaric substitution, still retains the hinge mode, all fall within the elliptical outline and were therefore recalled; this visually illustrates the fit of local measurements to the active terrain, that is, judging proximity based on the activity-related direction rather than the surface structure. like Figure 5 The figure shows a schematic curve illustrating the change in retrieval quality with ranking position. The horizontal axis represents the candidate ranking, and each curve is arranged in ascending order according to its own distance metric, taking the top few positions. The vertical axis represents the cumulative percentage of active molecules recalled. The figure shows two curves, one corresponding to the equal-weighted distance retrieval on the structural base and the other corresponding to the local metric retrieval of this method. Schematic, at the same ranking position, the curve of this method is above the equal-weighted distance curve, indicating that with the same number of candidates viewed, this method recalls more active molecules. This difference is more obvious at the earlier ranking positions.
[0026] As can be seen from the examples above, in the scenario of weakly labeled novelty regions such as lead compound expansion, this method can exclude molecules with similar structural surfaces but changed key groups and missing activities from the candidates, while recalling isosteres with different structural surfaces but retained pharmacophores, making the search results more reliable in terms of activity relevance. Since the structural base only depends on the structure and can cover the entire space including novel skeletons, and the local metric only needs to query a few nearby labels to synthesize, the method is still usable in areas with scarce labels, and honestly returns to structural neighbors and marks completely unlabeled queries. The method completes the coordinateization, indexing and activity label registration of the preset library in the offline stage, and only processes the target molecule, retrieves the support set, synthesizes the local metric and performs distance screening in the online stage. Therefore, it can return results within an acceptable interaction delay and is suitable for integration into daily molecular design workflows. From a feasibility perspective, this method only requires training two components: a structure-dependent encoder and a query-conditional local metric module. The remaining steps utilize existing methods such as descriptor computation and standardization, or existing tools like nearest-neighbor indexing. The two components have clearly defined roles, each addressing a specific problem: the encoder manages full-space structure coverage, while the metric module handles activity discrimination at the query location. There are no additional models or fancy structures added for aesthetic purposes. This approach not only produces more activity-related retrieval results in weakly labeled novel regions than existing methods, but also keeps the implementation complexity within a feasible training and deployment range, avoiding implementation difficulties due to an excessive number of components. Furthermore, this method is not limited to the specific scenario of kinase targets. Any task requiring the retrieval of candidate molecules from a large-scale database based on certain property relevance under weak labeling conditions—such as activity retrieval for other targets, or material molecule screening where activity labels are replaced with material property labels—can utilize the same framework of a structure-based foundation plus query-conditional local metrics. The only difference lies in the meaning of the labels in the support set.
[0027] Example 2: This invention also provides a molecular retrieval system based on descriptor space mapping, the system mainly comprising: The descriptor calculation module is used to obtain the structural representation of the target molecule and complete its normalization. It calculates three types of features—topological, physicochemical, and substructure statistics—according to a unified molecular descriptor protocol, forming the descriptor vector and feature anomaly markers of the target molecule. The mapping and encoding module is used to standardize the descriptor vector of the target molecule and feed it into the self-supervised structure to compare with the pre-trained mapping encoder and transform it layer by layer to map the target molecule to its chemical space coordinates. The offline coordinate conversion module is used to convert the preset molecular library offline using the same descriptor protocol and the same mapping encoder, build an indexed preset molecular coordinate reference set, and simultaneously register activity labels that can be searched by coordinate proximity. The metric synthesis module is used to retrieve the local support set recalled from the activity labeling registration at the chemical spatial coordinates of the target molecule, and synthesize a positive definite local metric matrix that varies with the support set in the field by the query-conditional small sample local metric module. The ranging and screening module is used to calculate the local metric distance between the chemical space coordinates of the target molecule and the preset molecular coordinate reference set using a local metric matrix, and to screen out a set of candidate molecules based on acceptable conditions. The sorting output module sorts the candidate molecule set in ascending order by local metric distance and merges structural attributes, outputting a list of candidate molecules with proximity metrics and structural attribute summaries.
[0028] It is understood that the molecular retrieval system based on descriptor space mapping provided in this embodiment of the invention corresponds to the molecular retrieval method based on descriptor space mapping described above. The explanations, examples, and beneficial effects of the relevant content can be referred to the corresponding content in the molecular retrieval method based on descriptor space mapping, and will not be repeated here.
[0029] Example 3: The present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the molecular retrieval method for descriptor space mapping as described in any of the above embodiments and their preferred embodiments. The method mainly includes: S1. Obtain the structural representation of the target molecule and complete its normalization. Calculate the three types of features—topological, physicochemical, and substructure statistics—according to the unified molecular descriptor protocol, forming the descriptor vector and feature anomaly markers of the target molecule. S2, after standardizing the descriptor vector of the target molecule, feeds it into the self-supervised structure and compares it with the pre-trained mapping encoder to transform it layer by layer, mapping the target molecule to its chemical space coordinates; S3 uses the same descriptor protocol and the same mapping encoder to perform offline coordinate transformation on the preset molecular library, builds an indexed preset molecular coordinate reference set, and simultaneously registers activity labels that can be searched by coordinate proximity; S4, at the chemical spatial coordinates of the target molecule, take the local support set recalled from the activity label registration, and synthesize the positive definite local metric matrix that varies with the support set in the field by the query conditional small sample local metric module. S5, calculate the local metric distance between the chemical space coordinates of the target molecule and the preset molecular coordinate reference set using the local metric matrix, and screen out the candidate molecule set according to the acceptable conditions; S6 sorts the candidate molecule set in ascending order by local metric distance and merges the structural attributes, outputting a list of candidate molecules with proximity metrics and structural attribute summaries.
[0030] It is understood that the molecular retrieval storage medium with descriptor space mapping provided in the embodiments of the present invention corresponds to the molecular retrieval method and system with descriptor space mapping described above. The explanation, examples, and beneficial effects of the relevant content can be referred to the corresponding content in the molecular retrieval method and system with descriptor space mapping, and will not be repeated here.
[0031] The embodiments of the present invention have been described above. However, the embodiments are not limited to the specific implementation methods described above. The specific implementation methods described above are merely illustrative and not restrictive. Those skilled in the art can make more equivalent embodiments under the guidance of the present embodiments, and all of them are within the protection scope of the present embodiments.
Claims
1. A method of molecular retrieval by descriptor space mapping, characterized in that, Includes the following steps: S1. Obtain the structural representation of the target molecule and complete its normalization. Calculate the three types of features—topological, physicochemical, and substructure statistics—according to the unified molecular descriptor protocol, forming the descriptor vector and feature anomaly markers of the target molecule. S2, after standardizing the descriptor vector of the target molecule, it is fed into the self-supervised structure and compared with the pre-trained mapping encoder to transform it layer by layer, and the target molecule is mapped to its chemical space coordinates. S3 uses the same descriptor protocol and the same mapping encoder to perform offline coordinate transformation on the preset molecular library, builds an indexed preset molecular coordinate reference set, and simultaneously registers activity labels that can be searched by coordinate proximity; S4, at the chemical spatial coordinates of the target molecule, take the local support set recalled from the activity label registration, and synthesize the positive definite local metric matrix that varies with the support set in the field by the query conditional small sample local metric module. S5, calculate the local metric distance between the chemical space coordinates of the target molecule and the preset molecular coordinate reference set using the local metric matrix, and screen out the candidate molecule set according to the acceptable conditions; S6 sorts the candidate molecule set in ascending order by local metric distance and merges the structural attributes, outputting a list of candidate molecules with proximity metrics and structural attribute summaries.
2. The descriptor space mapping method for molecular retrieval according to claim 1, wherein, The unified molecular descriptor protocol defines the categories and calculation order of descriptors. Topological features characterize atomic connections and ring system information, physicochemical features characterize molecular weight, lipid-water partitioning tendency, hydrogen bond donor and acceptor counts and polar surface area, and substructure statistical features characterize the occurrence of functional group and pharmacophore fragments. The three types of features are concatenated into a descriptor vector. The query side and the database side use the same descriptor list, calculation parameters, and arrangement order; missing or outlier values appearing in the calculation are given corresponding feature anomaly tags for subsequent standardization to mask or fill.
3. The descriptor space mapping method for molecular retrieval according to claim 1, wherein, In S2, standardization is to subtract the mean of the corresponding dimension from the preset molecular library statistics for each dimension of the descriptor vector and then divide by the standard deviation of the corresponding dimension. The mean and standard deviation are estimated and fixed once in the offline stage, and the query side and the library side share the same set. Dimensions marked by feature anomalies are masked or filled with the statistical values of the adjacent effective dimensions. The mapping encoder is a multi-layer feedforward neural network with the input layer dimension equal to the descriptor vector dimension. Each hidden layer performs a linear weighted sum of the output of the previous layer and then performs non-linear activation. The last layer outputs chemical space coordinates. The mapping encoder is pre-trained using a self-supervised structural comparison method and does not use active annotations during training. It uses equivalent notations, conformational perturbations, or structural approximations of the same molecule as positive sample pairs and different molecules as negative sample pairs, so that the chemical spatial coordinates of positive sample pairs are close together and the chemical spatial coordinates of negative sample pairs are far apart.
4. The descriptor space mapping method for molecular retrieval according to claim 1, wherein, In S3, offline coordinate transformation involves calculating the descriptor vector for each molecule in the preset molecular library according to the same normalization and descriptor protocol as the target molecule, normalizing it with the same normalization statistics, and then sending it to the same mapping encoder to obtain chemical space coordinates. The activity label registration is stored separately according to the target point. The same molecule is recorded with an activity label under different target points, and the preset molecules with activity labels are included in the indexed preset molecule coordinate reference set according to their chemical space coordinates. When online, given a target point, a local support set is formed by taking the pre-defined molecules with target point activity labels from the target point's activity label registration area according to the coordinates of the neighbors. If there are not enough pre-defined molecules with activity labels in the neighborhood, the range is widened and the selection continues.
5. The descriptor space mapping method for molecular retrieval according to claim 1, wherein, In S4, the query-conditional small-sample local metric module concatenates the coordinate displacement of each preset molecule relative to the target molecule in the local support set with its own normalized activity label as input, where the length of the coordinate displacement is equal to the dimension of the chemical space coordinates; each input is mapped to a hidden vector by a feedforward sub-network with shared parameters, and then the hidden vectors are weighted and summed by an order-insensitive attention convergence to obtain a context vector. The weight is obtained by multiplying the proximity of the preset molecule to the target molecule and the reliability of its activity label and normalizing them within the local support set; The context vector is divided into two branches by the output subnetwork. One branch outputs local discriminant directions that are normalized to unit vectors. The other branch outputs non-negative stretching coefficients that correspond one-to-one with the local discriminant directions through activations that only take non-negative values. Based on the identity matrix, the outer product of each local discriminant direction and itself is weighted by the corresponding non-negative stretching coefficient and then superimposed to obtain a positive definite local metric matrix. The superposition of the outer products makes the matrix symmetric, and the non-negative stretching coefficients and the identity matrix make the matrix positive definite. The number of local discriminant directions is less than the dimension of the chemical space coordinates.
6. The descriptor space mapping method for molecular retrieval according to claim 5, wherein, The query-conditional small-sample local metric module is obtained through scenario-based meta-training. In each training scenario, a local region of a target point is selected. An anchor molecule is designated from the preset molecules with activity labels in the local region to act as the query. The remaining preset molecules with activity labels near the anchor molecule are used to form a local support set, and a positive definite local metric matrix is synthesized at the chemical spatial coordinates of the anchor molecule. The remaining preset molecules with activity labels in the local region are used as evaluation molecules. The training objective is that, under the positive definite local metric matrix, the evaluation molecule whose activity is closer to the anchor molecule has a smaller local metric distance to the anchor molecule. During training, the sampling of the local support set and the number and activity composition of the preset molecules in it are randomly changed. When preset molecules with different activity levels exist simultaneously in a local support set, the local discrimination direction is the direction that distinguishes the preset molecules according to their activity levels; when the activities of the preset molecules in the local support set tend to be consistent and there is a lack of difference comparison, the query conditional small sample local metric module is changed to output the direction of leaving the known active molecule aggregation area as the local discrimination direction and amplified; when the local support set is empty, the positive definite local metric matrix reverts to the identity matrix and gives the structural nearest neighbors according to the Euclidean distance of chemical space coordinates; the latter two cases are recorded as activity-adaptive-limited in the candidate molecule list.
7. The descriptor space mapping method of claim 1, wherein the descriptor space mapping method is a molecular retrieval method. In S5, the difference between the chemical spatial coordinates of the target molecule and the preset molecular coordinates in the preset molecular coordinate reference set is used as the displacement vector. The displacement vector is then subjected to the action of a positive definite local metric matrix, and the inner product of the displacement vector with itself is taken, and the square root is then taken to obtain the local metric distance. First, a pre-defined molecular pool with a larger number of candidates is roughly screened out by index according to the Euclidean proximity of chemical spatial coordinates. Then, the local metric distance is calculated for each pre-defined molecule in the pre-defined molecular pool and rearranged according to it. The permissible condition is to include a preset set of candidate molecules whose local metric distance does not exceed the permissible threshold, and to set an upper limit on the number of molecules that meet the permissible threshold, selecting the ones with the highest local metric distance in ascending order. If the number is insufficient, all molecules will be included.
8. The descriptor space mapping method of claim 1, wherein, In S6, the candidate molecule set is sorted in ascending order by local metric distance, and the structural identifier, structural formula representation and physicochemical property summary of each candidate molecule, together with the local metric distance used as a measure of proximity, are merged into a list item. Candidate molecules are also categorized according to their structural skeletons, with those sharing the same core skeleton grouped together and those undergoing skeleton transitions grouped separately, thus forming the candidate molecule list.
9. A molecular retrieval system for descriptor space mapping, characterized by, include: The descriptor calculation module is used to obtain the structural representation of the target molecule and complete its normalization. It calculates three types of features—topological, physicochemical, and substructure statistics—according to a unified molecular descriptor protocol, forming the descriptor vector and feature anomaly markers of the target molecule. The mapping and encoding module is used to standardize the descriptor vector of the target molecule and feed it into the self-supervised structure to compare with the pre-trained mapping encoder and transform it layer by layer to map the target molecule to its chemical space coordinates. The offline coordinate conversion module is used to convert the preset molecular library offline using the same descriptor protocol and the same mapping encoder, build an indexed preset molecular coordinate reference set, and simultaneously register activity labels that can be searched by coordinate proximity. The metric synthesis module is used to retrieve the local support set recalled from the activity labeling registration at the chemical spatial coordinates of the target molecule, and synthesize a positive definite local metric matrix that varies with the support set in the field by the query-conditional small sample local metric module. The ranging and screening module is used to calculate the local metric distance between the chemical space coordinates of the target molecule and the preset molecular coordinate reference set using a local metric matrix, and to screen out a set of candidate molecules based on acceptable conditions. The sorting output module sorts the candidate molecule set in ascending order by local metric distance and merges structural attributes, outputting a list of candidate molecules with proximity metrics and structural attribute summaries.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the molecular retrieval method for descriptor space mapping according to any one of claims 1-8.
