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

无法生成3D构象 #305

Open
sunyrain opened this issue Dec 19, 2024 · 1 comment
Open

无法生成3D构象 #305

sunyrain opened this issue Dec 19, 2024 · 1 comment

Comments

@sunyrain
Copy link

import numpy as np
from unimol_tools import UniMolRepr
# single smiles unimol representation
clf = UniMolRepr(data_type='molecule', 
                 remove_hs=False,
                 model_name='unimolv1', # avaliable: unimolv1, unimolv2
                 model_size='84m', # work when model_name is unimolv2. avaliable: 84m, 164m, 310m, 570m, 1.1B.
                 )
smiles = 'CCCCCCCCC(CCCCCC)Cn1nc2c(-c3ccc(C)s3)c(F)c(F)c(-c3ccc(-c4cc5c(-c6ccc(CC(CC)CCCC)s6)c6sc(C)cc6c(-c6ccc(CC(CC)CCCC)s6)c5s4)s3)c2n1'
smiles_list = [smiles]
unimol_repr = clf.get_repr(smiles_list, return_atomic_reprs=True)
# CLS token repr
print(np.array(unimol_repr['cls_repr']).shape)
# atomic level repr, align with rdkit mol.GetAtoms()
print(np.array(unimol_repr['atomic_reprs']).shape)

运行这段代码,输出结果如下

2024-12-19 18:26:08 | unimol_tools/data/conformer.py | 126 | INFO | Uni-Mol Tools | Succeeded in generating conformers for 100.00% of molecules.
2024-12-19 18:26:08 | unimol_tools/data/conformer.py | 128 | INFO | Uni-Mol Tools | Succeeded in generating 3d conformers for 0.00% of molecules.

@Naplessss
Copy link
Collaborator

It seems CCCCCCCCC(CCCCCC)Cn1nc2c(-c3ccc(C)s3)c(F)c(F)c(-c3ccc(-c4cc5c(-c6ccc(CC(CC)CCCC)s6)c6sc(C)cc6c(-c6ccc(CC(CC)CCCC)s6)c5s4)s3)c2n1 is to hard for rdkit with MMFF. you can use other methods for conformation generation, unimol-tools also support to fit with custom conformations with coordinates provided.

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

2 participants