Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can ligand atom names and/or order be matched to the CIF format? #178

Open
kirmedvedev opened this issue Nov 26, 2024 · 3 comments
Open

Comments

@kirmedvedev
Copy link

Is there any way to match names and/or order of ligand's atoms in the output structure to CIF or SDF format of the ligand file?
Output:

ATOM 1949 N N_1 . LIG . 1 ? B 1.644 -8.467 17.946 1.000 2 B LIG 79.648 1
ATOM 1950 C C_1 . LIG . 1 ? B 0.784 -9.476 17.979 1.000 2 B LIG 82.140 1
ATOM 1951 N N_2 . LIG . 1 ? B 1.049 -10.542 18.752 1.000 2 B LIG 82.164 1
ATOM 1952 C C_2 . LIG . 1 ? B 0.173 -11.557 18.777 1.000 2 B LIG 81.894 1
ATOM 1953 N N_3 . LIG . 1 ? B -0.953 -11.599 18.095 1.000 2 B LIG 81.778 1
ATOM 1954 C C_3 . LIG . 1 ? B -1.246 -10.551 17.312 1.000 2 B LIG 84.079 1
ATOM 1955 C C_4 . LIG . 1 ? B -0.398 -9.456 17.224 1.000 2 B LIG 83.583 1
ATOM 1956 N N_4 . LIG . 1 ? B -0.968 -8.562 16.364 1.000 2 B LIG 82.189 1
ATOM 1957 C C_5 . LIG . 1 ? B -2.066 -9.108 15.957 1.000 2 B LIG 82.683 1
ATOM 1958 N N_5 . LIG . 1 ? B -2.263 -10.304 16.511 1.000 2 B LIG 86.551 1
ATOM 1959 C C_6 . LIG . 1 ? B -3.438 -11.201 16.289 1.000 2 B LIG 83.855 1
ATOM 1960 O O_1 . LIG . 1 ? B -3.525 -11.492 14.916 1.000 2 B LIG 83.025 1
ATOM 1961 C C_7 . LIG . 1 ? B -4.897 -11.534 14.578 1.000 2 B LIG 84.940 1
ATOM 1962 C C_8 . LIG . 1 ? B -5.130 -10.602 13.440 1.000 2 B LIG 81.968 1
ATOM 1963 O O_2 . LIG . 1 ? B -4.725 -9.323 13.857 1.000 2 B LIG 83.554 1
ATOM 1964 P P_1 . LIG . 1 ? B -4.721 -8.194 12.771 1.000 2 B LIG 89.003 1
ATOM 1965 O O_3 . LIG . 1 ? B -4.034 -8.622 11.558 1.000 2 B LIG 77.465 1
ATOM 1966 O O_4 . LIG . 1 ? B -4.147 -6.973 13.425 1.000 2 B LIG 77.723 1
ATOM 1967 O O_5 . LIG . 1 ? B -6.240 -7.865 12.424 1.000 2 B LIG 85.966 1
ATOM 1968 P P_2 . LIG . 1 ? B -6.685 -6.575 11.739 1.000 2 B LIG 88.616 1
ATOM 1969 O O_6 . LIG . 1 ? B -7.991 -6.827 11.083 1.000 2 B LIG 74.573 1
ATOM 1970 O O_7 . LIG . 1 ? B -5.639 -6.146 10.820 1.000 2 B LIG 75.176 1
ATOM 1971 O O_8 . LIG . 1 ? B -6.899 -5.505 12.865 1.000 2 B LIG 82.207 1
ATOM 1972 P P_3 . LIG . 1 ? B -7.007 -3.977 12.589 1.000 2 B LIG 85.246 1
ATOM 1973 O O_9 . LIG . 1 ? B -5.709 -3.617 11.896 1.000 2 B LIG 70.253 1
ATOM 1974 O O_10 . LIG . 1 ? B -7.101 -3.294 13.872 1.000 2 B LIG 70.072 1
ATOM 1975 O O_11 . LIG . 1 ? B -8.187 -3.761 11.713 1.000 2 B LIG 70.465 1
ATOM 1976 C C_9 . LIG . 1 ? B -5.713 -11.078 15.743 1.000 2 B LIG 83.223 1
ATOM 1977 O O_12 . LIG . 1 ? B -6.380 -12.179 16.293 1.000 2 B LIG 78.227 1
ATOM 1978 C C_10 . LIG . 1 ? B -4.718 -10.494 16.676 1.000 2 B LIG 82.254 1
ATOM 1979 O O_13 . LIG . 1 ? B -5.053 -10.779 18.010 1.000 2 B LIG 78.602 1

CIF:

ATP  O1G     O1G   O  0  1  N  N  N  45.779  46.330  56.052   1.740   1.140  -6.672  O1G     ATP   2  
ATP  O2G     O2G   O  0  1  N  N  N  47.382  44.497  56.626   2.123  -1.036  -7.891  O2G     ATP   3  
ATP  O3G     O3G   O  0  1  N  N  N  45.972  45.530  58.375  -0.302  -0.139  -7.421  O3G     ATP   4  
ATP  PB      PB    P  0  1  N  N  R  43.911  43.740  55.655   0.255  -0.130  -4.446  PB      ATP   5  
ATP  O1B     O1B   O  0  1  N  N  N  42.975  42.722  55.986   0.810   1.234  -4.304  O1B     ATP   6  
ATP  O2B     O2B   O  0  1  N  N  N  43.603  44.767  54.678  -1.231  -0.044  -5.057  O2B     ATP   7  
ATP  O3B     O3B   O  0  1  N  N  N  45.041  44.015  56.738   1.192  -0.990  -5.433  O3B     ATP   8  
ATP  PA      PA    P  0  1  N  N  R  45.228  42.669  53.257  -0.745   0.068  -2.071  PA      ATP   9  
ATP  O1A     O1A   O  0  1  N  N  N  46.380  43.396  52.788  -2.097   0.143  -2.669  O1A     ATP  10  
ATP  O2A     O2A   O  0  1  N  N  N  44.183  42.190  52.351  -0.125   1.549  -1.957  O2A     ATP  11  
ATP  O3A     O3A   O  0  1  N  N  N  44.917  42.716  54.789   0.203  -0.840  -3.002  O3A     ATP  12  
ATP  "O5'"   O5*   O  0  1  N  N  N  46.172  41.568  53.302  -0.844  -0.587  -0.604  "O5'"   ATP  13  
ATP  "C5'"   C5*   C  0  1  N  N  N  46.609  40.422  53.542  -1.694   0.260   0.170  "C5'"   ATP  14  
ATP  "C4'"   C4*   C  0  1  N  N  R  46.520  38.989  53.364  -1.831  -0.309   1.584  "C4'"   ATP  15  
ATP  "O4'"   O4*   O  0  1  N  N  N  46.785  38.908  51.948  -0.542  -0.355   2.234  "O4'"   ATP  16  
ATP  "C3'"   C3*   C  0  1  N  N  S  47.808  38.874  54.112  -2.683   0.630   2.465  "C3'"   ATP  17  
ATP  "O3'"   O3*   O  0  1  N  N  N  47.713  38.357  55.423  -4.033   0.165   2.534  "O3'"   ATP  18  
ATP  "C2'"   C2*   C  0  1  N  N  R  48.719  38.116  53.139  -2.011   0.555   3.856  "C2'"   ATP  19  
ATP  "O2'"   O2*   O  0  1  N  N  N  48.632  36.737  53.425  -2.926   0.043   4.827  "O2'"   ATP  20  
ATP  "C1'"   C1*   C  0  1  N  N  R  48.133  38.409  51.721  -0.830  -0.418   3.647  "C1'"   ATP  21  
ATP  N9      N9    N  0  1  Y  N  N  48.846  39.464  50.986   0.332   0.015   4.425  N9      ATP  22  
ATP  C8      C8    C  0  1  Y  N  N  48.616  40.842  50.945   1.302   0.879   4.012  C8      ATP  23  
ATP  N7      N7    N  0  1  Y  N  N  49.425  41.489  50.165   2.184   1.042   4.955  N7      ATP  24  
ATP  C5      C5    C  0  1  Y  N  N  50.232  40.470  49.664   1.833   0.300   6.033  C5      ATP  25  
ATP  C6      C6    C  0  1  Y  N  N  51.308  40.466  48.731   2.391   0.077   7.303  C6      ATP  26  
ATP  N6      N6    N  0  1  N  N  N  51.721  41.568  48.129   3.564   0.706   7.681  N6      ATP  27  
ATP  N1      N1    N  0  1  Y  N  N  51.912  39.274  48.447   1.763  -0.747   8.135  N1      ATP  28  
ATP  C2      C2    C  0  1  Y  N  N  51.493  38.151  49.029   0.644  -1.352   7.783  C2      ATP  29  
ATP  N3      N3    N  0  1  Y  N  N  50.491  38.016  49.900   0.088  -1.178   6.602  N3      ATP  30  
ATP  C4      C4    C  0  1  Y  N  N  49.892  39.253  50.171   0.644  -0.371   5.704  C4      ATP  31  

Thank you!

@wukevin
Copy link
Contributor

wukevin commented Nov 27, 2024

Unfortunately, there's no easy way to do this that I am aware of since Chai1 works on the level of SMILES inputs; you might consider doing some sort of graph alignment similar to what DockQ does here:
https://github.com/bjornwallner/DockQ/blob/13c9dcc84ef2751ecf6b958c6f55dc1981457b16/src/DockQ/DockQ.py#L245-L260

After aligning the graphs you could transfer the atom names that way.

@kirmedvedev
Copy link
Author

Unfortunately, there's no easy way to do this that I am aware of since Chai1 works on the level of SMILES inputs; you might consider doing some sort of graph alignment similar to what DockQ does here: https://github.com/bjornwallner/DockQ/blob/13c9dcc84ef2751ecf6b958c6f55dc1981457b16/src/DockQ/DockQ.py#L245-L260

After aligning the graphs you could transfer the atom names that way.

Thank you! I will try it

@arogozhnikov
Copy link
Contributor

@kirmedvedev I previously observed that ordering returned by rdkit coincided with first appearance in smiles, but you'd better double check this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants