Closed SebGay closed 5 years ago
Hi @sgay,
I'm sorry for the confusion, but I think you're looking for OpenBabel, and not PyBEL (we're working with Biological Expression Language here)
Please check their repository at https://github.com/openbabel/openbabel and more specifically https://github.com/openbabel/openbabel/tree/master/scripts/python
Sorry about that, thanks for your help!
Hello there, I am working with two large databases and currently need to obtain smiles strings for a large number (133k) of extended xyz files.
I have install pybel with no issues, and am able to read a sample xyz file with ease using which looks like
using
mol = pybel.readfile("xyz","ethane.xyz").next()
I am then able to verify it has read the molecule by usingetc.
Ideally I would like to be able to simply get the smile as a string in my python program, but could possibly live with writing a textfile to disk (or a virtual file to memory) and reading it again. My database file has all the molecules in the one file but they can be separated.
When I try to use
mol.write("smi","out.txt")
the output textfile simply readsCC charge=0=
Where I would like it to readH]C([H])([H])C([H])([H])[H]
Therefore, how would it be possible to:
If it at all helps I can easily have these molecules as ASE Atoms object.
Thank you very much for any help!