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

Incorrect import of pybel #26

Open
iGulitch opened this issue Aug 21, 2024 · 0 comments
Open

Incorrect import of pybel #26

iGulitch opened this issue Aug 21, 2024 · 0 comments

Comments

@iGulitch
Copy link

iGulitch commented Aug 21, 2024

Here, the package pybel is imported incorrectly as import pybel. This leads to errors for big molecules created out of SMILES, since AllChem.EmbedMolecule of RDKit struggles to guess the atom coordinates of a molecule.

Namely, the following set of commands :

APP="ligpargen"
MOL="NAME"
SMILES='C/C=C(\CC/C=C(\CC/C=C(\CC/C=C(\CC/C=C(/CC/C=C(\C)CCC=C(C)C)CC/C=C(\C)CC/C=C(\C)CCC=C(C)C)CC/C=C(\C)CCC=C(C)C)CC/C=C(\C)CCC=C(C)C)CC/C=C(\C)CCC=C(C)C)CC/C=C(\C)CCC=C(C)C'
ligpargen -s '${SMILES}' -n ${MOL} -p ${MOL} -r MOL -c 0 -o 0 -cgen CM1A

leads to the following error :

  File "/opt/conda/envs/ligpargen/bin/ligpargen", line 33, in <module>
    sys.exit(load_entry_point('LigPargen', 'console_scripts', 'ligpargen')())
  File "/ligpargen/ligpargen/ligpargen.py", line 504, in main
    molname=args.molname, workdir= args.path, debug= args.debug)
  File "<string>", line 17, in __init__
  File "/ligpargen/ligpargen/ligpargen.py", line 174, in __post_init__
    moleculeRDkit, newIndexToOriginalIndex, atomsNameOriginal, residueNameOriginal = utilities.generateRDkitMolecule(self.ifile, self.smile, self.workdir, molnameA, self.debug)
  File "/ligpargen/ligpargen/tools/utilities.py", line 139, in generateRDkitMolecule
    mymol = pybel.readstring('smi', smile)
AttributeError: module 'pybel' has no attribute 'readstring'

Importing pybel as from openbabel import pybel solves the issue. I have tried it separately with RDKit in the Linux prompt and succeeded.

Would you fix the pybel import, please? I suppose, import openbabel might be necessary as well, but I'm not 100% sure.

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

1 participant